Skip to content

Commit

Permalink
librsvg: rename gdk-pixbuf module
Browse files Browse the repository at this point in the history
Works around an issue where GIMP doesn't detect the module if it doesn't have
that exact name.
  • Loading branch information
mmuetzel committed Nov 16, 2024
1 parent d37ed7d commit bde68b0
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions mingw-w64-librsvg/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}"
"${MINGW_PACKAGE_PREFIX}-${_realname}-docs")
pkgver=2.59.2
pkgrel=1
pkgrel=2
pkgdesc="SVG rendering library (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64')
Expand Down Expand Up @@ -42,24 +42,35 @@ sha256sums=('ecd293fb0cc338c170171bbc7bcfbea6725d041c95f31385dc935409933e4597'
msys2_repository_url="https://gitlab.gnome.org/GNOME/librsvg"
noextract=("${_realname}-${pkgver}.tar.xz")

apply_patch_with_msg() {
for _patch in "$@"
do
msg2 "Applying ${_patch}"
patch -Nbp1 -i "${srcdir}/${_patch}"
done
}

prepare() {
bsdtar -xf "${_realname}-${pkgver}.tar.xz" 2>/dev/null || true

# Patch bug in glib rust bindings
# See: https://github.com/gtk-rs/gtk-rs-core/pull/1199
# Version of glib-rs should match what is in librsvg Cargo.lock
cd "${srcdir}/glib-0.20.0"
patch -p1 -i "${srcdir}/glib-rs.patch"
apply_patch_with_msg \
glib-rs.patch

cd "${srcdir}/${_realname}-${pkgver}"

if [[ ${MINGW_PACKAGE_PREFIX} == *-clang-* ]]; then
# https://github.com/msys2/MINGW-packages/issues/21017
patch -p1 -i "${srcdir}/0002-avoid-link-whole.patch"
apply_patch_with_msg \
0002-avoid-link-whole.patch
fi

# fails to link for the static build, so skip for now
patch -p1 -i "${srcdir}/0004-add-option-for-disabling-convert.patch"
apply_patch_with_msg \
0004-add-option-for-disabling-convert.patch

echo "" >> Cargo.toml
echo "[patch.crates-io]" >> Cargo.toml
Expand Down Expand Up @@ -110,6 +121,9 @@ package_librsvg() {
meson install -C "build-${MSYSTEM}-static" --destdir "${pkgdir}"
meson install -C "build-${MSYSTEM}" --destdir "${pkgdir}"

_gdk_module_dir="$(cygpath.exe -u $(pkg-config.exe --variable=gdk_pixbuf_moduledir gdk-pixbuf-2.0))"
mv "${pkgdir}${_gdk_module_dir}/pixbufloader_svg.dll" "${pkgdir}${_gdk_module_dir}/libpixbufloader-svg.dll"

install -Dm644 "${srcdir}/${_realname}-${pkgver}/COPYING.LIB" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/COPYING.LIB"

mkdir -p dest${MINGW_PREFIX}/share
Expand Down

0 comments on commit bde68b0

Please sign in to comment.