recipes: Rename 'pkghashtag' variable to 'pkgcategory'
[dragora.git] / recipes / libs / libjpeg-turbo / recipe
blobb02af884981a76554e3ef51fe697dd04be807a5a
1 # Build recipe for libjpeg-turbo.
3 # Copyright (C) 2018, MMPG <mmpg@vp.pl>
4 # Copyright (C) 2018-2020 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 program=libjpeg-turbo
19 version=2.0.3
20 release=2
22 # Define a category for the output of the package name
23 pkgcategory=libs
25 tarname=${program}-${version}.tar.gz
27 # Remote source(s)
28 fetch=http://downloads.sourceforge.net/libjpeg-turbo/$tarname
30 description="
31 Library for JPEG images.
33 libjpeg-turbo is a high-speed version of libjpeg for x86 and x86-64
34 processors which uses SIMD instructions (MMX, SSE2, etc.) to accelerate
35 baseline JPEG compression and decompression.
37 ibjpeg-turbo is generally 2-4x as fast as the unmodified version of
38 libjpeg, all else being equal.
41 homepage=http://libjpeg-turbo.org/
42 license="IJG | BSD, zlib"
44 docs="ChangeLog.md LICENSE.md README.md README.ijg"
45 docsdir="${docdir}/${program}-${version}"
47 build()
49     set -e
50     unpack "${tardir}/$tarname"
52     cd "$srcdir"
54     # Set sane permissions
55     chmod -R u+w,go-w,a+rX-s .
57     mkdir BUILD
58     cd BUILD
60     cmake \
61      -DCMAKE_C_FLAGS_RELEASE:STRING="$QICFLAGS"       \
62      -DCMAKE_EXE_LINKER_FLAGS:STRING="$QILDFLAGS"     \
63      -DCMAKE_SHARED_LINKER_FLAGS:STRING="$QILDFLAGS"  \
64      -DCMAKE_INSTALL_PREFIX=/usr                      \
65      -DCMAKE_INSTALL_LIBDIR=/usr/lib${libSuffix}      \
66      -DCMAKE_INSTALL_MANDIR=$mandir                   \
67      -DCMAKE_INSTALL_DOCDIR=$docsdir                  \
68      -DCMAKE_BUILD_TYPE=Release                       \
69      -DCMAKE_VERBOSE_MAKEFILE=ON                      \
70      ..
72     make -j${jobs} V=1
73     make -j${jobs} DESTDIR="$destdir" install
75     cd ..
77     # Compress and link man pages (if needed)
78     if test -d "${destdir}/$mandir"
79     then
80         (
81             cd "${destdir}/$mandir"
82             find . -type f -exec lzip -9 '{}' +
83             find . -type l | while read -r file
84             do
85                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
86                 rm -- "$file"
87             done
88         )
89     fi
91     # Copy documentation
92     mkdir -p "${destdir}${docsdir}"
93     cp -p $docs "${destdir}${docsdir}"