diff --git a/.build-trigger.txt b/.build-trigger.txt deleted file mode 100644 index 7ec0e34..0000000 --- a/.build-trigger.txt +++ /dev/null @@ -1,20 +0,0 @@ -2018-07-16-09:48:50 -2018-08-07-09:01:15 -2018-08-16-11:10:44 -2018-08-31-08:12:32 -2018-09-17-08:07:57 -2018-09-20-06:37:41 -2018-09-20-10:23:19 -2018-09-21-06:44:42 -2018-10-09-07:40:53 -2018-11-01-09:49:25 -2018-12-07-10:44:12 -2019-02-02-10:09:08 -2019-05-23-08:14:29 -2019-06-20-08:37:04 -2020-08-28-09:47:14 -2020-09-03-09:51:36 -2020-09-18-09:50:36 -2020-12-04-09:35:58 -2020-12-09-10:24:33 -2021-02-26-08:47:58 diff --git a/.github/dependabot.yaml b/.github/dependabot.yaml new file mode 100644 index 0000000..169e893 --- /dev/null +++ b/.github/dependabot.yaml @@ -0,0 +1,7 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + # Check for updates to GitHub Actions every month + interval: "monthly" diff --git a/snap/local/slots-declaration.json b/.github/slot-declaration.json similarity index 100% rename from snap/local/slots-declaration.json rename to .github/slot-declaration.json diff --git a/.github/workflows/build-prs.yml b/.github/workflows/build-prs.yml deleted file mode 100644 index 40ef8fd..0000000 --- a/.github/workflows/build-prs.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Build Pull Requests - -on: -- pull_request - -jobs: - snapcraft-build: - runs-on: ubuntu-latest - strategy: - matrix: - architecture: - - amd64 - # - armhf - - arm64 - steps: - - uses: actions/checkout@v2 - - uses: docker/setup-qemu-action@v1 - with: - image: tonistiigi/binfmt@sha256:df15403e06a03c2f461c1f7938b171fda34a5849eb63a70e2a2109ed5a778bde - - uses: diddlesnaps/snapcraft-multiarch-action@v1 - id: build - with: - architecture: ${{ matrix.architecture }} - - uses: diddlesnaps/snapcraft-review-tools-action@v1 - with: - snap: ${{ steps.build.outputs.snap }} - slots: ./snap/local/slots-declaration.json diff --git a/.github/workflows/promote-to-stable.yml b/.github/workflows/promote-to-stable.yml new file mode 100644 index 0000000..b316aa8 --- /dev/null +++ b/.github/workflows/promote-to-stable.yml @@ -0,0 +1,27 @@ +name: Promote to `preview/stable` + +on: + issue_comment: + types: + - created + +permissions: + issues: write + +jobs: + promote: + name: ⬆️ Promote to preview/stable + environment: "Preview Candidate Branch" + runs-on: ubuntu-latest + if: | + ( !github.event.issue.pull_request ) + && contains(github.event.comment.body, '/promote ') + && contains(github.event.comment.body, 'preview/stable') + && contains(github.event.*.labels.*.name, 'testing') + steps: + - name: ⬆️ Promote to preview/stable + uses: snapcrafters/ci/promote-to-stable@main + with: + channel: preview/stable + github-token: ${{ secrets.GITHUB_TOKEN }} + store-token: ${{ secrets.SNAP_STORE_STABLE }} diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml new file mode 100644 index 0000000..6d41ef4 --- /dev/null +++ b/.github/workflows/pull-request.yml @@ -0,0 +1,18 @@ +name: Pull Request + +on: + pull_request: + branches: ["preview/candidate"] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build: + name: 🧪 Build snap on amd64 + runs-on: self-hosted + timeout-minutes: 1440 + steps: + - name: 🧪 Build snap on amd64 + uses: snapcrafters/ci/test-snap-build@main diff --git a/.github/workflows/release-to-candidate.yaml b/.github/workflows/release-to-candidate.yaml new file mode 100644 index 0000000..ccb4702 --- /dev/null +++ b/.github/workflows/release-to-candidate.yaml @@ -0,0 +1,77 @@ +name: Release + +on: + # Run the workflow each time new commits are pushed to the candidate branch. + push: + branches: ["preview/candidate"] + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + contents: read + issues: write + +jobs: + get-architectures: + name: 🖥 Get snap architectures + runs-on: ubuntu-latest + outputs: + architectures: ${{ steps.get-architectures.outputs.architectures }} + architectures-list: ${{ steps.get-architectures.outputs.architectures-list }} + steps: + - name: 🖥 Get snap architectures + id: get-architectures + uses: snapcrafters/ci/get-architectures@main + + release: + name: 🚢 Release to preview/candidate + needs: get-architectures + runs-on: self-hosted + timeout-minutes: 1440 + environment: "Preview Candidate Branch" + strategy: + matrix: + architecture: ${{ fromJSON(needs.get-architectures.outputs.architectures-list) }} + steps: + - name: 🚢 Release to preview/candidate + uses: snapcrafters/ci/release-to-candidate@main + with: + architecture: ${{ matrix.architecture }} + channel: preview/candidate + launchpad-token: ${{ secrets.LP_BUILD_SECRET }} + repo-token: ${{ secrets.SNAPCRAFTERS_BOT_COMMIT }} + store-token: ${{ secrets.SNAP_STORE_CANDIDATE }} + + call-for-testing: + name: 📣 Create call for testing + needs: [release, get-architectures] + environment: "Preview Candidate Branch" + runs-on: ubuntu-latest + outputs: + issue-number: ${{ steps.issue.outputs.issue-number }} + steps: + - name: 📣 Create call for testing + id: issue + uses: snapcrafters/ci/call-for-testing@main + with: + architectures: ${{ needs.get-architectures.outputs.architectures }} + channel: preview/candidate + github-token: ${{ secrets.GITHUB_TOKEN }} + promotion-channel: preview/stable + + screenshots: + name: 📸 Gather screenshots + needs: call-for-testing + environment: "Preview Candidate Branch" + runs-on: self-hosted + steps: + - name: 📸 Gather screenshots + uses: snapcrafters/ci/get-screenshots@main + with: + channel: preview/candidate + issue-number: ${{ needs.call-for-testing.outputs.issue-number }} + github-token: ${{ secrets.GITHUB_TOKEN }} + screenshots-token: ${{ secrets.SNAPCRAFTERS_BOT_COMMIT }} diff --git a/.github/workflows/sync-version-with-upstream.yml b/.github/workflows/sync-version-with-upstream.yml new file mode 100644 index 0000000..37a6574 --- /dev/null +++ b/.github/workflows/sync-version-with-upstream.yml @@ -0,0 +1,28 @@ +name: Update preview + +on: + # Runs at 10:00 UTC every day + schedule: + - cron: '0 10 * * *' + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + sync: + name: 🔄 Sync version with upstream + environment: "Preview Candidate Branch" + runs-on: ubuntu-latest + steps: + - name: 🔄 Sync version with upstream + uses: snapcrafters/ci/sync-version@main + with: + branch: preview/candidate + token: ${{ secrets.SNAPCRAFTERS_BOT_COMMIT }} + update-script: | + VERSION=$(curl -s https://www.gimp.org/downloads/devel/ | grep -Po "The current development release of GIMP is \K[^<]+") + sed -i 's/^\(version: \).*$/\1'"$VERSION"'/' snap/snapcraft.yaml + diff --git a/.gitignore b/.gitignore index bf52e32..7c78cb5 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,7 @@ prime __pycache__ *.pyc -.bzr \ No newline at end of file +.bzr + +# Snapcraft remote-build logs +gimp_*.txt \ No newline at end of file diff --git a/README.md b/README.md index 144e3ad..9438d9d 100644 --- a/README.md +++ b/README.md @@ -8,65 +8,80 @@ distributions.

-Snap Status +Snap Status + + +

## Install - sudo snap install gimp +```shell +snap install gimp --channel preview/stable +``` ([Don't have snapd installed?](https://snapcraft.io/docs/core/install)) -![GIMP](screenshot.png?raw=true "GIMP") -

Published for with :gift_heart: by Snapcrafters

