From 48549ba666dd81312c25eb1cf2e9b1635ef5aff9 Mon Sep 17 00:00:00 2001 From: Lucio Andrés Illanes Albornoz (arab, vxp) Date: Feb 15 2017 20:57:14 +0000 Subject: build.sh: set ${PKG_NAME_PARENT} for `flavoured' packages. subr/build.subr: fix bug in log_env_vars(). subr/pkg_setup_env.subr: inherit and log variables from parent packages when processing `flavoured' packages. vars/build.vars: replaces minipix packages w/ {bash,coreutils}_flavour_minipix, which are statically linked and installed to ${PREFIX_MINIPIX}. vars/musl.vars: don't install libc.so to ${PREFIX_MINIPIX}/lib. --- diff --git a/build.sh b/build.sh index 11ade03..57990f7 100755 --- a/build.sh +++ b/build.sh @@ -55,7 +55,9 @@ for BUILD_TARGET_LC in $(subst_tgts invariants ${BUILD_TARGETS_META:-world}); do # # # - if [ "${ARG_CHECK_UPDATES:-0}" -eq 1 ]\ + if [ "${PKG_NAME#*_flavour_*}" != "${PKG_NAME}" ]; then + PKG_NAME_PARENT="${PKG_NAME%_flavour_*}"; + elif [ "${ARG_CHECK_UPDATES:-0}" -eq 1 ]\ && [ "${BUILD_PACKAGE#*.*}" = "${BUILD_PACKAGE}" ]; then (mode_check_pkg_updates "${PKG_NAME}" "${BUILD_PACKAGE}"); continue; diff --git a/subr/build.subr b/subr/build.subr index 075575c..91c0335 100644 --- a/subr/build.subr +++ b/subr/build.subr @@ -129,12 +129,12 @@ lmatch() { }; log_env_vars() { - local _nvar _arg _arg_len_max; + local _nvar=1 _arg _arg_len_max=0; log_msg info "Variables for this ${1:-build}:"; shift; - while [ ${_nvar:=0} -lt ${#} ]; do + while [ ${_nvar} -le ${#} ]; do _arg="$(eval echo \${${_nvar}})"; _arg="${_arg%%=*}"; - if [ ${#_arg} -gt ${_arg_len_max:=0} ]; then + if [ ${#_arg} -gt ${_arg_len_max} ]; then _arg_len_max=${#_arg}; fi; : $((_nvar+=1)); done; diff --git a/subr/pkg_setup_env.subr b/subr/pkg_setup_env.subr index 75bf5f9..72314ed 100644 --- a/subr/pkg_setup_env.subr +++ b/subr/pkg_setup_env.subr @@ -3,16 +3,28 @@ # pkg_setup_env() { - local _pkg_name_uc _vars_fname _vname _build_uc __ _log_env_vars; + local _pkg_name_uc _pkg_name_parent_uc \ + _vars_fname _vname _build_uc __ _log_env_vars; _pkg_name_uc="$(echo ${PKG_NAME} | tr a-z A-Z)"; for _vars_fname in vars/${PKG_NAME}.vars; do [ -e "${_vars_fname}" ] && . "${_vars_fname}"; done; + _build_uc="$(echo ${BUILD} | tr a-z A-Z)"; + if [ -n "${PKG_NAME_PARENT}" ]; then + _pkg_name_parent_uc="$(echo ${PKG_NAME_PARENT} | tr a-z A-Z)"; + for _vname in PREFIX ${PKG_BUILD_VARS}; do + for __ in "DEFAULT_${_vname}" \ + "${BUILD_TARGET}_${_vname}" \ + "PKG_${_pkg_name_parent_uc}_${_vname}" \ + "PKG_${_pkg_name_parent_uc}_${_vname}_${_build_uc}"; do + set_var_unsafe "PKG_${_vname}" "$(get_var_unsafe ${__})"; + done; + done; + fi; for _vname in PREFIX ${PKG_BUILD_VARS}; do - _build_uc="$(echo ${BUILD} | tr a-z A-Z)"; - for __ in "DEFAULT_${_vname}" \ - "${BUILD_TARGET}_${_vname}" \ - "PKG_${_pkg_name_uc}_${_vname}" \ + for __ in "DEFAULT_${_vname}" \ + "${BUILD_TARGET}_${_vname}" \ + "PKG_${_pkg_name_uc}_${_vname}" \ "PKG_${_pkg_name_uc}_${_vname}_${_build_uc}"; do set_var_unsafe "PKG_${_vname}" "$(get_var_unsafe ${__})"; done; @@ -45,7 +57,10 @@ pkg_setup_env() { fi; fi; for __ in $(set); do - if [ "${__#PKG_${_pkg_name_uc}}" != "${__}" ]; then + if [ -n "${_pkg_name_parent_uc}" ]\ + && [ "${__#PKG_${_pkg_name_parent_uc}}" != "${__}" ]; then + _log_env_vars="${_log_env_vars:+${_log_env_vars} }${__%%=*}"; + elif [ "${__#PKG_${_pkg_name_uc}}" != "${__}" ]; then _log_env_vars="${_log_env_vars:+${_log_env_vars} }${__%%=*}"; fi; done; diff --git a/vars/build.vars b/vars/build.vars index eeb2045..500db8d 100644 --- a/vars/build.vars +++ b/vars/build.vars @@ -216,24 +216,19 @@ RUNTIME_PREFIX="${PREFIX_NATIVE}"; : ${PKG_PEMAGINE_URLS_GIT:=pemagine=${GITROOT}/pemagine}; : ${PKG_PEMAGINE_CFLAGS_CONFIGURE_EXTRA:=-O0}; : ${PKG_PEMAGINE_INSTALL_TARGET_EXTRA:=install-lib}; -: ${PKG_PEMAGINE_PREFIX_EXTRA:=${PREFIX_MINIPIX}}; : ${PKG_PEMAGINE_SUBDIR:=pemagine}; : ${PKG_DALIST_URLS_GIT:=dalist=${GITROOT}/dalist}; : ${PKG_DALIST_INSTALL_TARGET_EXTRA:=install-lib}; -: ${PKG_DALIST_PREFIX_EXTRA:=${PREFIX_MINIPIX}}; : ${PKG_DALIST_SUBDIR:=dalist}; : ${PKG_NTCON_URLS_GIT:=ntcon=${GITROOT}/ntcon}; : ${PKG_NTCON_INSTALL_TARGET_EXTRA:=install-lib}; -: ${PKG_NTCON_PREFIX_EXTRA:=${PREFIX_MINIPIX}}; : ${PKG_NTCON_SUBDIR:=ntcon}; : ${PKG_NTAPI_URLS_GIT:=ntapi=${GITROOT}/ntapi}; : ${PKG_NTAPI_INSTALL_TARGET_EXTRA:=install-lib}; -: ${PKG_NTAPI_PREFIX_EXTRA:=${PREFIX_MINIPIX}}; : ${PKG_NTAPI_SUBDIR:=ntapi}; : ${PKG_PSXSCL_URLS_GIT:=psxscl=${GITROOT_HEAD}/psxscl}; : ${PKG_PSXSCL_CFLAGS_CONFIGURE_EXTRA:=-O0}; : ${PKG_PSXSCL_INSTALL_TARGET_EXTRA:=install-lib}; -: ${PKG_PSXSCL_PREFIX_EXTRA:=${PREFIX_MINIPIX}}; : ${PKG_PSXSCL_SUBDIR:=psxscl}; : ${PKG_PSXSCL_STRACE_URLS_GIT:=psxscl=${GITROOT_HEAD}/psxscl}; : ${PKG_PSXSCL_STRACE_CFLAGS_CONFIGURE_EXTRA:="-DPSX_INTERNAL_STRACE -O0"}; @@ -242,12 +237,10 @@ RUNTIME_PREFIX="${PREFIX_NATIVE}"; : ${PKG_PSXSCL_STRACE_SUBDIR:=psxscl}; : ${PKG_NTCTTY_URLS_GIT:=ntctty=${GITROOT_HEAD}/ntctty}; : ${PKG_NTCTTY_CFLAGS_CONFIGURE_EXTRA:=-O0}; -: ${PKG_NTCTTY_PREFIX_EXTRA:=${PREFIX_MINIPIX}}; : ${PKG_NTCTTY_SUBDIR:=ntctty}; : ${PKG_PTYCON_URLS_GIT:=ptycon=${GITROOT_HEAD}/ptycon}; : ${PKG_PTYCON_CFLAGS_CONFIGURE_EXTRA:=-O0}; : ${PKG_PTYCON_INSTALL_TARGET_EXTRA:=install-app install-lib}; -: ${PKG_PTYCON_PREFIX_EXTRA:=${PREFIX_MINIPIX}}; : ${PKG_PTYCON_SUBDIR:=ptycon}; # @@ -327,7 +320,6 @@ LIB_PACKAGES_PREFIX="${PREFIX_NATIVE}"; : ${PKG_GZIP_CONFIGURE_ARGS:=--host=${TARGET} --prefix= --target=${TARGET}}; : ${PKG_GZIP_MAKEFLAGS_BUILD_EXTRA:=OBJA= prefix=}; : ${PKG_GZIP_MAKEFLAGS_INSTALL_EXTRA:=OBJA= prefix=}; -: ${PKG_GZIP_PREFIX_EXTRA:=${PREFIX_MINIPIX}}; : ${PKG_LIBARCHIVE_SHA256SUM:=691c194ee132d1f0f7a42541f091db811bc2e56f7107e9121be2bc8c04f1060f}; : ${PKG_LIBARCHIVE_VERSION:=3.2.2}; : ${PKG_LIBARCHIVE_URL:=http://www.libarchive.org/downloads/libarchive-${PKG_LIBARCHIVE_VERSION}.tar.gz}; @@ -413,7 +405,6 @@ LIB_PACKAGES_PREFIX="${PREFIX_NATIVE}"; : ${PKG_XZ_SHA256SUM:=73df4d5d34f0468bd57d09f2d8af363e95ed6cc3a4a86129d2f2c366259902a2}; : ${PKG_XZ_VERSION:=5.2.2}; : ${PKG_XZ_URL:=https://github.com/xz-mirror/xz/releases/download/v${PKG_XZ_VERSION}/xz-${PKG_XZ_VERSION}.tar.gz}; -: ${PKG_XZ_PREFIX_EXTRA:=${PREFIX_MINIPIX}}; : ${PKG_INPUTPROTO_SHA256SUM:=893a6af55733262058a27b38eeb1edc733669f01d404e8581b167f03c03ef31d}; : ${PKG_INPUTPROTO_VERSION:=2.3.2}; @@ -499,11 +490,11 @@ LEAF_PACKAGES_CONFIGURE_ARGS="-C --disable-nls --host=${TARGET} --prefix= --targ LEAF_PACKAGES_LDFLAGS_CONFIGURE="--sysroot=${PREFIX_NATIVE}"; LEAF_PACKAGES_MAKEFLAGS_INSTALL="DESTDIR=${PREFIX_NATIVE}"; LEAF_PACKAGES_PACKAGES=" -apk_tools bash bc bdwgc bind chicken clang_host coreutils cparser cron dash datamash diffutils -dos2unix ed figlet file findutils gawk git gnupg grep hexcurse htop inetutils infounzip infozip -irssi john ldns less lighttpd lynx make man_db mc mksh nano netcat nginx openlitespeed openssh -p7zip pacman patch perl procps_ng python3 qpdf rsync rxvt_unicode sed smallbasic tar tcsh -the_silver_searcher tmux util_linux vim weechat wget which whois xeyes xwd zsh"; +apk_tools bash bash_flavour_minipix bc bdwgc bind chicken clang_host coreutils coreutils_flavour_minipix +cparser cron dash datamash diffutils dos2unix ed figlet file findutils gawk git gnupg grep hexcurse htop +inetutils infounzip infozip irssi john ldns less lighttpd lynx make man_db mc mksh nano netcat nginx +openlitespeed openssh p7zip pacman patch perl procps_ng python3 qpdf rsync rxvt_unicode sed smallbasic +tar tcsh the_silver_searcher tmux util_linux vim weechat wget which whois xeyes xwd zsh"; LEAF_PACKAGES_PREFIX="${PREFIX_NATIVE}"; : ${PKG_APK_TOOLS_SHA256SUM:=def2b2c23cd12fd2a9c19be49653b0d1bf9d81a26dac5a0ee79a1351d674f93b}; : ${PKG_APK_TOOLS_VERSION:=2.6.8}; @@ -515,7 +506,8 @@ LEAF_PACKAGES_PREFIX="${PREFIX_NATIVE}"; : ${PKG_BASH_VERSION:=4.4-rc2}; : ${PKG_BASH_URL:=https://ftp.gnu.org/gnu/bash/bash-${PKG_BASH_VERSION}.tar.gz}; : ${PKG_BASH_CONFIGURE_ARGS_EXTRA:="--without-bash-malloc --with-curses"}; -: ${PKG_BASH_PREFIX_EXTRA:=${PREFIX_MINIPIX}}; +: ${PKG_BASH_FLAVOUR_MINIPIX_CONFIGURE_ARGS_EXTRA:="--enable-static-link --without-bash-malloc --with-curses"}; +: ${PKG_BASH_FLAVOUR_MINIPIX_MAKEFLAGS_INSTALL:="DESTDIR=${PREFIX_MINIPIX}"}; : ${PKG_BC_SHA256SUM:=7ee4abbcfac03d8a6e1a8a3440558a3d239d6b858585063e745c760957725ecc}; : ${PKG_BC_VERSION:=1.06.95}; : ${PKG_BC_URL:=http://alpha.gnu.org/gnu/bc/bc-${PKG_BC_VERSION}.tar.bz2}; @@ -543,7 +535,9 @@ LEAF_PACKAGES_PREFIX="${PREFIX_NATIVE}"; : ${PKG_COREUTILS_SHA256SUM:=155e94d748f8e2bc327c66e0cbebdb8d6ab265d2f37c3c928f7bf6c3beba9a8e}; : ${PKG_COREUTILS_VERSION:=8.26}; : ${PKG_COREUTILS_URL:=https://ftp.gnu.org/gnu/coreutils/coreutils-${PKG_COREUTILS_VERSION}.tar.xz}; -: ${PKG_COREUTILS_PREFIX_EXTRA:=${PREFIX_MINIPIX}}; +: ${PKG_COREUTILS_FLAVOUR_MINIPIX_LDFLAGS_BUILD_EXTRA:="-static"}; +: ${PKG_COREUTILS_FLAVOUR_MINIPIX_MAKEFLAGS_BUILD_EXTRA:="SHARED=0"}; +: ${PKG_COREUTILS_FLAVOUR_MINIPIX_MAKEFLAGS_INSTALL:="DESTDIR=${PREFIX_MINIPIX}"}; : ${PKG_CPARSER_URLS_GIT:="cparser=http://pp.info.uni-karlsruhe.de/git/cparser.git@master bcparser=${GITROOT}/compilers/bcparser@main"}; : ${PKG_CPARSER_BUILD_DIR:=cparser+libfirm/build/cparser}; : ${PKG_CPARSER_CONFIGURE:=bcparser/configure}; @@ -784,7 +778,6 @@ LEAF_PACKAGES_PREFIX="${PREFIX_NATIVE}"; : ${PKG_TAR_SHA256SUM:=cae466e6e58c7292355e7080248f244db3a4cf755f33f4fa25ca7f9a7ed09af0}; : ${PKG_TAR_VERSION:=1.29}; : ${PKG_TAR_URL:=https://ftp.gnu.org/gnu/tar/tar-${PKG_TAR_VERSION}.tar.gz}; -: ${PKG_TAR_PREFIX_EXTRA:=${PREFIX_MINIPIX}}; : ${PKG_TCSH_SHA256SUM:=b89de7064ab54dac454a266cfe5d8bf66940cb5ed048d0c30674ea62e7ecef9d}; : ${PKG_TCSH_VERSION:=6.20.00}; : ${PKG_TCSH_URL:=http://ftp.funet.fi/pub/mirrors/ftp.astron.com/pub/tcsh/tcsh-${PKG_TCSH_VERSION}.tar.gz}; diff --git a/vars/musl.vars b/vars/musl.vars index 36c041f..d5c88aa 100644 --- a/vars/musl.vars +++ b/vars/musl.vars @@ -74,7 +74,6 @@ pkg_musl_native_all() { if ! is_build_script_done "${PKG_NAME}" build "${_restart_at}"; then ./lazy -e "${_install}" -x build; build_fileop ln_symbolic ../lib/libc.so "${PKG_PREFIX}/bin/ldd"; - build_fileop cp lib/libc.so "${PREFIX_MINIPIX}/lib"; set_build_script_done "${PKG_NAME}" build finish; fi; exit 0;