blob: b8f2bb51ee7b70b16ff17be660fa9b9e6ef71b42 (
plain)
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
|
# Maintainer: Damian Höster <damian dot hoester at posteo dot de>
_pkgname=libjxl
pkgname=$_pkgname-metrics
pkgver=0.11.1
pkgrel=5
pkgdesc='JPEG XL image format reference implementation with butteraugli, ssimulacra, and ssimulacra2 metrics'
arch=(x86_64)
url=https://jpeg.org/jpegxl/
license=(BSD-3-Clause)
depends=(
brotli
highway
libpng
libjpeg
giflib
openexr
gperftools
)
makedepends=(
git
cmake
clang
lld
python
asciidoc
# plugins disabled for now because https://github.com/libjxl/libjxl/issues/4037
#gdk-pixbuf2 # for building gdk-pixbuf loader
#gimp # for building GIMP plugin
#java-environment # for building JNI bindings
)
provides=(
$_pkgname
libjxl.so=0.11
libjxl_threads.so=0.11
butteraugli
ssimulacra
ssimulacra2
jpegli
)
conflicts=(
$_pkgname
butteraugli
ssimulacra
ssimulacra2
jpegli
)
optdepends=(
'libjxl-doc: for documentation'
)
options=(!lto) # Disabling pacman's LTO, as ThinLTO is enforced
source=(
git+https://github.com/libjxl/$_pkgname.git#tag=v$pkgver
git+https://skia.googlesource.com/skcms.git#commit=b2e692629c1fb19342517d7fb61f1cf83d075492
git+https://github.com/webmproject/sjpeg.git#commit=e5ab13008bb214deb66d5f3e17ca2f8dbff150bf
git+https://github.com/libjpeg-turbo/libjpeg-turbo.git#tag=3.1.0
)
sha256sums=(
SKIP
SKIP
SKIP
SKIP
)
prepare() {
git -C $_pkgname submodule init third_party/{skcms,sjpeg,libjpeg-turbo}
git -C $_pkgname config submodule.third_party/skcms.url "$srcdir/skcms"
git -C $_pkgname config submodule.third_party/sjpeg.url "$srcdir/sjpeg"
git -C $_pkgname config submodule.third_party/libjpeg-turbo.url "$srcdir/libjpeg-turbo"
git -C $_pkgname -c protocol.file.allow=always submodule update
}
build() {
export CC=clang CXX=clang++
export CFLAGS+=' -flto=thin' CXXFLAGS+=' -flto=thin'
export LDFLAGS+=' -fuse-ld=lld'
cmake -S $_pkgname -B build \
-DBUILD_TESTING=OFF \
-DCMAKE_INSTALL_PREFIX=/usr \
-DJPEGXL_ENABLE_DEVTOOLS=ON \
-DJPEGXL_ENABLE_DOXYGEN=OFF \
-DJPEGXL_ENABLE_EXAMPLES=OFF \
-DJPEGXL_ENABLE_PLUGINS=OFF \
-DJPEGXL_FORCE_SYSTEM_BROTLI=ON \
-DJPEGXL_FORCE_SYSTEM_HWY=ON
make -C build
}
package() {
DESTDIR="$pkgdir" make -C build install
install -Dm644 $_pkgname/{LICENSE,PATENTS} \
-t "$pkgdir/usr/share/licenses/$pkgname"
ln -s /usr/bin/butteraugli_main "$pkgdir/usr/bin/butteraugli"
ln -s /usr/bin/ssimulacra_main "$pkgdir/usr/bin/ssimulacra"
}
|