diff --git a/104.libelf.vars b/104.libelf.vars deleted file mode 100644 index 7a0f9e3..0000000 --- a/104.libelf.vars +++ /dev/null @@ -1,16 +0,0 @@ -# -# . ./build.vars and set -o errexit are assumed. -# - -pkg_libelf_install_post() { - rm -f lib/libelf.def; - echo EXPORTS > lib/libelf.def; - perk -e lib/libelf.so >> lib/libelf.def; - ${HOST_NATIVE}-dlltool \ - --output-lib lib/libelf.lib.a \ - --dllname libelf.so \ - --input-def lib/libelf.def; - cp lib/libelf.lib.a ${PREFIX}/lib; -}; - -# vim:filetype=sh diff --git a/300.bzip2.vars b/300.bzip2.vars index 0dfccc1..34a5b7e 100644 --- a/300.bzip2.vars +++ b/300.bzip2.vars @@ -10,6 +10,18 @@ pkg_bzip2_install_post() { ${PKG_PREFIX}/bin/${1}; shift; done; + find . \( -name libbz2.so \ + -or -name libbz2.so.\[0-9\] \ + -or -name libbz2.so.\[0-9\].\[0-9\] \ + -or -name libbz2.so.\[0-9\].\[0-9\].\[0-9\] \) \ + -exec sh -c ' \ + if [ -L {} ]; then \ + echo ln -sf $(readlink {}) '"${PKG_PREFIX}"'/lib; \ + ln -sf $(readlink {}) '"${PKG_PREFIX}"'/lib; \ + else \ + echo install {} '"${PKG_PREFIX}"'/lib; \ + install {} '"${PKG_PREFIX}"'/lib; \ + fi' \;; }; # vim:filetype=sh diff --git a/build.sh b/build.sh index e875123..5572981 100755 --- a/build.sh +++ b/build.sh @@ -104,8 +104,8 @@ if [ $(( ${BUILD_NFINI} + ${BUILD_NSKIP} )) -ge 0 ] \ tar -C ${PREFIX_BASENAME}/lib -cpf - . | tar -C ${PREFIX_BASENAME}/lib.bak -xpf -; log_msg info "Backed up ${PREFIX_BASENAME}/lib."; find native/lib -maxdepth 1 -type l \ - -exec sh -c '[ -f "${DEST:=$(readlink -- "${0}")}" ] && \ - rm -f -- "${0}" && ln -- "${DEST}" "${0}"' {} \;; + -exec sh -c '[ -f "${DEST:=native/lib/$(readlink -- "${0}")}" ] && \ + rm -f -- "${0}" && ln -f -- "${DEST}" "${0}"' {} \;; log_msg info "Converted symbolic links in ${PREFIX_BASENAME}/lib to hard links."; tar -cJpf ${TARBALL_FNAME_PREFIX}${BUILD_USER}@${BUILD_HNAME}-${BUILD_DATE_START}.tar.xz\ $(find_with_no_paths "${TARBALL_EXCLUDE_PATHS} native/lib.bak" . \ diff --git a/build.vars b/build.vars index 5bb2121..6cb0a5f 100644 --- a/build.vars +++ b/build.vars @@ -42,7 +42,7 @@ export PATH="${PREFIX}/bin${PATH:+:${PATH}}"; : ${WORKDIR:=${PREFIX}/tmp}; : ${PKG_BUILD_NAMES:="apk_tools bash binutils binutils_host bzip2 coreutils dalist dash diffutils findutils gawk git glib gmp grep gzip hexcurse irssi less libelf libffi libressl libz make mpc mpfr nano ncurses ncursestw ncursesw ntapi ntcon ntctty openssh patch pemagine popt psxscl psxstub psxtypes rsync sed tar util_linux which xz"}; -: ${PKG_BUILD_VARS:="AR_BUILD AR_CONFIGURE BUILD_DIR BUILD_TYPE CC_BUILD CC_CONFIGURE CC_INSTALL CFLAGS_BUILD_EXTRA CFLAGS_CONFIGURE CFLAGS_CONFIGURE_EXTRA CFLAGS_INSTALL_EXTRA CONFIGURE_ARGS CONFIGURE_ARGS_EXTRA ENV_VARS_EXTRA GIT_ARGS_EXTRA INSTALL_TARGET LDFLAGS_BUILD_EXTRA LDFLAGS_CONFIGURE LDFLAGS_CONFIGURE_EXTRA LDFLAGS_INSTALL_EXTRA LIBTOOL_MIDIPIX LIBTOOL_MIDIPIX_FIX MAKEFLAGS_BUILD MAKEFLAGS_BUILD_EXTRA MAKEFLAGS_INSTALL MAKEFLAGS_INSTALL_EXTRA NO_CLEAN PATCHES_EXTRA_URL PREFIX_EXTRA RANLIB_INSTALL SHA256SUM SUBDIR URL URL_TYPE VERSION"}; +: ${PKG_BUILD_VARS:="AR_BUILD AR_CONFIGURE BUILD_DIR BUILD_TYPE CC_BUILD CC_CONFIGURE CC_INSTALL CFLAGS_BUILD_EXTRA CFLAGS_CONFIGURE CFLAGS_CONFIGURE_EXTRA CFLAGS_INSTALL_EXTRA CONFIGURE_ARGS CONFIGURE_ARGS_EXTRA ENV_VARS_EXTRA GIT_ARGS_EXTRA INSTALL_TARGET LDFLAGS_BUILD_EXTRA LDFLAGS_CONFIGURE LDFLAGS_CONFIGURE_EXTRA LDFLAGS_INSTALL_EXTRA LIBFILES_FIX LIBTOOL_MIDIPIX LIBTOOL_MIDIPIX_FIX MAKEFLAGS_BUILD MAKEFLAGS_BUILD_EXTRA MAKEFLAGS_INSTALL MAKEFLAGS_INSTALL_EXTRA NO_CLEAN PATCHES_EXTRA_URL PREFIX_EXTRA RANLIB_INSTALL SHA256SUM SUBDIR URL URL_TYPE VERSION"}; : ${PKG_LVL0_CFLAGS_CONFIGURE:=-O0}; : ${PKG_LVL0_CONFIGURE_ARGS:="-C --host=${HOST_NATIVE} --prefix= --target=${TARGET}"}; : ${PKG_LVL0_MAKEFLAGS_BUILD:=${MAKEFLAGS_DEFAULT}}; @@ -76,6 +76,7 @@ export PATH="${PREFIX}/bin${PATH:+:${PATH}}"; : ${PKG_BZIP2_CFLAGS_BUILD_EXTRA:=${PKG_LVL3_CFLAGS_CONFIGURE}}; : ${PKG_BZIP2_MAKEFLAGS_BUILD_EXTRA:=-f Makefile-libbz2_so}; : ${PKG_BZIP2_NO_CLEAN:=1}; +: ${PKG_BZIP2_LIBFILES_FIX:=1}; : ${PKG_BZIP2_MAKEFLAGS_INSTALL_EXTRA:=PREFIX=${PREFIX_LVL3}}; : ${PKG_BZIP2_RANLIB_INSTALL:=${HOST_NATIVE}-ranlib}; : ${PKG_BASH_VERSION:=4.3}; @@ -117,6 +118,7 @@ export PATH="${PREFIX}/bin${PATH:+:${PATH}}"; : ${PKG_GIT_GIT_ARGS_EXTRA:=--branch v2.7.1}; : ${PKG_GIT_LDFLAGS_BUILD_EXTRA:=--sysroot=${PREFIX_LVL3}}; : ${PKG_GIT_LDFLAGS_INSTALL_EXTRA:=--sysroot=${PREFIX_LVL3}}; +: ${PKG_GIT_LIBFILES_FIX:=1}; : ${PKG_GIT_MAKEFLAGS_BUILD_EXTRA:=NO_CURL=1 NO_PERL=1 prefix=${PREFIX_LVL3} V=99}; : ${PKG_GIT_MAKEFLAGS_INSTALL:=NO_CURL=1 NO_PERL=1 prefix=${PREFIX_LVL3} V=99}; : ${PKG_GIT_RANLIB_INSTALL:=${HOST_NATIVE}-ranlib}; @@ -133,6 +135,7 @@ export PATH="${PREFIX}/bin${PATH:+:${PATH}}"; : ${PKG_GMP_SHA256SUM:=752079520b4690531171d0f4532e40f08600215feefede70b24fabdc6f1ab160}; : ${PKG_GMP_URL:=https://gmplib.org/download/gmp/gmp-${PKG_GMP_VERSION}.tar.bz2}; : ${PKG_GMP_CONFIGURE_ARGS_EXTRA:=--disable-assembly}; +: ${PKG_GMP_LIBFILES_FIX:=1}; : ${PKG_GMP_LIBTOOL_MIDIPIX:=1}; : ${PKG_GMP_PREFIX_EXTRA:=DESTDIR=${PREFIX_TARGET}}; : ${PKG_GREP_VERSION:=2.22}; @@ -143,6 +146,7 @@ export PATH="${PREFIX}/bin${PATH:+:${PATH}}"; : ${PKG_GZIP_URL:=https://ftp.gnu.org/gnu/gzip/gzip-${PKG_GZIP_VERSION}.tar.gz}; : ${PKG_GZIP_CC_BUILD:=${HOST_NATIVE}-gcc}; : ${PKG_GZIP_CONFIGURE_ARGS:=--host=${HOST_NATIVE} --prefix= --target=${TARGET} --sysroot=${PREFIX_LVL3}}; +: ${PKG_GZIP_LIBFILES_FIX:=1}; : ${PKG_HEXCURSE_CFLAGS_CONFIGURE_EXTRA:=-I${PREFIX_LVL3}/include/ncursesw}; : ${PKG_HEXCURSE_URL:=https://github.com/LonnyGomes/hexcurse}; : ${PKG_HEXCURSE_URL_TYPE:=git}; @@ -161,6 +165,7 @@ export PATH="${PREFIX}/bin${PATH:+:${PATH}}"; : ${PKG_LIBELF_URL:=http://www.mr511.de/software/libelf-${PKG_LIBELF_VERSION}.tar.gz}; : ${PKG_LIBELF_CC_CONFIGURE:=${HOST_NATIVE}-gcc}; : ${PKG_LIBELF_CONFIGURE_ARGS:="--host=${HOST_NATIVE} --prefix=${PREFIX_LVL1} --target=${TARGET}"}; +: ${PKG_LIBELF_LIBFILES_FIX:=1}; : ${PKG_LIBELF_MAKEFLAGS_INSTALL:=}; : ${PKG_LIBFFI_VERSION:=3.2.1}; : ${PKG_LIBFFI_SHA256SUM:=d06ebb8e1d9a22d19e38d63fdb83954253f39bedc5d46232a05645685722ca37}; @@ -172,6 +177,7 @@ export PATH="${PREFIX}/bin${PATH:+:${PATH}}"; : ${PKG_LIBRESSL_URL:=http://ftp.eu.openbsd.org/pub/OpenBSD/LibreSSL/libressl-${PKG_LIBRESSL_VERSION}.tar.gz}; : ${PKG_LIBRESSL_CFLAGS_CONFIGURE_EXTRA:=-D__MIDIPIX}; : ${PKG_LIBRESSL_CONFIGURE_ARGS_EXTRA:=--disable-asm}; +: ${PKG_LIBRESSL_LIBFILES_FIX:=1}; : ${PKG_LIBRESSL_LIBTOOL_MIDIPIX:=1}; : ${PKG_LIBRESSL_LIBTOOL_MIDIPIX_FIX:=1}; : ${PKG_LIBZ_VERSION:=1.2.8.2015.05.20}; @@ -185,12 +191,14 @@ export PATH="${PREFIX}/bin${PATH:+:${PATH}}"; : ${PKG_MPC_SHA256SUM:=ed5a815cfea525dc778df0cb37468b9c1b554aaf30d9328b1431ca705b7400ff}; : ${PKG_MPC_URL:=ftp://ftp.gnu.org/gnu/mpc/mpc-${PKG_MPC_VERSION}.tar.gz}; : ${PKG_MPC_CONFIGURE_ARGS_EXTRA:=--with-gmp=${PREFIX_NATIVE} --with-mpfr=${PREFIX_NATIVE}}; +: ${PKG_MPC_LIBFILES_FIX:=1}; : ${PKG_MPC_LIBTOOL_MIDIPIX:=1}; : ${PKG_MPC_PREFIX_EXTRA:=DESTDIR=${PREFIX_TARGET}}; : ${PKG_MPFR_VERSION:=3.1.2}; : ${PKG_MPFR_SHA256SUM:=79c73f60af010a30a5c27a955a1d2d01ba095b72537dab0ecaad57f5a7bb1b6b}; : ${PKG_MPFR_URL:=ftp://ftp.gnu.org/gnu/mpfr/mpfr-${PKG_MPFR_VERSION}.tar.bz2}; : ${PKG_MPFR_CONFIGURE_ARGS_EXTRA:=--with-gmp=${PREFIX_NATIVE}}; +: ${PKG_MPFR_LIBFILES_FIX:=1}; : ${PKG_MPFR_LIBTOOL_MIDIPIX:=1}; : ${PKG_MPFR_PREFIX_EXTRA:=DESTDIR=${PREFIX_TARGET}}; : ${PKG_MUSL_VERSION:=1.1.12}; @@ -204,17 +212,20 @@ export PATH="${PREFIX}/bin${PATH:+:${PATH}}"; : ${PKG_NCURSES_VERSION:=6.0}; : ${PKG_NCURSES_SHA256SUM:=f551c24b30ce8bfb6e96d9f59b42fbea30fa3a6123384172f9e7284bcf647260}; : ${PKG_NCURSES_URL:=https://ftp.gnu.org/gnu/ncurses/ncurses-${PKG_NCURSES_VERSION}.tar.gz}; -: ${PKG_NCURSES_CONFIGURE_ARGS_EXTRA:=--with-pkg-config --with-pkg-config-libdir=${PREFIX_LVL3}/lib/pkgconfig --enable-pc-files --with-shared}; +: ${PKG_NCURSES_CONFIGURE_ARGS_EXTRA:=--with-pkg-config --with-pkg-config-libdir=${PREFIX_LVL3}/lib/pkgconfig --enable-pc-files --disable-widec --with-shared}; +: ${PKG_NCURSES_LIBFILES_FIX:=1}; : ${PKG_NCURSES_MAKEFLAGS_INSTALL_EXTRA:=PKG_CONFIG_LIBDIR=/lib/pkgconfig}; : ${PKG_NCURSESTW_VERSION:=6.0}; : ${PKG_NCURSESTW_SHA256SUM:=f551c24b30ce8bfb6e96d9f59b42fbea30fa3a6123384172f9e7284bcf647260}; : ${PKG_NCURSESTW_URL:=https://ftp.gnu.org/gnu/ncurses/ncurses-${PKG_NCURSES_VERSION}.tar.gz}; : ${PKG_NCURSESTW_CONFIGURE_ARGS_EXTRA:=--with-pkg-config --with-pkg-config-libdir=${PREFIX_LVL3}/lib/pkgconfig --enable-pc-files --enable-widec --with-shared --with-pthread}; +: ${PKG_NCURSESTW_LIBFILES_FIX:=1}; : ${PKG_NCURSESTW_MAKEFLAGS_INSTALL_EXTRA:=PKG_CONFIG_LIBDIR=/lib/pkgconfig}; : ${PKG_NCURSESW_VERSION:=6.0}; : ${PKG_NCURSESW_SHA256SUM:=f551c24b30ce8bfb6e96d9f59b42fbea30fa3a6123384172f9e7284bcf647260}; : ${PKG_NCURSESW_URL:=https://ftp.gnu.org/gnu/ncurses/ncurses-${PKG_NCURSES_VERSION}.tar.gz}; : ${PKG_NCURSESW_CONFIGURE_ARGS_EXTRA:=--with-pkg-config --with-pkg-config-libdir=${PREFIX_LVL3}/lib/pkgconfig --enable-pc-files --enable-widec --with-shared}; +: ${PKG_NCURSESW_LIBFILES_FIX:=1}; : ${PKG_NCURSESW_MAKEFLAGS_INSTALL_EXTRA:=PKG_CONFIG_LIBDIR=/lib/pkgconfig}; : ${PKG_OPENSSH_VERSION:=7.1p2}; : ${PKG_OPENSSH_SHA256SUM:=dd75f024dcf21e06a0d6421d582690bf987a1f6323e32ad6619392f3bfde6bbd}; @@ -244,6 +255,7 @@ export PATH="${PREFIX}/bin${PATH:+:${PATH}}"; : ${PKG_XZ_VERSION:=5.2.2}; : ${PKG_XZ_SHA256SUM:=73df4d5d34f0468bd57d09f2d8af363e95ed6cc3a4a86129d2f2c366259902a2}; : ${PKG_XZ_URL:=http://tukaani.org/xz/xz-${PKG_XZ_VERSION}.tar.gz}; +: ${PKG_XZ_LIBFILES_FIX:=1}; : ${PKG_DALIST_URL:=${GITROOT_HEAD}/dalist}; : ${PKG_NTAPI_URL:=${GITROOT_HEAD}/ntapi}; diff --git a/pkg.build b/pkg.build index df63b00..0c57a35 100644 --- a/pkg.build +++ b/pkg.build @@ -122,6 +122,23 @@ if ! is_build_script_done install; then fi; fi; find ${PKG_PREFIX}/lib -type f -name \*.la -exec rm -f {} \; + if [ ${PKG_LIBFILES_FIX:-0} -eq 1 ]; then + find . \( -name '*.so' -or -name '*.so.[0-9]' \ + -or -name '*.so.[0-9].[0-9]' -or \ + -name '*.so.[0-9].[0-9].[0-9]' \) \ + -exec sh -c ' \ + SO_PNAME={}; SO_PNAME=${SO_PNAME#./}; \ + if [ "${SO_PNAME##*.}" = "so" ]; then \ + SO_NAME=${SO_PNAME%%.*}; \ + else SO_NAME=${SO_PNAME}; fi; \ + echo perk -epdlltool ${SO_PNAME} \> ${SO_NAME}.def; \ + perk -epdlltool ${SO_PNAME} > ${SO_NAME}.def; \ + echo x86_64-nt64-midipix-dlltool -l ${SO_NAME}.lib.a -D ${SO_PNAME} -d ${SO_NAME}.def; \ + x86_64-nt64-midipix-dlltool -l ${SO_NAME}.lib.a -D ${SO_PNAME} -d ${SO_NAME}.def; \ + echo cp ${SO_NAME}.lib.a '"${PKG_PREFIX}/lib"'; \ + cp ${SO_NAME}.lib.a '"${PKG_PREFIX}/lib" \;; + + fi; set_build_script_done install -finish; fi; set_build_script_done finish;