diff --git a/subr/pkg.subr b/subr/pkg.subr index da36f35..2130feb 100644 --- a/subr/pkg.subr +++ b/subr/pkg.subr @@ -3,59 +3,20 @@ # See warning at the top of build.vars. # -# N.B. URLs ($1) may contain `?' or '&' characters. -fetch() { - _f_url="${1}"; _f_sha256sum_src="${2}"; - _f_url_dst="${DLCACHEDIR}/$(basename "${_f_url}")"; - if [ ${ARG_OFFLINE:-0} -eq 1 ]\ - || [ -e ${_f_url_dst}.fetched ]; then - unset _f_url _f_sha256sum_src _f_url_dst; - return 0; - else - wget ${WGET_ARGS} -c -O ${_f_url_dst} "${_f_url}"; - fi; - if [ -n "${_f_sha256sum_src}" ]; then - set -- $(openssl dgst -sha256 ${_f_url_dst}); shift $((${#}-1)); - if [ "${_f_sha256sum_dst:=${1}}" != "${_f_sha256sum_src}" ]; then - if [ ${ARG_IGNORE_SHA256SUMS:-0} -eq 0 ]; then - log_msg failexit "Error: hash mismatch for URL \`${_f_url}' (is: ${_f_sha256sum_dst}, should be: ${_f_sha256sum_src}.)"; - else - log_msg warn "Warning: hash mismatch for URL \`${_f_url}' (is: ${_f_sha256sum_dst}, should be: ${_f_sha256sum_src}.)"; - fi; - fi; - fi; - touch ${_f_url_dst}.fetched; - unset _f_url _f_url_dst _f_sha256sum_src _f_sha256sum_dst; -}; - -fetch_git() { - _fg_subdir="${1}"; _fg_url="${2}"; _fg_branch="${3}"; - if [ ${ARG_OFFLINE:-0} -eq 0 ]; then - if [ -e "${DLCACHEDIR}/${_fg_subdir}" ]; then - cd ${DLCACHEDIR}/${_fg_subdir} &&\ - git pull origin ${_fg_branch:-main} && cd ${OLDPWD}; +is_build_script_done() { + if [ "${1}" = "clean" ]; then + if match_list "${ARG_RESTART}" , ${BUILD_PACKAGE_LC} \ + && [ -n "${ARG_RESTART_AT}" ] \ + && match_list "${ARG_RESTART_AT}" , "${1}"; then + return 1; # Build else - git clone ${_fg_url} ${DLCACHEDIR}/${_fg_subdir}; - if [ -n "${_fg_branch}" -a \ - \( -z "${_fg_branch#main}" \) -a \ - \( -z "${_fg_branch#master}" \) ]; then - cd ${DLCACHEDIR}/${_fg_subdir} &&\ - git checkout -b ${_fg_branch} && cd ${OLDPWD}; - fi; + return 0; # Skip fi; - fi; - secure_rm ${_fg_subdir}; - cp -pr ${DLCACHEDIR}/${_fg_subdir} .; -}; - -is_build_script_done() { - if [ "${1}" != "clean" ]\ - && [ "${ARG_RESTART}" = "ALL" ]; then + elif [ "${ARG_RESTART}" = "ALL" ]; then return 1; # Build elif match_list "${ARG_RESTART}" , ${BUILD_PACKAGE_LC}; then if [ -n "${ARG_RESTART_AT}" ]; then - if [ "${1}" != "clean" ]\ - && [ "${ARG_RESTART_AT}" = "ALL" ]; then + if [ "${ARG_RESTART_AT}" = "ALL" ]; then return 1; # Build elif match_list "${ARG_RESTART_AT}" , "${1}"; then return 1; # Build @@ -93,6 +54,7 @@ parse_with_pkg_name() { PKG_NAME=${1}; shift; _pwpn_pkg_name_uc=$(echo ${PKG_NAME} | tr a-z A-Z); if [ -z "$(get_var_unsafe PKG_${_pwpn_pkg_name_uc}_URL)" ]\ + && [ -z "$(get_var_unsafe PKG_${_pwpn_pkg_name_uc}_URLS_GIT)" ]\ && [ -z "$(get_var_unsafe PKG_${_pwpn_pkg_name_uc}_VERSION)" ]; then unset _pwpn_pkg_name_uc; log_msg failexit "Error: package \`${PKG_NAME}' missing in build.vars."; diff --git a/subr/pkg_extract.subr b/subr/pkg_extract.subr index 1bee883..2b7d4fd 100644 --- a/subr/pkg_extract.subr +++ b/subr/pkg_extract.subr @@ -4,7 +4,8 @@ # pkg_extract() { - if [ "${PKG_URL_TYPE:-wget}" = wget ]; then + if [ -n "${PKG_URL}" ]\ + && [ "${PKG_URL_TYPE:-wget}" = wget ]; then secure_rm ${PKG_SUBDIR}; if [ ${PKG_SUBDIR_CREATE:-0} -eq 1 ]; then insecure_mkdir ${PKG_SUBDIR}; diff --git a/subr/pkg_fetch.subr b/subr/pkg_fetch.subr index 705e493..f265375 100644 --- a/subr/pkg_fetch.subr +++ b/subr/pkg_fetch.subr @@ -3,16 +3,80 @@ # See warning at the top of build.vars. # -pkg_fetch() { - if [ "${PKG_URL_TYPE:-wget}" = wget ]; then - fetch "${PKG_URL}" ${PKG_SHA256SUM}; +# N.B. URLs ($1) may contain `?' or '&' characters. +pkgp_fetch() { + _f_url="${1}"; _f_sha256sum_src="${2}"; + _f_url_dst="${DLCACHEDIR}/$(basename "${_f_url}")"; + if [ ${ARG_OFFLINE:-0} -eq 1 ]\ + || [ -e ${_f_url_dst}.fetched ]; then + unset _f_url _f_sha256sum_src _f_url_dst; + return 0; else - fetch_git ${PKG_SUBDIR} ${PKG_URL} ${PKG_GIT_BRANCH}; + wget ${WGET_ARGS} -c -O ${_f_url_dst} "${_f_url}"; + fi; + if [ -n "${_f_sha256sum_src}" ]; then + set -- $(openssl dgst -sha256 ${_f_url_dst}); shift $((${#}-1)); + if [ "${_f_sha256sum_dst:=${1}}" != "${_f_sha256sum_src}" ]; then + if [ ${ARG_IGNORE_SHA256SUMS:-0} -eq 0 ]; then + log_msg failexit "Error: hash mismatch for URL \`${_f_url}' (is: ${_f_sha256sum_dst}, should be: ${_f_sha256sum_src}.)"; + else + log_msg warn "Warning: hash mismatch for URL \`${_f_url}' (is: ${_f_sha256sum_dst}, should be: ${_f_sha256sum_src}.)"; + fi; + fi; + fi; + touch ${_f_url_dst}.fetched; + unset _f_url _f_url_dst _f_sha256sum_src _f_sha256sum_dst; +}; + +pkgp_fetch_git() { + _fg_subdir="${1}"; _fg_url="${2}"; _fg_branch="${3}"; + if [ ${ARG_OFFLINE:-0} -eq 0 ]; then + if [ -e "${DLCACHEDIR}/${_fg_subdir}" ]; then + cd ${DLCACHEDIR}/${_fg_subdir} &&\ + git pull origin ${_fg_branch:-main} && cd ${OLDPWD}; + else + git clone ${_fg_url} ${DLCACHEDIR}/${_fg_subdir}; + if [ -n "${_fg_branch}" -a \ + \( -z "${_fg_branch#main}" \) -a \ + \( -z "${_fg_branch#master}" \) ]; then + cd ${DLCACHEDIR}/${_fg_subdir} &&\ + git checkout -b ${_fg_branch} && cd ${OLDPWD}; + fi; + fi; fi; - if test_cmd pkg_${PKG_NAME}_fetch_post; then - pkg_${PKG_NAME}_fetch_post; + secure_rm ${_fg_subdir}; + cp -pr ${DLCACHEDIR}/${_fg_subdir} .; +}; + +pkgp_fetch_urls_git() { + for _ppfu_url_spec in ${1}; do + _ppfu_subdir=${_ppfu_url_spec%=*}; + _ppfu_url=${_ppfu_url_spec#*=}; + _ppfu_url=${_ppfu_url%@*}; + if [ "${_ppfu_url_spec#*@}" != "${_ppfu_url_spec}" ]; then + _ppfu_git_branch=${_ppfu_url_spec#*@}; + fi; + pkgp_fetch_git ${_ppfu_subdir} ${_ppfu_url} ${_ppfu_git_branch}; + done; + unset _ppfu_url_spec _ppfu_subdir _ppfu_url _ppfu_git_branch; +}; + +pkg_fetch() { + if [ -n "${1}" ]; then + if [ "${1}" = "-git" ]; then + shift; pkgp_fetch_urls_git ${1}; + else + pkgp_fetch ${1} ${2}; + fi; + else + if [ -n "${PKG_URL}" ]; then + pkgp_fetch ${PKG_URL} ${PKG_SHA256SUM}; + fi; + if [ -n "${PKG_URLS_GIT}" ]; then + pkgp_fetch_urls_git ${PKG_URLS_GIT}; + fi; + set_build_script_done fetch -extract; fi; - set_build_script_done fetch -extract; }; # vim:filetype=sh diff --git a/vars/build.vars b/vars/build.vars index 2b7b6f6..ff6005e 100644 --- a/vars/build.vars +++ b/vars/build.vars @@ -57,7 +57,7 @@ fi; : ${LOG_MSG_INFO_COLOUR:=93}; : ${LOG_MSG_SUCC_COLOUR:=92}; : ${LOG_MSG_WARN_COLOUR:=96}; -: ${PKG_BUILD_VARS:="BUILD_CMDLINE BUILD_DIR BUILD_TYPE CFLAGS_BUILD_EXTRA CFLAGS_CONFIGURE CFLAGS_CONFIGURE_EXTRA CFLAGS_INSTALL_EXTRA CONFIG_CACHE_EXTRA CONFIGURE CONFIGURE_ARGS CONFIGURE_ARGS_EXTRA DISABLED ENV_VARS_EXTRA FNAME GIT_BRANCH INSTALL_FILES INSTALL_TARGET INSTALL_TARGET_EXTRA LDFLAGS_BUILD_EXTRA LDFLAGS_CONFIGURE LDFLAGS_CONFIGURE_EXTRA LDFLAGS_INSTALL_EXTRA MAKEFLAGS_BUILD MAKEFLAGS_BUILD_EXTRA MAKEFLAGS_INSTALL MAKEFLAGS_INSTALL_EXTRA NO_CLEAN NO_MAKE_BUILD NO_MAKE_INSTALL PREFIX_EXTRA SHA256SUM SLIBTOOL SUBDIR SUBDIR_CREATE TARGET URL URL_FNAME URL_TYPE VERSION"}; +: ${PKG_BUILD_VARS:="BUILD_CMDLINE BUILD_DIR BUILD_TYPE CFLAGS_BUILD_EXTRA CFLAGS_CONFIGURE CFLAGS_CONFIGURE_EXTRA CFLAGS_INSTALL_EXTRA CONFIG_CACHE_EXTRA CONFIGURE CONFIGURE_ARGS CONFIGURE_ARGS_EXTRA DISABLED ENV_VARS_EXTRA FNAME INSTALL_FILES INSTALL_TARGET INSTALL_TARGET_EXTRA LDFLAGS_BUILD_EXTRA LDFLAGS_CONFIGURE LDFLAGS_CONFIGURE_EXTRA LDFLAGS_INSTALL_EXTRA MAKEFLAGS_BUILD MAKEFLAGS_BUILD_EXTRA MAKEFLAGS_INSTALL MAKEFLAGS_INSTALL_EXTRA NO_CLEAN NO_MAKE_BUILD NO_MAKE_INSTALL PREFIX_EXTRA SHA256SUM SLIBTOOL SUBDIR SUBDIR_CREATE TARGET URL URL_FNAME URL_TYPE URLS_GIT VERSION"}; : ${TARBALL_FNAME_PREFIX:=midipix-${ARCH}-${BUILD}.}; : ${TARBALL_SIGN_GPG_KEY:=}; : ${TARBALL_CROSS_FNAME_PREFIX:=midipix-${ARCH}-${BUILD}_cross.}; @@ -77,9 +77,9 @@ export PATH="${PREFIX}/bin${PATH:+:${PATH}}"; # Build target invariants # INVARIANTS_PACKAGES="chainport"; -: ${PKG_CHAINPORT_URL:=${GITROOT}/ports/chainport}; -: ${PKG_CHAINPORT_URL_TYPE:=git}; +: ${PKG_CHAINPORT_URLS_GIT:="chainport=${GITROOT}/ports/chainport"}; : ${PKG_CHAINPORT_BUILD_DIR:=chainport}; +: ${PKG_CHAINPORT_SUBDIR:=chainport}; # # Build target host_toolchain @@ -89,16 +89,16 @@ HOST_TOOLCHAIN_CFLAGS_CONFIGURE="${HOST_TOOLCHAIN_CFLAGS_CONFIGURE_DEFAULT}"; HOST_TOOLCHAIN_CONFIGURE_ARGS="-C --disable-nls --host=${TARGET} --prefix= --target=${TARGET}"; HOST_TOOLCHAIN_PACKAGES="slibtool_host perk_host binutils_host binutils_host_x86_64_w64_mingw32 gcc_stage1_cross_x86_64_w64_mingw32 gcc_stage1 psxstub musl_no_complex gcc_runtime musl_full gcc_libstdcpp_v3 gcc_full file_host mdso_host pkgconf_host"; HOST_TOOLCHAIN_PREFIX="${PREFIX_CROSS}"; -: ${PKG_SLIBTOOL_HOST_URL:=${GITROOT}/slibtool}; -: ${PKG_SLIBTOOL_HOST_URL_TYPE:=git}; +: ${PKG_SLIBTOOL_HOST_URLS_GIT:="slibtool=${GITROOT}/slibtool"}; : ${PKG_SLIBTOOL_HOST_CONFIGURE_ARGS:=--host= --prefix=}; : ${PKG_SLIBTOOL_HOST_MAKEFLAGS_INSTALL:=DESTDIR=${PREFIX}}; -: ${PKG_PERK_HOST_URL:=${GITROOT}/perk}; -: ${PKG_PERK_HOST_URL_TYPE:=git}; +: ${PKG_SLIBTOOL_HOST_SUBDIR:=slibtool}; +: ${PKG_PERK_HOST_URLS_GIT:="perk=${GITROOT}/perk"}; : ${PKG_PERK_HOST_CONFIGURE_ARGS:="--prefix=/usr"}; : ${PKG_PERK_HOST_INSTALL_FILES:="@perk=bin/${TARGET}-perk"}; : ${PKG_PERK_HOST_MAKEFLAGS_INSTALL:="DESTDIR=${PREFIX}"}; : ${PKG_PERK_HOST_PREFIX:=${PREFIX}}; +: ${PKG_PERK_HOST_SUBDIR:=perk}; : ${PKG_BINUTILS_HOST_SHA256SUM:=250d3b2925c6b211fb16173b0b25bc091c58829fbcad3eb849645e0af52cf7fa}; : ${PKG_BINUTILS_HOST_VERSION:=2.24.51}; : ${PKG_BINUTILS_HOST_URL:=ftp://sourceware.org/pub/binutils/snapshots/binutils-${PKG_BINUTILS_HOST_VERSION}.tar.bz2}; @@ -113,9 +113,8 @@ HOST_TOOLCHAIN_PREFIX="${PREFIX_CROSS}"; : ${PKG_GCC_STAGE1_CROSS_X86_64_W64_MINGW32_VERSION:=4.6.4}; : ${PKG_GCC_STAGE1_CROSS_X86_64_W64_MINGW32_TARGET:=x86_64-w64-mingw32}; : ${PKG_GCC_STAGE1_VERSION:=4.6.4}; -: ${PKG_PSXSTUB_URL:=${GITROOT}/psxstub}; -: ${PKG_PSXSTUB_URL_TYPE:=git}; -: ${PKG_PSXSTUB_URL:=${GITROOT}/psxstub}; +: ${PKG_PSXSTUB_URLS_GIT:="psxstub=${GITROOT}/psxstub"}; +: ${PKG_PSXSTUB_SUBDIR:=psxstub}; : ${PKG_MUSL_NO_COMPLEX_VERSION:=1.1.12}; : ${PKG_GCC_RUNTIME_VERSION:=4.6.4}; : ${PKG_MUSL_FULL_VERSION:=1.1.12}; @@ -125,12 +124,12 @@ HOST_TOOLCHAIN_PREFIX="${PREFIX_CROSS}"; : ${PKG_FILE_HOST_VERSION:=5.29}; : ${PKG_FILE_HOST_URL:=ftp://ftp.astron.com/pub/file/file-${PKG_FILE_HOST_VERSION}.tar.gz}; : ${PKG_FILE_HOST_CONFIGURE_ARGS:="-C --prefix=${PREFIX}"}; -: ${PKG_MDSO_HOST_URL:=${GITROOT}/mdso}; -: ${PKG_MDSO_HOST_URL_TYPE:=git}; +: ${PKG_MDSO_HOST_URLS_GIT:="mdso=${GITROOT}/mdso"}; : ${PKG_MDSO_HOST_CONFIGURE_ARGS:="--prefix=/usr"}; : ${PKG_MDSO_HOST_INSTALL_FILES:="@mdso=bin/${TARGET}-mdso"}; : ${PKG_MDSO_HOST_MAKEFLAGS_INSTALL:="DESTDIR=${PREFIX}"}; : ${PKG_MDSO_HOST_PREFIX:=${PREFIX}}; +: ${PKG_MDSO_HOST_SUBDIR:=mdso}; : ${PKG_PKGCONF_HOST_SHA256SUM:=7ec8b516e655e247f4ba976837cee808134785819ab8f538f652fe919cc6c09f}; : ${PKG_PKGCONF_HOST_VERSION:=0.9.12}; : ${PKG_PKGCONF_HOST_URL:=https://github.com/pkgconf/pkgconf/releases/download/pkgconf-${PKG_PKGCONF_HOST_VERSION}/pkgconf-${PKG_PKGCONF_HOST_VERSION}.tar.bz2}; @@ -145,13 +144,13 @@ NATIVE_TOOLCHAIN_CONFIGURE_ARGS="--disable-nls --host=${TARGET} --prefix=/ --tar NATIVE_TOOLCHAIN_MAKEFLAGS_INSTALL="DESTDIR=${PREFIX_NATIVE}"; NATIVE_TOOLCHAIN_PACKAGES="slibtool perk pkgconf gmp mpfr mpc libelf binutils binutils_x86_64_w64_mingw32 musl_native gcc_native gcc_stage1_native_x86_64_w64_mingw32 mdso"; NATIVE_TOOLCHAIN_PREFIX="${PREFIX_NATIVE}"; -: ${PKG_SLIBTOOL_URL:=git://midipix.org/slibtool}; -: ${PKG_SLIBTOOL_URL_TYPE:=git}; +: ${PKG_SLIBTOOL_URLS_GIT:="slibtool=git://midipix.org/slibtool"}; : ${PKG_SLIBTOOL_CONFIGURE_ARGS:="--host=${TARGET} --prefix= --target=${TARGET}"}; -: ${PKG_PERK_URL:=${GITROOT}/perk}; -: ${PKG_PERK_URL_TYPE:=git}; +: ${PKG_SLIBTOOL_SUBDIR:=slibtool}; +: ${PKG_PERK_URLS_GIT:="perk=${GITROOT}/perk"}; : ${PKG_PERK_CONFIGURE_ARGS:="--prefix=/usr --target=${TARGET}"}; : ${PKG_PERK_INSTALL_FILES:="@perk=bin/${TARGET}-perk"}; +: ${PKG_PERK_SUBDIR:=perk}; : ${PKG_PKGCONF_SHA256SUM:=7ec8b516e655e247f4ba976837cee808134785819ab8f538f652fe919cc6c09f}; : ${PKG_PKGCONF_VERSION:=0.9.12}; : ${PKG_PKGCONF_URL:=https://github.com/pkgconf/pkgconf/releases/download/pkgconf-${PKG_PKGCONF_VERSION}/pkgconf-${PKG_PKGCONF_VERSION}.tar.bz2}; @@ -192,10 +191,10 @@ NATIVE_TOOLCHAIN_PREFIX="${PREFIX_NATIVE}"; : ${PKG_GCC_NATIVE_VERSION:=4.6.4}; : ${PKG_GCC_STAGE1_NATIVE_X86_64_W64_MINGW32_VERSION:=4.6.4}; : ${PKG_GCC_STAGE1_NATIVE_X86_64_W64_MINGW32_TARGET:=x86_64-w64-mingw32}; -: ${PKG_MDSO_URL:=${GITROOT}/mdso}; -: ${PKG_MDSO_URL_TYPE:=git}; +: ${PKG_MDSO_URLS_GIT:="mdso=${GITROOT}/mdso"}; : ${PKG_MDSO_CONFIGURE_ARGS:="--prefix=/usr --target=${TARGET}"}; : ${PKG_MDSO_INSTALL_FILES:="@mdso=bin/${TARGET}-mdso"}; +: ${PKG_MDSO_SUBDIR:=mdso}; # # Build target runtime @@ -207,38 +206,46 @@ RUNTIME_ENV_VARS_EXTRA="CFLAGS_PATH=-I${PREFIX_NATIVE}/include:LDFLAGS_PATH=-L${ RUNTIME_MAKEFLAGS_INSTALL="DESTDIR=${PREFIX_NATIVE}"; RUNTIME_PACKAGES="psxtypes pemagine dalist ntcon ntapi psxscl psxscl_strace ntctty ptycon"; RUNTIME_PREFIX="${PREFIX_NATIVE}"; -RUNTIME_URL_TYPE="git"; -: ${PKG_PSXTYPES_URL:=${GITROOT}/psxtypes}; +: ${PKG_PSXTYPES_URLS_GIT:=psxtypes=${GITROOT}/psxtypes}; : ${PKG_PSXTYPES_BUILD_DIR:=psxtypes}; : ${PKG_PSXTYPES_MAKEFLAGS_BUILD:="DESTDIR=${PREFIX_NATIVE}"}; -: ${PKG_PEMAGINE_URL:=${GITROOT}/pemagine}; +: ${PKG_PSXTYPES_SUBDIR:=psxtypes}; +: ${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_DALIST_URL:=${GITROOT}/dalist}; +: ${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_NTCON_URL:=${GITROOT}/ntcon}; +: ${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_NTAPI_URL:=${GITROOT}/ntapi}; +: ${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_PSXSCL_URL:=${GITROOT_HEAD}/psxscl}; +: ${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_STRACE_URL:=${GITROOT_HEAD}/psxscl}; +: ${PKG_PSXSCL_SUBDIR:=psxscl}; +: ${PKG_PSXSCL_STRACE_URLS_GIT:=psxscl=${GITROOT_HEAD}/psxscl}; : ${PKG_PSXSCL_STRACE_CFLAGS_CONFIGURE_EXTRA:="-DPSX_INTERNAL_STRACE -O0"}; : ${PKG_PSXSCL_STRACE_INSTALL_FILES:="/=lib/psxscl_strace lib/libpsxscl.so=lib/psxscl_strace/"}; : ${PKG_PSXSCL_STRACE_NO_MAKE_INSTALL:=1}; -: ${PKG_NTCTTY_URL:=${GITROOT_HEAD}/ntctty}; +: ${PKG_PSXSCL_SUBDIR:=psxscl}; +: ${PKG_NTCTTY_URLS_GIT:=ntctty=${GITROOT_HEAD}/ntctty}; : ${PKG_NTCTTY_CFLAGS_CONFIGURE_EXTRA:=-O0}; : ${PKG_NTCTTY_PREFIX_EXTRA:=${PREFIX_MINIPIX}}; -: ${PKG_PTYCON_URL:=${GITROOT_HEAD}/ptycon}; +: ${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}; # # Build target lib_packages @@ -312,9 +319,8 @@ LIB_PACKAGES_PREFIX="${PREFIX_NATIVE}"; : ${PKG_LIBARCHIVE_CONFIGURE_ARGS_EXTRA:=--without-xml2}; : ${PKG_LIBARCHIVE_LDFLAGS_CONFIGURE_EXTRA:=-L${PREFIX_NATIVE}/lib}; : ${PKG_LIBARCHIVE_MAKEFLAGS_INSTALL_EXTRA:="prefix=:DESTDIR=${PREFIX_NATIVE}:LIBTOOL=slibtool"}; -: ${PKG_LIBATOMIC_OPS_GIT_BRANCH:=master}; -: ${PKG_LIBATOMIC_OPS_URL:=https://github.com/ivmai/libatomic_ops}; -: ${PKG_LIBATOMIC_OPS_URL_TYPE:=git}; +: ${PKG_LIBATOMIC_OPS_URLS_GIT:="libatomic_ops=https://github.com/ivmai/libatomic_ops@master"}; +: ${PKG_LIBATOMIC_OPS_SUBDIR:=libatomic_ops}; : ${PKG_LIBPIPELINE_SHA256SUM:=da46d7b20163aadb9db2faae483f734e9096a7550c84b94029abeab62dd1b9ee}; : ${PKG_LIBPIPELINE_VERSION:=1.4.1}; : ${PKG_LIBPIPELINE_URL:=http://download.savannah.gnu.org/releases/libpipeline/libpipeline-${PKG_LIBPIPELINE_VERSION}.tar.gz}; @@ -340,12 +346,10 @@ LIB_PACKAGES_PREFIX="${PREFIX_NATIVE}"; : ${PKG_LIBASSUAN_SHA256SUM:=22843a3bdb256f59be49842abf24da76700354293a066d82ade8134bb5aa2b71}; : ${PKG_LIBASSUAN_VERSION:=2.4.3}; : ${PKG_LIBASSUAN_URL:=https://www.gnupg.org/ftp/gcrypt/libassuan/libassuan-${PKG_LIBASSUAN_VERSION}.tar.bz2}; -: ${PKG_LIBFIRM_URL:=http://pp.info.uni-karlsruhe.de/git/libfirm.git}; -: ${PKG_LIBFIRM_URL_TYPE:=git}; +: ${PKG_LIBFIRM_URLS_GIT:="libfirm=http://pp.info.uni-karlsruhe.de/git/libfirm.git@master bfirm=${GITROOT}/compilers/bfirm@main"}; : ${PKG_LIBFIRM_BUILD_DIR:=cparser+libfirm/build/libfirm}; : ${PKG_LIBFIRM_CONFIGURE:=bfirm/configure}; : ${PKG_LIBFIRM_CONFIGURE_ARGS:="--source-dir=../../../libfirm --prefix="}; -: ${PKG_LIBFIRM_GIT_BRANCH:=master}; : ${PKG_LIBFIRM_MAKEFLAGS_INSTALL:=DESTDIR=../../sysroot}; : ${PKG_LIBFIRM_PREFIX_EXTRA:=${PREFIX_NATIVE}}; : ${PKG_LIBFIRM_SUBDIR:=libfirm}; @@ -495,9 +499,8 @@ LEAF_PACKAGES_PREFIX="${PREFIX_NATIVE}"; : ${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}; -: ${PKG_BDWGC_GIT_BRANCH:=master}; -: ${PKG_BDWGC_URL:=https://github.com/ivmai/bdwgc}; -: ${PKG_BDWGC_URL_TYPE:=git}; +: ${PKG_BDWGC_URLS_GIT:="bdwgc=https://github.com/ivmai/bdwgc@master"}; +: ${PKG_BDWGC_SUBDIR:=bdwgc}; : ${PKG_CHICKEN_SHA256SUM:=e3dc2b8f95b6a3cd59c85b5bb6bdb2bd9cefc45b5d536a20cad74e3c63f4ad89}; : ${PKG_CHICKEN_VERSION:=4.11.0}; : ${PKG_CHICKEN_URL:=https://code.call-cc.org/releases/4.11.0/chicken-${PKG_CHICKEN_VERSION}.tar.gz}; @@ -516,20 +519,17 @@ LEAF_PACKAGES_PREFIX="${PREFIX_NATIVE}"; : ${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_CPARSER_URL:=http://pp.info.uni-karlsruhe.de/git/cparser.git}; -: ${PKG_CPARSER_URL_TYPE:=git}; +: ${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}; : ${PKG_CPARSER_CONFIGURE_ARGS:="--source-dir=../../../cparser --prefix="}; -: ${PKG_CPARSER_GIT_BRANCH:=master}; : ${PKG_CPARSER_MAKEFLAGS_INSTALL:=DESTDIR=../../sysroot}; : ${PKG_CPARSER_PREFIX_EXTRA:=${PREFIX_NATIVE}}; : ${PKG_CPARSER_SUBDIR:=cparser}; -: ${PKG_CRON_URL:=git://anonscm.debian.org/pkg-cron/pkg-cron.git}; -: ${PKG_CRON_URL_TYPE:=git}; +: ${PKG_CRON_URLS_GIT:="pkg-cron.git=git://anonscm.debian.org/pkg-cron/pkg-cron.git@debian/3.0pl1-128"}; : ${PKG_CRON_BUILD_DIR:=pkg-cron.git}; : ${PKG_CRON_ENV_VARS_EXTRA:="CC=${TARGET}-gcc:CFLAGS=${PACKAGES_CFLAGS_CONFIGURE} -D__GNU__"}; -: ${PKG_CRON_GIT_BRANCH:=debian/3.0pl1-128}; +: ${PKG_CRON_SUBDIR:=pkg-cron.git}; : ${PKG_DASH_SHA256SUM:=5ecd5bea72a93ed10eb15a1be9951dd51b52e5da1d4a7ae020efd9826b49e659}; : ${PKG_DASH_VERSION:=0.5.9.1}; : ${PKG_DASH_URL:=http://gondor.apana.org.au/~herbert/dash/files/dash-${PKG_DASH_VERSION}.tar.gz}; @@ -581,10 +581,9 @@ LEAF_PACKAGES_PREFIX="${PREFIX_NATIVE}"; : ${PKG_GREP_SHA256SUM:=ad4cc44d23074a1c3a8baae8fbafff2a8c60f38a9a6108f985eef6fbee6dcaeb}; : ${PKG_GREP_VERSION:=2.27}; : ${PKG_GREP_URL:=https://ftp.gnu.org/gnu/grep/grep-${PKG_GREP_VERSION}.tar.xz}; -: ${PKG_HEXCURSE_URL:=https://github.com/LonnyGomes/hexcurse}; -: ${PKG_HEXCURSE_URL_TYPE:=git}; +: ${PKG_HEXCURSE_URLS_GIT:="hexcurse=https://github.com/LonnyGomes/hexcurse@master"}; : ${PKG_HEXCURSE_CFLAGS_CONFIGURE_EXTRA:=-I${PREFIX_NATIVE}/include/ncursesw}; -: ${PKG_HEXCURSE_GIT_BRANCH:=master}; +: ${PKG_HEXCURSE_SUBDIR:=hexcurse}; : ${PKG_HTOP_SHA256SUM:=f410626dfaf6b70fdf73cd7bb33cae768869707028d847fed94a978e974f5666}; : ${PKG_HTOP_VERSION:=2.0.1}; : ${PKG_HTOP_URL:=http://hisham.hm/htop/releases/${PKG_HTOP_VERSION}/htop-${PKG_HTOP_VERSION}.tar.gz}; @@ -687,12 +686,11 @@ LEAF_PACKAGES_PREFIX="${PREFIX_NATIVE}"; : ${PKG_OPENSSH_URL:=http://artfiles.org/openbsd/OpenSSH/portable/openssh-${PKG_OPENSSH_VERSION}.tar.gz}; : ${PKG_OPENSSH_CONFIGURE_ARGS_EXTRA_DEBUG:=--disable-strip}; : ${PKG_OPENSSH_INSTALL_TARGET:=install-nokeys}; -: ${PKG_P7ZIP_URL:=https://github.com/lalbornoz/p7zip-midipix.git}; -: ${PKG_P7ZIP_URL_TYPE:=git}; +: ${PKG_P7ZIP_URLS_GIT:="p7zip-midipix.git=https://github.com/lalbornoz/p7zip-midipix.git@master"}; : ${PKG_P7ZIP_BUILD_DIR:=p7zip-midipix.git}; -: ${PKG_P7ZIP_GIT_BRANCH:=master}; : ${PKG_P7ZIP_INSTALL_FILES:="bin/7za=bin/"}; : ${PKG_P7ZIP_NO_MAKE_INSTALL:=1}; +: ${PKG_P7ZIP_SUBDIR:=p7zip-midipix.git}; : ${PKG_PACMAN_SHA256SUM:=84599e2ee2158134fd704f1cd681ea46e021165bed4df5f002aa1748caef9e7b}; : ${PKG_PACMAN_VERSION:=5.0.1}; : ${PKG_PACMAN_URL:=https://projects.archlinux.org/pacman.git/snapshot/pacman-${PKG_PACMAN_VERSION}.tar.gz}; @@ -703,6 +701,8 @@ LEAF_PACKAGES_PREFIX="${PREFIX_NATIVE}"; : ${PKG_PERL_SHA256SUM:=2b475d0849d54c4250e9cba4241b7b7291cffb45dfd083b677ca7b5d38118f27}; : ${PKG_PERL_VERSION:=5.22.1}; : ${PKG_PERL_URL:=http://www.cpan.org/src/5.0/perl-${PKG_PERL_VERSION}.tar.gz}; +: ${PKG_PERL_URLS_GIT:="perl-cross=https://github.com/lalbornoz/perl-cross@master"}; +: ${PKG_PERL_SUBDIR:=perl-${PKG_PERL_VERSION}}; : ${PKG_PERL_CONFIGURE_ARGS:="-A ccflags=-I${PREFIX_NATIVE}/include --sysroot=${PREFIX_NATIVE} --target=${TARGET}"}; : ${PKG_PERL_ENV_VARS_EXTRA:="TARGET=${TARGET}"}; : ${PKG_PERL_MAKEFLAGS_BUILD:=-j1}; @@ -729,10 +729,8 @@ LEAF_PACKAGES_PREFIX="${PREFIX_NATIVE}"; : ${PKG_SED_SHA256SUM:=f048d1838da284c8bc9753e4506b85a1e0cc1ea8999d36f6995bcb9460cddbd7}; : ${PKG_SED_VERSION:=4.2.2}; : ${PKG_SED_URL:=https://ftp.gnu.org/gnu/sed/sed-${PKG_SED_VERSION}.tar.bz2}; -: ${PKG_SMALLBASIC_GIT_BRANCH:=master}; : ${PKG_SMALLBASIC_SUBDIR:=SmallBASIC}; -: ${PKG_SMALLBASIC_URL:=https://github.com/smallbasic/SmallBASIC}; -: ${PKG_SMALLBASIC_URL_TYPE:=git}; +: ${PKG_SMALLBASIC_URLS_GIT:="SmallBASIC=https://github.com/smallbasic/SmallBASIC@master"}; : ${PKG_SMALLBASIC_BUILD_DIR:=${PKG_SMALLBASIC_SUBDIR}}; : ${PKG_TAR_SHA256SUM:=cae466e6e58c7292355e7080248f244db3a4cf755f33f4fa25ca7f9a7ed09af0}; : ${PKG_TAR_VERSION:=1.29}; diff --git a/vars/cparser.vars b/vars/cparser.vars index ce22a0d..1977745 100644 --- a/vars/cparser.vars +++ b/vars/cparser.vars @@ -2,12 +2,8 @@ # . ./build.vars and set -o errexit -o noglob are assumed. # -pkg_cparser_fetch_post() { - fetch_git bcparser ${GITROOT}/compilers/bcparser; - insecure_mkdir cparser+libfirm/sysroot cparser+libfirm/build/cparser; -}; - pkg_cparser_configure_pre() { + insecure_mkdir cparser+libfirm/sysroot cparser+libfirm/build/cparser; export CFLAGS_PATH="-I../../sysroot/include"; export LDFLAGS_PATH="-L../../sysroot/lib"; }; diff --git a/vars/gcc.vars b/vars/gcc.vars index 0301e31..3638399 100644 --- a/vars/gcc.vars +++ b/vars/gcc.vars @@ -9,18 +9,22 @@ pkgp_gcc_setup_env() { export cbb_ldflags_for_target=--sysroot=${PKG_PREFIX} \ cbb_sysroot_for_libgcc=${PKG_PREFIX} \ cbb_target=${PKG_TARGET}; - case ${1} in - stage1) export cbb_neutral_libiberty=no; - if [ "${PKG_TARGET}" = "x86_64-w64-mingw32" ]; then - export cbb_xgcc_for_specs=${PKG_TARGET}-gcc; - else - export cbb_xgcc_for_specs=${WORKDIR}/${PKG_BUILD_DIR}/gcc/xgcc; - fi; ;; - native) export cbb_xgcc_for_specs=${PKG_TARGET}-gcc \ - sysroot_headers_suffix=${PKG_PREFIX}; + case ${PKG_NAME} in + gcc_stage1) + export cbb_neutral_libiberty=no \ + cbb_xgcc_for_specs=${WORKDIR}/${PKG_BUILD_DIR}/gcc/xgcc; ;; + gcc_stage1_cross_x86_64_w64_mingw32) + export cbb_neutral_libiberty=no \ + cbb_xgcc_for_specs=${WORKDIR}/${PKG_BUILD_DIR}/gcc/xgcc; ;; + gcc_stage1_native_x86_64_w64_mingw32) + export cbb_neutral_libiberty=no \ + cbb_xgcc_for_specs=${PKG_TARGET}-gcc; ;; + gcc_native) + export cbb_xgcc_for_specs=${PKG_TARGET}-gcc \ + sysroot_headers_suffix=${PKG_PREFIX}; ;; esac; GCCTARGET_FLAGS="-DIN_TARGET_LIBRARY_BUILD --sysroot=${PKG_PREFIX}"; - GCCFLAGS="${CFLAGS:+${CFLAGS} }--include $(readlink -f ${WORKDIR}/cbb-gcc-${2}/libc/cbb-musl-pe.h)"; + GCCFLAGS="${CFLAGS:+${CFLAGS} }--include $(readlink -f ${WORKDIR}/cbb-gcc-${1}/libc/cbb-musl-pe.h)"; for __ in CFLAGS CFLAGS_FOR_BUILD CPPFLAGS_FOR_BUILD CXXFLAGS CXXFLAGS_FOR_BUILD; do export "${__}=${GCCFLAGS}"; done; @@ -87,16 +91,27 @@ pkg_gcc_stage1_all() { esac; # GCC, stage1. if ! is_build_script_done fetch; then - fetch_git cbb-gcc-${PKG_GCC_VERSION} \ - ${GITROOT}/cbb/cbb-gcc-${PKG_GCC_VERSION}; + pkg_fetch -git "cbb-gcc-${PKG_GCC_VERSION}=${GITROOT}/cbb/cbb-gcc-${PKG_GCC_VERSION}"; set_build_script_done fetch -configure; fi; - pkgp_gcc_setup_env stage1 "${PKG_GCC_VERSION}"; + pkgp_gcc_setup_env ${PKG_GCC_VERSION}; if ! is_build_script_done configure; then insecure_mkdir ${PKG_PREFIX}/include; [ \! -d ${PKG_PREFIX}/usr ] && \ ln -s -- . ${PKG_PREFIX}/usr; - if [ "${PKG_TARGET}" = "x86_64-w64-mingw32" ]; then + case ${PKG_NAME} in + gcc_stage1) + pkgp_gcc_configure \ + --disable-sjlj-exceptions \ + --prefix=${PREFIX} \ + --with-sysroot=${PREFIX}/${PKG_TARGET}; ;; + gcc_stage1_cross_x86_64_w64_mingw32) + pkgp_gcc_configure \ + --enable-sjlj-exceptions \ + --prefix=${PREFIX} \ + --with-sysroot=${PREFIX}/${PKG_TARGET} \ + --without-headers; ;; + gcc_stage1_native_x86_64_w64_mingw32) patch -b -d cbb-gcc-4.6.4 -p1 < ${MIDIPIX_BUILD_PWD}/patches/${PKG_NAME}.local.patch; pkgp_gcc_configure \ --build=x86_64-unknown-linux-gnu \ @@ -108,13 +123,8 @@ pkg_gcc_stage1_all() { --with-mpc=${PKG_PREFIX} \ --with-mpfr=${PKG_PREFIX} \ --with-sysroot= \ - --without-headers; - else - pkgp_gcc_configure \ - --disable-sjlj-exceptions \ - --prefix=${PREFIX} \ - --with-sysroot=${PREFIX}/${PKG_TARGET}; - fi; + --without-headers; ;; + esac; else cd ${PKG_BUILD_DIR}; fi; @@ -127,11 +137,14 @@ pkg_gcc_stage1_all() { set_build_script_done build -install; fi; if ! is_build_script_done install; then - if [ "${PKG_TARGET}" = "x86_64-w64-mingw32" ]; then - make ${MAKEFLAGS} DESTDIR=${PKG_PREFIX} install-gcc; - else - make ${MAKEFLAGS} install-gcc; - fi; + case ${PKG_NAME} in + gcc_stage1) + make ${MAKEFLAGS} install-gcc; ;; + gcc_stage1_cross_x86_64_w64_mingw32) + make ${MAKEFLAGS} install-gcc; ;; + gcc_stage1_native_x86_64_w64_mingw32) + make ${MAKEFLAGS} DESTDIR=${PKG_PREFIX} install-gcc; ;; + esac; __="$(uname -s)"; if [ "${__#*CYGWIN*}" != "${__}" ]; then ln -s -- ${PREFIX}/libexec/gcc/${PKG_TARGET}/${PKG_GCC_VERSION}/liblto_plugin.dll.a \ @@ -191,7 +204,7 @@ pkg_gcc_native_all() { export MAKE="make LIBTOOL=slibtool"; # GCC, native. set_build_dir cbb-gcc-${PKG_GCC_VERSION} native; - pkgp_gcc_setup_env native "${PKG_GCC_VERSION}"; + pkgp_gcc_setup_env ${PKG_GCC_VERSION}; if ! is_build_script_done configure; then insecure_mkdir ${PKG_PREFIX}/${PKG_TARGET}; if [ \! -d ${PKG_PREFIX}/${PKG_TARGET}/usr ]; then diff --git a/vars/libfirm.vars b/vars/libfirm.vars index fc51967..1d57910 100644 --- a/vars/libfirm.vars +++ b/vars/libfirm.vars @@ -2,8 +2,7 @@ # . ./build.vars and set -o errexit -o noglob are assumed. # -pkg_libfirm_fetch_post() { - fetch_git bfirm ${GITROOT}/compilers/bfirm; +pkg_libfirm_configure_pre() { insecure_mkdir cparser+libfirm/sysroot cparser+libfirm/build/libfirm; }; diff --git a/vars/musl.vars b/vars/musl.vars index bec1e06..8d0e53b 100644 --- a/vars/musl.vars +++ b/vars/musl.vars @@ -22,16 +22,16 @@ pkgp_musl_configure() { pkg_musl_no_complex_all() { PKG_MUSL_VERSION="${PKG_MUSL_NO_COMPLEX_VERSION}"; # Git clone what we need. - fetch_git lazy ${GITROOT}/lazy; + pkg_fetch -git "lazy=${GITROOT}/lazy"; export lz_arch=${ARCH} lz_cflags_debug=-O2 lz_target=${TARGET}; # Musl: build (no-complex) _install=install_no_complex; set_build_dir musl-${PKG_MUSL_VERSION}-${2} cross; if ! is_build_script_done fetch; then - fetch http://www.musl-libc.org/releases/musl-${PKG_MUSL_VERSION}.tar.gz \ + pkg_fetch http://www.musl-libc.org/releases/musl-${PKG_MUSL_VERSION}.tar.gz \ ${PKG_MUSL_NO_COMPLEX_SHA256SUM}; secure_rm mmglue; - fetch_git mmglue ${GITROOT}/mmglue; + pkg_fetch -git "mmglue=${GITROOT}/mmglue"; set_build_script_done fetch -extract; fi; if ! is_build_script_done extract; then @@ -60,7 +60,7 @@ pkg_musl_no_complex_all() { pkg_musl_native_all() { PKG_MUSL_VERSION="${PKG_MUSL_NATIVE_VERSION}"; # Git clone what we need. - fetch_git lazy ${GITROOT}/lazy; + pkg_fetch -git "lazy=${GITROOT}/lazy"; export lz_arch=${ARCH} lz_cflags_debug=-O2 lz_target=${TARGET}; # Musl: build (full) _install=install; @@ -86,7 +86,7 @@ pkg_musl_native_all() { pkg_musl_full_all() { PKG_MUSL_VERSION="${PKG_MUSL_FULL_VERSION}"; # Git clone what we need. - fetch_git lazy ${GITROOT}/lazy; + pkg_fetch -git "lazy=${GITROOT}/lazy"; export lz_arch=${ARCH} lz_cflags_debug=-O2 lz_target=${TARGET}; # Musl: build (full) _install=install; diff --git a/vars/perl.vars b/vars/perl.vars index 302a040..28f9d9b 100644 --- a/vars/perl.vars +++ b/vars/perl.vars @@ -3,7 +3,6 @@ # pkg_perl_extract_post() { - fetch_git perl-cross https://github.com/lalbornoz/perl-cross master; for _ppep_fname_src in $(find perl-cross -type f \ -not -path perl-cross/.git/\* -not -name .gitignore); do _ppep_fname_dst=perl-${PKG_VERSION}${_ppep_fname_src#perl-cross};