blob: b7e3e25c3d8c8b79f6b90ab4360fce32558aba4f [file] [log] [blame] [edit]
# Maintainer: Jürgen Pfeifer <juergen@familiepfeifer.de>
# Contributor: Tim S <stahta01@gmail.com>
_realname=gprbuild
pkgbase=mingw-w64-${_realname}
pkgname=${MINGW_PACKAGE_PREFIX}-${_realname}
_gh_release=21.0.0
pkgver=20${_gh_release}
pkgrel=3
pkgdesc="Software tool designed to help automate the construction of multi-language systems (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64')
replaces=("${MINGW_PACKAGE_PREFIX}-gprbuild-gpl")
license=('GPL3')
url="https://github.com/AdaCore/gprbuild/"
makedepends=("${MINGW_PACKAGE_PREFIX}-gcc-ada"
"${MINGW_PACKAGE_PREFIX}-xmlada"
"${MINGW_PACKAGE_PREFIX}-gprbuild-bootstrap-git")
conflicts=("${MINGW_PACKAGE_PREFIX}-gprbuild-bootstrap")
source=("gprbuild-${_gh_release}.tar.gz::https://github.com/AdaCore/gprbuild/archive/v${_gh_release}.tar.gz"
"gprconfig_kb-${_gh_release}.tar.gz::https://github.com/AdaCore/gprconfig_kb/archive/v${_gh_release}.tar.gz"
"0001-remove-binder-option.patch")
sha256sums=('54b7d1a3298160109aaee4d8c263c1ab3ab4abae75d354f3e90a4c51639167a2'
'2aec26afad5bb1a4685d9c041c9c797ff5beda211a5e81f2a97452d2ceabc557'
'b3cbf68cdd1e5dfa48ad87a4e0cf85b50cdc806d43380d37026382a9eea58d7b')
prepare() {
cd "${srcdir}/gprbuild-${_gh_release}/"
# Apply patch to remove binder -E option. This option makes exception
# propagation crash with msys2's GNAT.
patch -p0 -i "${srcdir}/0001-remove-binder-option.patch"
# GPRbuild hard-codes references to ${MINGW_PREFIX}/libexec, but MINGW packages
# must use ${MINGW_PREFIX}/lib instead.
sed -i "s|libexec|lib|g" doinstall gprbuild.gpr \
"${srcdir}/gprconfig_kb-${_gh_release}/db/compilers.xml" \
"${srcdir}/gprconfig_kb-${_gh_release}/db/linker.xml" \
"${srcdir}/gprconfig_kb-${_gh_release}/db/gnat.xml"
build_date=$(date '+%Y%m%d')
release_year=$(echo ${pkgver} | cut -d. -f1)
# Set version information
sed -i "s/18.0w/${pkgver}/" gpr/src/gpr-version.ads
sed -i "s/19940713/${build_date}/" gpr/src/gpr-version.ads
sed -i "s/2016/${release_year}/" gpr/src/gpr-version.ads
sed -i "s/:= Gnatpro;/:= FSF;/" gpr/src/gpr-version.ads
}
build() {
cd "${srcdir}/gprbuild-${_gh_release}/"
rm -f makefile.setup
make SOURCE_DIR="$PWD" prefix="${MINGW_PREFIX}" PROCESSORS="$(nproc)" setup
make
}
package() {
cd "${srcdir}/gprbuild-${_gh_release}/"
make prefix="${pkgdir}${MINGW_PREFIX}" INSTALL=cp install
# Copy License Files
install -Dm644 -t "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/" COPYING*
# Copy gprconfig knowledge base
install -Dm644 -t "${pkgdir}${MINGW_PREFIX}/share/gprconfig" "${srcdir}/gprconfig_kb-${_gh_release}"/db/*
}