@@ -76,7 +76,8 @@ BUILDENV=(!distcc color !ccache check !sign)
# These are default values for the options=() settings
#########################################################################
#
-# Makepkg defaults: OPTIONS=(!strip docs libtool staticlibs emptydirs !zipman !purge !debug !lto)
+# Makepkg defaults:
+# OPTIONS=(!strip docs libtool staticlibs emptydirs !zipman !purge !debug !lto !autodeps)
# A negated option will do the opposite of the comments below.
#
#-- strip: Strip symbols from binaries/libraries
@@ -88,8 +89,9 @@ BUILDENV=(!distcc color !ccache check !sign)
#-- purge: Remove files specified by PURGE_TARGETS
#-- debug: Add debugging flags as specified in DEBUG_* variables
#-- lto: Add compile flags for building with link time optimization
+#-- autodeps: Automatically add depends/provides
#
-OPTIONS=(strip docs libtool staticlibs emptydirs zipman purge !debug !lto)
+OPTIONS=(strip docs libtool staticlibs emptydirs zipman purge !debug !lto !autodeps)
#-- File integrity checks to use. Valid: ck, md5, sha1, sha224, sha256, sha384, sha512, b2
INTEGRITY_CHECK=(ck)
new file mode 100644
@@ -0,0 +1,38 @@
+#!/bin/bash
+#
+# autodep.sh - functions for automatically adding depends/provides
+#
+# Copyright (c) 2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
+#
+# 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 <http://www.gnu.org/licenses/>.
+#
+
+[[ -n "$LIBMAKEPKG_AUTODEP_SH" ]] && return
+LIBMAKEPKG_AUTODEP_SH=1
+
+LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
+
+declare -a autodep_functions
+
+for lib in "$LIBRARY/autodep/"*.sh; do
+ source "$lib"
+done
+
+readonly -a autodep_functions
+
+generate_autodeps() {
+ for func in ${autodep_functions[@]}; do
+ $func
+ done
+}
@@ -480,6 +480,7 @@ write_pkginfo() {
local size=$(dirsize)
merge_arch_attrs
+ generate_autodeps
printf "# Generated by makepkg %s\n" "$makepkg_version"
printf "# using %s\n" "$(fakeroot -v)"
Signed-off-by: Allan McRae <allan@archlinux.org> --- etc/makepkg.conf.in | 6 +++-- scripts/libmakepkg/autodep.sh.in | 38 ++++++++++++++++++++++++++++++++ scripts/makepkg.sh.in | 1 + 3 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 scripts/libmakepkg/autodep.sh.in