-## Remaining tasks - -Snapcrafters ([join us](https://forum.snapcraft.io/t/join-snapcrafters/1325)) -are working to land snap install documentation and -the [snapcraft.yaml](https://github.com/snapcrafters/fork-and-rename-me/blob/master/snap/snapcraft.yaml) -upstream so GIMP can authoritatively publish future releases. - - - [x] Fork the [Snapcrafters template](https://github.com/snapcrafters/fork-and-rename-me) repository to your own GitHub account. - - If you have already forked the Snapcrafter template to your account and want to create another snap, you'll need to use GitHub's [Import repository](https://github.com/new/import) feature because you can only fork a repository once. - - [x] Rename the forked Snapcrafters template repository - - [x] Update logos and references to `[Project]` and `[my-snap-name]` - - [x] Create a snap that runs in `devmode` - - [x] Register the snap in the store, **using the preferred upstream name** - - [x] Add a screenshot to this `README.md` - - [x] Publish the `devmode` snap in the Snap store edge channel - - [x] Add install instructions to this `README.md` - - [x] Update snap store metadata, icons and screenshots - - [x] Convert the snap to `strict` confinement, or `classic` confinement if it qualifies - - [x] Publish the confined snap in the Snap store beta channel - - [x] Update the install instructions in this `README.md` - - [x] Post a call for testing on the [Snapcraft Forum](https://forum.snapcraft.io) - [link](https://forum.snapcraft.io/t/call-for-testing-gimp/1281) - - [x] Ask a [Snapcrafters admin](https://github.com/orgs/snapcrafters/people?query=%20role%3Aowner) to fork your repo into github.com/snapcrafters, transfer the snap name from you to snapcrafters, and configure the repo for automatic publishing into edge on commit - - [x] Add the provided Snapcraft build badge to this `README.md` - - [x] Publish the snap in the Snap store stable channel - - [x] Update the install instructions in this `README.md` - - [x] Post an announcement in the [Snapcraft Forum](https://forum.snapcraft.io) - [link](https://forum.snapcraft.io/t/gimp-snap-pushed-to-stable-channel/1619) - - [ ] Submit a pull request or patch upstream that adds snap install documentation - [link]() - - [ ] Submit a pull request or patch upstream that adds the `snapcraft.yaml` and any required assets/launchers - [link]() - - [ ] Add upstream contact information to the `README.md` - - If upstream accept the PR: - - [ ] Request upstream create a Snap store account - - [ ] Contact the Snap Advocacy team to request the snap be transferred to upstream - - [ ] Ask the Snap Advocacy team to celebrate the snap - [link]() - -If you have any questions, [post in the Snapcraft forum](https://forum.snapcraft.io). - -## The Snapcrafters - -| [![Dani Llewellyn](https://gravatar.com/avatar/c77d9922c44ee0a34b8cabc4029b5082/?s=128)](https://github.com/diddledani/) | -| :---: | -| [Dani Llewellyn](https://github.com/diddledani/) | - - +## How to contribute to this snap + +Thanks for your interest! Below you find instructions to help you contribute to this snap. + +The general workflow is to submit pull requests that merges your changes into the `candidate` branch here on GitHub. Once the pull request has been merged, a GitHub action will automatically build the snap and publish it to the `candidate` channel in the Snap Store. Once the snap has been tested thoroughly, we promote it to the `stable` channel so all our users get it! + +### Initial setup + +If this is your first time contributing to this snap, you first need to set up your own fork of this repository. + +1. [Fork the repository](https://docs.github.com/en/github/getting-started-with-github/fork-a-repo) into your own GitHub namespace. +2. [Clone your fork](https://git-scm.com/book/en/v2/Git-Basics-Getting-a-Git-Repository), so that you have it on your local computer. +3. Configure your local repo. To make things a bit more intuitive, we will rename your fork's remote to `myfork`, and add the snapcrafters repo as `snapcrafters`. + + ```shell + git remote rename origin myfork + git remote add snapcrafters https://github.com/snapcrafters/gimp.git + git fetch --all + ``` + +### Submitting changes in a pull request + +Once you're all setup for contributing, keep in mind that you want the git information to be all up-to-date. So if you haven't "fetched" all changes in a while, start with that: + +```shell +git fetch --all -p +``` + +Now that your git metadata has been updated you are ready to create a bugfix branch, make your changes, and open a pull request. + +1. All pull requests should go to the stable branch so create your branch as a copy of the stable branch: + + ```shell + git checkout -b my-bugfix-branch snapcrafters/candidate + ``` + +2. Make your desired changes and build a snap locally for testing: + + ```shell + snapcraft --use-lxd + ``` + +3. After you are happy with your changes, commit them and push them to your fork so they are available on GitHub: + + ```shell + git commit -a + git push -u myfork my-bugfix-branch + ``` + +4. Then, [open up a pull request](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-requests) from your `my-bugfix-branch` to the `snapcrafters/candidate` branch. +5. Once you've opened the pull request, it will automatically trigger the build-test action that will launch a build of the snap. You can watch the progress of the snap build from your pull request (Show all checks -> Details). Once the snap build has completed, you can find the built snap (to test with) under "Artifacts". +6. Someone from the team will review the open pull request and either merge it or start a discussion with you with additional changes or clarification needed. +7. Once the pull request has been merged into the stable branch, a GitHub action will rebuild the snap using your changes and publish it to the [Snap Store](https://snapcraft.io/gimp) into the `candidate` channel. After sufficient testing of the snap from the candidate channel, one of the maintainers or administrators will promote the snap to the stable branch in the Snap Store. + +## Maintainers + +- [@lucyllewy](https://github.com/lucyllewy/) + +## License + +- The license of both the build files in this repository is [MIT](https://github.com/snapcrafters/gimp/blob/main/LICENSE) diff --git a/desktop-launch/Makefile b/desktop-launch/Makefile deleted file mode 100644 index 5205b1e..0000000 --- a/desktop-launch/Makefile +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/make -f - -SRC_DIR ?= . - -DATA_DIR := $(DESTDIR)/data-dir -BIN_DIR := $(DESTDIR)/snap/command-chain -LIB_DIR := $(DESTDIR)/lib -DEST_LAUNCHER := desktop-launch -LOCALE_GENERATOR := locale-gen -BINDTEXTDOMAIN := bindtextdomain.so - -build: $(DEST_LAUNCHER) - -clean: - rm -f $(DEST_LAUNCHER) - rm -f $(BINDTEXTDOMAIN) - -$(DEST_LAUNCHER): - @cat $(SRC_DIR)/common/init > $(DEST_LAUNCHER) - @tail -n +2 $(SRC_DIR)/common/desktop-exports >> $(DEST_LAUNCHER) - @tail -n +2 $(SRC_DIR)/gnome/launcher-specific >> $(DEST_LAUNCHER) - @tail -n +2 $(SRC_DIR)/kde-neon/launcher-specific >> $(DEST_LAUNCHER) - @tail -n +2 $(SRC_DIR)/common/mark-and-exec >> $(DEST_LAUNCHER) - gcc -Wall -O2 -o $(BINDTEXTDOMAIN) -fPIC -shared $(SRC_DIR)/src/bindtextdomain.c -ldl - -install: $(DEST_LAUNCHER) - install -d $(DATA_DIR) - install -d $(DATA_DIR)/gnome-platform - install -d $(DATA_DIR)/kf5 - install -d $(DATA_DIR)/icons - install -d $(DATA_DIR)/sounds - install -d $(DATA_DIR)/themes - install -D -m755 $(DEST_LAUNCHER) "$(BIN_DIR)"/$(DEST_LAUNCHER) - install -D -m755 kde-neon/$(LOCALE_GENERATOR) "$(BIN_DIR)"/$(LOCALE_GENERATOR) - install -D -m644 $(BINDTEXTDOMAIN) "$(LIB_DIR)"/$(BINDTEXTDOMAIN) diff --git a/desktop-launch/common/desktop-exports b/desktop-launch/common/desktop-exports deleted file mode 100644 index 8bb896c..0000000 --- a/desktop-launch/common/desktop-exports +++ /dev/null @@ -1,346 +0,0 @@ -#!/bin/bash -############################################### -# Launcher common exports for any desktop app # -############################################### - -# Note: We avoid using `eval` because we don't want to expand variable names -# in paths. For example: LD_LIBRARY_PATH paths might contain `$LIB`. -function prepend_dir() { - local -n var="$1" - local dir="$2" - # We can't check if the dir exists when the dir contains variables - if [[ "$dir" == *"\$"* || -d "$dir" ]]; then - export "${!var}=${dir}${var:+:$var}" - fi -} - -function append_dir() { - local -n var="$1" - local dir="$2" - # We can't check if the dir exists when the dir contains variables - if [[ "$dir" == *"\$"* || -d "$dir" ]]; then - export "${!var}=${var:+$var:}${dir}" - fi -} - -function can_open_file() { - [ -f "$1" ] && [ -r "$1" ] -} - -function update_xdg_dirs_values() { - local save_initial_values=false - local XDG_DIRS="DOCUMENTS DESKTOP DOWNLOAD MUSIC PICTURES VIDEOS PUBLICSHARE TEMPLATES" - unset XDG_SPECIAL_DIRS_PATHS - - if [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/user-dirs.dirs" ]; then - # shellcheck source=/dev/null - source "${XDG_CONFIG_HOME:-$HOME/.config}/user-dirs.dirs" - fi - - if [ -z ${XDG_SPECIAL_DIRS+x} ]; then - save_initial_values=true - fi - - for d in $XDG_DIRS; do - var="XDG_${d}_DIR" - value="${!var}" - - if [ "$save_initial_values" = true ]; then - XDG_SPECIAL_DIRS+=("$var") - XDG_SPECIAL_DIRS_INITIAL_PATHS+=("$value") - fi - - XDG_SPECIAL_DIRS_PATHS+=("$value") - done -} - -function is_subpath() { - dir="$(realpath "$1")" - parent="$(realpath "$2")" - [ "${dir##$parent/}" != "$dir" ] && return 0 || return 1 -} - -append_dir LD_LIBRARY_PATH "$SNAP_DESKTOP_RUNTIME/lib/$ARCH" -append_dir LD_LIBRARY_PATH "$SNAP_DESKTOP_RUNTIME/usr/lib/$ARCH" -append_dir LD_LIBRARY_PATH "$SNAP_DESKTOP_RUNTIME/usr/lib" -append_dir LD_LIBRARY_PATH "$SNAP_DESKTOP_RUNTIME/lib" -append_dir PATH "$SNAP_DESKTOP_RUNTIME/usr/bin" - -# XKB config -export XKB_CONFIG_ROOT="$SNAP_DESKTOP_RUNTIME/usr/share/X11/xkb" - -# Give XOpenIM a chance to locate locale data. -# This is required for text input to work in SDL2 games. -export XLOCALEDIR="$SNAP_DESKTOP_RUNTIME/usr/share/X11/locale" - -# Set XCursors path -export XCURSOR_PATH="$SNAP_DESKTOP_RUNTIME/usr/share/icons" -prepend_dir XCURSOR_PATH "$SNAP/data-dir/icons" - -# Mesa Libs for OpenGL support -append_dir LD_LIBRARY_PATH "$SNAP_DESKTOP_RUNTIME/usr/lib/$ARCH/mesa" -append_dir LD_LIBRARY_PATH "$SNAP_DESKTOP_RUNTIME/usr/lib/$ARCH/mesa-egl" - -# Tell libGL and libva where to find the drivers -export LIBGL_DRIVERS_PATH="$SNAP_DESKTOP_RUNTIME/usr/lib/$ARCH/dri" -append_dir LD_LIBRARY_PATH "$LIBGL_DRIVERS_PATH" -export LIBVA_DRIVERS_PATH="$SNAP_DESKTOP_RUNTIME/usr/lib/$ARCH/dri" - -# Workaround in snapd for proprietary nVidia drivers mounts the drivers in -# /var/lib/snapd/lib/gl that needs to be in LD_LIBRARY_PATH -# Without that OpenGL using apps do not work with the nVidia drivers. -# Ref.: https://bugs.launchpad.net/snappy/+bug/1588192 -append_dir LD_LIBRARY_PATH "/var/lib/snapd/lib/gl" - -# Unity7 export (workaround for https://launchpad.net/bugs/1638405) -append_dir LD_LIBRARY_PATH "$SNAP_DESKTOP_RUNTIME/usr/lib/$ARCH/libunity" - -# Pulseaudio export -append_dir LD_LIBRARY_PATH "$SNAP_DESKTOP_RUNTIME/usr/lib/$ARCH/pulseaudio" - -# EGL vendor files on glvnd enabled systems -[ -d /var/lib/snapd/lib/glvnd/egl_vendor.d ] && \ - append_dir __EGL_VENDOR_LIBRARY_DIRS "/var/lib/snapd/lib/glvnd/egl_vendor.d" - -# Tell GStreamer where to find its plugins -export GST_PLUGIN_PATH="$SNAP/usr/lib/$ARCH/gstreamer-1.0" -export GST_PLUGIN_SYSTEM_PATH="$SNAP_DESKTOP_RUNTIME/usr/lib/$ARCH/gstreamer-1.0" -# gst plugin scanner doesn't install in the correct path: https://github.com/ubuntu/snapcraft-desktop-helpers/issues/43 -export GST_PLUGIN_SCANNER="$SNAP_DESKTOP_RUNTIME/usr/lib/$ARCH/gstreamer1.0/gstreamer-1.0/gst-plugin-scanner" - -# XDG Config -prepend_dir XDG_CONFIG_DIRS "$SNAP_DESKTOP_RUNTIME/etc/xdg" -prepend_dir XDG_CONFIG_DIRS "$SNAP/etc/xdg" - -# Define snaps' own data dir -prepend_dir XDG_DATA_DIRS "$SNAP_DESKTOP_RUNTIME/usr/share" -prepend_dir XDG_DATA_DIRS "$SNAP/usr/share" -prepend_dir XDG_DATA_DIRS "$SNAP/share" -prepend_dir XDG_DATA_DIRS "$SNAP/data-dir" -prepend_dir XDG_DATA_DIRS "$SNAP_USER_DATA" - -# Set XDG_DATA_HOME to local path -export XDG_DATA_HOME="$SNAP_USER_DATA/.local/share" -ensure_dir_exists "$XDG_DATA_HOME" - -# Workaround for GLib < 2.53.2 not searching for schemas in $XDG_DATA_HOME: -# https://bugzilla.gnome.org/show_bug.cgi?id=741335 -prepend_dir XDG_DATA_DIRS "$XDG_DATA_HOME" - -# Set cache folder to local path -export XDG_CACHE_HOME="$SNAP_USER_COMMON/.cache" -if [[ -d "$SNAP_USER_DATA/.cache" && ! -e "$XDG_CACHE_HOME" ]]; then - # the .cache directory used to be stored under $SNAP_USER_DATA, migrate it - mv "$SNAP_USER_DATA/.cache" "$SNAP_USER_COMMON/" -fi -ensure_dir_exists "$XDG_CACHE_HOME" - -# Create $XDG_RUNTIME_DIR if not exists (to be removed when LP: #1656340 is fixed) -# shellcheck disable=SC2174 -ensure_dir_exists "$XDG_RUNTIME_DIR" -m 700 - -# Ensure the app finds locale definitions (requires locales-all to be installed) -append_dir LOCPATH "$SNAP_DESKTOP_RUNTIME/usr/lib/locale" - -# If any, keep track of where XDG dirs were so we can potentially migrate the content later -update_xdg_dirs_values - -# Setup user-dirs.* or run xdg-user-dirs-update if needed -needs_xdg_update=false -needs_xdg_reload=false -needs_xdg_links=false - -if [ "$HOME" != "$SNAP_USER_DATA" ] && ! is_subpath "$XDG_CONFIG_HOME" "$HOME"; then - for f in user-dirs.dirs user-dirs.locale; do - if [ -f "$HOME/.config/$f" ]; then - mv "$HOME/.config/$f" "$XDG_CONFIG_HOME" - needs_xdg_reload=true - fi - done -fi - -if can_open_file "$REALHOME/.config/user-dirs.dirs"; then - # shellcheck disable=SC2154 - if [ "$needs_update" = true ] || [ "$needs_xdg_reload" = true ]; then - sed "/^#/!s#\$HOME#${REALHOME}#g" "$REALHOME/.config/user-dirs.dirs" > "$XDG_CONFIG_HOME/user-dirs.dirs" - md5sum < "$REALHOME/.config/user-dirs.dirs" > "$XDG_CONFIG_HOME/user-dirs.dirs.md5sum" - # It's possible user-dirs.dirs exists when user-dirs.locale doesn't. This - # simply means the user opted to never ask to translate their user dirs - if can_open_file "$REALHOME/.config/user-dirs.locale"; then - cp -a "$REALHOME/.config/user-dirs.locale" "$XDG_CONFIG_HOME" - md5sum < "$REALHOME/.config/user-dirs.locale" > "$XDG_CONFIG_HOME/user-dirs.locale.md5sum" - elif [ -f "$XDG_CONFIG_HOME/user-dirs.locale.md5sum" ]; then - rm "$XDG_CONFIG_HOME/user-dirs.locale.md5sum" - fi - needs_xdg_reload=true - fi -else - needs_xdg_update=true - needs_xdg_links=true -fi - -if [ $needs_xdg_reload = true ]; then - update_xdg_dirs_values - needs_xdg_reload=false -fi - -# Check if we can actually read the contents of each xdg dir -for ((i = 0; i < ${#XDG_SPECIAL_DIRS_PATHS[@]}; i++)); do - if ! can_open_file "${XDG_SPECIAL_DIRS_PATHS[$i]}"; then - needs_xdg_update=true - needs_xdg_links=true - break - fi -done - -# If needs XDG update and xdg-user-dirs-update exists in $PATH, run it -if [ "$needs_xdg_update" = true ] && command -v xdg-user-dirs-update >/dev/null; then - xdg-user-dirs-update - update_xdg_dirs_values -fi - -# Create links for user-dirs.dirs -if [ "$needs_xdg_links" = true ]; then - for ((i = 0; i < ${#XDG_SPECIAL_DIRS_PATHS[@]}; i++)); do - b="$(realpath "${XDG_SPECIAL_DIRS_PATHS[$i]}" --relative-to="$HOME")" - if [[ "$b" != "." && -e "$REALHOME/$b" ]]; then - [ -d "$HOME/$b" ] && rmdir "$HOME/$b" 2> /dev/null - [ ! -e "$HOME/$b" ] && ln -s "$REALHOME/$b" "$HOME/$b" - fi - done -else - # If we aren't creating new links, check if we have content saved in old locations and move it - for ((i = 0; i < ${#XDG_SPECIAL_DIRS[@]}; i++)); do - old="${XDG_SPECIAL_DIRS_INITIAL_PATHS[$i]}" - new="${XDG_SPECIAL_DIRS_PATHS[$i]}" - if [ -L "$old" ] && [ -d "$new" ] && [ "$(readlink "$old")" != "$new" ]; then - mv -vn "$old"/* "$new"/ 2>/dev/null - elif [ -d "$old" ] && [ -d "$new" ] && [ "$old" != "$new" ] && - (is_subpath "$old" "$SNAP_USER_DATA" || is_subpath "$old" "$SNAP_USER_COMMON"); then - mv -vn "$old"/* "$new"/ 2>/dev/null - fi - done -fi - -# If detect wayland server socket, then set environment so applications prefer -# wayland, and setup compat symlink (until we use user mounts. Remember, -# XDG_RUNTIME_DIR is /run/user//snap.$SNAP so look in the parent directory -# for the socket. For details: -# https://forum.snapcraft.io/t/wayland-dconf-and-xdg-runtime-dir/186/10 -# Applications that don't support wayland natively may define DISABLE_WAYLAND -# (to any non-empty value) to skip that logic entirely. -wayland_available=false -if [[ -n "$XDG_RUNTIME_DIR" && -z "$DISABLE_WAYLAND" ]]; then - wdisplay="wayland-0" - if [ -n "$WAYLAND_DISPLAY" ]; then - wdisplay="$WAYLAND_DISPLAY" - fi - wayland_sockpath="$XDG_RUNTIME_DIR/../$wdisplay" - wayland_snappath="$XDG_RUNTIME_DIR/$wdisplay" - if [ -S "$wayland_sockpath" ]; then - # if running under wayland, use it - #export WAYLAND_DEBUG=1 - # shellcheck disable=SC2034 - wayland_available=true - # create the compat symlink for now - if [ ! -e "$wayland_snappath" ]; then - ln -s "$wayland_sockpath" "$wayland_snappath" - fi - fi -fi - -# Make PulseAudio socket available inside the snap-specific $XDG_RUNTIME_DIR -if [ -n "$XDG_RUNTIME_DIR" ]; then - pulsenative="pulse/native" - pulseaudio_sockpath="$XDG_RUNTIME_DIR/../$pulsenative" - if [ -S "$pulseaudio_sockpath" ]; then - export PULSE_SERVER="unix:${pulseaudio_sockpath}" - fi -fi - -# GI repository -prepend_dir GI_TYPELIB_PATH "$SNAP_DESKTOP_RUNTIME/usr/lib/$ARCH/girepository-1.0" -prepend_dir GI_TYPELIB_PATH "$SNAP_DESKTOP_RUNTIME/usr/lib/girepository-1.0" -prepend_dir GI_TYPELIB_PATH "$SNAP_DESKTOP_RUNTIME/usr/lib/gjs/girepository-1.0" -prepend_dir GI_TYPELIB_PATH "$SNAP/usr/lib/$ARCH/girepository-1.0" -prepend_dir GI_TYPELIB_PATH "$SNAP/usr/lib/girepository-1.0" -prepend_dir GI_TYPELIB_PATH "$SNAP/usr/lib/gjs/girepository-1.0" - -# Font Config and themes -export FONTCONFIG_PATH="$SNAP_DESKTOP_RUNTIME/etc/fonts" -export FONTCONFIG_FILE="$SNAP_DESKTOP_RUNTIME/etc/fonts/fonts.conf" - -# Build mime.cache -# needed for gtk and qt icon -if [ "$needs_update" = true ]; then - rm -rf "$XDG_DATA_HOME/mime" - if [ ! -f "$SNAP_DESKTOP_RUNTIME/usr/share/mime/mime.cache" ]; then - if command -v update-mime-database >/dev/null; then - cp --preserve=timestamps -dR "$SNAP_DESKTOP_RUNTIME/usr/share/mime" "$XDG_DATA_HOME" - async_exec update-mime-database "$XDG_DATA_HOME/mime" - fi - fi -fi - -# Gio modules and cache (including gsettings module) -export GIO_MODULE_DIR="$XDG_CACHE_HOME/gio-modules" -function compile_giomodules { - if [ -f "$1/glib-2.0/gio-querymodules" ]; then - rm -rf "$GIO_MODULE_DIR" - ensure_dir_exists "$GIO_MODULE_DIR" - ln -sf "$1"/gio/modules/*.so "$GIO_MODULE_DIR" - ln -sf $SNAP/usr/lib/x86_64-linux-gnu/gio/modules/libgvfsdbus.so "$GIO_MODULE_DIR/libgvfsdbus.so" - "$1/glib-2.0/gio-querymodules" "$GIO_MODULE_DIR" - fi -} -if [ "$needs_update" = true ]; then - async_exec compile_giomodules "$SNAP_DESKTOP_RUNTIME/usr/lib/$ARCH" -fi - -# Enable gsettings user changes -# symlink the dconf file if home plug is connected for read -DCONF_DEST_USER_DIR="$SNAP_USER_DATA/.config/dconf" -if [ ! -f "$DCONF_DEST_USER_DIR/user" ]; then - if [ -f "$REALHOME/.config/dconf/user" ]; then - ensure_dir_exists "$DCONF_DEST_USER_DIR" - ln -s "$REALHOME/.config/dconf/user" "$DCONF_DEST_USER_DIR" - fi -fi -# symlink the runtime dconf file as well -if [ -r "$XDG_RUNTIME_DIR/../dconf/user" ]; then - ensure_dir_exists "$XDG_RUNTIME_DIR/dconf" - ln -sf "../../dconf/user" "$XDG_RUNTIME_DIR/dconf/user" -fi - -# Testability support -append_dir LD_LIBRARY_PATH "$SNAP/testability" -append_dir LD_LIBRARY_PATH "$SNAP/testability/$ARCH" -append_dir LD_LIBRARY_PATH "$SNAP/testability/$ARCH/mesa" - -# Gdk-pixbuf loaders -export GDK_PIXBUF_MODULE_FILE="$XDG_CACHE_HOME/gdk-pixbuf-loaders.cache" -export GDK_PIXBUF_MODULEDIR="$SNAP_DESKTOP_RUNTIME/usr/lib/$ARCH/gdk-pixbuf-2.0/2.10.0/loaders" -if [ "$needs_update" = true ] || [ ! -f "$GDK_PIXBUF_MODULE_FILE" ]; then - rm -f "$GDK_PIXBUF_MODULE_FILE" - if [ -f "$SNAP_DESKTOP_RUNTIME/usr/lib/$ARCH/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders" ]; then - async_exec "$SNAP_DESKTOP_RUNTIME/usr/lib/$ARCH/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders" > "$GDK_PIXBUF_MODULE_FILE" - fi -fi - -# GTK theme and behavior modifier -# Those can impact the theme engine used by Qt as well -gtk_configs=(gtk-3.0/settings.ini gtk-3.0/bookmarks gtk-2.0/gtkfilechooser.ini) -for f in "${gtk_configs[@]}"; do - dest="$XDG_CONFIG_HOME/$f" - if [ ! -L "$dest" ]; then - ensure_dir_exists "$(dirname "$dest")" - ln -sf "$REALHOME/.config/$f" "$dest" - fi -done - -# create symbolic link to ibus socket path for ibus to look up its socket files -# (see comments #3 and #6 on https://launchpad.net/bugs/1580463) -IBUS_CONFIG_PATH="$XDG_CONFIG_HOME/ibus" -ensure_dir_exists "$IBUS_CONFIG_PATH" -[ -d "$IBUS_CONFIG_PATH/bus" ] && rm -rf "$IBUS_CONFIG_PATH/bus" -ln -sfn "$REALHOME/.config/ibus/bus" "$IBUS_CONFIG_PATH" diff --git a/desktop-launch/common/init b/desktop-launch/common/init deleted file mode 100644 index 243dd4a..0000000 --- a/desktop-launch/common/init +++ /dev/null @@ -1,77 +0,0 @@ -#!/bin/bash -################# -# Launcher init # -################# - -# shellcheck disable=SC2034 -START=$(date +%s.%N) - -# ensure_dir_exists calls `mkdir -p` if the given path is not a directory. -# This speeds up execution time by avoiding unnecessary calls to mkdir. -# -# Usage: ensure_dir_exists []... -# -function ensure_dir_exists() { - [ -d "$1" ] || mkdir -p "$@" -} - -declare -A PIDS -function async_exec() { - "$@" & - PIDS[$!]=$* -} -function wait_for_async_execs() { - for pid in "${!PIDS[@]}" - do - wait "$pid" && continue || echo "ERROR: ${PIDS[$pid]} exited abnormally with status $?" - done -} - -# shellcheck source=/dev/null -source "$SNAP_USER_DATA/.last_revision" 2>/dev/null || true -if [ "$SNAP_DESKTOP_LAST_REVISION" = "$SNAP_REVISION" ]; then - needs_update=false -else - needs_update=true -fi - -# Set $REALHOME to the users real home directory -REALHOME=$(getent passwd $UID | cut -d ':' -f 6) - -# Set config folder to local path -export XDG_CONFIG_HOME="$SNAP_USER_DATA/.config" -ensure_dir_exists "$XDG_CONFIG_HOME" -chmod 700 "$XDG_CONFIG_HOME" - -# If the user has modified their user-dirs settings, force an update -if [[ -f "$XDG_CONFIG_HOME/user-dirs.dirs.md5sum" ]]; then - if [[ "$(md5sum < "$REALHOME/.config/user-dirs.dirs")" != "$(cat "$XDG_CONFIG_HOME/user-dirs.dirs.md5sum")" || - ( -f "$XDG_CONFIG_HOME/user-dirs.locale.md5sum" && - "$(md5sum < "$REALHOME/.config/user-dirs.locale")" != "$(cat "$XDG_CONFIG_HOME/user-dirs.locale.md5sum")" ) ]]; then - needs_update=true - fi -else - # shellcheck disable=SC2034 - needs_update=true -fi - -if [ "$SNAP_ARCH" = "amd64" ]; then - ARCH="x86_64-linux-gnu" -elif [ "$SNAP_ARCH" = "armhf" ]; then - ARCH="arm-linux-gnueabihf" -elif [ "$SNAP_ARCH" = "arm64" ]; then - ARCH="aarch64-linux-gnu" -elif [ "$SNAP_ARCH" = "ppc64el" ]; then - ARCH="powerpc64le-linux-gnu" -else - ARCH="$SNAP_ARCH-linux-gnu" -fi - -export SNAP_LAUNCHER_ARCH_TRIPLET="$ARCH" - -# Don't LD_PRELOAD bindtextdomain for classic snaps -if ! grep -qs "^\s*confinement:\s*classic\s*" "$SNAP/meta/snap.yaml"; then - if [ -f "$SNAP/lib/bindtextdomain.so" ]; then - export LD_PRELOAD="$LD_PRELOAD:$SNAP/lib/bindtextdomain.so" - fi -fi diff --git a/desktop-launch/common/mark-and-exec b/desktop-launch/common/mark-and-exec deleted file mode 100644 index 490cebb..0000000 --- a/desktop-launch/common/mark-and-exec +++ /dev/null @@ -1,123 +0,0 @@ -#!/bin/bash -############################### -# Mark update and exec binary # -############################### - -# Keep an array of data dirs, for looping through them -IFS=':' read -r -a data_dirs_array <<< "$XDG_DATA_DIRS" - - -function make_user_fontconfig { - echo "" - if [ -d "$REALHOME/.local/share/fonts" ]; then - echo " $REALHOME/.local/share/fonts" - fi - if [ -d "$REALHOME/.fonts" ]; then - echo " $REALHOME/.fonts" - fi - for ((i = 0; i < ${#data_dirs_array[@]}; i++)); do - if [ -d "${data_dirs_array[$i]}/fonts" ]; then - echo " ${data_dirs_array[$i]}/fonts" - fi - done - echo ' conf.d' - # We need to include this default cachedir first so that caching - # works: without it, fontconfig will try to write to the real user home - # cachedir and be blocked by AppArmor. - echo ' fontconfig' - if [ -d "$REALHOME/.cache/fontconfig" ]; then - echo " $REALHOME/.cache/fontconfig" - fi - echo "" -} - -if [ "$needs_update" = true ]; then - rm -rf "$XDG_DATA_HOME"/{fontconfig,fonts,fonts-*,themes,.themes} - - # This fontconfig fragment is installed in a location that is - # included by the system fontconfig configuration: namely the - # etc/fonts/conf.d/50-user.conf file. - ensure_dir_exists "$XDG_CONFIG_HOME/fontconfig" - async_exec make_user_fontconfig > "$XDG_CONFIG_HOME/fontconfig/fonts.conf" - - # the themes symlink are needed for GTK 3.18 when the prefix isn't changed - # GTK 3.20 looks into XDG_DATA_DIRS which has connected themes. - if [ -d "$SNAP/data-dir/themes" ]; then - ln -sf "$SNAP/data-dir/themes" "$XDG_DATA_HOME" - ln -sfn "$SNAP/data-dir/themes" "$SNAP_USER_DATA/.themes" - elif [ -d "$SNAP_DESKTOP_RUNTIME/usr/share/themes" ]; then - ln -sf "$SNAP_DESKTOP_RUNTIME/usr/share/themes" "$XDG_DATA_HOME" - ln -sfn "$SNAP_DESKTOP_RUNTIME/usr/share/themes" "$SNAP_USER_DATA/.themes" - fi -fi - -# Setup compiled gsettings schema -GS_SCHEMA_DIR="$XDG_DATA_HOME/glib-2.0/schemas" -function compile_schemas { - if [ -f "$1" ]; then - rm -rf "$GS_SCHEMA_DIR" - ensure_dir_exists "$GS_SCHEMA_DIR" - for ((i = 0; i < ${#data_dirs_array[@]}; i++)); do - if [ "${data_dirs_array[$i]}" = "$XDG_DATA_HOME" ]; then - continue - fi - schema_dir="${data_dirs_array[$i]}/glib-2.0/schemas" - if [ -f "$schema_dir/gschemas.compiled" ]; then - # This directory already has compiled schemas - continue - fi - if [ -n "$(ls -A "$schema_dir"/*.xml 2>/dev/null)" ]; then - ln -sf "$schema_dir"/*.xml "$GS_SCHEMA_DIR" - fi - if [ -n "$(ls -A "$schema_dir"/*.override 2>/dev/null)" ]; then - ln -sf "$schema_dir"/*.override "$GS_SCHEMA_DIR" - fi - done - # Only compile schemas if we copied anything - if [ -n "$(ls -A "$GS_SCHEMA_DIR"/*.xml "$GS_SCHEMA_DIR"/*.override 2>/dev/null)" ]; then - "$1" "$GS_SCHEMA_DIR" - fi - fi -} -if [ "$needs_update" = true ]; then - async_exec compile_schemas "$SNAP_DESKTOP_RUNTIME/usr/lib/$ARCH/glib-2.0/glib-compile-schemas" -fi - -# Icon themes cache -if [ "$needs_update" = true ]; then - rm -rf "$XDG_DATA_HOME/icons" - ensure_dir_exists "$XDG_DATA_HOME/icons" - for ((i = 0; i < ${#data_dirs_array[@]}; i++)); do - # The runtime and theme content snaps should already contain icon caches - # so we skip them to optimise app start time. - if [[ "${data_dirs_array[$i]}" == "$SNAP/data-dir" || "${data_dirs_array[$i]}" == "$SNAP_DESKTOP_RUNTIME/"* ]]; then - continue - fi - for theme in "${data_dirs_array[$i]}"/icons/*; do - if [ -f "$theme/index.theme" ] && [ ! -f "$theme/icon-theme.cache" ]; then - theme_dir="$XDG_DATA_HOME/icons/$(basename "$theme")" - if [ ! -d "$theme_dir" ]; then - ensure_dir_exists "$theme_dir" - ln -sf "$theme"/* "$theme_dir" - if [ -f "$SNAP_DESKTOP_RUNTIME/usr/sbin/update-icon-caches" ]; then - async_exec "$SNAP_DESKTOP_RUNTIME/usr/sbin/update-icon-caches" "$theme_dir" - elif [ -f "$SNAP_DESKTOP_RUNTIME/usr/sbin/update-icon-cache.gtk2" ]; then - async_exec "$SNAP_DESKTOP_RUNTIME/usr/sbin/update-icon-cache.gtk2" "$theme_dir" - fi - fi - fi - done - done -fi - -# shellcheck disable=SC2154 -[ "$needs_update" = true ] && echo "SNAP_DESKTOP_LAST_REVISION=$SNAP_REVISION" > "$SNAP_USER_DATA/.last_revision" - -wait_for_async_execs - -if [ -n "$SNAP_DESKTOP_DEBUG" ]; then - echo "desktop-launch elapsed time: $(date +%s.%N --date="$START seconds ago")" - echo "Now running: exec $*" -fi - -exec "$@" diff --git a/desktop-launch/gnome/launcher-specific b/desktop-launch/gnome/launcher-specific deleted file mode 100755 index 3c0f7f8..0000000 --- a/desktop-launch/gnome/launcher-specific +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash -############################## -# GTK launcher specific part # -############################## - -# shellcheck disable=SC2154 -if [ "$wayland_available" = true ]; then - export GDK_BACKEND="wayland" - export CLUTTER_BACKEND="wayland" - # Does not hurt to specify this as well, just in case - export QT_QPA_PLATFORM=wayland-egl -fi - -# ibus and fcitx integration -GTK_IM_MODULE_DIR="$XDG_CACHE_HOME/immodules/gtk2" -GTK3_IM_MODULE_DIR="$XDG_CACHE_HOME/immodules/gtk3" -export GTK_IM_MODULE_FILE="$GTK_IM_MODULE_DIR/gtk2-immodules.cache" -export GTK3_IM_MODULE_FILE="$GTK_IM_MODULE_DIR/gtk3-immodules.cache" -# shellcheck disable=SC2154 -if [ "$needs_update" = true ]; then - rm -rf "$GTK_IM_MODULE_DIR" "$GTK3_IM_MODULE_DIR" - ensure_dir_exists "$GTK_IM_MODULE_DIR" - ensure_dir_exists "$GTK3_IM_MODULE_DIR" - ln -sf "$SNAP"/usr/lib/"$ARCH"/gtk-2.0/2.10.0/immodules/*.so "$GTK_IM_MODULE_DIR" - ln -sf "$SNAP_DESKTOP_RUNTIME"/usr/lib/"$ARCH"/gtk-3.0/3.0.0/immodules/*.so "$GTK3_IM_MODULE_DIR" - async_exec "$SNAP/usr/lib/$ARCH/libgtk2.0-0/gtk-query-immodules-2.0" > "$GTK_IM_MODULE_FILE" - async_exec "$SNAP_DESKTOP_RUNTIME/usr/lib/$ARCH/libgtk-3-0/gtk-query-immodules-3.0" > "$GTK3_IM_MODULE_FILE" -fi - diff --git a/desktop-launch/kde-neon/launcher-specific b/desktop-launch/kde-neon/launcher-specific deleted file mode 100644 index 9958898..0000000 --- a/desktop-launch/kde-neon/launcher-specific +++ /dev/null @@ -1,93 +0,0 @@ -#!/bin/bash -################################### -# KDE NEON launcher specific part # -################################### - -append_dir LD_LIBRARY_PATH "$SNAP/data-dir/kf5/lib/$ARCH" -append_dir LD_LIBRARY_PATH "$SNAP/data-dir/kf5/usr/lib/$ARCH" -append_dir LD_LIBRARY_PATH "$SNAP/data-dir/kf5/usr/lib" -append_dir LD_LIBRARY_PATH "$SNAP/data-dir/kf5/lib" -append_dir PATH "$SNAP/data-dir/kf5/usr/bin" - -# Set XCursors path -append_dir XCURSOR_PATH "$SNAP/data-dir/kf5/icons" - -# XDG Config -prepend_dir XDG_CONFIG_DIRS "$SNAP/data-dir/kf5/etc/xdg" - -# Define snaps' own data dir -prepend_dir XDG_DATA_DIRS "$SNAP/data-dir/kf5/usr/share" - -# Ensure a sane default for QT_QPA_PLATFORMTHEME. -export QT_QPA_PLATFORMTHEME=${QT_QPA_PLATFORMTHEME:-kde} - -# Add paths for games -append_dir PATH "$SNAP/usr/games" -append_dir PATH "$SNAP/data-dir/kf5/usr/games" - -# Qt Libs -prepend_dir LD_LIBRARY_PATH "$SNAP/data-dir/kf5/usr/lib/$ARCH/qt5/libs" - -# Add QT_PLUGIN_PATH (Qt Modules). -append_dir QT_PLUGIN_PATH "$SNAP/usr/lib/$ARCH/qt5/plugins" -append_dir QT_PLUGIN_PATH "$SNAP/usr/lib/$ARCH" -append_dir QT_PLUGIN_PATH "$SNAP/data-dir/kf5/usr/lib/$ARCH/qt5/plugins" -append_dir QT_PLUGIN_PATH "$SNAP/data-dir/kf5/usr/lib/$ARCH" -# And QML2_IMPORT_PATH (Qt Modules). -append_dir QML2_IMPORT_PATH "$SNAP/usr/lib/$ARCH/qt5/qml" -append_dir QML2_IMPORT_PATH "$SNAP/lib/$ARCH" -append_dir QML2_IMPORT_PATH "$SNAP/data-dir/kf5/usr/lib/$ARCH/qt5/qml" -append_dir QML2_IMPORT_PATH "$SNAP/data-dir/kf5/lib/$ARCH" - -# GI repository -append_dir GI_TYPELIB_PATH "$SNAP_DESKTOP_RUNTIME/usr/lib/$ARCH/girepository-1.0" -append_dir GI_TYPELIB_PATH "$SNAP_DESKTOP_RUNTIME/usr/lib/girepository-1.0" -append_dir GI_TYPELIB_PATH "$SNAP_DESKTOP_RUNTIME/usr/lib/gjs/girepository-1.0" - -# Fix locating the QtWebEngineProcess executable -export QTWEBENGINEPROCESS_PATH="$SNAP/data-dir/kf5/usr/lib/$ARCH/qt5/libexec/QtWebEngineProcess" - -# Removes Qt warning: Could not find a location -# of the system Compose files -export QTCOMPOSE="$SNAP/data-dir/kf5/usr/share/X11/locale" -export QT_XKB_CONFIG_ROOT="/usr/share/X11/xkb" - -# KIO specific -# Directly fork slaves. -export KDE_FORK_SLAVES=1 -# Path to KIO slaves. -export KF5_LIBEXEC_DIR="$SNAP/data-dir/kf5/usr/lib/$ARCH/libexec/kf5" - -# Add path to VLC plugins -export VLC_PLUGIN_PATH="$SNAP/data-dir/kf5/usr/lib/x86_64-linux-gnu/vlc/plugins" - -# Ensure QtChooser behaves. -export QTCHOOSER_NO_GLOBAL_DIR=1 -export QT_SELECT=5 -# qtchooser hardcodes reference paths, we'll need to rewrite them properly -ensure_dir_exists "$XDG_CONFIG_HOME/qtchooser" -echo "$SNAP/usr/lib/qt5/bin" > "$XDG_CONFIG_HOME/qtchooser/5.conf" -echo "$SNAP/usr/lib/$ARCH" >> "$XDG_CONFIG_HOME/qtchooser/5.conf" -echo "$SNAP/usr/lib/qt5/bin" > "$XDG_CONFIG_HOME/qtchooser/default.conf" -echo "$SNAP/usr/lib/$ARCH" >> "$XDG_CONFIG_HOME/qtchooser/default.conf" - -# This relies on qtbase patch -# 0001-let-qlibraryinfo-fall-back-to-locate-qt.conf-via-XDG.patch -# to make QLibraryInfo look in XDG_* locations for qt.conf. The paths configured -# here are applied to everything that uses QLibraryInfo as final fallback and -# has no XDG_* fallback before that. Currently the most interesting offender -# is QtWebEngine which will not work unless the Data path is correctly set. -cat << EOF > "$XDG_CONFIG_HOME/qt.conf" -[Paths] -Data = $SNAP/data-dir/kf5/usr/share/qt5/ -Translations = $SNAP/data-dir/kf5/usr/share/qt5/translations -EOF - -if [ -e "$SNAP/data-dir/kf5/usr/share/i18n" ]; then - export I18NPATH="$SNAP/data-dir/kf5/usr/share/i18n" - locpath="$XDG_DATA_HOME/locale" - ensure_dir_exists "$locpath" - prepend_dir LOCPATH "$locpath" - append_dir LOCPATH "/usr/lib/locale" - LC_ALL=C.UTF-8 async_exec "$SNAP/snap/command-chain/locale-gen" -fi diff --git a/desktop-launch/kde-neon/locale-gen b/desktop-launch/kde-neon/locale-gen deleted file mode 100755 index 2c8b605..0000000 --- a/desktop-launch/kde-neon/locale-gen +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/perl - -use strict; - -sub uniq -{ - my %seen; - grep !$seen{$_}++, @_; -} - -# TODO support for KDE's in-app language switch feature. -sub get_languages -{ - # Initialize with sane defaults. - my @found_languages = ($ENV{'LANG'} or 'C.UTF-8'); - - # Go through LC_. - foreach (sort keys %ENV) - { - if (substr($_, 0, length("LC_")) eq "LC_") - { - push(@found_languages, $ENV{$_}); - } - } - # And finally LANGUAGE, but normalize it. - if (my $language = $ENV{'LANGUAGE'}) - { - foreach (split(':', $language)) - { - push(@found_languages, "$_.UTF-8"); - } - } - - # Remove duplicates before returning. - @found_languages = uniq(@found_languages); - - return @found_languages -} - -my $env_locpath = $ENV{'LOCPATH'} or die "LOCPATH must be set"; -my @locpaths = split(/:/, $env_locpath); - -foreach my $lang (get_languages()) -{ - my $found = 0; - foreach my $locpath (@locpaths) - { - my $loc_target = "$locpath/$lang"; - if (-e $loc_target) - { - $found = 1; - last; - } - } - next if $found; - my $target = "@locpaths[0]/$lang"; - - # localedef will exit !0 for unknown reasons, even when everything was - # generated fine. - my ($locale, $encoding) = split(/\./, $lang); - system('localedef', '-i', $locale, '-f', $encoding, $target); -} diff --git a/desktop-launch/src/bindtextdomain.c b/desktop-launch/src/bindtextdomain.c deleted file mode 100644 index 9930294..0000000 --- a/desktop-launch/src/bindtextdomain.c +++ /dev/null @@ -1,123 +0,0 @@ -/* gcc -Wall -O2 -o bindtextdomain.so -fPIC -shared bindtextdomain.c -ldl */ - -#define _GNU_SOURCE - -#include -#include -#include -#include -#include -#include -#include - -static void die (const char *msg) -{ - fprintf (stderr, "can't preload: %s\n", msg); - exit (EXIT_FAILURE); -} - -typedef char * (*BindTextDomainFunc) (const char *a, - const char *b); - -static BindTextDomainFunc r_bindtextdomain = NULL; - -char *bindtextdomain(const char *domainname, const char *dirname) -{ - char *snap = NULL; - char *snap_path = NULL; - char *snap_locale_path = NULL; - DIR *dir = NULL; - struct dirent *ent = NULL; - char *ret = NULL; - - if (r_bindtextdomain == 0 && !(r_bindtextdomain = - (BindTextDomainFunc) dlsym (RTLD_NEXT, "bindtextdomain"))) - die ("can't find symbol \"bindtextdomain\""); - - if (dirname == NULL || dirname[0] != '/') - goto orig; - - snap = getenv ("SNAP"); - - if (snap == NULL || strcmp (snap, "") == 0) - goto orig; - - char * paths[] = { - "gnome-platform/usr/share/locale", - "gnome-platform/usr/share/locale-langpack", - "usr/share/locale", - "usr/share/locale-langpack", - NULL - }; - for(int i = 0; paths[i] != NULL; i++) - { - if (asprintf (&snap_path, "%s/%s", snap, paths[i]) < 0) - continue; - - if (access (snap_path, F_OK) < 0) { - free(snap_path); - snap_path = NULL; - continue; - } - - /* - * if the mo file exists for one language we assume it exists for them - * all, or at least that we're not going to find it anywhere else. we - * don't know at this point what locale the application is actually - * going to use, so we can't look in any particular directory. - */ - dir = opendir (snap_path); - if (dir == NULL) { - free (snap_path); - snap_path = NULL; - continue; - } - - while ((ent = readdir (dir)) != NULL) { - if (ent->d_name[0] == '.') - continue; - - if (asprintf (&snap_locale_path, - "%s/%s/LC_MESSAGES/%s.mo", - snap_path, - ent->d_name, - domainname) < 0) - continue; - - /* snap_locale_path has been allocated if we made it - * this far, be sure it's freed before any goto - * or continue - */ - if (access (snap_locale_path, F_OK) == 0) { - closedir (dir); - free (snap_locale_path); - snap_locale_path = NULL; - goto ok; - } else { - free (snap_locale_path); - snap_locale_path = NULL; - continue; - } - } - - closedir (dir); - free (snap_path); - snap_path = NULL; - } - /* - * we fell out of the loop, so we'll go to orig regardless - no need to - * check for errors - */ - goto orig; - -ok: - ret = r_bindtextdomain (domainname, snap_path); - free (snap_path); - snap_path = NULL; - goto out; -orig: - ret = r_bindtextdomain (domainname, dirname); - goto out; -out: - return ret; -} diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 30b7a0e..078cc15 100755 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -1,5 +1,5 @@ name: gimp -version: '2.99.10' +version: "2.99.16" summary: GNU Image Manipulation Program description: | Whether you are a graphic designer, photographer, illustrator, or scientist, @@ -13,56 +13,45 @@ base: core22 compression: lzo architectures: -- build-on: amd64 -- build-on: arm64 -# - build-on: armhf + - build-on: amd64 + - build-on: arm64 layout: /etc/gimp: bind: $SNAP/etc/gimp /etc/ld.so.cache: bind-file: $SNAP_DATA/etc/ld.so.cache - /usr/lib/$CRAFT_ARCH_TRIPLET/babl-0.1: - bind: $SNAP/usr/lib/$CRAFT_ARCH_TRIPLET/babl-0.1 - /usr/lib/$CRAFT_ARCH_TRIPLET/gegl-0.4: - bind: $SNAP/usr/lib/$CRAFT_ARCH_TRIPLET/gegl-0.4 - # /usr/lib/$CRAFT_ARCH_TRIPLET/darktable: - # bind: $SNAP/usr/lib/$CRAFT_ARCH_TRIPLET/darktable - /usr/lib/$CRAFT_ARCH_TRIPLET/evince/4/backends: - bind: $SNAP/usr/lib/$CRAFT_ARCH_TRIPLET/evince/4/backends - /usr/lib/gimp: - bind: $SNAP/usr/lib/gimp - /usr/lib/python3.10: - bind: $SNAP/usr/lib/python3.10 + /usr/bin/gjs: + symlink: $SNAP/gnome-platform/usr/bin/gjs + /usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/babl-0.1: + bind: $SNAP/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/babl-0.1 + /usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/gegl-0.4: + bind: $SNAP/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/gegl-0.4 + /usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/evince/4/backends: + bind: $SNAP/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/evince/4/backends /usr/lib/gvfs: bind: $SNAP/usr/lib/gvfs - /usr/lib/$CRAFT_ARCH_TRIPLET/gvfs: - bind: $SNAP/usr/lib/$CRAFT_ARCH_TRIPLET/gvfs + /usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/gvfs: + bind: $SNAP/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/gvfs + /usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/lua: + symlink: $SNAP/usr/lib/$CRAFT_ARCH_TRIPLET/lua /usr/libexec: bind: $SNAP/usr/libexec /usr/share/color: bind: $SNAP/usr/share/color - # /usr/share/darktable: - # bind: $SNAP/usr/share/darktable /usr/share/ghostscript: bind: $SNAP/usr/share/ghostscript - /usr/share/gimp: - bind: $SNAP/usr/share/gimp /usr/share/gvfs: bind: $SNAP/usr/share/gvfs /usr/share/lensfun: bind: $SNAP/usr/share/lensfun /usr/share/locale: bind: $SNAP/usr/share/locale + /usr/share/lua: + bind: $SNAP/usr/share/lua /usr/share/mypaint-data: bind: $SNAP/usr/share/mypaint-data -# plugs: - # color-profiles: - # interface: system-files - # read: - # - /usr/share/color/icc - slots: dbus-gimp: interface: dbus @@ -70,50 +59,34 @@ slots: name: org.gimp.GIMP.UI environment: - GTK_USE_PORTAL: '1' + GTK_USE_PORTAL: "1" + GI_TYPELIB_PATH: $SNAP/gnome-platform/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/gjs/girepository-1.0 GIMP2_LOCALEDIR: $SNAP/usr/share/locale - LD_LIBRARY_PATH: $SNAP/usr/lib/$CRAFT_ARCH_TRIPLET/lapack:$SNAP/usr/lib/$CRAFT_ARCH_TRIPLET/blas - PYTHONPATH: $SNAP/usr/lib/python3.10:$SNAP/usr/lib/python3.10/site-packages:$PYTHONPATH + LD_LIBRARY_PATH: $SNAP/lib:$SNAP/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 + PYTHONHOME: $SNAP/gnome-platform/usr + PYTHONPATH: $SNAP/gnome-platform/usr/lib/python3.10 apps: gimp: - command: usr/bin/gimp + command: usr/bin/gimp-2.99 extensions: [gnome] desktop: usr/share/applications/gimp.desktop common-id: org.gimp.GIMP slots: - - dbus-gimp + - dbus-gimp plugs: - - cups-control - - browser-support - - desktop - - desktop-legacy - - gsettings - - home - - network - - opengl - - removable-media - - unity7 - - wayland - - x11 - - # darktable: - # command: usr/bin/darktable - # command-chain: [snap/command-chain/desktop-launch] - # desktop: usr/share/applications/darktable.desktop - # common-id: darktable.desktop - # plugs: - # - cups-control - # - desktop - # - desktop-legacy - # - gsettings - # - home - # - network - # - opengl - # - removable-media - # - unity7 - # - wayland - # - x11 + - cups-control + - browser-support + - desktop + - desktop-legacy + - gsettings + - home + - network + - opengl + - removable-media + - unity7 + - wayland + - x11 parts: gexiv: @@ -121,83 +94,76 @@ parts: source: https://download.gnome.org/sources/gexiv2/0.14/gexiv2-0.14.0.tar.xz source-checksum: sha256/e58279a6ff20b6f64fa499615da5e9b57cf65ba7850b72fafdf17221a9d6d69e meson-parameters: - - --prefix=/usr - - --buildtype=release - - -Db_lto=true - - -Dintrospection=false - - -Dpython3=false - - -Dvapi=false + - --prefix=/usr + - --buildtype=release + - -Db_lto=true + - -Dintrospection=false + - -Dpython3=false + - -Dvapi=false build-environment: - - to armhf: - - CFLAGS: -Ofast -g -pipe -mfpu=neon - - CXXFLAGS: -Ofast -g -pipe -mfpu=neon - - LDFLAGS: -mfpu=neon - - else: - CFLAGS: -Ofast -g -pipe - CXXFLAGS: -Ofast -g -pipe build-packages: - - libexiv2-dev - - libcodec2-dev + - libexiv2-dev + - libcodec2-dev stage-packages: - - libexiv2-27 + - libexiv2-27 libav: after: - - libaom + - libaom plugin: autotools source: https://ffmpeg.org/releases/ffmpeg-5.1.tar.xz autotools-configure-parameters: - - --prefix=/usr - - --disable-programs - - --disable-doc - - --disable-alsa - - --enable-gpl - - --enable-shared - - --enable-libaom - - --enable-libfontconfig - - --enable-libfreetype - - --enable-librsvg - - --enable-libv4l2 - - --enable-libvpx - - --enable-libwebp - - --enable-libx264 - - --enable-libx265 - - --enable-libxvid + - --prefix=/usr + - --disable-programs + - --disable-doc + - --disable-alsa + - --enable-gpl + - --enable-shared + - --enable-libaom + - --enable-libfontconfig + - --enable-libfreetype + - --enable-librsvg + - --enable-libv4l2 + - --enable-libvpx + - --enable-libwebp + - --enable-libx264 + - --enable-libx265 + - --enable-libxvid build-environment: - - to armhf: - - CFLAGS: -Ofast -g -pipe -mfpu=neon - - CXXFLAGS: -Ofast -g -pipe -mfpu=neon - - LDFLAGS: -mfpu=neon - - else: - CFLAGS: -Ofast -g -pipe - CXXFLAGS: -Ofast -g -pipe + - PATH: /usr/bin:$PATH build-packages: - - to amd64: - - libmfx-dev - - libbz2-dev - - libsdl2-dev - - libtheora-dev - - libv4l-dev - - libva-dev - - libvdpau-dev - - libvpx-dev - - libx264-dev - - libx265-dev - - libxvidcore-dev - - nasm + - to amd64: + - libmfx-dev + - libbz2-dev + - libsdl2-dev + - libtheora-dev + - libv4l-dev + - libva-drm2 + - libva-x11-2 + - libva-dev + - libvdpau-dev + - libvpx-dev + - libx264-dev + - libx265-dev + - libxvidcore-dev + - nasm stage-packages: - - to amd64: - - libmfx1 - - libbz2-1.0 - - libsdl2-2.0-0 - - libtheora0 - - libv4l-0 - - libva2 - - libvdpau1 - - libvpx7 - - libx264-163 - - libx265-199 - - libxvidcore4 + - to amd64: + - libmfx1 + - libbz2-1.0 + - libsdl2-2.0-0 + - libtheora0 + - libv4l-0 + - libva2 + - libvdpau1 + - libvpx7 + - libx264-163 + - libx265-199 + - libxvidcore4 # https://download.gimp.org/pub/babl babl: @@ -206,216 +172,106 @@ parts: # source: https://download.gimp.org/pub/babl/0.1/babl-0.1.92.tar.xz # source-checksum: sha256/f667735028944b6375ad18f160a64ceb93f5c7dccaa9d8751de359777488a2c1 meson-parameters: - - --prefix=/usr - - --buildtype=release - - -Db_lto=true - - -Dwith-docs=false + - --prefix=/usr + - --buildtype=release + - -Db_lto=true + - -Dwith-docs=false build-environment: - - to armhf: - - CFLAGS: -Ofast -g -pipe -mfpu=neon - - CXXFLAGS: -Ofast -g -pipe -mfpu=neon - - LDFLAGS: -mfpu=neon - - else: - CFLAGS: -Ofast -g -pipe - CXXFLAGS: -Ofast -g -pipe override-pull: | craftctl default sed -i 's/not stable, Description:/not stable, description:/' meson.build - override-build: | - # LTO fails on armhf - LTO=-Db_lto=true - if [ $CRAFT_ARCH_TRIPLET = "arm-linux-gnueabihf" ]; then - LTO=-Db_lto=false - fi - - meson \ - --prefix=/usr \ - --buildtype=release \ - -Dwith-docs=false \ - $LTO \ - $CRAFT_PART_SRC - ninja - DESTDIR=$CRAFT_PART_INSTALL ninja install build-packages: - - git - - meson - - w3m - prime: - - -usr/include - - -usr/lib/pkgconfig - - -**/*.la + - git + - meson + - w3m # https://download.gimp.org/pub/gegl gegl: after: - - babl - - gexiv - - ghostscript - - libav + - babl + - gexiv + - ghostscript + - libav source: https://gitlab.gnome.org/GNOME/gegl.git # source: https://download.gimp.org/pub/gegl/0.4/gegl-0.4.36.tar.xz # source-checksum: sha256/6fd58a0cdcc7702258adaeffb573a389228ae8f0eff47578efda2309b61b2ca6 plugin: meson meson-parameters: - - --prefix=/usr - - --buildtype=release - - -Ddocs=false - - -Dworkshop=true - - -Db_lto=true + - --prefix=/usr + - --buildtype=release + - -Ddocs=false + - -Dworkshop=true + - -Db_lto=true build-environment: - - to armhf: - - CFLAGS: -Ofast -g -pipe -mfpu=neon - - CXXFLAGS: -Ofast -g -pipe -mfpu=neon - - LDFLAGS: -mfpu=neon - - else: - CFLAGS: -Ofast -g -pipe - CXXFLAGS: -Ofast -g -pipe - - GIO_MODULE_DIR: /snap/gnome-42-2204-sdk/current/usr/lib/$CRAFT_ARCH_TRIPLET/gio/modules - override-build: | - # LTO fails on armhf - LTO=-Db_lto=true - if [ $CRAFT_ARCH_TRIPLET = "arm-linux-gnueabihf" ]; then - LTO=-Db_lto=false - fi - - meson \ - --prefix=/usr \ - --buildtype=release \ - -Dworkshop=true \ - $LTO \ - $CRAFT_PART_SRC - ninja - DESTDIR=$CRAFT_PART_INSTALL ninja install + - GIO_MODULE_DIR: /snap/gnome-42-2204-sdk/current/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/gio/modules build-packages: - - libexiv2-dev - - libfftw3-dev - - libglu1-mesa-dev - - liblensfun-dev - - libluajit-5.1-dev - - libmaxflow-dev - - libopenexr-dev - - libraw-dev - - libsdl2-dev - - libspiro-dev - - libsuitesparse-dev - - libv4l-dev - - libwebp-dev - - meson + - libexiv2-dev + - libfftw3-dev + - libglu1-mesa-dev + - liblensfun-dev + - libluajit-5.1-dev + - libmaxflow-dev + - libopenexr-dev + - libraw-dev + - libsdl2-dev + - libspiro-dev + - libsuitesparse-dev + - libv4l-dev + - libwebp-dev + - meson stage-packages: - - libamd2 - - libbtf1 - - libcamd2 - - libccolamd2 - - libcholmod3 - - libcolamd2 - - libcxsparse3 - - libexiv2-27 - - libgraphblas6 - - libklu1 - - liblapack3 - - libldl2 - - liblensfun1 - - libluajit-5.1-2 - - libmaxflow0 - - libopenexr25 - - libraw20 - - librbio2 - - libsdl2-2.0-0 - - libspiro1 - - libspqr2 - - libumfpack5 - - libv4l-0 - stage: - - -**/*.la - - -etc - - -var/lib/ucf - - -usr/sbin/update-mime - - -usr/share/X11 - - -usr/share/alsa - - -usr/share/applications - - -usr/share/apport - - -usr/share/apps - - -usr/share/binfmts - - -usr/share/bug - - -usr/share/debhelper - - -usr/share/doc - - -usr/share/doc-base - - -usr/share/fonts - - -usr/share/glib-2.0 - - -usr/share/libdrm - - -usr/share/libthai - - -usr/share/lintian - - -usr/share/locale - - -usr/share/man - - -usr/share/menu - - -usr/share/mime - - -usr/share/perl5 - - -usr/share/pixmaps - - -usr/share/pkgconfig - - -usr/share/python - - -usr/share/xml - prime: - - -usr/include - - -usr/lib/pkgconfig - - -usr/share/vala + - libamd2 + - libbtf1 + - libcamd2 + - libccolamd2 + - libcholmod3 + - libcolamd2 + - libcxsparse3 + - libexiv2-27 + - libgraphblas6 + - libklu1 + - liblapack3 + - libldl2 + - liblensfun1 + - libluajit-5.1-2 + - libmaxflow0 + - libopenexr25 + - libraw20 + - librbio2 + - libsdl2-2.0-0 + - libspiro1 + - libspqr2 + - libumfpack5 + - libv4l-0 # https://aomedia.googlesource.com libaom: source: https://aomedia.googlesource.com/aom source-type: git + source-tag: v3.4.0 plugin: cmake - build-snaps: [cmake] build-environment: - - to armhf: - # LTO succeeds here, but breaks libheif build on armhf - - CFLAGS: -Ofast -g -pipe -mfpu=neon - - CXXFLAGS: -Ofast -g -pipe -mfpu=neon - - LDFLAGS: -mfpu=neon - - else: - CFLAGS: -Ofast -g -pipe -flto - CXXFLAGS: -Ofast -g -pipe -flto - LDFLAGS: -flto + - PATH: /usr/bin:$PATH cmake-parameters: - - -DCMAKE_BUILD_TYPE=Release - - -DCMAKE_INSTALL_PREFIX=/usr - - -DENABLE_DOCS=OFF - - -DENABLE_EXAMPLES=OFF - - -DENABLE_TESTDATA=OFF - - -DENABLE_TESTS=OFF - - -DCONFIG_PIC=1 - - -DCONFIG_AV1_ENCODER=1 - - -DCONFIG_AV1_DECODER=1 - - -DCONFIG_MULTITHREAD=1 - # Needs advanced grammar support from Snapcraft that isn't available here - # Tested against Snapcraft 7.0 (beta - 2022-05-05 (7468)). - # - to armhf: - # - -DAOM_NEON_INTRIN_FLAG=-mfpu=neon - override-build: | - EXTRA="" - if [ $CRAFT_ARCH_TRIPLET = "arm-linux-gnueabihf" ]; then - EXTRA="-DAOM_NEON_INTRIN_FLAG=-mfpu=neon" - fi - - export DESTDIR="$CRAFT_PART_INSTALL" - - cmake $CRAFT_PART_SRC \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX=/usr \ - -DENABLE_DOCS=OFF \ - -DENABLE_EXAMPLES=OFF \ - -DENABLE_TESTDATA=OFF \ - -DENABLE_TESTS=OFF \ - -DCONFIG_PIC=1 \ - -DCONFIG_AV1_ENCODER=1 \ - -DCONFIG_AV1_DECODER=1 \ - -DCONFIG_MULTITHREAD=1 \ - $EXTRA - - cmake --build . -- -j$CRAFT_PARALLEL_BUILD_COUNT - - cmake --build . --target install + - -DCMAKE_BUILD_TYPE=Release + - -DCMAKE_INSTALL_PREFIX=/usr + - -DENABLE_DOCS=OFF + - -DENABLE_EXAMPLES=OFF + - -DENABLE_TESTDATA=OFF + - -DENABLE_TESTS=OFF + - -DCONFIG_PIC=1 + - -DCONFIG_AV1_ENCODER=1 + - -DCONFIG_AV1_DECODER=1 + - -DCONFIG_MULTITHREAD=1 build-packages: - - yasm + - yasm # https://github.com/strukturag/libheif/releases libheif: @@ -423,25 +279,20 @@ parts: source: https://github.com/strukturag/libheif/releases/download/v1.12.0/libheif-1.12.0.tar.gz plugin: autotools build-environment: - - to armhf: - # LTO fails on armhf - - CFLAGS: -Ofast -g -pipe -mfpu=neon - - CXXFLAGS: -Ofast -g -pipe -mfpu=neon - - LDFLAGS: -mfpu=neon - - else: - CFLAGS: -Ofast -g -pipe -flto - CXXFLAGS: -Ofast -g -pipe -flto - LDFLAGS: -flto + - PATH: /usr/bin:$PATH autotools-configure-parameters: - - --prefix=/usr - - --disable-go - - --disable-examples + - --prefix=/usr + - --disable-go + - --disable-examples build-packages: - - libde265-dev - - libx265-dev + - libde265-dev + - libx265-dev stage-packages: - - libde265-0 - - libx265-199 + - libde265-0 + - libx265-199 # https://github.com/mypaint/libmypaint/releases libmypaint: @@ -449,133 +300,105 @@ parts: source: https://github.com/mypaint/libmypaint/releases/download/v1.6.1/libmypaint-1.6.1.tar.xz source-checksum: sha256/741754f293f6b7668f941506da07cd7725629a793108bb31633fb6c3eae5315f build-packages: - - intltool - - libjson-c-dev + - intltool + - libjson-c-dev autotools-configure-parameters: - - --prefix=/usr - - --disable-static + - --prefix=/usr + - --disable-static build-environment: - - to armhf: - - CFLAGS: -Ofast -g -pipe -mfpu=neon -flto - - CXXFLAGS: -Ofast -g -pipe -mfpu=neon -flto - - LDFLAGS: -mfpu=neon -flto - - else: - CFLAGS: -Ofast -g -pipe -flto - CXXFLAGS: -Ofast -g -pipe -flto - LDFLAGS: -flto stage: - - -**/*.la + - -**/*.la prime: - - -usr/include - - -usr/lib/pkgconfig + - -usr/include + - -usr/lib/pkgconfig # https://github.com/mypaint/mypaint-brushes/releases mypaint-brushes: after: - - libmypaint + - libmypaint source: https://github.com/mypaint/mypaint-brushes/releases/download/v1.3.1/mypaint-brushes-1.3.1.tar.xz source-checksum: sha256/fef66ffc241b7c5cd29e9c518e933c739618cb51c4ed4d745bf648a1afc3fe70 plugin: autotools autotools-configure-parameters: - - --prefix=/usr + - --prefix=/usr build-environment: - - to armhf: - - CFLAGS: -Ofast -g -pipe -mfpu=neon -flto - - CXXFLAGS: -Ofast -g -pipe -mfpu=neon -flto - - LDFLAGS: -mfpu=neon -flto - - else: - CFLAGS: -Ofast -g -pipe -flto - CXXFLAGS: -Ofast -g -pipe -flto - LDFLAGS: -flto build-packages: - - automake + - automake # https://github.com/hughsie/appstream-glib appstream-glib: plugin: meson source: https://github.com/hughsie/appstream-glib.git build-environment: - - to armhf: - - CFLAGS: -Ofast -g -pipe -mfpu=neon - - CXXFLAGS: -Ofast -g -pipe -mfpu=neon - - LDFLAGS: -mfpu=neon - - else: - CFLAGS: -Ofast -g -pipe - CXXFLAGS: -Ofast -g -pipe meson-parameters: - - --prefix=/usr - - --buildtype=release - - -Db_lto=true - - -Dbuilder=false - - -Drpm=false - - -Dman=false + - --prefix=/usr + - --buildtype=release + - -Db_lto=true + - -Dbuilder=false + - -Drpm=false + - -Dman=false build-packages: - - gperf - - libarchive-dev - - libstemmer-dev - - libyaml-dev + - gperf + - libarchive-dev + - libstemmer-dev + - libyaml-dev stage-packages: - - libarchive13 - - libstemmer0d - - libyaml-0-2 + - libarchive13 + - libstemmer0d + - libyaml-0-2 # https://gitlab.gnome.org/GNOME/evince evince: source: https://gitlab.gnome.org/GNOME/evince.git source-type: git - source-branch: 'gnome-42' + source-branch: "gnome-42" plugin: meson build-environment: - - to armhf: - - CFLAGS: -Ofast -g -pipe -mfpu=neon -flto - - CXXFLAGS: -Ofast -g -pipe -mfpu=neon -flto - - LDFLAGS: -mfpu=neon -flto - - else: - CFLAGS: -Ofast -g -pipe -flto - CXXFLAGS: -Ofast -g -pipe -flto - LDFLAGS: -flto meson-parameters: - - --prefix=/snap/$SNAPCRAFT_PROJECT_NAME/current/usr - - --buildtype=release - - -Dnautilus=false - - -Dgtk_doc=false - - -Dintrospection=false + - --prefix=/snap/$SNAPCRAFT_PROJECT_NAME/current/usr + - --buildtype=release + - -Dnautilus=false + - -Dgtk_doc=false + - -Dintrospection=false organize: snap/$SNAPCRAFT_PROJECT_NAME/current/usr: usr build-packages: - - autotools-dev - - dh-apparmor - - intltool - - libarchive-dev - - libdjvulibre-dev - # - libgstreamer-plugins-base1.0-dev - # - libgstreamer1.0-dev - - libkpathsea-dev - - libsm-dev + - autotools-dev + - dh-apparmor + - intltool + - libarchive-dev + - libdjvulibre-dev + - libkpathsea-dev + - libsm-dev stage-packages: - - libarchive13 - - libdjvulibre21 - - libkpathsea6 - - libnspr4 - # - libnss3 + - libarchive13 + - libdjvulibre21 + - libkpathsea6 + - libnspr4 # https://github.com/ArtifexSoftware/ghostpdl-downloads ghostscript: plugin: autotools source: https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs9561/ghostscript-9.56.1.tar.xz build-environment: - - to armhf: - - CFLAGS: -Ofast -g -pipe -mfpu=neon -flto - - CXXFLAGS: -Ofast -g -pipe -mfpu=neon -flto - - LDFLAGS: -mfpu=neon -flto - - else: - CFLAGS: -Ofast -g -pipe -flto - CXXFLAGS: -Ofast -g -pipe -flto - LDFLAGS: -flto autotools-configure-parameters: - - --prefix=/usr - - --disable-compile-inits - - --enable-dynamic + - --prefix=/usr + - --disable-compile-inits + - --enable-dynamic override-build: | ./configure \ --prefix=/usr \ @@ -599,20 +422,14 @@ parts: - -DWITH_LTO=ON - -DCACHE_NAME_SUFFIX="" build-environment: - # -Ofast enables -ffast-math which is incompatible with rawtherapee so use -O3 instead - - to armhf: - - CFLAGS: -O3 -g -pipe -mfpu=neon - - CXXFLAGS: -O3 -g -pipe -mfpu=neon - - LDFLAGS: -mfpu=neon - - else: - CFLAGS: -O3 -g -pipe - CXXFLAGS: -O3 -g -pipe build-packages: - - libiptcdata0-dev - - liblensfun-dev + - libiptcdata0-dev + - liblensfun-dev stage-packages: - - libiptcdata0 - - liblensfun1 + - libiptcdata0 + - liblensfun1 # https://github.com/caolanm/libwmf libwmf: @@ -625,14 +442,9 @@ parts: patch -Np1 -i $CRAFT_PROJECT_DIR/patches/libwmf/freetype-pkg-config.patch autoreconf --force --install --include=patches autotools-configure-parameters: - - --prefix=/usr - - --with-gsfontmap=/usr/share/ghostscript/9.56.1/Resource/Init/Fontmap.GS + - --prefix=/usr + - --with-gsfontmap=/usr/share/ghostscript/9.56.1/Resource/Init/Fontmap.GS build-environment: - - to armhf: - - CFLAGS: -Ofast -g -pipe -mfpu=neon -flto - - CXXFLAGS: -Ofast -g -pipe -mfpu=neon -flto - - LDFLAGS: -mfpu=neon -flto - - else: - CFLAGS: -Ofast -g -pipe -flto - CXXFLAGS: -Ofast -g -pipe -flto - LDFLAGS: -flto @@ -640,332 +452,202 @@ parts: craftctl default sed -i "s|/usr/lib/libwmflite.la|$CRAFT_STAGE/usr/lib/libwmflite.la|" $CRAFT_PART_INSTALL/usr/lib/libwmf.la stage-packages: - - libexpat1 + - libexpat1 # https://download.gimp.org/pub/gimp/v2.10/ gimp: after: - - appstream-glib - - babl - - evince - - gegl - - gexiv - - ghostscript - - libheif - - libmypaint - - libwmf - - mypaint-brushes - - rawtherapee - plugin: autotools - source: https://gitlab.gnome.org/GNOME/gimp.git - # meson-parameters: - # - --prefix=/usr - # - --buildtype=release - # - -Dgi-docgen=disabled - # - -Dbuild-id=org.gimp.GIMP.snapcraft.edge - # - -Dbug-report-url=https://github.com/snapcrafters/gimp/issues/ - # - -Dcheck-update=no - autotools-configure-parameters: - - --prefix=/usr - - --sysconfdir=/etc - - --with-build-id=org.gimp.GIMP.snapcraft.edge - - --with-bug-report-url=https://github.com/snapcrafters/gimp/issues/ - - --enable-check-update=no - - --enable-gi-docgen=no - - --enable-g-ir-doc=no - - --enable-default-binary=yes + - appstream-glib + - babl + - evince + - gegl + - gexiv + - ghostscript + - libheif + - libmypaint + - libwmf + - mypaint-brushes + - rawtherapee + plugin: meson + source: https://download.gimp.org/gimp/v2.99/gimp-${SNAPCRAFT_PROJECT_VERSION}.tar.xz + meson-parameters: + - --prefix=/usr + - --buildtype=release + - -Dgi-docgen=disabled + - -Dg-ir-doc=false + - -Dbuild-id=org.gimp.GIMP.snapcraft.preview + - -Dbug-report-url=https://github.com/snapcrafters/gimp/issues/ + - -Dcheck-update=no + - -Dpython=enabled + - -Denable-default-bin=enabled + - -Drelocatable-bundle=yes + - -Dlibunwind=true build-environment: - - to armhf: - - CFLAGS: -Ofast -g -pipe -mfpu=neon -flto - - CXXFLAGS: -Ofast -g -pipe -mfpu=neon -flto - - LDFLAGS: -mfpu=neon -flto - - else: - - CFLAGS: -Ofast -g -pipe -flto - - CXXFLAGS: -Ofast -g -pipe -flto + - CFLAGS: -Ofast -pipe -flto + - CXXFLAGS: -Ofast -pipe -flto - LDFLAGS: -flto - - BABL_PATH: $CRAFT_STAGE/usr/lib/$CRAFT_ARCH_TRIPLET/babl-0.1 - - GEGL_PATH: $CRAFT_STAGE/usr/lib/$CRAFT_ARCH_TRIPLET/gegl-0.4 - # the LIBRARY_PATH is to fix ld unable to find libwmf - - LIBRARY_PATH: $CRAFT_STAGE/usr/lib - # the LD_LIBRARY_PATH is to fix configure failing to test for gegl matting-levin support - - LD_LIBRARY_PATH: $LD_LIBRARY_PATH:$CRAFT_STAGE/usr/lib/$CRAFT_ARCH_TRIPLET - - GIO_MODULE_DIR: /snap/gnome-42-2204-sdk/current/usr/lib/$CRAFT_ARCH_TRIPLET/gio/modules - - PYTHON: /usr/bin/python3.10 + - BABL_PATH: $CRAFT_STAGE/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/babl-0.1 + - GEGL_PATH: $CRAFT_STAGE/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/gegl-0.4 + # the LIBRARY_PATH is to fix ld unable to find libwmf + - LIBRARY_PATH: $CRAFT_STAGE/usr/lib + # the LD_LIBRARY_PATH is to fix configure failing to test for gegl matting-levin support + - LD_LIBRARY_PATH: $LD_LIBRARY_PATH:$CRAFT_STAGE/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR + - GIO_MODULE_DIR: /snap/gnome-42-2204-sdk/current/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/gio/modules + - PYTHON: /usr/bin/python3.10 override-pull: | craftctl default sed -i 's|^Icon=.*|Icon=/usr/share/icons/hicolor/256x256/apps/gimp.png|' desktop/gimp.desktop.in.in override-build: | - # rm -f $CRAFT_PART_INSTALL/usr/share/pkgconfig/iso-codes.pc craftctl default - # sed -i -E "s|^(.*python3?=).*|\1/snap/$CRAFT_PROJECT_NAME/current/usr/bin/python|" $CRAFT_PART_INSTALL/usr/lib/gimp/2.99/interpreters/pygimp.interp || true sed -i -E 's|^# \(mypaint-brush-path .*$|(mypaint-brush-path "/usr/share/mypaint-data/1.0/brushes:~/.mypaint/brushes")|' $CRAFT_PART_INSTALL/etc/gimp/2.99/gimprc build-packages: - - automake - - intltool - - iso-codes - - libaa1-dev - - libart-2.0-dev - - libbz2-dev - - libexif-dev - - libexpat1-dev - - libfftw3-dev - - libgpm-dev - - libice-dev - - libilmbase-dev - - libisocodes-dev - - libluajit-5.1-dev - - liblzma-dev - - libmng-dev - - libopenexr-dev - - libslang2-dev - - libsm-dev - - libwebp-dev - - libxmu-dev - - libxpm-dev - - luajit - - poppler-data - - xdg-utils - - xsltproc - - libunwind-dev + - automake + - intltool + - iso-codes + - libaa1-dev + - libart-2.0-dev + - libbz2-dev + - libexif-dev + - libexpat1-dev + - libfftw3-dev + - libgpm-dev + - libice-dev + - libilmbase-dev + - libisocodes-dev + - libluajit-5.1-dev + - liblzma-dev + - libmng-dev + - libopenexr-dev + - libslang2-dev + - libsm-dev + - libunwind-dev + - libwebp-dev + - libxmu-dev + - libxpm-dev + - luajit + - poppler-data + - xdg-utils + - xsltproc stage-packages: - # - gvfs-backends - - libaa1 - - libart-2.0-2 - - libbz2-1.0 - - libexif12 - - libfftw3-3 - - libgpm2 - - libilmbase25 - - libluajit-5.1-2 - - liblzma5 - - libmng2 - - libopenexr25 - - libslang2 - - libwebp7 - - libwebpdemux2 - - libwebpmux3 - - libxmu6 - - libxpm4 - - luajit - - poppler-data - - libunwind8 - stage: - - -**/*.la - - -etc/dbus-1 - - -etc/default - - -etc/dictionaries-common - - -etc/emacs - - -etc/fonts - - -etc/glvnd - - -etc/gnome - - -etc/gss - - -etc/gtk-3.0 - - -etc/init.d - - -etc/libblockdev - - -etc/libpaper.d - - -etc/mailcap.order - - -etc/mime.types - - -etc/rc*.d - - -etc/sensors3.conf - - -etc/systemd - - -etc/ucf.conf - - -etc/udisks2 - - -etc/X11 - - -sbin/cfdisk - - -sbin/cgdisk - - -sbin/fdisk - - -sbin/fixparts - - -sbin/gdisk - - -sbin/parted - - -sbin/partprobe - - -sbin/sfddisk - - -sbin/sgdisk - - -usr/bin/aspell* - - -usr/bin/dbus* - - -usr/bin/desktop-file-* - - -usr/bin/fc-* - - -usr/bin/gtk-update-icon-cache - - -usr/bin/ispell* - - -usr/bin/mtrace - - -usr/bin/rpcgen - - -usr/bin/run-* - - -usr/bin/select-default-iwrap - - -usr/bin/update-*-database - - -usr/bin/xdpyinfo - - -usr/bin/xdriinfo - - -usr/bin/xev - - -usr/bin/xfd - - -usr/bin/xfontsel - - -usr/bin/xkill - - -usr/bin/xlsatoms - - -usr/bin/xlsclients - - -usr/bin/xlsfonts - - -usr/bin/xmessage - - -usr/bin/xprop - - -usr/bin/xvinfo - - -usr/bin/xwininfo - - -usr/lib/aspell - - -usr/lib/$CRAFT_ARCH_TRIPLET/pkgconfig/libcrypt.pc - - -usr/lib/$CRAFT_ARCH_TRIPLET/pkgconfig/libxcrypt.pc - - -usr/share/doc/libjpeg* - - -usr/share/ghostscript - - -usr/share/pkgconfig/iso-codes.pc - - -**/iso-codes - - -var/cache - - -var/lib/aspell - - -var/lib/dbus - - -var/lib/dictionaries-common - - -var/lib/emacsen-common - - -var/lib/ispell - - -var/lib/systemd - - -var/lib/ucf - prime: - - -usr/include - - -usr/lib/pkgconfig + - iso-codes + - libaa1 + - libart-2.0-2 + - libbz2-1.0 + - libexif12 + - libfftw3-3 + - libgpm2 + - libilmbase25 + - libluajit-5.1-2 + - liblzma5 + - libmng2 + - libopenexr25 + - libslang2 + - libsndio7.0 + - libunwind8 + - libwebp7 + - libwebpdemux2 + - libwebpmux3 + - libxmu6 + - libxpm4 + - libxv1 + - lua-lgi + - luajit + - poppler-data - # gmic: - # after: [appstream-glib, gexiv, gimp] - # plugin: nil - # override-pull: | - # git clone https://github.com/dtschump/gmic.git - # git clone https://github.com/dtschump/CImg.git - # git clone https://github.com/c-koi/gmic-qt.git - # cd gmic-qt - # # VERSION="$(git tag -l 'v.*.*' --sort=version:refname | tail -n1)" - # VERSION=v.2.9.6 - # git checkout "$VERSION" - # cd ../gmic - # git checkout "$VERSION" - # cd ../CImg - # git checkout "$VERSION" - # override-build: | - # make -C gmic/src CImg.h gmic_stdlib.h - # cd gmic-qt - # mkdir build - # cd build - # cmake .. \ - # -DCMAKE_INSTALL_PREFIX=/usr \ - # -DGMIC_QT_HOST=gimp \ - # -DGMIC_PATH=$CRAFT_PART_BUILD/gmic/src \ - # -DCMAKE_BUILD_TYPE=Release - # make -j$CRAFT_PARALLEL_BUILD_COUNT - # make DESTDIR=$CRAFT_PART_INSTALL install - # build-environment: - # - PATH: /snap/bin:$PATH - # - to armhf: - # - CFLAGS: -Ofast -g -pipe -mfpu=neon -flto - # - CXXFLAGS: -Ofast -g -pipe -mfpu=neon -flto - # - LDFLAGS: -mfpu=neon -flto - # - else: - # - CFLAGS: -Ofast -g -pipe -flto - # - CXXFLAGS: -Ofast -g -pipe -flto - # - LDFLAGS: -flto - # build-packages: - # - curl - # - libarchive-dev - # - libfftw3-dev - # - libgraphicsmagick++1-dev - # - libgraphicsmagick1-dev - # - libluajit-5.1-dev - # - libopencv-core-dev - # - libopencv-highgui-dev - # - libopencv-videoio-dev - # # - libopencv-imgcodecs-dev - # # - libopencv-imgproc-dev - # - libopenexr-dev - # - libxres-dev - # - luajit - # - make - # - qt5-qmake - # - qtbase5-dev - # - qtbase5-dev-tools - # - qtchooser - # - qttools5-dev - # - wget - # stage-packages: - # - libarchive13 - # - libdouble-conversion3 - # - libfftw3-3 - # - libgraphicsmagick-q16-3 - # - libgraphicsmagick++-q16-12 - # - libluajit-5.1-2 - # - libopencv-core4.5d - # - libopencv-highgui4.5d - # - libopencv-videoio4.5d - # - libopenexr25 - # - libqt5core5a - # - libqt5gui5 - # - libqt5network5 - # - libqt5widgets5 - # - libxres1 - # - luajit - # - qtwayland5 + gmic: + after: [gimp] + plugin: nil + override-pull: | + VERSION=v.3.3.3 + 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 - # # https://github.com/darktable-org/darktable/releases - # darktable: - # after: [gimp, gmic] - # source: https://github.com/darktable-org/darktable/releases/download/release-3.0.2/darktable-3.0.2.tar.xz - # source-checksum: sha256/6abaf661fe9414e92bdb33b58b98ef024ccf6132b7876abaf0751ec2109f36fb - # plugin: cmake - # build-snaps: [cmake] - # override-pull: | - # craftctl default - # sed -i 's|Exec=.*|Exec=darktable %U|;s|TryExec=.*|TryExec=darktable|;s|Icon=.*|Icon=${SNAP}/usr/share/icons/hicolor/scalable/apps/darktable.svg|' data/darktable.desktop.in - # cmkae-parameters: - # - -DCMAKE_BUILD_TYPE=Release - # - -DCMAKE_INSTALL_PREFIX=/usr - # build-environment: - # - CFLAGS: -Ofast -g -pipe -flto - # - CXXFLAGS: -Ofast -g -pipe -flto - # - LDFLAGS: -flto - # build-snaps: [cmake] - # build-packages: - # - curl - # - freeglut3-dev - # - fop - # - intltool - # - libflickcurl-dev - # - libgnome-keyring-dev - # - libgphoto2-dev - # - libgraphicsmagick1-dev - # - liblensfun-dev - # - liblua5.3-dev - # - libopenexr-dev - # - libosmgpsmap-1.0-dev - # - libpugixml-dev - # - libsdl1.2-dev - # - libwebp-dev - # - xsltproc - # stage-packages: - # - freeglut3 - # - libexiv2-27 - # - libflickcurl0 - # - libgnome-keyring0 - # - libgphoto2-6 - # - libgraphicsmagick-q16-3 - # - liblensfun1 - # - liblensfun-data-v1 - # - liblua5.3-0 - # - libopenexr25 - # - libosmgpsmap-1.0-1 - # - libpugixml1v5 - # - libsdl1.2debian - # - libwebp7 + # 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: + - LD_LIBRARY_PATH: $CRAFT_STAGE/usr/lib:$CRAFT_STAGE/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR + - PATH: /snap/bin:$PATH + - PKG_CONFIG_PATH: $CRAFT_STAGE/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/pkgconfig:${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH} + - QT_SELECT: qt6 + - CFLAGS: -Ofast -g -pipe -flto + - CXXFLAGS: -Ofast -g -pipe -flto + - LDFLAGS: -flto + build-packages: + - curl + - g++ + - gcc + - libcurl4-openssl-dev + - libffi7 + - libfftw3-dev + - libgraphicsmagick++1-dev + - libgraphicsmagick1-dev + - libjpeg-dev + - libopencv-core-dev + - libopencv-highgui-dev + - libopencv-videoio-dev + - libopenexr-dev + - libpng-dev + - libtiff5-dev + - libxkbfile-dev + - libxres-dev + - make + - pkg-config + - qmake6-bin + - qt6-base-dev + - qt6-l10n-tools + - qt6-tools-dev + - qt6-wayland-dev + - qtchooser + - wget + - zlib1g-dev + 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 -j$SNAPCRAFT_PARALLEL_BUILD_COUNT + make DESTDIR=$SNAPCRAFT_PART_INSTALL install + stage-packages: + - libcurl4 + - libdouble-conversion3 + - libfftw3-3 + - libffi7 + - libgraphicsmagick-q16-3 + - libgraphicsmagick++-q16-12 + - libjpeg-turbo8 + - libopencv-core4.5d + - libopencv-highgui4.5d + - libopencv-videoio4.5d + - libopenexr25 + - libpng16-16 + - libqt6core6 + - libqt6gui6 + - libqt6network6 + - libqt6widgets6 + - libtiff5 + - libxkbfile1 + - libxres1 + - qt6-wayland + - zlib1g cleanup: - after: [ gimp ] #, gmic ] + after: [gimp, gmic] plugin: nil build-snaps: - - core22 - - gnome-42-2204 - - gtk-common-themes + - core22 + - gnome-42-2204 + - gtk-common-themes override-prime: | set -eux for snap in "gnome-42-2204" "gtk-common-themes"; do # List all content-snaps you're using here - cd "/snap/$snap/current" && find . -type f,l -exec rm -f "$CRAFT_PRIME/{}" \; + cd "/snap/$snap/current" && find . -type f,l -not -path "./usr/share/xml/iso-codes/*" -exec rm -f "$CRAFT_PRIME/{}" \; done for CRUFT in bug lintian man; do rm -rf $CRAFT_PRIME/usr/share/$CRUFT done find $CRAFT_PRIME/usr/share/doc/ -type f -not -name 'copyright' -delete - find $CRAFT_PRIME/usr/share -type d -empty -not -path "$CRAFT_PRIME/usr/share/gimp/*" -delete + find $CRAFT_PRIME/usr/share -type d -empty -delete