From d377356690d60ab79e07354cdaeb7d2102557173 Mon Sep 17 00:00:00 2001 From: Lucio Andrés Illanes Albornoz Date: Jan 19 2019 00:41:41 +0000 Subject: subr/pkg_install{,_rpm}.subr: honour ${PKG_{PKGLIST,RPM}_DISABLE}. vars/build.vars:host_tools: moves mpackage from dist as mpackage_host. vars/build.vars:{ntctty,psxscl{,_strace},ptycon}: specify ${PKG_SRC_TARBALL_DISABLE:=1}. vars/build.vars:minipix: specify ${{PKGLIST,RPM}=1}. vars/dist_etc.vars: removed. vars/env.vars: adds {PKGLIST,RPM,SRC_TARBALL}_DISABLE. vars/invariants_tarballs.vars:pkgp_dist_tarball_src(): honour ${PKG_SRC_TARBALL_DISABLE}. vars/invariants_zipdist.vars: ensure build directories for packages in the pkglist.native exist. vars/{invariants_zipdist,mpackage_host}.vars: {reference,provide} mpackage/ symlink. --- diff --git a/subr/pkg_install.subr b/subr/pkg_install.subr index 36ff31d..cd55fdb 100644 --- a/subr/pkg_install.subr +++ b/subr/pkg_install.subr @@ -18,8 +18,7 @@ pkg_install() { tar -C "${PKG_DESTDIR}" -cpf - . |\ gzip -c -9 - > "${PKG_BASE_DIR}/${PKG_NAME}.tgz" fi; - if [ "${PKG_NAME%_minipix}" = "${PKG_NAME}" ] \ - && [ "${PKG_NAME}" != "mpackage" ]; then + if [ [ "${PKG_PKGLIST_DISABLE:-0}" -eq 0 ]; then if [ ! -e "${PREFIX}/pkglist.${PKG_BUILD_TYPE}" ]; then touch "${PREFIX}/pkglist.${PKG_BUILD_TYPE}"; fi; diff --git a/subr/pkg_install_rpm.subr b/subr/pkg_install_rpm.subr index 8da1023..856370d 100644 --- a/subr/pkg_install_rpm.subr +++ b/subr/pkg_install_rpm.subr @@ -5,8 +5,7 @@ pkg_install_rpm() { local _pkg_url="" _pkg_version_full="" _pkg_version_rpm=""; if [ "${ARG_RPM:-0}" -eq 0 ]\ - || ! [ -x "$(which rpmbuild 2>/dev/null)" ]\ - || [ "${PKG_NAME}" = "mpackage" ]; then + || [ "${PKG_RPM_DISABLE:-0}" -eq 1 ]; then return 0; fi; if [ -n "${PKG_URL}" ]; then diff --git a/vars/build.vars b/vars/build.vars index fa1f54c..6b0dcb8 100644 --- a/vars/build.vars +++ b/vars/build.vars @@ -24,8 +24,7 @@ xorg_cv_malloc0_returns_null=yes"}; HOST_TOOLS_BUILD_TYPE="host"; HOST_TOOLS_CONFIGURE_ARGS="--disable-nls --host=${DEFAULT_TARGET} --prefix= --target=${DEFAULT_TARGET}"; HOST_TOOLS_PACKAGES=" -chainport_host slibtool_host mdso_host -perk_host install_strip_host pkgconf_host"; +chainport_host slibtool_host mdso_host mpackage_host perk_host install_strip_host pkgconf_host"; HOST_TOOLS_PREFIX="${PREFIX}"; : ${PKG_CHAINPORT_HOST_URLS_GIT:="chainport=${DEFAULT_GITROOT}/ports/chainport"}; : ${PKG_CHAINPORT_HOST_BUILD_STEPS_DISABLE:=build}; @@ -35,6 +34,13 @@ HOST_TOOLS_PREFIX="${PREFIX}"; : ${PKG_MDSO_HOST_URLS_GIT:="mdso=${DEFAULT_GITROOT}/mdso"}; : ${PKG_MDSO_HOST_CONFIGURE_ARGS:="--prefix=/usr"}; : ${PKG_MDSO_HOST_INSTALL_FILES:="@mdso=bin/${DEFAULT_TARGET}-mdso /=${DEFAULT_TARGET}/bin bin/mdso=${DEFAULT_TARGET}/bin/mdso"}; +: ${PKG_MPACKAGE_HOST_URLS_GIT:=mpackage=${DEFAULT_GITROOT}/mpackage}; +: ${PKG_MPACKAGE_HOST_MAKEFLAGS_BUILD:="DESTDIR=${PREFIX_NATIVE}"}; +: ${PKG_MPACKAGE_HOST_IN_TREE:=1}; +: ${PKG_MPACKAGE_HOST_PKGLIST_DISABLE:=1}; +: ${PKG_MPACKAGE_HOST_PREFIX:=${PREFIX_NATIVE}}; +: ${PKG_MPACKAGE_HOST_RPM_DISABLE:=1}; +: ${PKG_MPACKAGE_HOST_SRC_TARBALL_DISABLE:=1}; : ${PKG_PERK_HOST_URLS_GIT:="perk=${DEFAULT_GITROOT}/perk"}; : ${PKG_PERK_HOST_CONFIGURE_ARGS:="--prefix=/usr"}; : ${PKG_PERK_HOST_INSTALL_FILES:="@perk=bin/${DEFAULT_TARGET}-perk"}; @@ -334,18 +340,22 @@ NATIVE_RUNTIME_PREFIX="${PREFIX_NATIVE}"; : ${PKG_PSXSCL_URLS_GIT:=psxscl=${DEFAULT_GITROOT_HEAD}/psxscl}; : ${PKG_PSXSCL_CFLAGS_CONFIGURE_EXTRA:=-O0}; : ${PKG_PSXSCL_INSTALL_TARGET_EXTRA:=install-lib}; +: ${PKG_PSXSCL_SRC_TARBALL_DISABLE:=1}; : ${PKG_PSXSCL_STRACE_URLS_GIT:=psxscl=${DEFAULT_GITROOT_HEAD}/psxscl}; : ${PKG_PSXSCL_STRACE_BUILD_STEPS_DISABLE:=install_make}; : ${PKG_PSXSCL_STRACE_CFLAGS_CONFIGURE_EXTRA:="-DPSX_EXTENDED_STRACE -O0"}; : ${PKG_PSXSCL_STRACE_INSTALL_FILES:="/=lib/debug ../obj/lib/libpsxscl.so=lib/debug/"}; +: ${PKG_PSXSCL_STRACE_SRC_TARBALL_DISABLE:=1}; : ${PKG_NTCTTY_URLS_GIT:=ntctty=${DEFAULT_GITROOT_HEAD}/ntctty}; : ${PKG_NTCTTY_CFLAGS_CONFIGURE_EXTRA:=-O0}; +: ${PKG_NTCTTY_SRC_TARBALL_DISABLE:=1}; : ${PKG_NTUX_URLS_GIT:=ntux=${DEFAULT_GITROOT}/ntux}; : ${PKG_NTUX_CFLAGS_CONFIGURE_EXTRA:=-O0}; : ${PKG_NTUX_HOST_INSTALL_FILES:="ntux/bin/ntux=bin/ntux"}; : ${PKG_PTYCON_URLS_GIT:=ptycon=${DEFAULT_GITROOT}/ptycon}; : ${PKG_PTYCON_CFLAGS_CONFIGURE_EXTRA:=-O0}; : ${PKG_PTYCON_INSTALL_TARGET_EXTRA:="install-app install-lib"}; +: ${PKG_PTYCON_SRC_TARBALL_DISABLE:=1}; : ${PKG_U16PORTS_CFLAGS_CONFIGURE_EXTRA:="--sysroot=${PREFIX_NATIVE} -Wno-missing-field-initializers"}; : ${PKG_U16PORTS_URLS_GIT:=u16ports=${DEFAULT_GITROOT}/u16ports}; : ${PKG_U16PORTS_INSTALL_TARGET_EXTRA:=install-lib}; @@ -1560,7 +1570,9 @@ sed_minipix tar_minipix vim_minipix wget_minipix which_minipix xz_minipix mintty_minipix ntctty_minipix ntux_minipix perk_minipix ptycon_minipix"; MINIPIX_PARALLELISE=1; +MINIPIX_PKGLIST_DISABLE=1; MINIPIX_PREFIX="${PREFIX}/minipix_dist"; +MINIPIX_RPM_DISABLE=1; # # 3rd party packages @@ -1621,11 +1633,7 @@ MINIPIX_PREFIX="${PREFIX}/minipix_dist"; # Build target dist # DIST_NO_LOG_VARS=1; -DIST_PACKAGES="dist_minipix_dist dist_etc mpackage"; -: ${PKG_MPACKAGE_URLS_GIT:=mpackage=${DEFAULT_GITROOT}/mpackage}; -: ${PKG_MPACKAGE_MAKEFLAGS_BUILD:="DESTDIR=${PREFIX_NATIVE}"}; -: ${PKG_MPACKAGE_IN_TREE:=1}; -: ${PKG_MPACKAGE_PREFIX:=${PREFIX_NATIVE}}; +DIST_PACKAGES="dist_minipix_dist"; # # Build target invariants diff --git a/vars/dist_etc.vars b/vars/dist_etc.vars deleted file mode 100644 index a4ca716..0000000 --- a/vars/dist_etc.vars +++ /dev/null @@ -1,9 +0,0 @@ -# -# set -o errexit -o noglob are assumed. -# - -pkg_dist_etc_all() { - ex_rtl_fileop cp "${MIDIPIX_BUILD_PWD}/etc/README" "${PREFIX}"; -}; - -# vim:filetype=sh diff --git a/vars/env.vars b/vars/env.vars index 785783d..1f1c7f1 100644 --- a/vars/env.vars +++ b/vars/env.vars @@ -15,8 +15,8 @@ DEFAULT_BUILD_VARS=" LDFLAGS_CONFIGURE_EXTRA LDFLAGS_INSTALL_EXTRA LIBTOOL MAKE MAKE_INSTALL_VNAME \ MAKEFLAGS_BUILD MAKEFLAGS_BUILD_EXTRA MAKEFLAGS_INSTALL MAKEFLAGS_INSTALL_EXTRA \ NO_CLEAN_BASE_DIR NO_LOG_VARS PYTHON PARALLELISE PATCHES_EXTRA PKG_CONFIG \ - PKG_CONFIG_LIBDIR PKGCONFIG PREFIX RANLIB SHA256SUM SUBDIR TARGET URL - URL_TYPE URLS_GIT VERSION"; + PKG_CONFIG_LIBDIR PKGCONFIG PKGLIST_DISABLE PREFIX RANLIB RPM_DISABLE SHA256SUM \ + SRC_TARBALL_DISABLE SUBDIR TARGET URL URL_TYPE URLS_GIT VERSION"; DEFAULT_LOG_MSG_FAIL_COLOUR=91; DEFAULT_LOG_MSG_INFO_COLOUR=93; DEFAULT_LOG_MSG_INF2_COLOUR=33; diff --git a/vars/invariants_tarballs.vars b/vars/invariants_tarballs.vars index d9a6aaa..1b89aeb 100644 --- a/vars/invariants_tarballs.vars +++ b/vars/invariants_tarballs.vars @@ -48,14 +48,21 @@ pkgp_dist_tarball_minipix() { }; pkgp_dist_tarball_src() { + local _build_tgt_lc="" _build_tgt_uc="" _find_filters="" _pkg_name_lc="" _pkg_name_uc=""; TARBALL_SRC_FNAME="${DEFAULT_TARBALL_SRC_FNAME_PREFIX}${BUILD_USER}@${BUILD_HNAME}-${BUILD_DATE_START}.tar.${DEFAULT_TARBALL_SUFFIX}"; ex_rtl_log_msg info "Building source tarball..."; + for _build_tgt_lc in ${BUILD_TARGETS:-${TARGETS_DEFAULT}}; do + _build_tgt_uc="$(ex_rtl_toupper "${_build_tgt_lc}")"; + for _pkg_name_lc in $(ex_rtl_get_var_unsafe ${_build_tgt_uc}_PACKAGES); do + _pkg_name_uc="$(ex_rtl_toupper "${_pkg_name_lc}")"; + if [ "$(ex_rtl_get_var_unsafe ${_pkg_name_uc}_SRC_TARBALL_DISABLE)" = "1" ]; then + _find_filters="${_find_filters:+${_find_filters} }( -not -name ${_pkg_name}-\*-\* )"; + fi; + done; + done; tar -C "${BUILD_WORKDIR}" -cpf - $(cd "${BUILD_WORKDIR}" && find \ - -maxdepth 1 -mindepth 1 \ - -name \*-\*-\* \ - \( -not -name ntctty\* \) \ - \( -not -name psxscl\* \) \ - \( -not -name ptycon\* \)) |\ + -maxdepth 1 -mindepth 1 -name \*-\*-\* \ + ${_find_filters}) |\ "${TARBALL_COMPRESS_CMD}" ${TARBALL_COMPRESS_ARGS} -c > "${TARBALL_SRC_FNAME}"; ex_rtl_log_msg info "Finished building source tarball."; if [ -x "$(which gpg 2>/dev/null)" -a -n "${DEFAULT_TARBALL_SIGN_GPG_KEY}" ] && \ diff --git a/vars/invariants_zipdist.vars b/vars/invariants_zipdist.vars index b1f84b2..246e556 100644 --- a/vars/invariants_zipdist.vars +++ b/vars/invariants_zipdist.vars @@ -3,21 +3,25 @@ # pkg_invariants_zipdist_all() { - local _dist_fname="" _mpackage_dname=""; + local _dist_fname="" _pkg_name="" _pkglist_fname="${PREFIX}/pkglist.native"; if [ -z "${ARG_ZIPDIST}" ]; then exit 0; else ex_rtl_log_msg info "Building deployable distribution ZIP archive..."; + for _pkg_name in $(cat "${_pkglist_fname}"); do + if ! stat "${BUILD_WORKDIR}/${_pkg_name}-native-${DEFAULT_TARGET}" >/dev/null 2>&1; then + ex_rtl_log_msg failexit "Error: missing package build directory for package \`${_pkg_name}'."; + fi; + done; _dist_fname="${DEFAULT_ZIPDIST_FNAME_PREFIX}${BUILD_USER}@${BUILD_HNAME}-${BUILD_DATE_START}.zip"; - _mpackage_dname="${BUILD_WORKDIR}/mpackage-native-${DEFAULT_TARGET}/mpackage"; - "${_mpackage_dname}/mpackage.sh" \ + "${BUILD_WORKDIR}/mpackage/mpackage.sh" \ --defroot=/dev/fs/c/midipix \ --flysyms \ --minroot="${PREFIX_MINIPIX}" \ --objroot="${BUILD_WORKDIR}" \ --pkgroot="${BUILD_WORKDIR}/pkgroot" \ --product=Midipix \ - --subset="${PREFIX}/pkglist.native" \ + --subset="${_pkglist_fname}" \ --symbols \ --sysroot="${BUILD_WORKDIR}/sysroot" \ --target="${DEFAULT_TARGET}" \ diff --git a/vars/mpackage_host.vars b/vars/mpackage_host.vars new file mode 100644 index 0000000..3dd332c --- /dev/null +++ b/vars/mpackage_host.vars @@ -0,0 +1,10 @@ +# +# set -o errexit -o noglob are assumed. +# + +pkg_mpackage_host_install_make() { + ex_rtl_fileop rm "${BUILD_WORKDIR}/mpackage"; + ex_rtl_fileop ln_symbolic "${PKG_SUBDIR}" "${BUILD_WORKDIR}/mpackage"; +}; + +# vim:filetype=sh