Skip to content

Commit

Permalink
Update librsvg to version 2.59.1
Browse files Browse the repository at this point in the history
This change requires using meson, and also to avoid snapcraft
adding $CRAFT_STAGE to the `prefix` part in librsvg-2.0.pc,
since now that .pc file is position-independent thanks to the
use of ${pcfiledir}.

Also some changes to the libgweather patch had to be added to
enable it to build.
  • Loading branch information
sergio-costas committed Jan 16, 2025
1 parent 0f79e38 commit 224dd6f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 13 deletions.
2 changes: 1 addition & 1 deletion patches/libgweather.diff
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ index c4d6445a..9cec37cf 100644
output: '@[email protected]',
install: true,
install_dir: pkglibdir,
+ env: ['LD_LIBRARY_PATH=/usr/lib:/usr/lib/$CRAFT_ARCH_TRIPLET'],
+ env: ['LD_LIBRARY_PATH=CRAFT_ENV_REPLACE'],
)

install_data('Locations.xml',
37 changes: 25 additions & 12 deletions snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -351,27 +351,39 @@ parts:
- libtiff-dev

librsvg:
after: [ gdk-pixbuf, vala ]
after: [ gdk-pixbuf, vala, meson-deps ]
source: https://gitlab.gnome.org/GNOME/librsvg.git
source-tag: '2.58.5' # they left the odd->unstable even->stable scheme, and now all tags are stable
source-tag: '2.59.1' # they left the odd->unstable even->stable scheme, and now all tags are stable
# ext:updatesnap
# version-format:
# no-9x-revisions: true
source-depth: 1
plugin: autotools
autotools-configure-parameters:
plugin: meson
meson-parameters:
- --prefix=/usr
- --enable-introspection=yes
- --enable-vala=yes
- --enable-pixbuf-loader
- -Doptimization=3
- -Ddebug=true
- -Dintrospection=enabled
- -Dvala=enabled
- -Dpixbuf=enabled
- -Dpixbuf-loader=enabled
- -Ddocs=disabled
- -Dtests=false
build-environment: *buildenv
build-packages:
- cargo
- libssl-dev
- curl
override-pull: |
craftctl default
# cargo version in .deb is too old
curl https://sh.rustup.rs -sSf > cargo.sh
sh ./cargo.sh -y
export PATH=$PATH:$HOME/.cargo/bin
~/.cargo/bin/cargo install cargo-c
cp ~/.cargo/bin/* /usr/local/bin
override-stage: |
set -eux
craftctl default
# snapcraft is adding twice $CRAFT_STAGE
cp -a $CRAFT_STAGE/$CRAFT_STAGE/* $CRAFT_STAGE/
sed -i 's#prefix=$CRAFT_STAGE${pcfiledir}#prefix=${pcfiledir}#' $CRAFT_STAGE/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/pkgconfig/librsvg-2.0.pc
epoxy:
after: [ librsvg, meson-deps ]
Expand Down Expand Up @@ -1235,7 +1247,7 @@ parts:
override-pull: |
craftctl default
patch -p1 < $CRAFT_PROJECT_DIR/patches/libgweather.diff
sed -i 's#CRAFT_ENV_REPLACE#/usr/lib:/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR#' $CRAFT_PART_SRC/data/meson.build
sed -i "s#CRAFT_ENV_REPLACE#/usr/lib:/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR:$CRAFT_STAGE/usr/lib:$CRAFT_STAGE/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR#" $CRAFT_PART_SRC/data/meson.build
build-packages:
- gir1.2-glib-2.0

Expand Down Expand Up @@ -1526,6 +1538,7 @@ parts:
for PC in $(find . -path "*/pkgconfig/*.pc")
do
sed -i 's#prefix=$CRAFT_STAGE${pcfiledir}#prefix=${pcfiledir}#' $PC
sed -i 's#prefix=$CRAFT_STAGE#prefix=/snap/gnome-46-2404-sdk/current#' $PC
sed -i 's#prefix = /usr#prefix=/snap/gnome-46-2404-sdk/current/usr#' $PC
sed -i 's#prefix=/usr#prefix=/snap/gnome-46-2404-sdk/current/usr#' $PC
Expand Down

0 comments on commit 224dd6f

Please sign in to comment.