Skip to content

Commit

Permalink
build all statically
Browse files Browse the repository at this point in the history
  • Loading branch information
bjia56 authored Nov 4, 2024
1 parent 1af18c4 commit 0e1baf5
Showing 1 changed file with 31 additions and 40 deletions.
71 changes: 31 additions & 40 deletions scripts/build_freebsd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ cd ${BUILDDIR}

download_verify_extract zlib-1.3.1.tar.gz
cd zlib*
./configure --prefix=${DEPSDIR}
./configure --prefix=${DEPSDIR} --static
gmake -j4
gmake install
install_license
Expand All @@ -37,7 +37,7 @@ else
download_verify_extract openssl-3.0.15.tar.gz
fi
cd openssl*
./Configure BSD-${ARCH} --prefix=${DEPSDIR} --openssldir=${DEPSDIR}
./Configure BSD-${ARCH} no-shared --prefix=${DEPSDIR} --openssldir=${DEPSDIR}
gmake -j4
gmake install_sw
install_license
Expand All @@ -51,7 +51,7 @@ cd ${BUILDDIR}

download_verify_extract libffi-3.4.6.tar.gz
cd libffi*
./configure --prefix=${DEPSDIR}
./configure --disable-shared --prefix=${DEPSDIR}
gmake -j4
gmake install
install_license
Expand All @@ -65,7 +65,7 @@ cd ${BUILDDIR}

download_verify_extract sqlite-autoconf-3450000.tar.gz
cd sqlite*
./configure --enable-shared --prefix=${DEPSDIR}
./configure --disable-shared --prefix=${DEPSDIR}
gmake -j4
gmake install

Expand All @@ -78,7 +78,7 @@ cd ${BUILDDIR}

download_verify_extract expat-2.6.2.tar.gz
cd expat*
./configure --prefix=${DEPSDIR}
./configure --disable-shared --prefix=${DEPSDIR}
gmake -j4
gmake install
install_license
Expand All @@ -92,7 +92,7 @@ cd ${BUILDDIR}

download_verify_extract ncurses-6.4.tar.gz
cd ncurses*
./configure --with-normal --with-shared --without-progs --enable-overwrite --disable-stripping --prefix=${DEPSDIR}
./configure --with-normal --without-shared --without-progs --enable-overwrite --disable-stripping --prefix=${DEPSDIR}
gmake -j4
gmake install.libs
install_license
Expand All @@ -106,7 +106,7 @@ cd ${BUILDDIR}

download_verify_extract readline-8.2.tar.gz
cd readline*
./configure --with-curses --host=${CHOST} --prefix=${DEPSDIR}
./configure --with-curses --disable-shared --host=${CHOST} --prefix=${DEPSDIR}
gmake -j4
gmake install
install_license
Expand Down Expand Up @@ -173,7 +173,7 @@ cd ${BUILDDIR}

download_verify_extract gdbm-1.23.tar.gz
cd gdbm*
./configure --enable-libgdbm-compat --prefix=${DEPSDIR}
./configure --enable-libgdbm-compat --disable-shared --prefix=${DEPSDIR}
gmake -j4
gmake install
install_license
Expand All @@ -187,7 +187,7 @@ cd ${BUILDDIR}

download_verify_extract libxml2-2.12.4.tar.xz
cd libxml2*
./configure --without-python --prefix=${DEPSDIR}
./configure --without-python --enable-static --disable-shared --prefix=${DEPSDIR}
gmake -j4
gmake install
install_license ./Copyright
Expand All @@ -201,7 +201,7 @@ cd ${BUILDDIR}

download_verify_extract libpng-1.6.41.tar.gz
cd libpng*
./configure --with-zlib-prefix=${DEPSDIR} --disable-tools --prefix=${DEPSDIR}
./configure --with-zlib-prefix=${DEPSDIR} --enable-static --disable-shared --disable-tools --prefix=${DEPSDIR}
gmake -j4
gmake install

Expand All @@ -214,7 +214,7 @@ cd ${BUILDDIR}

download_verify_extract libgpg-error-1.47.tar.bz2
cd libgpg-error*
./configure --prefix=${DEPSDIR}
./configure --enable-static --disable-shared --prefix=${DEPSDIR}
gmake -j4
gmake install
install_license ./COPYING.LIB
Expand All @@ -223,7 +223,7 @@ cd ${BUILDDIR}

