]> Nishi Git Mirror - mivfx.git/commitdiff
OpenBSDで靜的リンクを可能に
author諏訪子 <suwako@076.moe>
Thu, 2 May 2024 18:40:37 +0000 (03:40 +0900)
committer諏訪子 <suwako@076.moe>
Thu, 2 May 2024 18:40:37 +0000 (03:40 +0900)
CHANGELOG.md
MISSING-STATIC-OPENBSD.md [new file with mode: 0644]
Makefile

index 0af2a416d39fe4096b17238d03106d62ec533fea..221f7756595545282ee3bd18ba115c5bc0deba74 100644 (file)
@@ -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 (file)
index 0000000..606b8fd
--- /dev/null
@@ -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
+```
index b86ab00bb0f28cb19100654b88f4f80579e47d64..0b29f2eed5abea58f4373c55919309d1cd13842d 100644 (file)
--- 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