From e41d0183987702fd0216fd88926659ed0c6038ce Mon Sep 17 00:00:00 2001 From: loqs <2227-loqs@users.noreply.gitlab.archlinux.org> Date: Thu, 18 Jan 2024 14:56:50 +0000 Subject: [PATCH 1/9] Add and use check_append_debug_flags --- scripts/libmakepkg/buildenv.sh.in | 13 +++++++++++++ scripts/libmakepkg/buildenv/rust.sh.in | 9 +++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/scripts/libmakepkg/buildenv.sh.in b/scripts/libmakepkg/buildenv.sh.in index a5847777..3b8f5867 100644 --- a/scripts/libmakepkg/buildenv.sh.in +++ b/scripts/libmakepkg/buildenv.sh.in @@ -33,6 +33,19 @@ done readonly -a buildenv_functions buildenv_vars build_options +check_append_debug_flags() { + local -n flag=$1 + local -n debug_flag=$2 + + if check_option "debug" "y" && ! check_option "buildflags" "n"; then + if [[ $# -gt 1 ]]; then + local debug_extra=$3 + append_once debug_flag "$debug_extra" + fi + append_once flag "$debug_flag" + fi +} + prepare_buildenv() { # ensure this function runs first buildenv_buildflags diff --git a/scripts/libmakepkg/buildenv/rust.sh.in b/scripts/libmakepkg/buildenv/rust.sh.in index 93114dcd..deb5e9be 100644 --- a/scripts/libmakepkg/buildenv/rust.sh.in +++ b/scripts/libmakepkg/buildenv/rust.sh.in @@ -2,7 +2,7 @@ # # rust.sh - Specify flags for building a package with rust # -# Copyright (c) 2022 Pacman Development Team +# Copyright (c) 2022-2024 Pacman Development Team # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -30,8 +30,5 @@ buildenv_vars+=('RUSTFLAGS' 'DEBUG_RUSTFLAGS') buildenv_functions+=('buildenv_rust') buildenv_rust() { - if check_option "debug" "y" && ! check_option "buildflags" "n"; then - append_once DEBUG_RUSTFLAGS "--remap-path-prefix=$srcdir=${DBGSRCDIR:-/usr/src/debug}/${pkgbase}" - append_once RUSTFLAGS "$DEBUG_RUSTFLAGS" - fi -} \ No newline at end of file + check_append_debug_flags RUSTFLAGS DEBUG_RUSTFLAGS "--remap-path-prefix=$srcdir=${DBGSRCDIR:-/usr/src/debug}/${pkgbase}" +} From 3d7fb3213f2899c16bffe57fd1521d088095c6a7 Mon Sep 17 00:00:00 2001 From: loqs <2227-loqs@users.noreply.gitlab.archlinux.org> Date: Tue, 16 Jan 2024 22:29:14 +0000 Subject: [PATCH 2/9] Split exported build variables into buildenv_vars_exported. --- scripts/libmakepkg/buildenv.sh.in | 8 ++++---- scripts/libmakepkg/buildenv/buildflags.sh.in | 4 ++-- scripts/libmakepkg/buildenv/rust.sh.in | 3 ++- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/scripts/libmakepkg/buildenv.sh.in b/scripts/libmakepkg/buildenv.sh.in index 3b8f5867..ad1d7957 100644 --- a/scripts/libmakepkg/buildenv.sh.in +++ b/scripts/libmakepkg/buildenv.sh.in @@ -3,7 +3,7 @@ # buildenv.sh - functions for altering the build environment before # compilation # -# Copyright (c) 2015-2022 Pacman Development Team +# Copyright (c) 2015-2024 Pacman Development Team # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -24,8 +24,8 @@ LIBMAKEPKG_BUILDENV_SH=1 MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'} -declare -a buildenv_functions build_options -buildenv_vars=('CPPFLAGS' 'CFLAGS' 'CXXFLAGS' 'LDFLAGS' 'MAKEFLAGS' 'CHOST') +declare -a buildenv_functions buildenv_vars build_options +buildenv_vars_exported=('CPPFLAGS' 'CFLAGS' 'CXXFLAGS' 'LDFLAGS' 'MAKEFLAGS' 'CHOST') for lib in "$MAKEPKG_LIBRARY/buildenv/"*.sh; do source "$lib" @@ -55,5 +55,5 @@ prepare_buildenv() { done # ensure all necessary build variables are exported - export ${buildenv_vars[@]} + export ${buildenv_vars_exported[@]} } diff --git a/scripts/libmakepkg/buildenv/buildflags.sh.in b/scripts/libmakepkg/buildenv/buildflags.sh.in index 60774051..ade28539 100644 --- a/scripts/libmakepkg/buildenv/buildflags.sh.in +++ b/scripts/libmakepkg/buildenv/buildflags.sh.in @@ -2,7 +2,7 @@ # # buildflags.sh - Clear user-specified buildflags if requested # -# Copyright (c) 2011-2022 Pacman Development Team +# Copyright (c) 2011-2024 Pacman Development Team # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -29,6 +29,6 @@ build_options+=('buildflags') buildenv_buildflags() { if check_option "buildflags" "n"; then - unset ${buildenv_vars[@]} + unset ${buildenv_vars_exported[@]} fi } diff --git a/scripts/libmakepkg/buildenv/rust.sh.in b/scripts/libmakepkg/buildenv/rust.sh.in index deb5e9be..d3d90fef 100644 --- a/scripts/libmakepkg/buildenv/rust.sh.in +++ b/scripts/libmakepkg/buildenv/rust.sh.in @@ -26,7 +26,8 @@ MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'} source "$MAKEPKG_LIBRARY/util/option.sh" source "$MAKEPKG_LIBRARY/util/util.sh" -buildenv_vars+=('RUSTFLAGS' 'DEBUG_RUSTFLAGS') +buildenv_vars+=('DEBUG_RUSTFLAGS') +buildenv_vars_exported+=('RUSTFLAGS') buildenv_functions+=('buildenv_rust') buildenv_rust() { From 1e1c73e28310970b3c9bd1e96975c81a26235340 Mon Sep 17 00:00:00 2001 From: loqs <2227-loqs@users.noreply.gitlab.archlinux.org> Date: Tue, 16 Jan 2024 22:40:24 +0000 Subject: [PATCH 3/9] Split out CPPFLAGS --- scripts/libmakepkg/buildenv.sh.in | 2 +- scripts/libmakepkg/buildenv/cpp.sh.in | 30 +++++++++++++++++++++++++ scripts/libmakepkg/buildenv/meson.build | 1 + 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 scripts/libmakepkg/buildenv/cpp.sh.in diff --git a/scripts/libmakepkg/buildenv.sh.in b/scripts/libmakepkg/buildenv.sh.in index ad1d7957..791ae3fb 100644 --- a/scripts/libmakepkg/buildenv.sh.in +++ b/scripts/libmakepkg/buildenv.sh.in @@ -25,7 +25,7 @@ LIBMAKEPKG_BUILDENV_SH=1 MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'} declare -a buildenv_functions buildenv_vars build_options -buildenv_vars_exported=('CPPFLAGS' 'CFLAGS' 'CXXFLAGS' 'LDFLAGS' 'MAKEFLAGS' 'CHOST') +buildenv_vars_exported=('CFLAGS' 'CXXFLAGS' 'LDFLAGS' 'MAKEFLAGS' 'CHOST') for lib in "$MAKEPKG_LIBRARY/buildenv/"*.sh; do source "$lib" diff --git a/scripts/libmakepkg/buildenv/cpp.sh.in b/scripts/libmakepkg/buildenv/cpp.sh.in new file mode 100644 index 00000000..f9622f56 --- /dev/null +++ b/scripts/libmakepkg/buildenv/cpp.sh.in @@ -0,0 +1,30 @@ +#!/usr/bin/bash +# +# rust.sh - Specify flags for building a package with rust +# +# Copyright (c) 2024 Pacman Development Team +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +[[ -n "$LIBMAKEPKG_BUILDENV_CPP_SH" ]] && return +LIBMAKEPKG_BUILDENV_CPP_SH=1 + +MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'} + +source "$MAKEPKG_LIBRARY/util/option.sh" +source "$MAKEPKG_LIBRARY/util/util.sh" + +buildenv_vars_exported+=('CPPFLAGS') +buildenv_functions+=('buildenv_rust') diff --git a/scripts/libmakepkg/buildenv/meson.build b/scripts/libmakepkg/buildenv/meson.build index 4c289ac1..c2886902 100644 --- a/scripts/libmakepkg/buildenv/meson.build +++ b/scripts/libmakepkg/buildenv/meson.build @@ -3,6 +3,7 @@ libmakepkg_module = 'buildenv' sources = [ 'buildflags.sh.in', 'compiler.sh.in', + 'cpp.sh.in', 'debugflags.sh.in', 'lto.sh.in', 'makeflags.sh.in', From 735d1b0073b0c81ade437672a650c09481c1fa89 Mon Sep 17 00:00:00 2001 From: loqs <2227-loqs@users.noreply.gitlab.archlinux.org> Date: Tue, 16 Jan 2024 22:44:10 +0000 Subject: [PATCH 4/9] Split out CFLAGS and DEBUG_CFLAGS --- scripts/libmakepkg/buildenv.sh.in | 2 +- scripts/libmakepkg/buildenv/c.sh.in | 35 ++++++++++++++++++++ scripts/libmakepkg/buildenv/debugflags.sh.in | 4 +-- scripts/libmakepkg/buildenv/meson.build | 1 + 4 files changed, 38 insertions(+), 4 deletions(-) create mode 100644 scripts/libmakepkg/buildenv/c.sh.in diff --git a/scripts/libmakepkg/buildenv.sh.in b/scripts/libmakepkg/buildenv.sh.in index 791ae3fb..53f12d32 100644 --- a/scripts/libmakepkg/buildenv.sh.in +++ b/scripts/libmakepkg/buildenv.sh.in @@ -25,7 +25,7 @@ LIBMAKEPKG_BUILDENV_SH=1 MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'} declare -a buildenv_functions buildenv_vars build_options -buildenv_vars_exported=('CFLAGS' 'CXXFLAGS' 'LDFLAGS' 'MAKEFLAGS' 'CHOST') +buildenv_vars_exported=('CXXFLAGS' 'LDFLAGS' 'MAKEFLAGS' 'CHOST') for lib in "$MAKEPKG_LIBRARY/buildenv/"*.sh; do source "$lib" diff --git a/scripts/libmakepkg/buildenv/c.sh.in b/scripts/libmakepkg/buildenv/c.sh.in new file mode 100644 index 00000000..46adc9a4 --- /dev/null +++ b/scripts/libmakepkg/buildenv/c.sh.in @@ -0,0 +1,35 @@ +#!/usr/bin/bash +# +# c.sh - Specify flags for building a package with C +# +# Copyright (c) 2024 Pacman Development Team +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +[[ -n "$LIBMAKEPKG_BUILDENV_C_SH" ]] && return +LIBMAKEPKG_BUILDENV_C_SH=1 + +MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'} + +source "$MAKEPKG_LIBRARY/util/option.sh" +source "$MAKEPKG_LIBRARY/util/util.sh" + +buildenv_vars+=('DEBUG_CFLAGS') +buildenv_vars_exported+=('CFLAGS') +buildenv_functions+=('buildenv_c') + +buildenv_c() { + check_append_debug_flags CFLAGS DEBUG_CFLAGS "-ffile-prefix-map=$srcdir=${DBGSRCDIR:-/usr/src/debug}/${pkgbase}" +} diff --git a/scripts/libmakepkg/buildenv/debugflags.sh.in b/scripts/libmakepkg/buildenv/debugflags.sh.in index 22a79281..678fd79a 100644 --- a/scripts/libmakepkg/buildenv/debugflags.sh.in +++ b/scripts/libmakepkg/buildenv/debugflags.sh.in @@ -3,7 +3,7 @@ # debugflags.sh - Specify flags for building a package with debugging # symbols # -# Copyright (c) 2012-2022 Pacman Development Team +# Copyright (c) 2012-2024 Pacman Development Team # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -31,9 +31,7 @@ buildenv_functions+=('buildenv_debugflags') buildenv_debugflags() { if check_option "debug" "y" && ! check_option "buildflags" "n"; then - append_once DEBUG_CFLAGS "-ffile-prefix-map=$srcdir=${DBGSRCDIR:-/usr/src/debug}/${pkgbase}" append_once DEBUG_CXXFLAGS "-ffile-prefix-map=$srcdir=${DBGSRCDIR:-/usr/src/debug}/${pkgbase}" - append_once CFLAGS "$DEBUG_CFLAGS" append_once CXXFLAGS "$DEBUG_CXXFLAGS" fi } diff --git a/scripts/libmakepkg/buildenv/meson.build b/scripts/libmakepkg/buildenv/meson.build index c2886902..2064bbfc 100644 --- a/scripts/libmakepkg/buildenv/meson.build +++ b/scripts/libmakepkg/buildenv/meson.build @@ -2,6 +2,7 @@ libmakepkg_module = 'buildenv' sources = [ 'buildflags.sh.in', + 'c.sh.in', 'compiler.sh.in', 'cpp.sh.in', 'debugflags.sh.in', From 34e8c3b26ef395d4ef627e99fe23f23b3d807927 Mon Sep 17 00:00:00 2001 From: loqs <2227-loqs@users.noreply.gitlab.archlinux.org> Date: Tue, 16 Jan 2024 22:51:23 +0000 Subject: [PATCH 5/9] Split out CXXFLAGS and DEBUG_CXXFLAGS --- scripts/libmakepkg/buildenv.sh.in | 2 +- scripts/libmakepkg/buildenv/cxx.sh.in | 35 ++++++++++++++++++++ scripts/libmakepkg/buildenv/debugflags.sh.in | 3 +- scripts/libmakepkg/buildenv/meson.build | 1 + 4 files changed, 38 insertions(+), 3 deletions(-) create mode 100644 scripts/libmakepkg/buildenv/cxx.sh.in diff --git a/scripts/libmakepkg/buildenv.sh.in b/scripts/libmakepkg/buildenv.sh.in index 53f12d32..370b2e70 100644 --- a/scripts/libmakepkg/buildenv.sh.in +++ b/scripts/libmakepkg/buildenv.sh.in @@ -25,7 +25,7 @@ LIBMAKEPKG_BUILDENV_SH=1 MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'} declare -a buildenv_functions buildenv_vars build_options -buildenv_vars_exported=('CXXFLAGS' 'LDFLAGS' 'MAKEFLAGS' 'CHOST') +buildenv_vars_exported=('LDFLAGS' 'MAKEFLAGS' 'CHOST') for lib in "$MAKEPKG_LIBRARY/buildenv/"*.sh; do source "$lib" diff --git a/scripts/libmakepkg/buildenv/cxx.sh.in b/scripts/libmakepkg/buildenv/cxx.sh.in new file mode 100644 index 00000000..65974d1f --- /dev/null +++ b/scripts/libmakepkg/buildenv/cxx.sh.in @@ -0,0 +1,35 @@ +#!/usr/bin/bash +# +# cxx.sh - Specify flags for building a package with C++ +# +# Copyright (c) 2024 Pacman Development Team +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +[[ -n "$LIBMAKEPKG_BUILDENV_CXX_SH" ]] && return +LIBMAKEPKG_BUILDENV_CXX_SH=1 + +MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'} + +source "$MAKEPKG_LIBRARY/util/option.sh" +source "$MAKEPKG_LIBRARY/util/util.sh" + +buildenv_vars+=('DEBUG_CXXFLAGS') +buildenv_vars_exported+=('CXXFLAGS') +buildenv_functions+=('buildenv_cxx') + +buildenv_cxx() { + check_append_debug_flags CXXFLAGS DEBUG_CXXFLAGS "-ffile-prefix-map=$srcdir=${DBGSRCDIR:-/usr/src/debug}/${pkgbase}" +} diff --git a/scripts/libmakepkg/buildenv/debugflags.sh.in b/scripts/libmakepkg/buildenv/debugflags.sh.in index 678fd79a..ab8cc015 100644 --- a/scripts/libmakepkg/buildenv/debugflags.sh.in +++ b/scripts/libmakepkg/buildenv/debugflags.sh.in @@ -31,7 +31,6 @@ buildenv_functions+=('buildenv_debugflags') buildenv_debugflags() { if check_option "debug" "y" && ! check_option "buildflags" "n"; then - append_once DEBUG_CXXFLAGS "-ffile-prefix-map=$srcdir=${DBGSRCDIR:-/usr/src/debug}/${pkgbase}" - append_once CXXFLAGS "$DEBUG_CXXFLAGS" + : fi } diff --git a/scripts/libmakepkg/buildenv/meson.build b/scripts/libmakepkg/buildenv/meson.build index 2064bbfc..f740910f 100644 --- a/scripts/libmakepkg/buildenv/meson.build +++ b/scripts/libmakepkg/buildenv/meson.build @@ -5,6 +5,7 @@ sources = [ 'c.sh.in', 'compiler.sh.in', 'cpp.sh.in', + 'cxx.sh.in', 'debugflags.sh.in', 'lto.sh.in', 'makeflags.sh.in', From 28be625a3ed2a5a24adce02b6665b70ad4928dbb Mon Sep 17 00:00:00 2001 From: loqs <2227-loqs@users.noreply.gitlab.archlinux.org> Date: Tue, 16 Jan 2024 22:53:50 +0000 Subject: [PATCH 6/9] Drop debugflags.sh.in --- scripts/libmakepkg/buildenv/debugflags.sh.in | 36 -------------------- scripts/libmakepkg/buildenv/meson.build | 1 - 2 files changed, 37 deletions(-) delete mode 100644 scripts/libmakepkg/buildenv/debugflags.sh.in diff --git a/scripts/libmakepkg/buildenv/debugflags.sh.in b/scripts/libmakepkg/buildenv/debugflags.sh.in deleted file mode 100644 index ab8cc015..00000000 --- a/scripts/libmakepkg/buildenv/debugflags.sh.in +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/bash -# -# debugflags.sh - Specify flags for building a package with debugging -# symbols -# -# Copyright (c) 2012-2024 Pacman Development Team -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# - -[[ -n "$LIBMAKEPKG_BUILDENV_DEBUGFLAGS_SH" ]] && return -LIBMAKEPKG_BUILDENV_DEBUGFLAGS_SH=1 - -MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'} - -source "$MAKEPKG_LIBRARY/util/option.sh" -source "$MAKEPKG_LIBRARY/util/util.sh" - -buildenv_functions+=('buildenv_debugflags') - -buildenv_debugflags() { - if check_option "debug" "y" && ! check_option "buildflags" "n"; then - : - fi -} diff --git a/scripts/libmakepkg/buildenv/meson.build b/scripts/libmakepkg/buildenv/meson.build index f740910f..ea08f11c 100644 --- a/scripts/libmakepkg/buildenv/meson.build +++ b/scripts/libmakepkg/buildenv/meson.build @@ -6,7 +6,6 @@ sources = [ 'compiler.sh.in', 'cpp.sh.in', 'cxx.sh.in', - 'debugflags.sh.in', 'lto.sh.in', 'makeflags.sh.in', 'rust.sh.in', From 6b3d2487f974f74912527e06082fb057a638c0be Mon Sep 17 00:00:00 2001 From: loqs <2227-loqs@users.noreply.gitlab.archlinux.org> Date: Wed, 17 Jan 2024 19:36:58 +0000 Subject: [PATCH 7/9] Move buildflags check and build_options definition to scripts/libmakepkg/buildenv.sh.in. --- scripts/libmakepkg/buildenv.sh.in | 6 ++++-- scripts/libmakepkg/buildenv/buildflags.sh.in | 6 +----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/scripts/libmakepkg/buildenv.sh.in b/scripts/libmakepkg/buildenv.sh.in index 370b2e70..ff7ea2a4 100644 --- a/scripts/libmakepkg/buildenv.sh.in +++ b/scripts/libmakepkg/buildenv.sh.in @@ -26,6 +26,7 @@ MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'} declare -a buildenv_functions buildenv_vars build_options buildenv_vars_exported=('LDFLAGS' 'MAKEFLAGS' 'CHOST') +build_options+=('buildflags') for lib in "$MAKEPKG_LIBRARY/buildenv/"*.sh; do source "$lib" @@ -47,8 +48,9 @@ check_append_debug_flags() { } prepare_buildenv() { - # ensure this function runs first - buildenv_buildflags + if check_option "buildflags" "n"; then + unset ${buildenv_vars_exported[@]} + fi for func in ${buildenv_functions[@]}; do $func diff --git a/scripts/libmakepkg/buildenv/buildflags.sh.in b/scripts/libmakepkg/buildenv/buildflags.sh.in index ade28539..31ad1d52 100644 --- a/scripts/libmakepkg/buildenv/buildflags.sh.in +++ b/scripts/libmakepkg/buildenv/buildflags.sh.in @@ -25,10 +25,6 @@ MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'} source "$MAKEPKG_LIBRARY/util/option.sh" -build_options+=('buildflags') - buildenv_buildflags() { - if check_option "buildflags" "n"; then - unset ${buildenv_vars_exported[@]} - fi + : } From 69710adcd45841ad1fa3d459cea4637e25d1a80d Mon Sep 17 00:00:00 2001 From: loqs <2227-loqs@users.noreply.gitlab.archlinux.org> Date: Wed, 17 Jan 2024 19:55:28 +0000 Subject: [PATCH 8/9] Drop scripts/libmakepkg/buildenv/buildflags.sh.in --- scripts/libmakepkg/buildenv/buildflags.sh.in | 30 -------------------- scripts/libmakepkg/buildenv/meson.build | 1 - 2 files changed, 31 deletions(-) delete mode 100644 scripts/libmakepkg/buildenv/buildflags.sh.in diff --git a/scripts/libmakepkg/buildenv/buildflags.sh.in b/scripts/libmakepkg/buildenv/buildflags.sh.in deleted file mode 100644 index 31ad1d52..00000000 --- a/scripts/libmakepkg/buildenv/buildflags.sh.in +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/bash -# -# buildflags.sh - Clear user-specified buildflags if requested -# -# Copyright (c) 2011-2024 Pacman Development Team -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# - -[[ -n "$LIBMAKEPKG_BUILDENV_BUILDFLAGS_SH" ]] && return -LIBMAKEPKG_BUILDENV_BUILDFLAGS_SH=1 - -MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'} - -source "$MAKEPKG_LIBRARY/util/option.sh" - -buildenv_buildflags() { - : -} diff --git a/scripts/libmakepkg/buildenv/meson.build b/scripts/libmakepkg/buildenv/meson.build index ea08f11c..d782c33a 100644 --- a/scripts/libmakepkg/buildenv/meson.build +++ b/scripts/libmakepkg/buildenv/meson.build @@ -1,7 +1,6 @@ libmakepkg_module = 'buildenv' sources = [ - 'buildflags.sh.in', 'c.sh.in', 'compiler.sh.in', 'cpp.sh.in', From cc7f0b390dcaef17868069aa5e4a754097f6921f Mon Sep 17 00:00:00 2001 From: loqs <2227-loqs@users.noreply.gitlab.archlinux.org> Date: Thu, 18 Jan 2024 19:35:49 +0000 Subject: [PATCH 9/9] lint_config/variable.sh support configuration additions via a subdirectory --- scripts/libmakepkg/lint_config/variable.sh.in | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/scripts/libmakepkg/lint_config/variable.sh.in b/scripts/libmakepkg/lint_config/variable.sh.in index 664230f9..db88618f 100644 --- a/scripts/libmakepkg/lint_config/variable.sh.in +++ b/scripts/libmakepkg/lint_config/variable.sh.in @@ -2,7 +2,7 @@ # # variable.sh - Check that variables are or are not arrays as appropriate # -# Copyright (c) 2018-2022 Pacman Development Team +# Copyright (c) 2018-2024 Pacman Development Team # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -24,6 +24,7 @@ LIBMAKEPKG_LINT_CONFIG_VARIABLE_SH=1 MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'} source "$MAKEPKG_LIBRARY/util/message.sh" +source "$MAKEPKG_LIBRARY/buildenv.sh" lint_config_functions+=('lint_config_variables') @@ -32,10 +33,10 @@ lint_config_variables() { local array=(DLAGENTS VCSCLIENTS BUILDENV OPTIONS INTEGRITY_CHECK MAN_DIRS DOC_DIRS PURGE_TARGETS COMPRESSGZ COMPRESSBZ2 COMPRESSXZ COMPRESSLRZ COMPRESSLZO COMPRESSZ) - local string=(CARCH CHOST CPPFLAGS CFLAGS CXXFLAGS LDFLAGS LTOFLAGS DEBUG_CFLAGS - DEBUG_CXXFLAGS DISTCC_HOSTS BUILDDIR STRIP_BINARIES STRIP_SHARED - STRIP_STATIC PKGDEST SRCDEST SRCPKGDEST LOGDEST PACKAGER GPGKEY - PKGEXT SRCEXT) + local string=(CARCH CHOST LDFLAGS LTOFLAGS DISTCC_HOSTS BUILDDIR + STRIP_BINARIES STRIP_SHARED STRIP_STATIC PKGDEST SRCDEST + SRCPKGDEST LOGDEST PACKAGER GPGKEY PKGEXT SRCEXT + ${buildenv_vars[@]} ${buildenv_vars_exported[@]}) local i keys ret=0