download_verify_extract libgcrypt-1.10.3.tar.bz2
cd libgcrypt*
./configure --disable-asm --prefix=${DEPSDIR}
./configure --enable-static --disable-shared --disable-asm --prefix=${DEPSDIR}
gmake -j4
gmake install
install_license ./COPYING.LIB
Expand All @@ -237,7 +237,7 @@ cd ${BUILDDIR}

download_verify_extract libxslt-1.1.39.tar.xz
cd libxslt*
CFLAGS="${CFLAGS} -I${DEPSDIR}/include/libxml2" ./configure --with-libxml-prefix=${DEPSDIR} --without-python --prefix=${DEPSDIR}
CFLAGS="${CFLAGS} -I${DEPSDIR}/include/libxml2" ./configure --enable-static --disable-shared --with-libxml-prefix=${DEPSDIR} --without-python --prefix=${DEPSDIR}
gmake -j4
gmake install
install_license
Expand All @@ -251,7 +251,7 @@ cd ${BUILDDIR}

download_verify_extract freetype-2.13.2.tar.gz
cd freetype*
./configure --prefix=${DEPSDIR}
./configure --enable-static --disable-shared --prefix=${DEPSDIR}
gmake -j4
gmake install
install_license ./docs/FTL.TXT
Expand All @@ -265,7 +265,7 @@ cd ${BUILDDIR}

download_verify_extract fontconfig-2.15.0.tar.gz
cd fontconfig*
./configure --enable-libxml2 --disable-cache-build --prefix=${DEPSDIR}
./configure --enable-libxml2 --disable-cache-build --enable-static --disable-shared --prefix=${DEPSDIR}
gmake -j4
gmake install
install_license
Expand All @@ -287,7 +287,7 @@ if [[ "${DISTRIBUTION}" != "headless" ]]; then
download_verify_extract $file
cd $pkg
autoreconf -vfi ${AL_OPTS}
./configure $ext_flags --prefix=${DEPSDIR}
./configure --enable-static --disable-shared $ext_flags --prefix=${DEPSDIR}
gmake -j4
gmake install

Expand Down Expand Up @@ -330,7 +330,7 @@ if [[ "${DISTRIBUTION}" != "headless" ]]; then

download_verify_extract tcl8.6.13-src.tar.gz
cd tcl*/unix
./configure --prefix=${DEPSDIR}
./configure --enable-static --disable-shared --prefix=${DEPSDIR}
gmake -j4
gmake install
cd ..
Expand All @@ -345,7 +345,7 @@ if [[ "${DISTRIBUTION}" != "headless" ]]; then

download_verify_extract tk8.6.13-src.tar.gz
cd tk*/unix
./configure --prefix=${DEPSDIR}
./configure --enable-static --disable-shared --prefix=${DEPSDIR}
gmake -j4
gmake install
cd ..
Expand All @@ -364,11 +364,11 @@ additionalparams=()
if [[ "${DISTRIBUTION}" != "headless" ]]; then
additionalparams+=(
-DTK_INCLUDE_PATH:FILEPATH=${DEPSDIR}/include \
-DTK_LIBRARY:FILEPATH=${DEPSDIR}/lib/libtk8.6.so \
-DTK_LIBRARY:FILEPATH=${DEPSDIR}/lib/libtk8.6.a \
-DTCL_INCLUDE_PATH:FILEPATH=${DEPSDIR}/include \
-DTCL_LIBRARY:FILEPATH=${DEPSDIR}/lib/libtcl8.6.so \
-DTCL_LIBRARY:FILEPATH=${DEPSDIR}/lib/libtcl8.6.a \
-DX11_INCLUDE_DIR:PATH=${DEPSDIR}/include/X11 \
-DX11_LIBRARIES="${DEPSDIR}/lib/libXau.so;${DEPSDIR}/lib/libXdmcp.so;${DEPSDIR}/lib/libX11.so;${DEPSDIR}/lib/libXext.so;${DEPSDIR}/lib/libICE.so;${DEPSDIR}/lib/libSM.so;${DEPSDIR}/lib/libXrender.so;${DEPSDIR}/lib/libXft.so;${DEPSDIR}/lib/libXss.so;${DEPSDIR}/lib/libxcb.so"
-DX11_LIBRARIES="${DEPSDIR}/lib/libXau.a;${DEPSDIR}/lib/libXdmcp.a;${DEPSDIR}/lib/libX11.a;${DEPSDIR}/lib/libXext.a;${DEPSDIR}/lib/libICE.a;${DEPSDIR}/lib/libSM.a;${DEPSDIR}/lib/libXrender.a;${DEPSDIR}/lib/libXft.a;${DEPSDIR}/lib/libXss.a;${DEPSDIR}/lib/libxcb.a"
)
fi

