blob: 3b6c20268189a49c4f2a980a4b2ef2e012e85e4f (
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
96
97
98
99
100
101
102
103
104
105
106
107
|
# Maintainer: Daniel Bermond <dbermond@archlinux.org>
pkgbase=libjxl-git
pkgname=('libjxl-git' 'libjxl-doc-git')
pkgver=0.6.1.r590.g7f5a2cd0
pkgrel=1
pkgdesc='JPEG XL image format reference implementation (git version)'
arch=('x86_64')
url='https://jpeg.org/jpegxl/'
license=('BSD')
makedepends=('git' 'cmake' 'clang' 'brotli' 'gdk-pixbuf2' 'giflib' 'gimp'
'gperftools' 'highway-git' 'libjpeg-turbo' 'libpng' 'openexr'
'gflags' 'gtest' 'java-environment' 'python' 'asciidoc'
'doxygen' 'graphviz' 'xdg-utils')
source=('git+https://github.com/libjxl/libjxl.git'
'git+https://github.com/google/brotli.git'
'git+https://github.com/mm2/Little-CMS.git'
'git+https://github.com/google/googletest.git'
'git+https://github.com/webmproject/sjpeg.git'
'git+https://skia.googlesource.com/skcms.git'
'git+https://github.com/google/highway.git'
'git+https://github.com/glennrp/libpng.git'
'git+https://github.com/madler/zlib.git'
'git+https://github.com/gflags/gflags.git'
'libjxl-testdata'::'git+https://github.com/libjxl/testdata.git')
sha256sums=('SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP')
prepare() {
git -C libjxl submodule init
local _submodule
for _submodule in brotli googletest sjpeg skcms highway libpng zlib gflags
do
git -C libjxl config --local "submodule.third_party/${_submodule}.url" "${srcdir}/${_submodule}"
done
git -C libjxl config --local submodule.third_party/lcms.url "${srcdir}/Little-CMS"
git -C libjxl config --local submodule.third_party/testdata.url "${srcdir}/libjxl-testdata"
git -C libjxl submodule update
}
pkgver() {
local _tag
_tag="$(git -C libjxl tag --list --sort='-v:refname' 'v[[:digit:]]*' | sed -n 's/^v//;1p')"
printf "${_tag}.r%s.g%s" "$(git -C libjxl rev-list --count "v${_tag}..HEAD")" \
"$(git -C libjxl rev-parse --short HEAD)"
}
build() {
export CFLAGS+=' -DNDEBUG -ffat-lto-objects'
export CXXFLAGS+=' -DNDEBUG -ffat-lto-objects'
cmake -B build -S libjxl \
-DCMAKE_BUILD_TYPE:STRING='None' \
-DCMAKE_INSTALL_PREFIX:PATH='/usr' \
-DJPEGXL_ENABLE_BENCHMARK:BOOL='false' \
-DJPEGXL_ENABLE_EXAMPLES:BOOL='false' \
-DJPEGXL_ENABLE_FUZZERS:BOOL='false' \
-DJPEGXL_ENABLE_PLUGINS:BOOL='true' \
-DJPEGXL_ENABLE_VIEWERS:BOOL='false' \
-DJPEGXL_FORCE_SYSTEM_BROTLI:BOOL='true' \
-DJPEGXL_FORCE_SYSTEM_GTEST:BOOL='true' \
-DJPEGXL_FORCE_SYSTEM_HWY:BOOL='true' \
-DJPEGXL_BUNDLE_LIBPNG:BOOL='NO' \
-DJPEGXL_BUNDLE_GFLAGS='NO' \
-DJPEGXL_INSTALL_JARDIR='/usr/share/java' \
-Wno-dev
make -C build all doc
}
check() {
make -C build test
}
package_libjxl-git() {
depends=('brotli' 'gflags' 'giflib' 'gperftools' 'highway-git' 'libjpeg-turbo'
'libpng' 'openexr')
optdepends=('gdk-pixbuf2: for gdk-pixbuf loader'
'gimp: for gimp plugin'
'java-runtime: for JNI bindings')
provides=('libjxl' 'libjpeg-xl-git' 'libjxl.so' 'libjxl_threads.so')
conflicts=('libjxl' 'libjpeg-xl-git')
replaces=('libjpeg-xl-git')
make -C build DESTDIR="$pkgdir" install
install -D -m644 libjxl/{LICENSE,PATENTS} -t "${pkgdir}/usr/share/licenses/${pkgname}"
mv "${pkgdir}/usr/share/java"/{org.jpeg.jpegxl,jpegxl}.jar
}
package_libjxl-doc-git() {
pkgdesc="$(sed 's/(\(git\)/(documentation; \1/' <<< "$pkgdesc")"
arch=('any')
provides=('libjxl-doc' 'libjpeg-xl-doc-git')
conflicts=('libjxl-doc' 'libjpeg-xl-doc-git')
replaces=('libjpeg-xl-doc-git')
install -d -m755 "${pkgdir}/usr/share/doc"
install -D -m644 libjxl/{LICENSE,PATENTS} -t "${pkgdir}/usr/share/licenses/${pkgname}"
cp -dr --no-preserve='ownership' build/html "${pkgdir}/usr/share/doc/libjxl"
}
|