122 lines
4.8 KiB
Bash
122 lines
4.8 KiB
Bash
# Maintainer: Alexey Pavlov <alexpux@gmail.com>
|
|
# Maintainer: Ray Donnelly <mingw.android@gmail.com>
|
|
|
|
_realname=gobject-introspection
|
|
pkgbase=mingw-w64-${_realname}
|
|
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}"
|
|
"${MINGW_PACKAGE_PREFIX}-${_realname}-runtime")
|
|
pkgver=1.86.0
|
|
pkgrel=2
|
|
arch=('any')
|
|
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64')
|
|
url="https://gi.readthedocs.io/"
|
|
msys2_repository_url="https://gitlab.gnome.org/GNOME/gobject-introspection"
|
|
license=("spdx:LGPL-2.0-only")
|
|
makedepends=("${MINGW_PACKAGE_PREFIX}-cc"
|
|
"${MINGW_PACKAGE_PREFIX}-glib2"
|
|
"${MINGW_PACKAGE_PREFIX}-libffi"
|
|
"${MINGW_PACKAGE_PREFIX}-meson"
|
|
"${MINGW_PACKAGE_PREFIX}-pkgconf"
|
|
"${MINGW_PACKAGE_PREFIX}-python"
|
|
"${MINGW_PACKAGE_PREFIX}-python-mako"
|
|
"${MINGW_PACKAGE_PREFIX}-python-markdown"
|
|
"${MINGW_PACKAGE_PREFIX}-python-setuptools")
|
|
source=(https://download.gnome.org/sources/gobject-introspection/${pkgver%.*}/${_realname}-${pkgver}.tar.xz
|
|
0002-relocate-tools.patch
|
|
0022-change-pkg-config-invocations.mingw.patch
|
|
0024-Support-passing-arguments-to-g-ir-scanner-through-a-.all.patch
|
|
0026-giscanner-assertions-and-waits.patch
|
|
pyscript2exe.py)
|
|
|
|
sha256sums=('920d1a3fcedeadc32acff95c2e203b319039dd4b4a08dd1a2dfd283d19c0b9ae'
|
|
'26152a13e391a5cf49968c1b852c81f4979c8ad7c2c21a9dfd0febc9135bbbda'
|
|
'89224a8bae7256c68dbac5007717b622f39bd5b3a0db2b96ff07d9a17572e169'
|
|
'594a067618922f10bdc5034f290f49d36944df3b970c9604381e2b9058a648da'
|
|
'5b13c3571ef9ccceb96b4add46f907a1f099d3da5819e8cc5fbf5e8aab5f5da3'
|
|
'3c65bc3dd7337877e14b19bc7c42918bde664a11a860cfc0b9db891f8a1052db')
|
|
|
|
prepare() {
|
|
cd "${srcdir}"/${_realname}-${pkgver}
|
|
|
|
patch -p1 -i "${srcdir}"/0002-relocate-tools.patch
|
|
patch -p1 -i "${srcdir}"/0022-change-pkg-config-invocations.mingw.patch
|
|
patch -p1 -i "${srcdir}"/0024-Support-passing-arguments-to-g-ir-scanner-through-a-.all.patch
|
|
patch -p1 -i "${srcdir}"/0026-giscanner-assertions-and-waits.patch
|
|
}
|
|
|
|
build() {
|
|
mkdir -p "${srcdir}/build-${MSYSTEM}" && cd "${srcdir}/build-${MSYSTEM}"
|
|
|
|
MSYS2_ARG_CONV_EXCL="--prefix=" \
|
|
${MINGW_PREFIX}/bin/meson setup \
|
|
--prefix="${MINGW_PREFIX}" \
|
|
--buildtype=plain \
|
|
-Ddoctool=enabled \
|
|
-Dcairo=disabled \
|
|
"../${_realname}-${pkgver}"
|
|
|
|
GI_SCANNER_DISABLE_CACHE=1 ${MINGW_PREFIX}/bin/meson compile
|
|
}
|
|
|
|
package_gobject-introspection() {
|
|
pkgdesc="Introspection system for GObject-based libraries (mingw-w64)"
|
|
depends=("${MINGW_PACKAGE_PREFIX}-gobject-introspection-runtime=${pkgver}"
|
|
"${MINGW_PACKAGE_PREFIX}-gettext-runtime"
|
|
"${MINGW_PACKAGE_PREFIX}-glib2"
|
|
"${MINGW_PACKAGE_PREFIX}-libffi"
|
|
"${MINGW_PACKAGE_PREFIX}-python"
|
|
"${MINGW_PACKAGE_PREFIX}-python-mako"
|
|
"${MINGW_PACKAGE_PREFIX}-python-markdown"
|
|
"${MINGW_PACKAGE_PREFIX}-python-setuptools")
|
|
options=('!emptydirs')
|
|
|
|
cd "${srcdir}/build-${MSYSTEM}"
|
|
|
|
DESTDIR="${pkgdir}" ${MINGW_PREFIX}/bin/meson install
|
|
|
|
local _PRE_WIN="$(cygpath -m ${MINGW_PREFIX})"
|
|
for name in g-ir-scanner g-ir-doc-tool g-ir-annotation-tool; do
|
|
${MINGW_PREFIX}/bin/python3 \
|
|
"${srcdir}/pyscript2exe.py" "${pkgdir}${MINGW_PREFIX}/bin/${name}"
|
|
done
|
|
|
|
for pcfile in "${pkgdir}${MINGW_PREFIX}"/lib/pkgconfig/*.pc; do
|
|
sed -s "s|${_PRE_WIN}/lib/libffi|\${prefix}/lib/libffi|g" -i "${pcfile}"
|
|
# we create an .exe launcher for g-ir-scanner, so adjust here too
|
|
sed -s "s|/g-ir-scanner|/g-ir-scanner.exe|g" -i "${pcfile}"
|
|
done
|
|
|
|
rm "${pkgdir}${MINGW_PREFIX}/bin/libgirepository"*.dll
|
|
rm "${pkgdir}${MINGW_PREFIX}/lib/libgirepository"*.a
|
|
rm -R "${pkgdir}${MINGW_PREFIX}/lib/girepository-1.0"
|
|
|
|
MSYS2_ARG_CONV_EXCL="-p" \
|
|
python -m compileall -o 0 -o 1 -q -s"${pkgdir}" -p"/" "${pkgdir}${MINGW_PREFIX}/lib"
|
|
}
|
|
|
|
package_gobject-introspection-runtime() {
|
|
pkgdesc="Introspection system for GObject-based libraries - runtime files (mingw-w64)"
|
|
depends=("${MINGW_PACKAGE_PREFIX}-glib2"
|
|
"${MINGW_PACKAGE_PREFIX}-libffi")
|
|
|
|
cd "${srcdir}/build-${MSYSTEM}"
|
|
local tmp_install="$(pwd)/_temp"
|
|
|
|
DESTDIR="${tmp_install}" meson install
|
|
|
|
install -Dt "${pkgdir}${MINGW_PREFIX}/bin" "${tmp_install}${MINGW_PREFIX}/bin/libgirepository"*.dll
|
|
install -Dt "${pkgdir}${MINGW_PREFIX}/lib" "${tmp_install}${MINGW_PREFIX}/lib/libgirepository"*.a
|
|
install -Dt "${pkgdir}${MINGW_PREFIX}/lib/girepository-1.0" "${tmp_install}${MINGW_PREFIX}/lib/girepository-1.0/"*.typelib
|
|
}
|
|
|
|
# template start; name=mingw-w64-splitpkg-wrappers; version=1.0;
|
|
# vim: set ft=bash :
|
|
|
|
# generate wrappers
|
|
for _name in "${pkgname[@]}"; do
|
|
_short="package_${_name#${MINGW_PACKAGE_PREFIX}-}"
|
|
_func="$(declare -f "${_short}")"
|
|
eval "${_func/#${_short}/package_${_name}}"
|
|
done
|
|
# template end;
|