Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set necessary env for system gtk themes to work and clean up content interfaces #97

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 21 additions & 24 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,27 +37,30 @@ layout:
bind: $SNAP/usr/share/mypaint-data

plugs:
## DISABLED (1 of 4) because gtk2-common-themes only available on amd64
# gtk-2-engines:
# interface: content
# target: $SNAP/lib/gtk-2.0
# default-provider: gtk2-common-themes
gtk-2-engines:
interface: content
target: $SNAP/lib/gtk-2.0
default-provider: gtk2-common-themes
gtk-2-themes:
interface: content
target: $SNAP/share/themes
default-provider: gtk2-common-themes
gtk-3-themes:
default-provider: gtk-common-themes:gtk-3-themes
interface: content
target: $SNAP/data-dir/themes
default-provider: gtk-common-themes
sound-themes:
default-provider: gtk-common-themes:sound-themes
interface: content
target: $SNAP/data-dir/sounds
default-provider: gtk-common-themes
gnome-3-28-1804:
default-provider: gnome-3-28-1804:gnome-3-28-1804
interface: content
target: $SNAP/gnome-platform
default-provider: gnome-3-28-1804
icon-themes:
default-provider: gtk-common-themes:icon-themes
interface: content
target: $SNAP/data-dir/icons
default-provider: gtk-common-themes

slots:
dbus-gimp:
Expand All @@ -81,6 +84,9 @@ environment:
LD_LIBRARY_PATH: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/lapack:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/blas:$LD_LIBRARY_PATH
PYTHONPATH: $SNAP/usr/lib/python2.7:$SNAP/usr/lib/python2.7/site-packages:$PYTHONPATH
FINAL_BINARY: $SNAP/usr/bin/gimp
GTK_PATH: $SNAP/lib/gtk-2.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this break GTK3?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it looks like the symlinks created in the gnome-extension part should be adjusted so we don't need to set GTK_PATH or GTK3 will be inoperable. (Line 170 and 171)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also see the GTK3 version linking into the platform snap on 167 and 168 for inspiration :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this break GTK3?

I don't think GTK3 uses GTK_PATH.

GTK_DATA_PREFIX: $SNAP
XDG_DATA_DIRS: $SNAP/share:$XDG_DATA_DIRS

apps:
gimp:
Expand Down Expand Up @@ -138,16 +144,10 @@ parts:
gnome-extension:
after: [patches]
build-packages:
- libgail-dev
- libgtk-3-dev
- libgtk2.0-dev
stage-packages:
- appmenu-gtk2-module
- gtk2-engines
- gtk2-engines-pixbuf
- libatk-adaptor
- libcanberra-gtk-module
- libgail-common
- libgtk2.0-0
- libgtk2.0-bin
- unity-gtk2-module
Expand All @@ -169,10 +169,9 @@ parts:
# Make GTK2 available via GTK_EXE_PREFIX expansion instead of GTK_PATH
mv $SNAPCRAFT_PART_INSTALL/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/gtk-2.0 \
$SNAPCRAFT_PART_INSTALL/usr/lib/gtk-2.0
## DISABLED (2 of 4) because gtk2-common-themes only available on amd64
# # Make GTK2 engines available from content snap via GTK_EXE_PREFIX expansion
# ln -sf ../../../../lib/gtk-2.0/2.10.0/engines \
# $SNAPCRAFT_PART_INSTALL/usr/lib/gtk-2.0/2.10.0/
# Make GTK2 engines available from content snap via GTK_EXE_PREFIX expansion
ln -sf ../../../../lib/gtk-2.0/2.10.0/engines \
$SNAPCRAFT_PART_INSTALL/usr/lib/gtk-2.0/2.10.0/

patches:
source: patches
Expand Down Expand Up @@ -618,8 +617,7 @@ parts:
- core18
- gnome-3-28-1804
- gtk-common-themes
## DISABLED (3 of 4) because gtk2-common-themes only available on amd64
# - gtk2-common-themes
- gtk2-common-themes
override-prime: |
set -eux
cd /snap/core18/current
Expand All @@ -628,6 +626,5 @@ parts:
find . -type f,l -exec rm -f $SNAPCRAFT_PRIME/{} \;
cd /snap/gtk-common-themes/current
find . -type f,l -exec rm -f $SNAPCRAFT_PRIME/usr/{} \;
## DISABLED (4 of 4) because gtk2-common-themes only available on amd64
# cd /snap/gtk2-common-themes/current/lib
# find . -type f,l -exec rm -f $SNAPCRAFT_PRIME/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/{} \;
cd /snap/gtk2-common-themes/current/lib
find . -type f,l -exec rm -f $SNAPCRAFT_PRIME/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/{} \;