From 8c8dfc1dfd0397b2d8ae4e0f9f694f8a0d01dd36 Mon Sep 17 00:00:00 2001 From: classabbyamp Date: Wed, 8 Mar 2023 04:26:21 -0500 Subject: [PATCH 1/5] common/xbps-src/shutils/common.sh: add function for str->array this will allow select variables to be defined as arrays or strings. if a string is specified, it will be converted to an array for internal usage. if it is an array, it passes through untouched. this should allow for a smooth transition to using more arrays inside xbps-src, and should solve issues with shell quoting in things like configure_args, make_check_args, etc. --- common/xbps-src/shutils/common.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/common/xbps-src/shutils/common.sh b/common/xbps-src/shutils/common.sh index fdc0c5eedd92..3f95c2029cbb 100644 --- a/common/xbps-src/shutils/common.sh +++ b/common/xbps-src/shutils/common.sh @@ -250,6 +250,18 @@ source_file() { fi } +arrayise() { + for name; do + if [[ -n "$name" && "${!name@a}" != *a* ]]; then + IFS=" " read -r -a "${name}" <<< "${!name}" + declare -n nameref="$name" + if [ "${#nameref[@]}" -gt 1 ]; then + msg_error "template variable '$name' should be an array!\n" + fi + fi + done +} + run_pkg_hooks() { local phase="$1" hookn f @@ -530,6 +542,8 @@ setup_pkg() { set_build_options + arrayise configure_args + export CFLAGS="$XBPS_CFLAGS $XBPS_CROSS_CFLAGS $CFLAGS $dbgflags" export CXXFLAGS="$XBPS_CXXFLAGS $XBPS_CROSS_CXXFLAGS $CXXFLAGS $dbgflags" export FFLAGS="$XBPS_FFLAGS $XBPS_CROSS_FFLAGS $FFLAGS $dbgflags" From e3c5f35a9cdeab63c3c21c5976fee5f8212668a9 Mon Sep 17 00:00:00 2001 From: classabbyamp Date: Wed, 8 Mar 2023 04:32:03 -0500 Subject: [PATCH 2/5] common/xbps-src/shutils/show.sh: refactor show_pkg_var to support arrays --- common/xbps-src/shutils/show.sh | 89 ++++++++++++++++++++++----------- 1 file changed, 61 insertions(+), 28 deletions(-) diff --git a/common/xbps-src/shutils/show.sh b/common/xbps-src/shutils/show.sh index 6ae0f4e6d7df..464ac04f6261 100644 --- a/common/xbps-src/shutils/show.sh +++ b/common/xbps-src/shutils/show.sh @@ -1,27 +1,27 @@ # vim: set ts=4 sw=4 et: show_pkg() { - show_pkg_var "pkgname" "$pkgname" - show_pkg_var "version" "$version" - show_pkg_var "revision" "$revision" - show_pkg_var "distfiles" "$distfiles" 1 - show_pkg_var "checksum" "$checksum" 1 - show_pkg_var "archs" "$archs" 1 - show_pkg_var "maintainer" "${maintainer}" - show_pkg_var "Upstream URL" "$homepage" - show_pkg_var "License(s)" "${license//,/ }" 1 - show_pkg_var "Changelog" "$changelog" - show_pkg_var "build_style" "$build_style" - show_pkg_var "build_helper" "$build_helper" 1 - show_pkg_var "configure_args" "$configure_args" 1 - show_pkg_var "short_desc" "$short_desc" - show_pkg_var "subpackages" "$subpackages" 1 + show_pkg_var no "pkgname" "$pkgname" + show_pkg_var no "version" "$version" + show_pkg_var no "revision" "$revision" + show_pkg_var st "distfiles" "$distfiles" + show_pkg_var st "checksum" "$checksum" + show_pkg_var st "archs" "$archs" + show_pkg_var no "maintainer" "${maintainer}" + show_pkg_var no "Upstream URL" "$homepage" + show_pkg_var st "License(s)" "${license//,/ }" + show_pkg_var no "Changelog" "$changelog" + show_pkg_var no "build_style" "$build_style" + show_pkg_var st "build_helper" "$build_helper" + show_pkg_var ar "configure_args" "${configure_args[@]}" + show_pkg_var no "short_desc" "$short_desc" + show_pkg_var st "subpackages" "$subpackages" set -f - show_pkg_var "conf_files" "$conf_files" 1 + show_pkg_var st "conf_files" "$conf_files" set +f - show_pkg_var "replaces" "$replaces" 1 - show_pkg_var "provides" "$provides" 1 - show_pkg_var "conflicts" "$conflicts" 1 + show_pkg_var st "replaces" "$replaces" + show_pkg_var st "provides" "$provides" + show_pkg_var st "conflicts" "$conflicts" local OIFS="$IFS" IFS=',' for var in $1; do @@ -29,9 +29,9 @@ show_pkg() { if [ ${var} != ${var/'*'} ] then var="${var/'*'}" - show_pkg_var "$var" "${!var//$'\n'/' '}" + show_pkg_var no "$var" "${!var//$'\n'/' '}" else - show_pkg_var "$var" "${!var}" 1 + show_pkg_var st "$var" "${!var}" fi done IFS="$OIFS" @@ -41,26 +41,59 @@ show_pkg() { show_pkg_var() { local _sep i= - local _label="$1" - local _value="$2" - local _always_split="$3" - if [ -n "$_value" ] && [ -n "$_label" ]; then + local _split="$1" + local _label="$2" + shift 2 + if [ -n "$_label" ]; then # on short labels, use more padding so everything lines up if [ "${#_label}" -lt 7 ]; then _sep=" " else _sep=" " fi - if [ -n "$_always_split" ] || [[ "$_value" =~ $'\n' ]]; then - for i in ${_value}; do + + # treat as an array + if [ "$_split" = "ar" ]; then + for _value; do + if [ -n "$_value" ]; then + if [[ "$_value" =~ $'\n' ]]; then + OIFS="$IFS"; IFS=$'\n' + for i in $_value; do + [ -n "$i" ] && echo "${_label}:${_sep}${i}" + done + IFS="$OIFS" + else + echo "${_label}:${_sep}${_value}" + fi + fi + done + # treat as a string, always split at whitespace + elif [ "$_split" = "st" ] || [[ "$@" =~ $'\n' ]]; then + _value="$@" + for i in $_value; do [ -n "$i" ] && echo "${_label}:${_sep}${i}" done else - echo "${_label}:${_sep}${_value}" + _value="$@" + [ -n "$_value" ] && echo "${_label}:${_sep}${_value}" fi fi } +show_pkg_arr() { + local _sep i= + local _label="$1" + shift + for _value; do + # on short labels, use more padding so everything lines up + if [ "${#_label}" -lt 7 ]; then + _sep=" " + else + _sep=" " + fi + done +} + show_pkg_deps() { [ -f "${PKGDESTDIR}/rdeps" ] && cat ${PKGDESTDIR}/rdeps } From 5db6add46de1a7f3006d9a80dc2c09c66263cda2 Mon Sep 17 00:00:00 2001 From: classabbyamp Date: Wed, 8 Mar 2023 04:32:56 -0500 Subject: [PATCH 3/5] common/build-style/: convert configure-args to array --- common/build-style/cargo.sh | 6 +++--- common/build-style/cmake.sh | 4 ++-- common/build-style/configure.sh | 2 +- common/build-style/gemspec.sh | 2 +- common/build-style/gnu-configure.sh | 2 +- common/build-style/meson.sh | 4 ++-- common/build-style/perl-ModuleBuild.sh | 2 +- common/build-style/perl-module.sh | 2 +- common/build-style/qmake.sh | 4 ++-- common/build-style/sip-build.sh | 2 +- common/build-style/void-cross.sh | 4 ++-- common/build-style/waf.sh | 2 +- common/build-style/waf3.sh | 2 +- common/build-style/zig-build.sh | 2 +- 14 files changed, 20 insertions(+), 20 deletions(-) diff --git a/common/build-style/cargo.sh b/common/build-style/cargo.sh index 387e711060bc..8c21f9c20445 100644 --- a/common/build-style/cargo.sh +++ b/common/build-style/cargo.sh @@ -5,13 +5,13 @@ do_build() { : ${make_cmd:=cargo auditable} - ${make_cmd} build --release --target ${RUST_TARGET} ${configure_args} + ${make_cmd} build --release --target ${RUST_TARGET} "${configure_args[@]}" } do_check() { : ${make_cmd:=cargo auditable} - ${make_check_pre} ${make_cmd} test --release --target ${RUST_TARGET} ${configure_args} \ + ${make_check_pre} ${make_cmd} test --release --target ${RUST_TARGET} "${configure_args[@]}" \ ${make_check_args} } @@ -20,7 +20,7 @@ do_install() { : ${make_install_args:=--path .} ${make_cmd} install --target ${RUST_TARGET} --root="${DESTDIR}/usr" \ - --offline --locked ${configure_args} ${make_install_args} + --offline --locked "${configure_args[@]}" ${make_install_args} rm -f "${DESTDIR}"/usr/.crates.toml rm -f "${DESTDIR}"/usr/.crates2.json diff --git a/common/build-style/cmake.sh b/common/build-style/cmake.sh index 43750ad20dcd..92032b7a8b09 100644 --- a/common/build-style/cmake.sh +++ b/common/build-style/cmake.sh @@ -19,7 +19,7 @@ SET(CMAKE_FIND_ROOT_PATH "${XBPS_MASTERDIR}/usr;${XBPS_MASTERDIR}") SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) _EOF - configure_args+=" -DCMAKE_TOOLCHAIN_FILE=bootstrap.cmake" + configure_args+=("-DCMAKE_TOOLCHAIN_FILE=bootstrap.cmake") elif [ "$CROSS_BUILD" ]; then case "$XBPS_TARGET_MACHINE" in x86_64*) _CMAKE_SYSTEM_PROCESSOR=x86_64 ;; @@ -74,7 +74,7 @@ _EOF export CMAKE_GENERATOR="${CMAKE_GENERATOR:-Ninja}" # Remove -pipe: https://gitlab.kitware.com/cmake/cmake/issues/19590 CFLAGS="-DNDEBUG ${CFLAGS/ -pipe / }" CXXFLAGS="-DNDEBUG ${CXXFLAGS/ -pipe / }" \ - cmake ${cmake_args} ${configure_args} \ + cmake ${cmake_args} "${configure_args[@]}" \ ${LIBS:+-DCMAKE_C_STANDARD_LIBRARIES="$LIBS"} \ ${LIBS:+-DCMAKE_CXX_STANDARD_LIBRARIES="$LIBS"} \ ${wrksrc}/${build_wrksrc} diff --git a/common/build-style/configure.sh b/common/build-style/configure.sh index 8fe327507d9e..9b472ca28ccc 100644 --- a/common/build-style/configure.sh +++ b/common/build-style/configure.sh @@ -5,7 +5,7 @@ do_configure() { : ${configure_script:=./configure} - ${configure_script} ${configure_args} + ${configure_script} "${configure_args[@]}" } do_build() { diff --git a/common/build-style/gemspec.sh b/common/build-style/gemspec.sh index 9568e819ed45..0ed948dbff0e 100644 --- a/common/build-style/gemspec.sh +++ b/common/build-style/gemspec.sh @@ -120,7 +120,7 @@ do_install() { --no-document \ --verbose \ "${pkgname#ruby-}-${version}.gem" \ - -- $configure_args + -- "${configure_args[@]}" # Remove cache rm -rf ${DESTDIR}/${_GEMDIR}/cache diff --git a/common/build-style/gnu-configure.sh b/common/build-style/gnu-configure.sh index 82d36f6ee0f7..b89008875a89 100644 --- a/common/build-style/gnu-configure.sh +++ b/common/build-style/gnu-configure.sh @@ -5,7 +5,7 @@ do_configure() { : ${configure_script:=./configure} export lt_cv_sys_lib_dlsearch_path_spec="/usr/lib64 /usr/lib32 /usr/lib /lib /usr/local/lib" - ${configure_script} ${configure_args} + ${configure_script} "${configure_args[@]}" } do_build() { diff --git a/common/build-style/meson.sh b/common/build-style/meson.sh index e983c5f42c2f..2f97671388ff 100644 --- a/common/build-style/meson.sh +++ b/common/build-style/meson.sh @@ -91,7 +91,7 @@ do_configure() { : ${meson_crossfile:=xbps_meson.cross} if [ "$CROSS_BUILD" ]; then - configure_args+=" --cross-file=${meson_crossfile}" + configure_args+=("--cross-file=${meson_crossfile}") fi # binutils ar needs a plugin when LTO is used on static libraries, so we @@ -122,7 +122,7 @@ do_configure() { --wrap-mode=nodownload \ -Db_lto=true -Db_ndebug=true \ -Db_staticpic=true \ - ${configure_args} . ${meson_builddir} + "${configure_args[@]}" . ${meson_builddir} } do_build() { diff --git a/common/build-style/perl-ModuleBuild.sh b/common/build-style/perl-ModuleBuild.sh index f21d2b0efb4c..5efa8484068e 100644 --- a/common/build-style/perl-ModuleBuild.sh +++ b/common/build-style/perl-ModuleBuild.sh @@ -24,7 +24,7 @@ do_configure() { perl Build.PL --config optimize="$_optimize" --config ccflags="$_ccflags" \ --config lddlflags="$_lddlflags" --config ldflags="$_ldflags" \ --config archlibexp="${XBPS_CROSS_BASE}${_archlibexp}" \ - ${configure_args} INSTALLDIRS=vendor + "${configure_args[@]}" INSTALLDIRS=vendor else msg_error "$pkgver: cannot find Build.PL for perl module!\n" fi diff --git a/common/build-style/perl-module.sh b/common/build-style/perl-module.sh index 2945787ffbe1..2bcfda743083 100644 --- a/common/build-style/perl-module.sh +++ b/common/build-style/perl-module.sh @@ -47,7 +47,7 @@ do_configure() { CFLAGS="$CFLAGS -I${XBPS_CROSS_BASE}/usr/include" \ LDFLAGS="$LDFLAGS -L${XBPS_CROSS_BASE}/usr/lib -lperl" \ LDDLFLAGS="-shared $CFLAGS -L${XBPS_CROSS_BASE}/usr/lib" \ - perl -I. Makefile.PL ${configure_args} INSTALLDIRS=vendor + perl -I. Makefile.PL "${configure_args[@]}" INSTALLDIRS=vendor fi for i in ${perl_configure_dirs}; do diff --git a/common/build-style/qmake.sh b/common/build-style/qmake.sh index 31745833606e..1f79fd42d55c 100644 --- a/common/build-style/qmake.sh +++ b/common/build-style/qmake.sh @@ -117,7 +117,7 @@ _EOF QT_INSTALL_PREFIX=/usr \ LIB=/usr/lib \ QT_TARGET_ARCH=$_qt_arch \ - ${configure_args} + "${configure_args[@]}" else ${qmake} ${qmake_args} \ PREFIX=/usr \ @@ -129,7 +129,7 @@ _EOF QMAKE_CXXFLAGS="${CXXFLAGS}" \ QMAKE_LFLAGS="${LDFLAGS}" \ CONFIG+=no_qt_rpath \ - ${configure_args} + "${configure_args[@]}" fi } diff --git a/common/build-style/sip-build.sh b/common/build-style/sip-build.sh index d8b3bcea98bf..42b5b2bff191 100644 --- a/common/build-style/sip-build.sh +++ b/common/build-style/sip-build.sh @@ -124,7 +124,7 @@ do_configure() { sip-build --no-make \ ${_qt:+--qmake "$XBPS_WRAPPERDIR/sip-qmake"} \ --api-dir /usr/share/$_qt/qsci/api/python \ - $configure_args \ + "${configure_args[@]}" \ --build-dir "$sip_builddir" if [ "$CROSS_BUILD" ]; then diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh index 02bd1f555741..aae5db2b7355 100644 --- a/common/build-style/void-cross.sh +++ b/common/build-style/void-cross.sh @@ -142,7 +142,7 @@ _void_cross_build_bootstrap_gcc() { --with-gnu-ld \ --with-gnu-as \ ${extra_args} \ - ${configure_args} \ + "${configure_args[@]}" \ ${cross_gcc_bootstrap_configure_args} make ${makejobs} @@ -438,7 +438,7 @@ _void_cross_build_gcc() { --with-gnu-as \ --with-linker-hash-style=gnu \ ${extra_args} \ - ${configure_args} \ + "${configure_args[@]}" \ ${cross_gcc_configure_args} make ${makejobs} diff --git a/common/build-style/waf.sh b/common/build-style/waf.sh index e943765f9b17..2b3b6eb03c9d 100644 --- a/common/build-style/waf.sh +++ b/common/build-style/waf.sh @@ -5,7 +5,7 @@ do_configure() { : ${configure_script:=waf} PYTHON=/usr/bin/python2 python2 ${configure_script} configure \ - --prefix=/usr --libdir=/usr/lib${XBPS_TARGET_WORDSIZE} ${configure_args} + --prefix=/usr --libdir=/usr/lib${XBPS_TARGET_WORDSIZE} "${configure_args[@]}" } do_build() { diff --git a/common/build-style/waf3.sh b/common/build-style/waf3.sh index 54fd221172b7..455b043ebfa3 100644 --- a/common/build-style/waf3.sh +++ b/common/build-style/waf3.sh @@ -13,7 +13,7 @@ do_configure() { PYTHON=/usr/bin/python3 python3 ${configure_script} configure \ --prefix=/usr --libdir=/usr/lib${XBPS_TARGET_WORDSIZE} \ - ${configure_args} ${cross_args} + "${configure_args[@]}" ${cross_args} } do_build() { diff --git a/common/build-style/zig-build.sh b/common/build-style/zig-build.sh index 205c4cadf53f..e2d02fb11b7f 100644 --- a/common/build-style/zig-build.sh +++ b/common/build-style/zig-build.sh @@ -33,7 +33,7 @@ do_build() { --libc xbps_zig_libc.txt \ -Dtarget="${zig_target}" -Dcpu="${zig_cpu}" \ -Drelease-safe --prefix /usr install \ - ${configure_args} + "${configure_args[@]}" } do_install() { From fdf0f650476dfe198f0f439e8103a9df8ac28536 Mon Sep 17 00:00:00 2001 From: classabbyamp Date: Wed, 8 Mar 2023 04:33:30 -0500 Subject: [PATCH 4/5] common/environment/configure/gnu-configure-args.sh: configure_args->array --- .../environment/configure/gnu-configure-args.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/common/environment/configure/gnu-configure-args.sh b/common/environment/configure/gnu-configure-args.sh index dafbf5dc110c..60946b0439b3 100644 --- a/common/environment/configure/gnu-configure-args.sh +++ b/common/environment/configure/gnu-configure-args.sh @@ -6,18 +6,18 @@ fi # Store args from template so they can be included last and override # our defaults -TEMPLATE_CONFIGURE_ARGS="${configure_args}" +TEMPLATE_CONFIGURE_ARGS=("${configure_args[@]}") -export configure_args="--prefix=/usr --sysconfdir=/etc --sbindir=/usr/bin --bindir=/usr/bin - --mandir=/usr/share/man --infodir=/usr/share/info --localstatedir=/var" +export configure_args=(--prefix=/usr --sysconfdir=/etc --sbindir=/usr/bin --bindir=/usr/bin + --mandir=/usr/share/man --infodir=/usr/share/info --localstatedir=/var) . ${XBPS_COMMONDIR}/build-profiles/${XBPS_MACHINE}.sh -export configure_args+=" --host=$XBPS_TRIPLET --build=$XBPS_TRIPLET" +export configure_args+=("--host=$XBPS_TRIPLET" "--build=$XBPS_TRIPLET") # Always use wordsize-specific libdir even though the real path is lib # This is to make sure 32-bit and 64-bit libs can coexist when looking # up things (the opposite-libdir is always symlinked as libNN) -export configure_args+=" --libdir=\${exec_prefix}/lib${XBPS_TARGET_WORDSIZE}" +export configure_args+=("--libdir=\${exec_prefix}/lib${XBPS_TARGET_WORDSIZE}") _AUTOCONFCACHEDIR=${XBPS_COMMONDIR}/environment/configure/autoconf_cache @@ -33,16 +33,16 @@ esac # Cross compilation vars if [ -z "$CROSS_BUILD" ]; then - export configure_args+=" ${TEMPLATE_CONFIGURE_ARGS}" + export configure_args+=("${TEMPLATE_CONFIGURE_ARGS[@]}") unset TEMPLATE_CONFIGURE_ARGS set +a return 0 fi -export configure_args+=" --host=$XBPS_CROSS_TRIPLET --with-sysroot=$XBPS_CROSS_BASE --with-libtool-sysroot=$XBPS_CROSS_BASE " +export configure_args+=("--host=$XBPS_CROSS_TRIPLET" "--with-sysroot=$XBPS_CROSS_BASE" "--with-libtool-sysroot=$XBPS_CROSS_BASE") -export configure_args+=" ${TEMPLATE_CONFIGURE_ARGS}" +export configure_args+=("${TEMPLATE_CONFIGURE_ARGS[@]}") unset TEMPLATE_CONFIGURE_ARGS # Read autoconf cache variables for cross target (taken from OE). From 3d51873206332364938a8ac3de1ec95070d491f5 Mon Sep 17 00:00:00 2001 From: classabbyamp Date: Wed, 8 Mar 2023 04:45:40 -0500 Subject: [PATCH 5/5] srcpkgs/: fix configure_args --- srcpkgs/backintime/template | 4 ++-- srcpkgs/coreutils/template | 8 ++++---- srcpkgs/emacs/template | 6 +++--- srcpkgs/ndpi/template | 2 +- srcpkgs/net-snmp/template | 12 ++++++------ srcpkgs/nx-libs/template | 4 ++-- srcpkgs/openjdk15-bootstrap/template | 11 +++++------ srcpkgs/xen/template | 2 +- 8 files changed, 24 insertions(+), 25 deletions(-) diff --git a/srcpkgs/backintime/template b/srcpkgs/backintime/template index 2d8c9328216f..b0110046f42c 100644 --- a/srcpkgs/backintime/template +++ b/srcpkgs/backintime/template @@ -16,9 +16,9 @@ python_version=3 do_configure() { cd $wrksrc/common - ./configure $configure_args + ./configure "${configure_args[@]}" cd $wrksrc/qt - ./configure $configure_args + ./configure "${configure_args[@]}" } do_build() { diff --git a/srcpkgs/coreutils/template b/srcpkgs/coreutils/template index b9148c854960..6964a3b748a1 100644 --- a/srcpkgs/coreutils/template +++ b/srcpkgs/coreutils/template @@ -49,19 +49,19 @@ pre_configure() { do_configure() { if [ "$CROSS_BUILD" ]; then - configure_args+=" fu_cv_sys_stat_statfs2_bsize=no + configure_args+=(fu_cv_sys_stat_statfs2_bsize=no gl_cv_func_working_mkstemp=yes - gl_cv_func_working_acl_get_file=yes " + gl_cv_func_working_acl_get_file=yes) fi case "$XBPS_TARGET_MACHINE" in # XXX syncfs() in src/sync.c expects a return value. - *-musl) configure_args+=" ac_cv_func_syncfs=no";; + *-musl) configure_args+=(ac_cv_func_syncfs=no);; esac # # Do not install kill: provided by util-linux. # Do not install uptime: provided by procps-ng. # - env $_force_unsafe_configure ./configure ${configure_args} \ + env $_force_unsafe_configure ./configure "${configure_args[@]}" \ --enable-install-program=arch,hostname \ --enable-no-install-program=kill,uptime \ --disable-rpath diff --git a/srcpkgs/emacs/template b/srcpkgs/emacs/template index 1e74ec047dac..796d787225a6 100644 --- a/srcpkgs/emacs/template +++ b/srcpkgs/emacs/template @@ -59,16 +59,16 @@ post_extract() { do_configure() { cd $wrksrc/nox - ./configure --without-x $(vopt_with dbus) ${configure_args} \ + ./configure --without-x $(vopt_with dbus) "${configure_args[@]}" \ --without-native-compilation cd $wrksrc/x11 ./configure --with-x-toolkit=athena --without-toolkit-scroll-bars \ $(vopt_with dbus) --without-gconf --without-gsettings \ - ${configure_args} + "${configure_args[@]}" cd $wrksrc/gtk3 - ./configure --with-x-toolkit=gtk3 --with-xwidgets ${configure_args} + ./configure --with-x-toolkit=gtk3 --with-xwidgets "${configure_args[@]}" } do_build() { diff --git a/srcpkgs/ndpi/template b/srcpkgs/ndpi/template index 4fdef1b182e9..bcd50cc81954 100644 --- a/srcpkgs/ndpi/template +++ b/srcpkgs/ndpi/template @@ -13,7 +13,7 @@ distfiles="https://github.com/ntop/nDPI/archive/${version}.tar.gz" checksum=dc9b291c7fde94edb45fb0f222e0d93c93f8d6d37f4efba20ebd9c655bfcedf9 do_configure() { - ./autogen.sh ${configure_args} + ./autogen.sh ${configure_args[@]} } do_check() { diff --git a/srcpkgs/net-snmp/template b/srcpkgs/net-snmp/template index af0d79685f15..6eed952b84d0 100644 --- a/srcpkgs/net-snmp/template +++ b/srcpkgs/net-snmp/template @@ -2,6 +2,11 @@ pkgname=net-snmp version=5.9.1 revision=3 +configure_args=(--enable-ucd-snmp-compatibility --enable-ipv6 + --with-default-snmp-version="3" --with-sys-contact="root@localhost" + --with-sys-location="Unknown" --with-logfile=/var/log/snmpd.log + --sbindir=/usr/bin --with-persistent-directory=/var/net-snmp --disable-static + --with-mib-modules="host misc/ipfwacc ucd-snmp/diskio tunnel ucd-snmp/dlmod ucd-snmp/lmsensorsMib") hostmakedepends="pkg-config unzip" makedepends="bzip2-devel openssl-devel libnl-devel pciutils-devel libsensors-devel pcre-devel" @@ -20,12 +25,7 @@ do_configure() { # lack magic words. export GREP='grep -a' - ./configure ${configure_args} --enable-ucd-snmp-compatibility \ - --enable-ipv6 --with-default-snmp-version="3" \ - --with-sys-contact="root@localhost" --with-sys-location="Unknown" \ - --with-logfile=/var/log/snmpd.log --sbindir=/usr/bin \ - --with-mib-modules="host misc/ipfwacc ucd-snmp/diskio tunnel ucd-snmp/dlmod ucd-snmp/lmsensorsMib" \ - --with-persistent-directory=/var/net-snmp --disable-static + ./configure "${configure_args[@]}" } do_build() { diff --git a/srcpkgs/nx-libs/template b/srcpkgs/nx-libs/template index f604983c82c9..18c83aed0016 100644 --- a/srcpkgs/nx-libs/template +++ b/srcpkgs/nx-libs/template @@ -42,11 +42,11 @@ do_configure() { # Configure all subprojects in advance of build local _subdir for _subdir in nxcomp nxcompshad nxproxy nxdialog; do - ( cd ${_subdir} && ./configure ${configure_args} ) + ( cd ${_subdir} && ./configure "${configure_args[@]}" ) done # nx-X11 configure has an extra argument - ( cd nx-X11/lib && ./configure ${configure_args} --disable-poll ) + ( cd nx-X11/lib && ./configure "${configure_args[@]}" --disable-poll ) } post_install() { diff --git a/srcpkgs/openjdk15-bootstrap/template b/srcpkgs/openjdk15-bootstrap/template index a3b515b98a96..430cf43eb215 100644 --- a/srcpkgs/openjdk15-bootstrap/template +++ b/srcpkgs/openjdk15-bootstrap/template @@ -61,14 +61,14 @@ esac if [ -n "$_use_zero" ]; then makedepends+=" libffi-devel" - configure_args+=" --with-jvm-variants=zero" + configure_args+=("--with-jvm-variants=zero") case "$XBPS_TARGET_MACHINE" in - ppc*) configure_args+=" --with-boot-jdk-jvmargs=-XX:ThreadStackSize=2560";; + ppc*) configure_args+=("--with-boot-jdk-jvmargs=-XX:ThreadStackSize=2560");; esac fi if [ -n "$XBPS_DEBUG_PKGS" ]; then - configure_args+=" --with-native-debug-symbols=internal" + configure_args+=("--with-native-debug-symbols=internal") fi post_extract() { @@ -100,13 +100,12 @@ do_configure() { ;; esac - configure_args=${configure_args/--with-libtool-sysroot=\/usr\/[a-z0-9]*-linux-[a-z]*/} if [ "$XBPS_CCACHE" ]; then - configure_args+=" --enable-ccache" + configure_args+=(--enable-ccache) fi CC="/usr/bin/cc" CXX="/usr/bin/c++" - ./configure ${configure_args} \ + ./configure "${configure_args[@]/--with-libtool-sysroot=\/usr\/[a-z0-9]*-linux-[a-z]*/}" \ --with-extra-cflags="$CFLAGS" \ --with-extra-cxxflags="$CXXFLAGS" \ --with-extra-ldflags="$LDFLAGS" \ diff --git a/srcpkgs/xen/template b/srcpkgs/xen/template index 160db8e65929..dde7b0aa5df3 100644 --- a/srcpkgs/xen/template +++ b/srcpkgs/xen/template @@ -146,7 +146,7 @@ do_configure() { cp -a ${FILESDIR}/stdint_local.h ${wrksrc}/tools/libxl/ rm -f ${XBPS_WRAPPERDIR}/strip ./autogen.sh - ./configure ${configure_args} + ./configure ${configure_args[@]} } do_build() {