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

fix: minor plug-in and extension errors from logs #318

Merged
merged 2 commits into from
Jan 13, 2025
Merged
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
19 changes: 12 additions & 7 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ environment:
LD_LIBRARY_PATH: $SNAP/lib:$SNAP/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR:$SNAP/gnome-platform/usr/lib:$SNAP/gnome-platform/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR:$SNAP/usr/lib:$SNAP/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR:$SNAP/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/lapack:$SNAP/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/blas:$SNAP/npu-libs
# Ensure the gmic plugin can correctly locate the QT plugins
QT_PLUGIN_PATH: $SNAP/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/qt6/plugins
GIMP3_LOCALEDIR: $SNAP/usr/share/locale
# Lua goat exercise considered unstable upstream: https://gitlab.gnome.org/GNOME/gimp/-/commit/78665ca3723f723ac313fdaeef5b62d41ab6b48d
# The extension will fail on GIMP startup but commenting these lines avoids the risk of a nasty crash loop
#LUA_PATH: $SNAP/usr/share/lua/5.1/?.lua;$SNAP/usr/share/lua/5.1/lgi/?.lua;$SNAP/usr/share/lua/5.1/lgi/override/?.lua
#LUA_CPATH: $SNAP/usr/lib/x86_64-linux-gnu/lua/5.1/?.so

apps:
gimp:
Expand Down Expand Up @@ -245,17 +250,17 @@ parts:
- poppler-data
override-stage: |
# fix gimp python interpreters file
cat <<EOF > $CRAFT_PART_INSTALL/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/gimp/2.99/interpreters/pygimp.interp
python=/snap/"${SNAPCRAFT_PROJECT_NAME}"/current/usr/bin/python3
python3=/snap/"${SNAPCRAFT_PROJECT_NAME}"/current/usr/bin/python3
/usr/bin/python=/snap/"${SNAPCRAFT_PROJECT_NAME}"/current/usr/bin/python3
/usr/bin/python3=/snap/"${SNAPCRAFT_PROJECT_NAME}"/current/usr/bin/python3
cat <<EOF > ${CRAFT_PART_INSTALL}/usr/lib/${CRAFT_ARCH_TRIPLET_BUILD_FOR}/gimp/2.99/interpreters/pygimp.interp
python=/usr/bin/python3
python3=/usr/bin/python3
/usr/bin/python=/usr/bin/python3
/usr/bin/python3=/usr/bin/python3
:Python:E::py::python3:
EOF
# update gimp's plugin search path so it will pick up plugins mounted over snapd's content interface
current_path=$(grep "# (plug-in-path" ${CRAFT_PART_INSTALL}/etc/gimp/2.99/gimprc | cut -d '"' -f2)
add_dir=/snap/"${SNAPCRAFT_PROJECT_NAME}"/current/openvino-ai-plugins-gimp/gimp-plugins
echo "(plug-in-path \"${current_path}:${add_dir}\")" >> $CRAFT_PART_INSTALL/etc/gimp/2.99/gimprc
add_dir=/snap/${SNAPCRAFT_PROJECT_NAME}/current/openvino-ai-plugins-gimp/gimp-plugins
echo "(plug-in-path \"${current_path}:${add_dir}\")" >> ${CRAFT_PART_INSTALL}/etc/gimp/2.99/gimprc
craftctl default

command-chain-openvino:
Expand Down