Skip to content

Commit

Permalink
Merge pull request #318 from frenchwr/2.99-openvino
Browse files Browse the repository at this point in the history
fix: minor plug-in and extension errors from logs
  • Loading branch information
jnsgruk authored Jan 13, 2025
2 parents f07eada + f5da54c commit 1be96f2
Showing 1 changed file with 12 additions and 7 deletions.
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

0 comments on commit 1be96f2

Please sign in to comment.