Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC] [WIP] use bash arrays for some template fields #42656

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion common/build-helper/cmake-wxWidgets-gtk3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ if [ "$CROSS_BUILD" ]; then
else
export WX_CONFIG=/usr/bin/wx-config-gtk3
fi
configure_args+=" -DwxWidgets_CONFIG_EXECUTABLE=${WX_CONFIG} "
configure_args+=("-DwxWidgets_CONFIG_EXECUTABLE=${WX_CONFIG}")
16 changes: 8 additions & 8 deletions common/build-helper/gir.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,33 @@
# Check if the 'gir' build_option is set or if there is no
# 'gir' build_option.
if [ "$build_option_gir" ] || [[ $build_options != *"gir"* ]]; then
if [[ $hostmakedepends != *"gobject-introspection"* ]]; then
if ! array_contains hostmakedepends "gobject-introspection"; then
# Provide the host tooling, g-ir-scanner, g-ir-compiler
# and its wrappers.
hostmakedepends+=" gobject-introspection"
hostmakedepends+=(gobject-introspection)
fi

if [ "$CROSS_BUILD" ]; then
# Required for running binaries produced from g-ir-compiler
# via g-ir-scanner-qemuwrapper
hostmakedepends+=" qemu-user-static"
hostmakedepends+=(qemu-user-static)

# Required for running the g-ir-scanner-lddwrapper
hostmakedepends+=" prelink-cross"
hostmakedepends+=(prelink-cross)

if [[ $makedepends != *"gobject-introspection"* ]]; then
if ! array_contains makedepends "gobject-introspection"; then
# Provide basic .gir types like GLib, GObject, DBus, Gio, cairo
# and tooling like g-ir-compiler
makedepends+=" gobject-introspection"
makedepends+=(gobject-introspection)
fi

export VAPIGEN_VAPIDIRS=${XBPS_CROSS_BASE}/usr/share/vala/vapi
export VAPIGEN_GIRDIRS=${XBPS_CROSS_BASE}/usr/share/gir-1.0

# Provide some packages in hostmakedepends if they are in makedepends
for f in gtk+3-devel python3-gobject-devel; do
if [[ $makedepends == *"${f}"* ]]; then
hostmakedepends+=" ${f}"
if array_contains makedepends "${f}"; then
hostmakedepends+=("${f}")
fi
done
unset f
Expand Down
8 changes: 4 additions & 4 deletions common/build-helper/numpy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@

# Even for cross compilation, numpy should be available on the host to ensure
# that the host interpreter doesn't complain about missing deps
if [[ $hostmakedepends != *"python3-numpy"* ]]; then
hostmakedepends+=" python3-numpy"
if ! array_contains hostmakedepends "python3-numpy"; then
hostmakedepends+=(python3-numpy)
fi

[ -z "$CROSS_BUILD" ] && return 0

if [[ $makedepends != *"python3-numpy"* ]]; then
makedepends+=" python3-numpy"
if ! array_contains makedepends "python3-numpy"; then
makedepends+=(python3-numpy)
fi

# python3-setuptools finds numpy libs and headers on the host first;
Expand Down
4 changes: 2 additions & 2 deletions common/build-helper/qemu.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
if [ "$CROSS_BUILD" ]; then
export QEMU_LD_PREFIX=${XBPS_CROSS_BASE}
if [[ $hostmakedepends != *"qemu-user-static"* ]]; then
hostmakedepends+=" qemu-user-static"
if ! array_contains hostmakedepends "qemu-user-static"; then
hostmakedepends+=(qemu-user-static)
fi
fi

Expand Down
6 changes: 3 additions & 3 deletions common/build-style/cargo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@
do_build() {
: ${make_cmd:=cargo auditable}

${make_cmd} build --release --locked --target ${RUST_TARGET} ${configure_args}
${make_cmd} build --release --locked --target ${RUST_TARGET} "${configure_args[@]}"
}

do_check() {
: ${make_cmd:=cargo auditable}

${make_check_pre} ${make_cmd} test --release --locked --target ${RUST_TARGET} \
${configure_args} ${make_check_args}
"${configure_args[@]}" ${make_check_args}
}

