Subject: [PATCH] testing/sdcc: new aport

From: Drew DeVault <[email-masked]>
Date: Wed, 21 Oct 2020 16:17:24 -0400

---
 testing/sdcc/APKBUILD | 42 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)
 create mode 100644 testing/sdcc/APKBUILD

diff --git a/testing/sdcc/APKBUILD b/testing/sdcc/APKBUILD
new file mode 100644
index 0000000000..51c002d27a
--- /dev/null
+++ b/testing/sdcc/APKBUILD
@@ -0,0 +1,42 @@
+# Maintainer: Drew DeVault <[email-masked]>
+pkgname=sdcc
+pkgver=4.0.0
+pkgrel=0
+pkgdesc="Small Device C Compiler"
+url="http://sdcc.sourceforge.net/"
+arch="all"
+license="GPL-2.0-or-later"
+makedepends="
+	boost-dev
+	texinfo
+"
+subpackages="$pkgname-doc"
+source="https://downloads.sourceforge.net/project/sdcc/sdcc/$pkgver/sdcc-src-$pkgver.tar.bz2"
+options="!check" # no test suite
+
+build() {
+	# will add ucim and pic14/16 support if anyone asks nicely
+	./configure \
+		--prefix=/usr \
+		--includedir=/usr/include/sdcc \
+		--libdir=/usr/lib/sdcc \
+		--disable-non-free \
+		--disable-ucsim \
+		--disable-pic14-port \
+		--disable-pic16-port
+	make
+}
+
+package() {
+	make DESTDIR="$pkgdir" install
+
+	if [ -d "$pkgdir"/usr/lib/lib ]; then
+		mv "$pkgdir"/usr/lib/lib/* "$pkgdir"/usr/lib/sdcc/
+		rm -rf "$pkgdir"/usr/lib/lib
+	fi
+
+	sed -i 's|#!/usr/bin/env python|#!/usr/bin/env python3|' "$pkgdir"/usr/bin/as2gbmap
+	rm -rf "$pkgdir"/usr/share/info
+}
+
+sha512sums="41a92711a9278261879caec1a01425104b7c75346b3c6ad9617cab025309c9b38f79eea2d04122f5ae6ce273fcd61fbde8a0d23756313a4593394230b51a1d4c  sdcc-src-4.0.0.tar.bz2"
-- 
2.28.0