From 69c3f95935cb93d295daeb3dbd4b5ee6d7a7c340 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E8=AB=8F=E8=A8=AA=E5=AD=90?= Date: Fri, 3 May 2024 03:40:37 +0900 Subject: [PATCH] =?utf8?q?OpenBSD=E3=81=A7=E9=9D=9C=E7=9A=84=E3=83=AA?= =?utf8?q?=E3=83=B3=E3=82=AF=E3=82=92=E5=8F=AF=E8=83=BD=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + MISSING-STATIC-OPENBSD.md | 78 +++++++++++++++++++++++++++++++++++++++ Makefile | 13 +++++++ 3 files changed, 92 insertions(+) create mode 100644 MISSING-STATIC-OPENBSD.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 0af2a41..221f775 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ * Pixivからダウンロード出来る様に * ズーム機能性の追加 * マウスで使って画像を移動出来る様に +* OpenBSDで靜的リンクを可能に # 0.4.0 * URLから画像ファイルを開ける様に diff --git a/MISSING-STATIC-OPENBSD.md b/MISSING-STATIC-OPENBSD.md new file mode 100644 index 0000000..606b8fd --- /dev/null +++ b/MISSING-STATIC-OPENBSD.md @@ -0,0 +1,78 @@ +# libtiff +``` +odl http://www.libtiff.org/downloads/tiff-4.6.0t.tar.xz +bsdtar -xf tiff-4.6.0t.tar.xz +cd tiff-4.6.0t +./configure --enable-static +make +doas make install +``` + +# libyuv +``` +mkdir libyuv +cd libyuv +odl -o libyuv.tar.gz https://chromium.googlesource.com/libyuv/libyuv/+archive/331c361581896292fb46c8c6905e41262b7ca95f.tar.gz +bsdtar -xf libyuv.tar.gz +cmake -S . -B build -G Ninja -DBUILD_SHARED_LIBS=OFF +cmake --build build +doas cmake --install build +``` + +# libavif +``` +git clone https://github.com/AOMediaCodec/libavif.git +cd libavif +cmake -B build -DCMAKE_INSTALL_LIBDIR=lib -DBUILD_SHARED_LIBS=OFF -DAVIF_BUILD_TESTS=ON -DAVIF_CODEC_AOM=SYSTEM -DAVIF_CODEC_AOM_DECODE=OFF -DAVIF_CODEC_DAV1D=SYSTEM -DAVIF_ENABLE_GTEST=OFF -DCMAKE_DISABLE_FIND_PACKAGE_libyuv=OFF +cmake --build build +doas cmake --install build +``` + +# libhwy +``` +doas chown -R $(whoami):$(whoami) /usr/ports +cd /usr/ports/devel/highway +make clean +sed -i 's/SHARED_LIBS/STATIC_LIBS/g' Makefile +sed -i 's/STATIC_LIBS=ON/SHARED_LIBS=OFF/' Makefile +make +make fake +doas cp /usr/ports/pobj/highway-1.1.0/fake-amd64/usr/local/lib/*.a /usr/local/lib +``` + +# libgtest +``` +git clone https://github.com/google/googletest.git +cd googletest +cmake -B build -DBUILD_SHARED_LIBS=OFF -Dgtest_build_tests=OFF +cmake --build build +doas cmake --build build --target install +``` + +# libjxl +``` +doas chown -R $(whoami):$(whoami) /usr/ports +cd /usr/ports/graphics/libjxl +make clean +sed -i 's/SHARED_LIBS/STATIC_LIBS/g' Makefile +sed -i 's/-DJPEGXL_FORCE_SYSTEM_GTEST:BOOL=ON/-DJPEGXL_FORCE_SYSTEM_GTEST:BOOL=OFF/' Makefile +nvim Makefile +``` + +``` +... +CONFIGURE_ARGS += \ + -DJPEGXL_STATIC=ON \ + -DJPEGXL_BUNDLE_SKCMS:BOOL=OFF \ +... +``` + +``` +doas cp /usr/local/lib/libbrotlicommon-static.a /usr/local/lib/libbrotlicommon.a +doas cp /usr/local/lib/libbrotlidec-static.a /usr/local/lib/libbrotlidec.a +doas cp /usr/local/lib/libbrotlienc-static.a /usr/local/lib/libbrotlienc.a +doas make +doas chown -R $(whoami):$(whoami) /usr/ports +make fake +doas cp /usr/ports/pobj/libjxl-0.10.1/fake-amd64/usr/local/lib/*.a /usr/local/lib +``` diff --git a/Makefile b/Makefile index b86ab00..0b29f2e 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,5 @@ UNAME_S!=uname -s +UNAME_M!=uname -m NAME!=cat main.c | grep "const char\* sofname" | awk '{print $$5}' | \ sed "s/\"//g" | sed "s/;//" @@ -45,6 +46,18 @@ dist: clean tar zcfv release/src/${NAME}-${VERSION}.tar.gz ${NAME}-${VERSION} rm -rf ${NAME}-${VERSION} +release-openbsd: + mkdir -p release/bin + ${CC} ${CFLAGS} -o release/bin/${NAME}-${VERSION}-openbsd-${UNAME_M} ${FILES}\ + ${LDFLAGS}\ + -static -lSDL2 -lSDL2_image -lcurl -lc -lm -liconv -lsndio -lsamplerate -lX11\ + -lxcb -lXext -lXcursor -lXrender -lXfixes -lXi -lXrandr -lXss -lusbhid -lpthread\ + -ljxl -ljxl_cms -llcms2 -lhwy -lc++ -lc++abi -lbrotlidec\ + -lbrotlicommon -lbrotlienc -lyuv -ltiff -lz -ljpeg -llzma -lzstd -lavif\ + -ldav1d -laom -lsharpyuv -lwebpdemux -lwebp -lnghttp3 -lngtcp2_crypto_quictls\ + -lngtcp2 -lssl -lcrypto -lnghttp2 -lXau -lXdmcp + strip release/bin/${NAME}-${VERSION}-openbsd-${UNAME_M} + install: mkdir -p ${DESTDIR}${PREFIX}/bin cp -f ${NAME} ${DESTDIR}${PREFIX}/bin -- 2.43.0