do_install() {
: ${make_cmd:=cargo auditable}
: ${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
Expand Down
4 changes: 2 additions & 2 deletions common/build-style/cmake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 ;;
Expand Down Expand Up @@ -75,7 +75,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}
Expand Down
2 changes: 1 addition & 1 deletion common/build-style/configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
do_configure() {
: ${configure_script:=./configure}

${configure_script} ${configure_args}
${configure_script} "${configure_args[@]}"
}

do_build() {
Expand Down
2 changes: 1 addition & 1 deletion common/build-style/gemspec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ do_install() {
--no-document \
--verbose \
"${pkgname#ruby-}-${version}.gem" \
-- $configure_args
-- "${configure_args[@]}"

# Remove cache
rm -rf ${DESTDIR}/${_GEMDIR}/cache
Expand Down
2 changes: 1 addition & 1 deletion common/build-style/gnu-configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
4 changes: 2 additions & 2 deletions common/build-style/meson.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ do_configure() {
: ${meson_crossfile:="${XBPS_WRAPPERDIR}/meson/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
Expand Down Expand Up @@ -39,7 +39,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() {
Expand Down
2 changes: 1 addition & 1 deletion common/build-style/perl-ModuleBuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion common/build-style/perl-module.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions common/build-style/qmake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -129,7 +129,7 @@ _EOF
QMAKE_CXXFLAGS="${CXXFLAGS}" \
QMAKE_LFLAGS="${LDFLAGS}" \
CONFIG+=no_qt_rpath \
${configure_args}
"${configure_args[@]}"
fi
}

Expand Down
2 changes: 1 addition & 1 deletion common/build-style/sip-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions common/build-style/void-cross.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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}
Expand Down
2 changes: 1 addition & 1 deletion common/build-style/waf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion common/build-style/waf3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion common/build-style/zig-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
4 changes: 2 additions & 2 deletions common/environment/build-style/R-cran.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
makedepends+=" R"
depends+=" R"
makedepends+=(R)
depends+=(R)
create_wrksrc=required
build_wrksrc="${pkgname#R-cran-}"

Expand Down
6 changes: 3 additions & 3 deletions common/environment/build-style/cargo.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
hostmakedepends+=" cargo"
hostmakedepends+=(cargo)

if ! [[ "$pkgname" =~ ^cargo-auditable(-bootstrap)?$ ]]; then
hostmakedepends+=" cargo-auditable"
hostmakedepends+=(cargo-auditable)
fi

if [ "$CROSS_BUILD" ]; then
makedepends+=" rust-std"
makedepends+=(rust-std)
fi

build_helper+=" rust"
4 changes: 2 additions & 2 deletions common/environment/build-style/cmake.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
if [ "$CHROOT_READY" ]; then
if [ "$pkgname" != cmake-bootstrap ]; then
hostmakedepends+=" cmake-bootstrap"
hostmakedepends+=(cmake-bootstrap)
fi
if [ "${make_cmd:-ninja}" = ninja ]; then
hostmakedepends+=" ninja"
hostmakedepends+=(ninja)
fi
fi

Expand Down
4 changes: 2 additions & 2 deletions common/environment/build-style/gem.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
lib32disabled=yes
hostmakedepends+=" ruby"
depends+=" ruby"
hostmakedepends+=(ruby)
depends+=(ruby)

# default to rubygems
if [ -z "$distfiles" ]; then
Expand Down
4 changes: 2 additions & 2 deletions common/environment/build-style/gemspec.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
lib32disabled=yes
hostmakedepends+=" ruby-devel"
makedepends+=" ruby-devel"
hostmakedepends+=(ruby-devel)
makedepends+=(ruby-devel)
4 changes: 2 additions & 2 deletions common/environment/build-style/go.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
if [ -z "$hostmakedepends" -o "${hostmakedepends##*gcc-go-tools*}" ]; then
if [ "${#hostmakedepends[@]}" -eq 0 ] || ! array_contains hostmakedepends "gcc-go-tools"; then
# gc compiler
if [ -z "$archs" ]; then
archs="aarch64* armv[567]* i686* x86_64* ppc64le* riscv64*"
fi
hostmakedepends+=" go"
hostmakedepends+=(go)
nopie=yes
else
# gccgo compiler
Expand Down
2 changes: 1 addition & 1 deletion common/environment/build-style/haskell-stack.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
hostmakedepends+=" ghc stack"
hostmakedepends+=(ghc stack)
2 changes: 1 addition & 1 deletion common/environment/build-style/meson.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
hostmakedepends+=" meson"
hostmakedepends+=(meson)
build_helper+=" meson"
4 changes: 2 additions & 2 deletions common/environment/build-style/perl-ModuleBuild.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
hostmakedepends+=" perl"
makedepends+=" perl"
hostmakedepends+=(perl)
makedepends+=(perl)
lib32disabled=yes
6 changes: 3 additions & 3 deletions common/environment/build-style/perl-module.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
hostmakedepends+=" perl"
makedepends+=" perl"
depends+=" perl"
hostmakedepends+=(perl)
makedepends+=(perl)
depends+=(perl)
lib32disabled=yes
2 changes: 1 addition & 1 deletion common/environment/build-style/python2-module.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
lib32disabled=yes
makedepends+=" python"
makedepends+=(python)
2 changes: 1 addition & 1 deletion common/environment/build-style/python3-module.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
lib32disabled=yes
makedepends+=" python3"
makedepends+=(python3)
build_helper+=" python3"
2 changes: 1 addition & 1 deletion common/environment/build-style/python3-pep517.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
hostmakedepends+=" python3-build python3-installer"
hostmakedepends+=(python3-build python3-installer)
lib32disabled=yes
build_helper+=" python3"
6 changes: 3 additions & 3 deletions common/environment/build-style/raku-dist.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
depends+=" rakudo"
checkdepends+=" perl"
hostmakedepends+=" rakudo"
depends+=(rakudo)
checkdepends+=(perl)
hostmakedepends+=(rakudo)
2 changes: 1 addition & 1 deletion common/environment/build-style/scons.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
hostmakedepends+=" scons"
hostmakedepends+=(scons)
2 changes: 1 addition & 1 deletion common/environment/build-style/waf.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
hostmakedepends+=" python"
hostmakedepends+=(python)
2 changes: 1 addition & 1 deletion common/environment/build-style/waf3.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
hostmakedepends+=" python3"
hostmakedepends+=(python3)
2 changes: 1 addition & 1 deletion common/environment/build-style/zig-build.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
hostmakedepends+=" zig"
hostmakedepends+=(zig)
Loading