1 # Build recipe for openjpeg.
3 # Copyright (c) 2018 Markus Tornow, <tornow@riseup.net>.
4 # Copyright (c) 2021 Matias Fonzo, <selk@dragora.org>.
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
10 # http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
18 # Exit immediately on any error
25 # Define a category for the output of the package name
28 tarname=${program}-${version}.tar.gz
31 fetch=https://github.com/uclouvain/openjpeg/archive/v${version}/$tarname
34 OpenJPEG is an open-source JPEG 2000 codec.
36 OpenJPEG is written in C language. It has been developed in order to
37 promote the use of JPEG 2000, a still-image compression standard from
38 the Joint Photographic Experts Group (JPEG). Since may 2015, it is
39 officially recognized by ISO/IEC and ITU-T as a JPEG 2000 Reference
43 homepage=https://www.openjpeg.org
44 license="BSD 2-clause"
46 # Source documentation
47 docs="AUTHORS.md LICENSE CHANGELOG.md NEWS.md README.md THANKS.md"
48 docsdir="${docdir}/${program}-${version}"
52 unpack "${tardir}/$tarname"
56 # Set sane permissions
57 chmod -R u+w,go-w,a+rX-s .
64 -DCMAKE_C_FLAGS:STRING="$QICFLAGS" \
65 -DCMAKE_CXX_FLAGS:STRING="$QICXXFLAGS" \
66 -DCMAKE_EXE_LINKER_FLAGS:STRING="$QILDFLAGS" \
67 -DCMAKE_SHARED_LINKER_FLAGS:STRING="$QILDFLAGS" \
68 -DCMAKE_INSTALL_PREFIX=/usr \
69 -DOPENJPEG_INSTALL_LIB_DIR=lib${libSuffix} \
70 -DCMAKE_INSTALL_MANDIR=$mandir \
71 -DCMAKE_INSTALL_DOCDIR=$docsdir \
72 -DCMAKE_BUILD_TYPE=Release \
73 -DCMAKE_VERBOSE_MAKEFILE=ON \
74 -DCMAKE_SKIP_INSTALL_RPATH=YES \
75 -DBUILD_STATIC_LIBS=OFF \
79 DESTDIR="$destdir" ninja -j${jobs} install
81 # Leave the temporary BUILD directory
84 # Install manual pages (manually)
86 for file in man/man?/*
88 install -p -m 644 "$file" -D "${destdir}/usr/share/$file"
93 # Compress and link man pages (if needed)
94 if test -d "${destdir}/$mandir"
97 cd "${destdir}/$mandir"
98 find . -type f -exec lzip -9 '{}' +
99 find . -type l | while read -r file
101 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
108 mkdir -p "${destdir}${docsdir}"
109 cp -p $docs "${destdir}${docsdir}"