commit 3db8cc06f1480a39c53724a8f36f8cbb0c1a1eb8 Author: Folkert Kevelam Date: Sat May 17 23:06:11 2025 +0200 Initial commit diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 0000000..986df13 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,74 @@ +# Maintainer: Rod Kay + +# Contributor: Pierre-Marie de Rodat +# Contributor: Earnestly + +pkgname=xmlada +pkgdesc='An XML parser for Ada95.' +pkgver=25.0.0 +pkgrel=1 +epoch=1 + +arch=(i686 x86_64) +url=https://github.com/AdaCore/xmlada +license=(GPL3 custom) + +makedepends=(gprbuild gcc-ada) +conflicts=($pkgname-git) + +source=("${pkgname}-${pkgver}::https://github.com/AdaCore/${pkgname}/archive/refs/tags/v$pkgver.tar.gz" + expose-cargs-and-largs-makefile.patch) + +sha256sums=(dbb5984a0931311c7a787a679ef4cfaeeedd357474a585dc170140ef2251dcca + 7543e5fa8f2b0b400b937b0b3bb27b46b263a3cd7b17f00f6f9c6b3905729610) + +_xmlada_src=$pkgname-$pkgver + +prepare() +{ + cd $srcdir/$_xmlada_src + + patch -Np0 -i $srcdir/expose-cargs-and-largs-makefile.patch +} + + +build() +{ + cd $srcdir/$_xmlada_src + + ./configure --prefix=/usr \ + --libexecdir=/lib \ + --enable-shared \ + --enable-build=Production + + # Rid flags not used by Ada. + # + CFLAGS="${CFLAGS//-Wformat}" + CFLAGS="${CFLAGS//-Werror=format-security}" + + # Make using a single job (-j1) to avoid the same file being compiled at the same time. + # + make -j1 GPRBUILD_OPTIONS=-R +} + + +package() +{ + cd $srcdir/$_xmlada_src + + # Make one install at a time to avoid GPRinstall reading/writing to + # the same installed project files at the same time. + # + make -j1 prefix=$pkgdir/usr install + + # Install the licenses. + # + install -D -m644 \ + COPYING3 \ + $pkgdir/usr/share/licenses/$pkgname/COPYING3 + + # Install the custom license. + install -D -m644 \ + COPYING.RUNTIME \ + $pkgdir/usr/share/licenses/$pkgname/COPYING.RUNTIME +} diff --git a/expose-cargs-and-largs-makefile.patch b/expose-cargs-and-largs-makefile.patch new file mode 100644 index 0000000..8cbe752 --- /dev/null +++ b/expose-cargs-and-largs-makefile.patch @@ -0,0 +1,28 @@ +--- Makefile.in-orig 2022-09-28 16:33:19.000000000 +1000 ++++ Makefile.in 2022-11-15 21:15:27.002332097 +1100 +@@ -68,14 +68,22 @@ + install: install-clean install-static + endif + ++ifneq ($(strip $(CFLAGS)),) ++CARGS := -cargs $(CFLAGS) ++endif ++ ++ifneq ($(strip $(LDFLAGS)),) ++LARGS := -largs $(LDFLAGS) ++endif ++ + static: +- ${GPRBUILD} -p -XLIBRARY_TYPE=static ${GPROPTS} xmlada.gpr ${GPROPTS_EXTRA} ++ ${GPRBUILD} -p -XLIBRARY_TYPE=static ${GPROPTS} xmlada.gpr ${GPROPTS_EXTRA} $(CARGS) $(LARGS) + + shared relocatable: +- ${GPRBUILD} -p -XLIBRARY_TYPE=relocatable ${GPROPTS} xmlada.gpr ${GPROPTS_EXTRA} ++ ${GPRBUILD} -p -XLIBRARY_TYPE=relocatable ${GPROPTS} xmlada.gpr ${GPROPTS_EXTRA} $(CARGS) $(LARGS) + + static-pic: +- ${GPRBUILD} -p -XLIBRARY_TYPE=static-pic ${GPROPTS} xmlada.gpr ${GPROPTS_EXTRA} ++ ${GPRBUILD} -p -XLIBRARY_TYPE=static-pic ${GPROPTS} xmlada.gpr ${GPROPTS_EXTRA} $(CARGS) $(LARGS) + + # Rebuild the tests (and not the XML/Ada code itself) + test: force