Skip to content

Commit

Permalink
Add libdir to autotools builds
Browse files Browse the repository at this point in the history
This ensures that the libraries are installed at /usr/lib/TRIPLET
  • Loading branch information
sergio-costas committed Feb 10, 2023
1 parent 2e1850f commit 27bf4f0
Showing 1 changed file with 23 additions and 12 deletions.
35 changes: 23 additions & 12 deletions snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ parts:
build-environment: &buildenv
- ACLOCAL_PATH: $CRAFT_STAGE/usr/share/aclocal
- XDG_DATA_DIRS: $CRAFT_STAGE/usr/share:/usr/share
- LD_LIBRARY_PATH: $CRAFT_STAGE/usr/lib/vala-0.56:$CRAFT_STAGE/usr/lib:$CRAFT_STAGE/usr/lib/$CRAFT_ARCH_TRIPLET${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
- LD_LIBRARY_PATH: $CRAFT_STAGE/usr/lib/$CRAFT_ARCH_TRIPLET/vala-0.56:$CRAFT_STAGE/usr/lib/$CRAFT_ARCH_TRIPLET:$CRAFT_STAGE/usr/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
- GDK_PIXBUF_MODULE_FILE: $CRAFT_STAGE/usr/lib/$CRAFT_ARCH_TRIPLET/gdk-pixbuf-2.0/2.10.0/loaders.cache
- PKG_CONFIG_PATH: $CRAFT_STAGE/usr/lib/$CRAFT_ARCH_TRIPLET/pkgconfig:$CRAFT_STAGE/usr/lib/pkgconfig:$CRAFT_STAGE/usr/share/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}
- CRAFT_EXT_CORE_LEVEL: core22
Expand Down Expand Up @@ -73,7 +73,9 @@ parts:
source: https://git.savannah.gnu.org/git/libtool.git
source-tag: 'v2.4.7'
plugin: autotools
autotools-configure-parameters: [ --prefix=/usr ]
autotools-configure-parameters:
- --prefix=/usr
- --libdir=\${exec_prefix}/lib/$CRAFT_ARCH_TRIPLET
build-environment: *buildenv
build-packages:
- help2man
Expand Down Expand Up @@ -205,7 +207,9 @@ parts:
source: https://gitlab.gnome.org/GNOME/vala.git
source-tag: '0.56.3'
plugin: autotools
autotools-configure-parameters: [ --prefix=/usr ]
autotools-configure-parameters:
- --prefix=/usr
- --libdir=\${exec_prefix}/lib/$CRAFT_ARCH_TRIPLET
build-environment: *buildenv
build-packages:
- autoconf-archive
Expand All @@ -218,7 +222,9 @@ parts:
source-tag: '0.20.6'
source-depth: 1
plugin: autotools
autotools-configure-parameters: [ --prefix=/usr ]
autotools-configure-parameters:
- --prefix=/usr
- --libdir=\${exec_prefix}/lib/$CRAFT_ARCH_TRIPLET
build-environment: *buildenv
override-build: |
set -eux
Expand Down Expand Up @@ -327,8 +333,8 @@ parts:
sed -i 's#libdir=/usr#libdir=${prefix}#' $PC
sed -i 's#includedir=/usr#includedir=${prefix}#' $PC
done
for f in `find $CRAFT_PART_INSTALL/usr/$CRAFT_ARCH_TRIPLETlib |grep \\.la`; do
sed -i "s#^libdir='/usr/lib#libdir='$CRAFT_STAGE/usr/lib#g" $f
for f in `find $CRAFT_PART_INSTALL/usr/lib/$CRAFT_ARCH_TRIPLET |grep \\.la`; do
sed -i "s#^libdir='/usr/lib#libdir='$CRAFT_STAGE/usr/lib/$CRAFT_ARCH_TRIPLET#g" $f
done
build-packages:
Expand Down Expand Up @@ -395,6 +401,7 @@ parts:
plugin: autotools
autotools-configure-parameters:
- --prefix=/usr
- --libdir=\${exec_prefix}/lib/$CRAFT_ARCH_TRIPLET
- --enable-introspection=yes
- --enable-vala=yes
- --enable-pixbuf-loader
Expand Down Expand Up @@ -508,7 +515,9 @@ parts:
# same-minor: true
source-depth: 1
plugin: autotools
autotools-configure-parameters: [ --prefix=/usr ]
autotools-configure-parameters:
- --prefix=/usr
- --libdir=\${exec_prefix}/lib/$CRAFT_ARCH_TRIPLET
build-environment: *buildenv
build-packages:
- gtk-doc-tools
Expand Down Expand Up @@ -803,7 +812,7 @@ parts:
build-environment:
- ACLOCAL_PATH: $CRAFT_STAGE/usr/share/aclocal
- XDG_DATA_DIRS: $CRAFT_STAGE/usr/share:/usr/share
- LD_LIBRARY_PATH: $CRAFT_STAGE/usr/lib/vala-0.56${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
- LD_LIBRARY_PATH: $CRAFT_STAGE/usr/lib/$CRAFT_ARCH_TRIPLET/vala-0.56${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
- GDK_PIXBUF_MODULE_FILE: $CRAFT_STAGE/usr/lib/$CRAFT_ARCH_TRIPLET/gdk-pixbuf-2.0/2.10.0/loaders.cache
- M4PATH: $CRAFT_STAGE/usr/lib/glibmm-2.4/proc/m4
override-build: |
Expand All @@ -829,7 +838,7 @@ parts:
build-environment:
- ACLOCAL_PATH: $CRAFT_STAGE/usr/share/aclocal
- XDG_DATA_DIRS: $CRAFT_STAGE/usr/share:/usr/share
- LD_LIBRARY_PATH: $CRAFT_STAGE/usr/lib/$CRAFT_ARCH_TRIPLET:$CRAFT_STAGE/usr/lib/vala-0.56${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
- LD_LIBRARY_PATH: $CRAFT_STAGE/usr/lib/$CRAFT_ARCH_TRIPLET:$CRAFT_STAGE/usr/lib/$CRAFT_ARCH_TRIPLET/vala-0.56${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
- GDK_PIXBUF_MODULE_FILE: $CRAFT_STAGE/usr/lib/$CRAFT_ARCH_TRIPLET/gdk-pixbuf-2.0/2.10.0/loaders.cache
- M4PATH: $CRAFT_STAGE/usr/lib/glibmm-2.4/proc/m4

Expand All @@ -848,7 +857,7 @@ parts:
build-environment:
- ACLOCAL_PATH: $CRAFT_STAGE/usr/share/aclocal
- XDG_DATA_DIRS: $CRAFT_STAGE/usr/share:/usr/share
- LD_LIBRARY_PATH: $CRAFT_STAGE/usr/lib/vala-0.56:$CRAFT_STAGE/usr/lib:$CRAFT_STAGE/usr/lib/$CRAFT_ARCH_TRIPLET${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
- LD_LIBRARY_PATH: $CRAFT_STAGE/usr/lib/$CRAFT_ARCH_TRIPLET/vala-0.56:$CRAFT_STAGE/usr/lib:$CRAFT_STAGE/usr/lib/$CRAFT_ARCH_TRIPLET${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
- GDK_PIXBUF_MODULE_FILE: $CRAFT_STAGE/usr/lib/$CRAFT_ARCH_TRIPLET/gdk-pixbuf-2.0/2.10.0/loaders.cache
- M4PATH: $CRAFT_STAGE/usr/lib/glibmm-2.4/proc/m4
override-build: |
Expand Down Expand Up @@ -901,6 +910,7 @@ parts:
plugin: autotools
autotools-configure-parameters:
- --prefix=/usr
- --libdir=\${exec_prefix}/lib/$CRAFT_ARCH_TRIPLET
- --with-builtin=pulse
build-environment: *buildenv
build-packages:
Expand Down Expand Up @@ -972,6 +982,7 @@ parts:
plugin: autotools
autotools-configure-parameters:
- --prefix=/usr
- --libdir=\${exec_prefix}/lib/$CRAFT_ARCH_TRIPLET
- --enable-wayland-egl-platform=yes
- --enable-kms-egl-platform=yes
- --enable-introspection=yes
Expand Down Expand Up @@ -1472,10 +1483,10 @@ parts:
XML2_CONFIG=usr/bin/xml2-config
sed -i 's#/root/parts/debs/install#/snap/gnome-42-2204-sdk/current#g' $XML2_CONFIG
rm -f usr/lib/vala-current
rm -f usr/lib/$CRAFT_ARCH_TRIPLET/vala-current
rm -f usr/share/gettext-current
rm -f usr/lib/$CRAFT_ARCH_TRIPLET/gdk-pixbuf-current
ln -s vala-0.56 usr/lib/vala-current
ln -s vala-0.56 usr/lib/$CRAFT_ARCH_TRIPLET/vala-current
ln -s gettext-0.19.8 usr/share/gettext-current
ln -s gdk-pixbuf-2.0/2.10.0 usr/lib/$CRAFT_ARCH_TRIPLET/gdk-pixbuf-current
Expand Down

0 comments on commit 27bf4f0

Please sign in to comment.