1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192
|
# SPDX-FileCopyrightText: 2024, 2025 Scarlett Moore <sgmoore@kde.org>
#
# SPDX-License-Identifier: CC0-1.0
---
name: skanpage
confinement: strict
grade: stable
base: core24
adopt-info: skanpage
apps:
skanpage:
extensions:
- kde-neon-6
common-id: org.kde.skanpage.desktop
desktop: usr/share/applications/org.kde.skanpage.desktop
command: usr/bin/skanpage
plugs:
- audio-record
- home
- removable-media
- avahi-observe
- cups
- raw-usb
- hardware-observe
environment:
ALSA_CONFIG_PATH: "$SNAP/kf6/etc/asound.conf"
layout:
/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/alsa-lib:
bind: $SNAP/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/alsa-lib
/etc:
bind: $SNAP/etc
/usr/lib/sane:
bind: $SNAP/usr/lib/sane
slots:
session-dbus-interface:
interface: dbus
name: org.kde.skanpage
bus: session
parts:
# libsane:
# source: https://gitlab.com/sane-project/backends.git
# source-type: git
# source-tag: '1.2.1'
# source-depth: 1
# plugin: autotools
# autotools-configure-parameters:
# - --prefix=/usr
# - --sysconfdir=/etc
# - --with-avahi
# build-packages:
# # Everything of the build dependencies of the sane-backends
# # Debian package ...
# - libavahi-client-dev
# - libcups2-dev
# - libcurl4-gnutls-dev
# - libgphoto2-dev
# - libieee1284-3-dev
# - libjpeg-dev
# - libltdl3-dev
# - libpoppler-glib-dev
# - libsnmp-dev
# - libtiff-dev
# - libusb-1.0-0-dev
# - libxml2-dev
# - python3-minimal
# - autoconf-archive
# - rsync
# stage-packages:
# - libexif12
# - libgphoto2-6
# - libgphoto2-port12
# - libsnmp40
# organize:
# snap/skanpage/current/usr: usr
# override-build: |
# craftctl default
# rsync -a --ignore-existing $CRAFT_PART_INSTALL/ /
libsane-airscan:
# after: [libsane]
source: https://github.com/alexpevzner/sane-airscan
source-type: git
source-tag: 0.99.27
source-depth: 1
plugin: make
make-parameters:
- prefix=/usr
- sysconfdir=/etc
- libdir=/usr/lib
build-packages:
# Everything of the build dependencies of the sane-airscan
# Debian package ...
- libavahi-client-dev
- libavahi-common-dev
- libjpeg-turbo8-dev
- libpng-dev
- libxml2-dev
- libgnutls28-dev
- libsane-dev
ksanecore:
after:
# - libsane
- libsane-airscan
plugin: cmake
source: https://invent.kde.org/libraries/ksanecore.git
source-branch: master
build-packages:
- libsane-dev
stage-packages:
- libsane1
- libsane-hpaio
- libsane-common
cmake-parameters:
- -DCMAKE_INSTALL_PREFIX=/usr
- -DCMAKE_BUILD_TYPE=Release
- -DQT_MAJOR_VERSION=6
- -DBUILD_TESTING=OFF
build-environment: &build-environment
- LD_LIBRARY_PATH: "$CRAFT_STAGE/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR:$CRAFT_STAGE/usr/lib:$CRAFT_STAGE/lib:/snap/kde-qt6-core24-sdk/current/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR:/snap/kde-qt6-core24-sdk/current/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/libproxy:/snap/kf6-core24-sdk/current/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR"
- PKG_CONFIG_PATH: "$CRAFT_STAGE/usr/lib/pkgconfig:$CRAFT_STAGE/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/pkgconfig:/snap/kde-qt6-core24-sdk/current/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/pkgconfig:/snap/kf6-core24-sdk/current/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/pkgconfig"
libksane:
after:
- ksanecore
plugin: cmake
source: https://invent.kde.org/graphics/libksane.git
source-branch: master
cmake-parameters:
- -DCMAKE_INSTALL_PREFIX=/usr
- -DCMAKE_BUILD_TYPE=Release
- -DQT_MAJOR_VERSION=6
- -DBUILD_TESTING=OFF
build-environment: *build-environment
kquickimageeditor:
after:
- libksane
plugin: cmake
source: https://invent.kde.org/libraries/kquickimageeditor.git
source-branch: master
cmake-parameters:
- -DCMAKE_INSTALL_PREFIX=/usr
- -DCMAKE_BUILD_TYPE=Release
- -DQT_MAJOR_VERSION=6
- -DBUILD_TESTING=OFF
build-environment: *build-environment
skanpage:
after:
- kquickimageeditor
parse-info:
- usr/share/metainfo/org.kde.skanpage.appdata.xml
plugin: cmake
source: .
source-type: local
build-packages:
- libpng-dev
- libtesseract-dev
- libpulse0
stage-packages:
- libpulse0
- libasound2
- libasound2-plugins
- libasound2-data
- libtesseract5
- tesseract-ocr-all
- libieee1284-3t64
- libpoppler-glib8t64
- cups-client
cmake-parameters:
- -DCMAKE_INSTALL_PREFIX=/usr
- -DCMAKE_BUILD_TYPE=Release
- -DQT_MAJOR_VERSION=6
- -DBUILD_TESTING=OFF
build-environment: *build-environment
prime:
- -usr/lib/*/cmake/*
- -usr/include/*
- -usr/share/ECM/*
- -usr/share/man/*
- -usr/bin/X11
- -usr/lib/gcc/$CRAFT_ARCH_TRIPLET_BUILD_FOR/6.0.0
- -usr/lib/aspell/*
- -usr/share/lintian
cleanup:
after:
- skanpage
plugin: nil
build-snaps:
- core24
- kf6-core24
override-prime: |
set -eux
for snap in "core24" "kf6-core24"; do
cd "/snap/$snap/current" && find . -type f,l -exec rm -rf "${CRAFT_PRIME}/{}" \;
done
|