summaryrefslogtreecommitdiffstats
path: root/newapkbuild.in
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2016-05-24 01:30:23 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2016-06-13 12:37:20 +0000
commita3ce23dd53e4dc307dd01c9bdab80b31191555bd (patch)
tree8e6fe23da0957cf1429c37295e6d381944cd4a68 /newapkbuild.in
parent630c244cfe79e6ae2139968f8772d07846a9d82b (diff)
downloadabuild-a3ce23dd53e4dc307dd01c9bdab80b31191555bd.tar.bz2
abuild-a3ce23dd53e4dc307dd01c9bdab80b31191555bd.tar.xz
newapkbuild: omit depends_dev if no *.h or *.hpp file found
Diffstat (limited to 'newapkbuild.in')
-rw-r--r--newapkbuild.in6
1 files changed, 6 insertions, 0 deletions
diff --git a/newapkbuild.in b/newapkbuild.in
index b0349c6..d19e197 100644
--- a/newapkbuild.in
+++ b/newapkbuild.in
@@ -207,6 +207,12 @@ __EOF__
done
echo "builddir=$builddir" >> APKBUILD
+ # Subpackage -dev is usually required only for C/C++. Since depends_dev
+ # confuses a lot people, remove it if there's no .h or .hpp file.
+ find "$sdir" -name "*.h" -o -name "*.hpp" -maxdepth 3 \
+ | head -n 1 | grep -q ".*" \
+ || sed -i -e '/^depends_dev=.*/d' -e 's/\$depends_dev\s*//' APKBUILD
+
# Check if its autotools
if [ -z "$buildtype" ]; then
if [ -x "$sdir"/configure ]; then