Skip to content

Commit

Permalink
libadalang: update to 24.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
MehdiChinoune committed Mar 19, 2024
1 parent af4d41a commit 87a50bd
Showing 1 changed file with 52 additions and 34 deletions.
86 changes: 52 additions & 34 deletions mingw-w64-libadalang/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,57 +3,75 @@
_realname=libadalang
pkgbase=mingw-w64-${_realname}
pkgname=${MINGW_PACKAGE_PREFIX}-${_realname}
pkgver=23.0.0
pkgrel=3
pkgver=24.0.0
pkgrel=1

pkgdesc="Library for parsing and semantic analysis of Ada code (mingw-w64)"
arch=('any')
mingw_arch=('mingw64' 'ucrt64')
url="https://github.com/AdaCore/libadalang/"
url="https://github.com/AdaCore/libadalang"
msys2_references=(
'aur: libadalang'
'gentoo: dev-ada/libadalang'
)
license=('spdx:GPL-3.0-or-later with GCC-exception-3.1')
makedepends=("${MINGW_PACKAGE_PREFIX}-gprbuild")
depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs"
"${MINGW_PACKAGE_PREFIX}-gcc-ada"
"${MINGW_PACKAGE_PREFIX}-gnatcoll"
"${MINGW_PACKAGE_PREFIX}-libgpr"
"${MINGW_PACKAGE_PREFIX}-langkit_support"
"${MINGW_PACKAGE_PREFIX}-libiconv"
"${MINGW_PACKAGE_PREFIX}-gmp")
source=("https://github.com/AdaCore/libadalang/releases/download/v${pkgver}/libadalang-${pkgver}.tar.gz")
sha256sums=('7bc210f7a8015512b75ef4a149f804aa4fae13e82c93755d94ca004533be803f')

_library_types="static static-pic relocatable"
license=('spdx:Apache-2.0 WITH LLVM-exception')
makedepends=("${MINGW_PACKAGE_PREFIX}-gprbuild"
"${MINGW_PACKAGE_PREFIX}-langkit"
"${MINGW_PACKAGE_PREFIX}-python-build"
"${MINGW_PACKAGE_PREFIX}-python-docutils"
"${MINGW_PACKAGE_PREFIX}-python-e3-core"
"${MINGW_PACKAGE_PREFIX}-python-funcy"
"${MINGW_PACKAGE_PREFIX}-python-installer"
"${MINGW_PACKAGE_PREFIX}-python-mako"
"${MINGW_PACKAGE_PREFIX}-python-setuptools"
"${MINGW_PACKAGE_PREFIX}-python-sphinx"
"${MINGW_PACKAGE_PREFIX}-python-wheel")
depends=("${MINGW_PACKAGE_PREFIX}-gcc-ada"
"${MINGW_PACKAGE_PREFIX}-gcc-libs"
"${MINGW_PACKAGE_PREFIX}-gnatcoll-core"
"${MINGW_PACKAGE_PREFIX}-gnatcoll-gmp"
"${MINGW_PACKAGE_PREFIX}-gnatcoll-iconv"
"${MINGW_PACKAGE_PREFIX}-gpr"
"${MINGW_PACKAGE_PREFIX}-langkit_support")
options=('!strip')
source=("https://github.com/AdaCore/libadalang/archive/v${pkgver}/${_realname}-${pkgver}.tar.gz")
sha256sums=('418a6086cf5e790f66491ec78ae6979ef6e2dff3071b2c09d3f2dbd002471488')

_library_types="static,static-pic,relocatable"
_build_mode="prod"

build() {
[[ -d "${srcdir}"/build-${MSYSTEM} ]] && rm -rf "${srcdir}"/build-${MSYSTEM}
cp -r "${srcdir}/${_realname}-${pkgver}" "${srcdir}"/build-${MSYSTEM}
cd "${srcdir}"/build-${MSYSTEM}

for _library_type in ${_library_types}; do
echo "Building ${_library_type}:"
gprbuild -p -P libadalang.gpr \
-j"$(nproc)" \
-XBUILD_MODE="${_build_mode}" \
-XLIBRARY_TYPE="${_library_type}" \
--relocate-build-tree="${_library_type}"
done
${MINGW_PREFIX}/bin/python manage.py generate

${MINGW_PREFIX}/bin/python manage.py build \
--library-types=${_library_types} \
--build-mode=${_build_mode} \
--disable-java \
--gargs="-R"

cd build/python
${MINGW_PREFIX}/bin/python -m build --wheel --skip-dependency-check --no-isolation
}

package() {
cd "${srcdir}"/build-${MSYSTEM}

for _library_type in ${_library_types}; do
echo "Installing ${_library_type}:"
gprinstall -p -P libadalang.gpr \
--prefix="${pkgdir}${MINGW_PREFIX}" \
-XBUILD_MODE="${_build_mode}" \
-XLIBRARY_TYPE="${_library_type}" \
--relocate-build-tree="${_library_type}" \
--build-var=LIBRARY_TYPE \
--build-name="${_library_type}"
done
# Install the Ada library with its C binding
${MINGW_PREFIX}/bin/python manage.py install \
--library-types=${_library_types} \
--build-mode=${_build_mode} \
"$pkgdir/${MINGW_PREFIX}"

# Install the Python binding
cd build/python
MSYS2_ARG_CONV_EXCL="--prefix=" \
${MINGW_PREFIX}/bin/python -m installer --prefix=${MINGW_PREFIX} \
--destdir="${pkgdir}" dist/*.whl

install -Dm644 -t "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}" \
"${srcdir}/${_realname}-${pkgver}/LICENSE.txt"
}

0 comments on commit 87a50bd

Please sign in to comment.