Expand All @@ -395,24 +395,24 @@ cmake \
-DINSTALL_TEST=${INSTALL_TEST} \
-DINSTALL_MANUAL=OFF \
-DOPENSSL_INCLUDE_DIR:PATH=${DEPSDIR}/include \
-DOPENSSL_LIBRARIES="${DEPSDIR}/lib/libssl.so;${DEPSDIR}/lib/libcrypto.so" \
-DOPENSSL_LIBRARIES="${DEPSDIR}/lib/libssl.a;${DEPSDIR}/lib/libcrypto.a" \
-DSQLite3_INCLUDE_DIR:PATH=${DEPSDIR}/include \
-DSQLite3_LIBRARY:FILEPATH=${DEPSDIR}/lib/libsqlite3.so \
-DSQLite3_LIBRARY:FILEPATH=${DEPSDIR}/lib/libsqlite3.a \
-DZLIB_INCLUDE_DIR:PATH=${DEPSDIR}/include \
-DZLIB_LIBRARY:FILEPATH=${DEPSDIR}/lib/libz.so \
-DZLIB_LIBRARY:FILEPATH=${DEPSDIR}/lib/libz.a \
-DLZMA_INCLUDE_PATH:PATH=${DEPSDIR}/include \
-DLZMA_LIBRARY:FILEPATH=${DEPSDIR}/lib/liblzma.so \
-DLZMA_LIBRARY:FILEPATH=${DEPSDIR}/lib/liblzma.a \
-DBZIP2_INCLUDE_DIR:PATH=${DEPSDIR}/include \
-DBZIP2_LIBRARIES:FILEPATH=${DEPSDIR}/lib/libbz2.a \
-DLibFFI_INCLUDE_DIR:PATH=${DEPSDIR}/include \
-DLibFFI_LIBRARY:FILEPATH=${DEPSDIR}/lib/libffi.so \
-DLibFFI_LIBRARY:FILEPATH=${DEPSDIR}/lib/libffi.a \
-DREADLINE_INCLUDE_PATH:PATH=${DEPSDIR}/include \
-DREADLINE_LIBRARY:FILEPATH=${DEPSDIR}/lib/libreadline.so \
-DCURSES_LIBRARIES:FILEPATH=${DEPSDIR}/lib/libncurses.so \
-DPANEL_LIBRARIES:FILEPATH=${DEPSDIR}/lib/libpanel.so \
-DREADLINE_LIBRARY:FILEPATH=${DEPSDIR}/lib/libreadline.a \
-DCURSES_LIBRARIES:FILEPATH=${DEPSDIR}/lib/libncurses.a \
-DPANEL_LIBRARIES:FILEPATH=${DEPSDIR}/lib/libpanel.a \
-DGDBM_INCLUDE_PATH:PATH=${DEPSDIR}/include \
-DGDBM_LIBRARY:FILEPATH=${DEPSDIR}/lib/libgdbm.so \
-DGDBM_COMPAT_LIBRARY:FILEPATH=${DEPSDIR}/lib/libgdbm_compat.so \
-DGDBM_LIBRARY:FILEPATH=${DEPSDIR}/lib/libgdbm.a \
-DGDBM_COMPAT_LIBRARY:FILEPATH=${DEPSDIR}/lib/libgdbm_compat.a \
-DNDBM_TAG=NDBM \
-DNDBM_USE=NDBM \
"${additionalparams[@]}" \
Expand All @@ -421,15 +421,6 @@ make -j4
make install

cd ${BUILDDIR}
patchelf \
--add-needed libfontconfig.so.1 \
--add-needed libfreetype.so.6 \
--add-needed libxml2.so.2 \
--add-needed libpng16.so.16 \
--add-needed libbrotlidec.so.1 \
--add-needed libbrotlicommon.so.1 \
./python-install/bin/python
cp ${DEPSDIR}/lib/lib*.so* ./python-install/lib
cp -r ${LICENSEDIR} ./python-install

echo "::endgroup::"
Expand Down

0 comments on commit 0e1baf5

Please sign in to comment.