From 16ed3449751695521247f44df6a589b07fd8d821 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Tue, 11 Feb 2014 11:09:16 +0100 Subject: [PATCH] Update environment shell snippets for xbps-src>=101. --- common/environment/0001-bootstrap.sh | 6 -- common/environment/0001-configure-args.sh | 6 -- common/environment/0002-cross.sh | 58 ------------------ common/environment/README | 18 ++++++ common/environment/build/pkg-config.sh | 1 + .../{ => configure}/autoconf_cache/arm-common | 0 .../{ => configure}/autoconf_cache/arm-linux | 0 .../autoconf_cache/common-glibc | 0 .../autoconf_cache/common-linux | 0 .../{ => configure}/autoconf_cache/endian-big | 0 .../autoconf_cache/endian-little | 0 .../autoconf_cache/ix86-common | 0 .../autoconf_cache/mips-common | 0 .../{ => configure}/autoconf_cache/mips-linux | 0 .../autoconf_cache/mipsel-linux | 0 .../autoconf_cache/x86_64-linux | 0 .../configure/gnu-configure-args.sh | 61 +++++++++++++++++++ common/environment/configure/pkg-config.sh | 11 ++++ common/environment/fetch/misc.sh | 1 + common/environment/install/pkg-config.sh | 1 + .../{ => setup}/0000-REQUIREMENTS.sh | 6 +- .../{0003-misc.sh => setup/misc.sh} | 0 22 files changed, 96 insertions(+), 73 deletions(-) delete mode 100644 common/environment/0001-bootstrap.sh delete mode 100644 common/environment/0001-configure-args.sh delete mode 100644 common/environment/0002-cross.sh create mode 120000 common/environment/build/pkg-config.sh rename common/environment/{ => configure}/autoconf_cache/arm-common (100%) rename common/environment/{ => configure}/autoconf_cache/arm-linux (100%) rename common/environment/{ => configure}/autoconf_cache/common-glibc (100%) rename common/environment/{ => configure}/autoconf_cache/common-linux (100%) rename common/environment/{ => configure}/autoconf_cache/endian-big (100%) rename common/environment/{ => configure}/autoconf_cache/endian-little (100%) rename common/environment/{ => configure}/autoconf_cache/ix86-common (100%) rename common/environment/{ => configure}/autoconf_cache/mips-common (100%) rename common/environment/{ => configure}/autoconf_cache/mips-linux (100%) rename common/environment/{ => configure}/autoconf_cache/mipsel-linux (100%) rename common/environment/{ => configure}/autoconf_cache/x86_64-linux (100%) create mode 100644 common/environment/configure/gnu-configure-args.sh create mode 100644 common/environment/configure/pkg-config.sh create mode 120000 common/environment/fetch/misc.sh create mode 120000 common/environment/install/pkg-config.sh rename common/environment/{ => setup}/0000-REQUIREMENTS.sh (79%) rename common/environment/{0003-misc.sh => setup/misc.sh} (100%) diff --git a/common/environment/0001-bootstrap.sh b/common/environment/0001-bootstrap.sh deleted file mode 100644 index 5d4aed052e..0000000000 --- a/common/environment/0001-bootstrap.sh +++ /dev/null @@ -1,6 +0,0 @@ -# This file sets some envvars to allow building bootstrap packages -# when the chroot is not yet ready. - -[ -z "$CHROOT_READY" ] && return 0 - -export PKG_CONFIG_PATH="${XBPS_MASTERDIR}/usr/lib/pkgconfig:${XBPS_MASTERDIR}/usr/share/pkgconfig" diff --git a/common/environment/0001-configure-args.sh b/common/environment/0001-configure-args.sh deleted file mode 100644 index e9b5fb7e5e..0000000000 --- a/common/environment/0001-configure-args.sh +++ /dev/null @@ -1,6 +0,0 @@ -# This file sets up configure_args with commong settings for packages -# that don't set $build_style or set it to gnu-configure. - -if [ "$build_style" = "gnu-configure" -o -z "$build_style" ]; then - export configure_args="--prefix=/usr --sysconfdir=/etc --infodir=/usr/share/info --mandir=/usr/share/man --localstatedir=/var ${configure_args}" -fi diff --git a/common/environment/0002-cross.sh b/common/environment/0002-cross.sh deleted file mode 100644 index 9f35859635..0000000000 --- a/common/environment/0002-cross.sh +++ /dev/null @@ -1,58 +0,0 @@ -# This file sets some envvars to allow cross compiling packages. - -[ -z "$CROSS_BUILD" ] && return 0 - -# Export all variables from now on... -set -a - -PKG_CONFIG_SYSROOT_DIR="$XBPS_CROSS_BASE" -PKG_CONFIG_PATH="$XBPS_CROSS_BASE/lib/pkgconfig:$XBPS_CROSS_BASE/usr/share/pkgconfig" -PKG_CONFIG_LIBDIR="$XBPS_CROSS_BASE/lib/pkgconfig" - -configure_args+=" --host=$XBPS_CROSS_TRIPLET --with-sysroot=$XBPS_CROSS_BASE --with-libtool-sysroot=$XBPS_CROSS_BASE " - -if [ -z "$build_style" -o "$build_style" != "gnu-configure" ]; then - set +a; return 0 -fi - -# Read autoconf cache variables for cross target (taken from OE). -case "$XBPS_TARGET_MACHINE" in - # musl libc, empty for now - *-musl) ;; - - # gnu libc - *) . ${XBPS_COMMONDIR}/environment/autoconf_cache/common-glibc - . ${XBPS_COMMONDIR}/environment/autoconf_cache/common-linux - ;; -esac - -# Read apropiate autoconf cache files for target machine. -case "$XBPS_TARGET_MACHINE" in - armv?l) . ${XBPS_COMMONDIR}/environment/autoconf_cache/endian-little - . ${XBPS_COMMONDIR}/environment/autoconf_cache/arm-common - . ${XBPS_COMMONDIR}/environment/autoconf_cache/arm-linux - ;; - - i686) . ${XBPS_COMMONDIR}/environment/autoconf_cache/endian-little - . ${XBPS_COMMONDIR}/environment/autoconf_cache/ix86-common - ;; - - mips) . ${XBPS_COMMONDIR}/environment/autoconf_cache/endian-big - . ${XBPS_COMMONDIR}/environment/autoconf_cache/mips-common - . ${XBPS_COMMONDIR}/environment/autoconf_cache/mips-linux - ;; - - mipsel) . ${XBPS_COMMONDIR}/environment/autoconf_cache/endian-little - . ${XBPS_COMMONDIR}/environment/autoconf_cache/mips-common - . ${XBPS_COMMONDIR}/environment/autoconf_cache/mips-linux - ;; - - x86_64) . ${XBPS_COMMONDIR}/environment/autoconf_cache/endian-little - . ${XBPS_COMMONDIR}/environment/autoconf_cache/x86_64-linux - ;; - - *) ;; -esac - -# until now :-) -set +a diff --git a/common/environment/README b/common/environment/README index 99812870e1..bea6f83688 100644 --- a/common/environment/README +++ b/common/environment/README @@ -9,3 +9,21 @@ These files shall set environment variables for use in the xbps-src helpers (libexec/xbps-src-*). Only files with the `.sh' extension are read, so this file will be simply ignored. +The following directories are used to set the order in which the shell snippets +should be read by xbps-src: + + * setup (before reading template) + * fetch (before running fetch phase) + * extract (before running extract phase) + * configure (before running configure phase) + * build (before running build phase) + * install (before running install phase) + * pkg (before running pkg phase) + +NOTES +~~~~~ +* All variables are exported to the environment, so please be careful when + declaring new variables in the shell snippets. + +* Symlinks can be created (relative) to make a shell snippet available in + multiple phases. diff --git a/common/environment/build/pkg-config.sh b/common/environment/build/pkg-config.sh new file mode 120000 index 0000000000..b8f8c440ed --- /dev/null +++ b/common/environment/build/pkg-config.sh @@ -0,0 +1 @@ +../configure/pkg-config.sh \ No newline at end of file diff --git a/common/environment/autoconf_cache/arm-common b/common/environment/configure/autoconf_cache/arm-common similarity index 100% rename from common/environment/autoconf_cache/arm-common rename to common/environment/configure/autoconf_cache/arm-common diff --git a/common/environment/autoconf_cache/arm-linux b/common/environment/configure/autoconf_cache/arm-linux similarity index 100% rename from common/environment/autoconf_cache/arm-linux rename to common/environment/configure/autoconf_cache/arm-linux diff --git a/common/environment/autoconf_cache/common-glibc b/common/environment/configure/autoconf_cache/common-glibc similarity index 100% rename from common/environment/autoconf_cache/common-glibc rename to common/environment/configure/autoconf_cache/common-glibc diff --git a/common/environment/autoconf_cache/common-linux b/common/environment/configure/autoconf_cache/common-linux similarity index 100% rename from common/environment/autoconf_cache/common-linux rename to common/environment/configure/autoconf_cache/common-linux diff --git a/common/environment/autoconf_cache/endian-big b/common/environment/configure/autoconf_cache/endian-big similarity index 100% rename from common/environment/autoconf_cache/endian-big rename to common/environment/configure/autoconf_cache/endian-big diff --git a/common/environment/autoconf_cache/endian-little b/common/environment/configure/autoconf_cache/endian-little similarity index 100% rename from common/environment/autoconf_cache/endian-little rename to common/environment/configure/autoconf_cache/endian-little diff --git a/common/environment/autoconf_cache/ix86-common b/common/environment/configure/autoconf_cache/ix86-common similarity index 100% rename from common/environment/autoconf_cache/ix86-common rename to common/environment/configure/autoconf_cache/ix86-common diff --git a/common/environment/autoconf_cache/mips-common b/common/environment/configure/autoconf_cache/mips-common similarity index 100% rename from common/environment/autoconf_cache/mips-common rename to common/environment/configure/autoconf_cache/mips-common diff --git a/common/environment/autoconf_cache/mips-linux b/common/environment/configure/autoconf_cache/mips-linux similarity index 100% rename from common/environment/autoconf_cache/mips-linux rename to common/environment/configure/autoconf_cache/mips-linux diff --git a/common/environment/autoconf_cache/mipsel-linux b/common/environment/configure/autoconf_cache/mipsel-linux similarity index 100% rename from common/environment/autoconf_cache/mipsel-linux rename to common/environment/configure/autoconf_cache/mipsel-linux diff --git a/common/environment/autoconf_cache/x86_64-linux b/common/environment/configure/autoconf_cache/x86_64-linux similarity index 100% rename from common/environment/autoconf_cache/x86_64-linux rename to common/environment/configure/autoconf_cache/x86_64-linux diff --git a/common/environment/configure/gnu-configure-args.sh b/common/environment/configure/gnu-configure-args.sh new file mode 100644 index 0000000000..04cdc1299f --- /dev/null +++ b/common/environment/configure/gnu-configure-args.sh @@ -0,0 +1,61 @@ +# This file sets up configure_args with common settings. + +if [ -z "$build_style" -o "$build_style" = "gnu-configure" ]; then + configure_args="--prefix=/usr --sysconfdir=/etc --infodir=/usr/share/info --mandir=/usr/share/man --localstatedir=/var ${configure_args}" +fi + + +# Cross compilation vars +if [ -z "$CROSS_BUILD" ]; then + return 0 +fi + +configure_args+=" --host=$XBPS_CROSS_TRIPLET --with-sysroot=$XBPS_CROSS_BASE --with-libtool-sysroot=$XBPS_CROSS_BASE " + +if [ "$build_style" != "gnu-configure" ]; then + return 0 +fi + +_AUTOCONFCACHEDIR=${XBPS_COMMONDIR}/environment/configure/autoconf_cache + +# Read autoconf cache variables for cross target (taken from OE). +case "$XBPS_TARGET_MACHINE" in + # musl libc + *-musl) . ${_AUTOCONFCACHEDIR}/common-linux + ;; + # gnu libc + *) . ${_AUTOCONFCACHEDIR}/common-glibc + ;; +esac + +# Read apropiate autoconf cache files for target machine. +case "$XBPS_TARGET_MACHINE" in + armv?l*) + . ${_AUTOCONFCACHEDIR}/endian-little + . ${_AUTOCONFCACHEDIR}/arm-common + . ${_AUTOCONFCACHEDIR}/arm-linux + ;; + + i686*) . ${_AUTOCONFCACHEDIR}/endian-little + . ${_AUTOCONFCACHEDIR}/ix86-common + ;; + + mips) . ${_AUTOCONFCACHEDIR}/endian-big + . ${_AUTOCONFCACHEDIR}/mips-common + . ${_AUTOCONFCACHEDIR}/mips-linux + ;; + + mipsel) . ${_AUTOCONFCACHEDIR}/endian-little + . ${_AUTOCONFCACHEDIR}/mips-common + . ${_AUTOCONFCACHEDIR}/mips-linux + ;; + + x86_64*) + . ${_AUTOCONFCACHEDIR}/endian-little + . ${_AUTOCONFCACHEDIR}/x86_64-linux + ;; + + *) ;; +esac + +unset _AUTOCONFCACHEDIR diff --git a/common/environment/configure/pkg-config.sh b/common/environment/configure/pkg-config.sh new file mode 100644 index 0000000000..a4f594e05f --- /dev/null +++ b/common/environment/configure/pkg-config.sh @@ -0,0 +1,11 @@ +# This snippet setups pkg-config vars. + +if [ -z "$CHROOT_READY" ]; then + PKG_CONFIG_PATH="${XBPS_MASTERDIR}/usr/lib/pkgconfig:${XBPS_MASTERDIR}/usr/share/pkgconfig" +fi + +if [ "$CROSS_BUILD" ]; then + PKG_CONFIG_SYSROOT_DIR="$XBPS_CROSS_BASE" + PKG_CONFIG_PATH="$XBPS_CROSS_BASE/lib/pkgconfig:$XBPS_CROSS_BASE/usr/share/pkgconfig" + PKG_CONFIG_LIBDIR="$XBPS_CROSS_BASE/lib/pkgconfig" +fi diff --git a/common/environment/fetch/misc.sh b/common/environment/fetch/misc.sh new file mode 120000 index 0000000000..7d5f3f64e4 --- /dev/null +++ b/common/environment/fetch/misc.sh @@ -0,0 +1 @@ +../setup/misc.sh \ No newline at end of file diff --git a/common/environment/install/pkg-config.sh b/common/environment/install/pkg-config.sh new file mode 120000 index 0000000000..b8f8c440ed --- /dev/null +++ b/common/environment/install/pkg-config.sh @@ -0,0 +1 @@ +../configure/pkg-config.sh \ No newline at end of file diff --git a/common/environment/0000-REQUIREMENTS.sh b/common/environment/setup/0000-REQUIREMENTS.sh similarity index 79% rename from common/environment/0000-REQUIREMENTS.sh rename to common/environment/setup/0000-REQUIREMENTS.sh index 92fc4eb442..6aa5cb4a17 100644 --- a/common/environment/0000-REQUIREMENTS.sh +++ b/common/environment/setup/0000-REQUIREMENTS.sh @@ -7,10 +7,10 @@ # ========================================================= # # xbps-src version. -export XBPS_SRC_REQ=100 +XBPS_SRC_REQ=100 # XBPS utils version. -export XBPS_UTILS_REQ=0.29 +XBPS_UTILS_REQ=0.29 # XBPS utils API version. -export XBPS_UTILS_API_REQ=20131224 +XBPS_UTILS_API_REQ=20131224 diff --git a/common/environment/0003-misc.sh b/common/environment/setup/misc.sh similarity index 100% rename from common/environment/0003-misc.sh rename to common/environment/setup/misc.sh