makepkg.conf: allow configuration additions via a subdirectory

Move rust related buildflags to their own configuration file to
provide an example of how other languages could be supported.

Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Allan McRae 2023-01-13 11:32:52 +10:00
parent e0bbfb5682
commit 71764b6d4c
4 changed files with 22 additions and 2 deletions

View file

@ -0,0 +1,11 @@
#!/hint/bash
#
# @sysconfdir@/makepkg.conf.d/rust.conf
#
#########################################################################
# RUST LANGUAGE SUPPORT
#########################################################################
#
#RUSTFLAGS="-C opt-level=2"
#DEBUG_RUSTFLAGS="-C debuginfo=2"

View file

@ -42,13 +42,11 @@ CHOST="@CHOST@"
#CXXFLAGS="-O2 -pipe" #CXXFLAGS="-O2 -pipe"
#LDFLAGS="" #LDFLAGS=""
#LTOFLAGS="-flto" #LTOFLAGS="-flto"
#RUSTFLAGS="-C opt-level=2"
#-- Make Flags: change this for DistCC/SMP systems #-- Make Flags: change this for DistCC/SMP systems
#MAKEFLAGS="-j2" #MAKEFLAGS="-j2"
#-- Debugging flags #-- Debugging flags
#DEBUG_CFLAGS="-g" #DEBUG_CFLAGS="-g"
#DEBUG_CXXFLAGS="-g" #DEBUG_CXXFLAGS="-g"
#DEBUG_RUSTFLAGS="-C debuginfo=2"
######################################################################### #########################################################################
# BUILD ENVIRONMENT # BUILD ENVIRONMENT

View file

@ -401,6 +401,12 @@ configure_file(
configuration : substs, configuration : substs,
install_dir : SYSCONFDIR) install_dir : SYSCONFDIR)
configure_file(
input : 'etc/makepkg.conf.d/rust.conf.in',
output : 'rust.conf',
configuration : substs,
install_dir : join_paths(SYSCONFDIR, 'makepkg.conf.d/'))
configure_file( configure_file(
input : 'etc/pacman.conf.in', input : 'etc/pacman.conf.in',
output : 'pacman.conf', output : 'pacman.conf',

View file

@ -37,6 +37,11 @@ source_makepkg_config() {
# Source the config file; fail if it is not found # Source the config file; fail if it is not found
if [[ -r $MAKEPKG_CONF ]]; then if [[ -r $MAKEPKG_CONF ]]; then
source_safe "$MAKEPKG_CONF" source_safe "$MAKEPKG_CONF"
if [[ -d "$MAKEPKG_CONF.d" ]]; then
for c in "$MAKEPKG_CONF.d"/*.conf; do
source_safe $c
done
fi
else else
error "$(gettext "%s not found.")" "$MAKEPKG_CONF" error "$(gettext "%s not found.")" "$MAKEPKG_CONF"
plainerr "$(gettext "Aborting...")" plainerr "$(gettext "Aborting...")"