-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPKGBUILD
More file actions
133 lines (121 loc) · 4.72 KB
/
PKGBUILD
File metadata and controls
133 lines (121 loc) · 4.72 KB
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
#!/hint/bash
# Maintainer : bartus <arch-user-repoᘓbartus.33mail.com>
# Contributor: Filipe Laíns (FFY00) <filipe.lains@gmail.com>
# Contributor: Iru Cai <mytbk920423@gmail.com>
# Contributor: Alexander Hunziker <alex.hunziker@gmail.com>
# Contributor: Alessio Biancalana <dottorblaster@gmail.com>
# Configuration
_fragment="${FRAGMENT:-#branch=master}"
pkgname=gimp-develop-git
_pkgname=${pkgname%-develop-git}
epoch=1
pkgver=3.3.1.r178.37deee935b
pkgrel=1
pkgdesc="GNU Image Manipulation Program (non-conflicting git version)"
arch=('i686' 'x86_64')
url="https://www.gimp.org"
license=('GPL' 'LGPL')
depends=(
'libxmu'
'lcms2>=2.8'
'libwmf>=0.2.8'
'icu'
'enchant'
'libgexiv2>=0.14.0'
'librsvg>=2.40.6'
'desktop-file-utils'
'libexif>=0.6.15'
'libart-lgpl>=2.3.19'
'dbus-glib'
'gtk-doc>=1.0'
'poppler-glib>=0.69.0'
'poppler-data>=0.4.9'
'openexr>=1.6.1'
'libmypaint>=1.5.0'
'mypaint-brushes>=2.0'
'babl>=0.1.118'
'gegl>=0.4.66'
'cairo>=1.14.0'
'appstream>=0.16.1'
'gobject-introspection>=1.32.0'
'libbacktrace'
)
makedepends+=('git' 'intltool>=0.40.1'
'alsa-lib>=1.0.0' 'libxslt' 'glib-networking'
'alsa-lib' 'curl' 'ghostscript' 'libxpm' 'webkit2gtk-4.1'
'libheif' 'libwebp' 'libmng' 'iso-codes' 'aalib' 'zlib'
'gjs' 'python-gobject' 'python-packaging' 'luajit' 'meson'
'glib2-devel'
'libbacktrace' 'gi-docgen' 'cfitsio'
'python-cairo' 'xdg-utils' 'bash-completion'
)
checkdepends=('xorg-server-xvfb')
optdepends=('gutenprint: for sophisticated printing only as gimp has built-in cups print support'
'alsa-lib: for MIDI event controller module'
'curl: for URI support'
'ghostscript: for postscript support'
'libxpm: XPM support'
'webkit2gtk-4.1: HTML renderer and web content engine'
'libheif: HEIF support'
'libwebp: WebP support'
'libmng: MNG support'
'iso-codes: Language support'
'aalib: ASCII art support'
'zlib: Compression routines'
'gjs: JavaScript scripting support'
'luajit: LUA scripting support'
'cfitsio: for FITS support'
'gvfs: for HTTP/S support (and many other schemes)'
'xdg-utils: xdg-email required for sending support email'
)
source=("git+https://gitlab.gnome.org/GNOME/gimp.git${_fragment}"
"gimp-data::git+https://gitlab.gnome.org/GNOME/gimp-data"
'linux.gpl')
sha512sums=('SKIP'
'SKIP'
'6f33d57f242fa8ce04b65e06a712bd54677306a45b22cb853fbe348089cd4673bd4ed91073074fe067166fe8951c370f8bbbc386783e3ed5170d52e9062666fe')
pkgver() {
# shellcheck disable=SC2183,SC2046
printf "%s.r%s.%s" \
$(grep -zoP "(?s)^project\(.*?version: '\K.*?(?=(\+git)?',)" ${_pkgname}/meson.build|sed 's/-/./g'|tr -d '\0') \
"$(git -C $_pkgname rev-list "$(git -C $_pkgname describe --abbrev=0)"..HEAD --count)" \
"$(git -C $_pkgname log --pretty=format:'%h' -n 1)"
}
prepare() {
git -C "$srcdir/gimp" config submodule.gimp-data.url "$srcdir/gimp-data"
git -C "$srcdir/gimp" -c protocol.file.allow=always submodule update --init
sed -E 's/^(api_version_minor =) 0$/\1 1/' -i "${srcdir}"/${_pkgname}/meson.build
sed -E "s/(require_version\('Gimp(Ui)?',) '3.0'\)/\1 '3.1'\)/g" -i $(grep -Rl "require_version('Gimp', '3.0')" "${srcdir}"/${_pkgname})
}
build() {
export CFLAGS CXXFLAGS LDFLAGS
meson "${srcdir}/${_pkgname}"\
"${srcdir}/build"\
--prefix=/usr \
-Dbug-report-url='https://github.com/bartoszek/AUR-gimp-git/issues'
export NINJA_STATUS="[%p | %f<%r<%u | %cbps ] "
# shellcheck disable=SC2046 # allow MAKEFLAGS to split when passing multiple flags.
ninja $(grep -oP -- '-+[A-z]+ ?[0-9]*'<<<"${MAKEFLAGS:--j1}") -C "${srcdir}/build"
}
check() {
ninja -C "${srcdir}/build" test || true
}
package() {
_suffix=$(grep -oP '^\d\.\d'<<<"$pkgver")
DESTDIR="${pkgdir}" ninja -C "${srcdir}/build" install
install -Dm 644 "${srcdir}/linux.gpl" "${pkgdir}/usr/share/gimp/${_suffix}/palettes/Linux.gpl"
#fix gimp.desktop
mv "${pkgdir}"/usr/share/applications/gimp.desktop "${pkgdir}"/usr/share/applications/gimp-${_suffix}.desktop
sed -i "s/Icon=gimp/&-${_suffix}/" "${pkgdir}"/usr/share/applications/gimp-${_suffix}.desktop
#fix icons
for icon in $(find "${pkgdir}"/usr/share/icons/ -type f); do
mv "${icon}" "${icon%.*}-${_suffix}.${icon##*.}"
done
#fix metainfo
rm -rf "${pkgdir}"/usr/share/metainfo
#fix bins
rm "${pkgdir}"/usr/bin/gimp{,-console,tool,-test-clipboard}{,-${_suffix::1}} || true
#fix manpages
rm "${pkgdir}"/usr/share/man/man1/gimp{,-console,tool}{,-${_suffix::1}}.1 || true
rm "${pkgdir}"/usr/share/man/man5/gimprc{,-${_suffix::1}}.5 || true
}