Skip to content

Commit

Permalink
feat: re-enable and update gmic
Browse files Browse the repository at this point in the history
  • Loading branch information
jnsgruk committed Jan 6, 2025
1 parent 35122b9 commit e5049a3
Showing 1 changed file with 65 additions and 53 deletions.
118 changes: 65 additions & 53 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ parts:
- libexif-dev
- libexpat1-dev
- libfftw3-dev
- libgexiv2-2
- libgexiv2-dev
- libgpm-dev
- libice-dev
- libluajit-5.1-dev
Expand Down Expand Up @@ -193,7 +193,7 @@ parts:
- libbz2-1.0
- libexif12
- libfftw3-bin
- libgexiv2-dev
- libgexiv2-2
- libgpm2
- libheif1
- libluajit-5.1-2
Expand All @@ -218,55 +218,67 @@ parts:
- mypaint-data
- poppler-data

# TODO(jnsgruk): Re-enable once compatibility is restored with GIMP 3.0
# gmic:
# after: [gimp]
# plugin: nil
# override-pull: |
# VERSION="v.3.4.2"
# git clone -b "$VERSION" https://github.com/GreycLab/gmic.git
# git clone -b "$VERSION" https://github.com/GreycLab/CImg.git
# git clone -b "$VERSION" https://github.com/c-koi/gmic-qt.git
gmic:
after: [gimp]
plugin: dump
source: https://gmic.eu/files/source/gmic_3.5.0.tar.gz
build-environment:
- QT_SELECT: qt6
build-packages:
- cmake
- pkg-config
- qt6-base-dev
- qt6-l10n-tools
- qt6-tools-dev
- qt6-wayland-dev
- qtchooser
- wget
stage-packages:
- libcurl4
- libdouble-conversion3
- libfftw3-bin
- libffi8
- libgraphicsmagick-q16-3
- libgraphicsmagick++-q16-12
- libjpeg-turbo8
- libopencv-core406t64
- libopencv-highgui406t64
- libopencv-video406t64
- libopenexr-3-1-30
- libpng16-16
- libqt6core6t64
- libqt6gui6t64
- libqt6network6t64
- libqt6widgets6t64
- qt6-wayland
override-build: |
qtchooser -install qt6 "$(which qmake6)" || true
make -C src CImg.h gmic_stdlib_community.h
cd gmic-qt
# The CMakeLists.txt file hard-codes a minimum QT6 version of 6.5.0, which is not available
# in Noble. Testing confirms that things seem to work fine on the version in Noble (6.4.2).
sed -i "s|set(MIN_QT_VERSION 6.5.0)|set(MIN_QT_VERSION 6.4.0)|g" CMakeLists.txt
mkdir build
cd build
cmake \
-DGMIC_QT_HOST=gimp3 \
-DGMIC_PATH=$CRAFT_PART_SRC/src \
-DCMAKE_BUILD_TYPE=Release \
-DENABLE_SYSTEM_GMIC=OFF \
-DBUILD_WITH_QT6=ON \
..
make
install -Dm 0755 $CRAFT_PART_BUILD/gmic-qt/build/gmic_gimp_qt \
$CRAFT_PART_INSTALL/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/gimp/3.0/plug-ins/gmic_gimp_qt/gmic_gimp_qt
# # Force this extra online fetch to happen during the pull phase.
# # This build takes a long time on Launchpad, and if we wait until
# # the build phase, by the time we get there the proxy token has
# # expired - so force it to happen here.
# wget -qO gmic/src/gmic_stdlib_community.h "https://gmic.eu/gmic_stdlib_community$(echo "${VERSION}" | tr -d "v.").h"
# build-environment:
# - QT_SELECT: qt6
# build-packages:
# - pkg-config
# - qmake6-bin
# - qt6-base-dev
# - qt6-l10n-tools
# - qt6-tools-dev
# - qt6-wayland-dev
# - qtchooser
# - wget
# stage-packages:
# - libcurl4
# - libdouble-conversion3
# - libfftw3-bin
# - libffi8
# - libgraphicsmagick-q16-3
# - libgraphicsmagick++-q16-12
# - libjpeg-turbo8
# - libopencv-core406t64
# - libopencv-highgui406t64
# - libopencv-video406t64
# - libopenexr-3-1-30
# - libpng16-16
# - libqt6core6t64
# - libqt6gui6t64
# - libqt6network6t64
# - libqt6widgets6t64
# - qt6-wayland
# override-build: |
# qtchooser -install qt6 "$(which qmake6)" || true
# make -C gmic/src CImg.h gmic_stdlib_community.h
# cd gmic-qt
# qmake HOST=gimp3
# make
# install -Dm 0755 $CRAFT_PART_BUILD/gmic-qt/gmic_gimp_qt \
# $CRAFT_PART_INSTALL/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/gimp/3.0/plug-ins/gmic_gimp_qt/gmic_gimp_qt
cleanup:
after: [gmic]
source: https://github.com/canonical/gpu-snap.git
plugin: dump
override-prime: |
craftctl default
${CRAFT_PART_SRC}/bin/gpu-2404-cleanup mesa-2404

0 comments on commit e5049a3

Please sign in to comment.