1 # Build recipe for libjpeg-turbo.
3 # Copyright (C) 2018, MMPG <mmpg@vp.pl>
4 # Copyright (C) 2018, 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.
22 # Set 'outdir' for a nice and well-organized output directory
23 outdir="${outdir}/${arch}/libs"
25 tarname=${program}-${version}.tar.gz
28 fetch=http://downloads.sourceforge.net/libjpeg-turbo/$tarname
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}"
50 unpack "${tardir}/$tarname"
54 # Set sane permissions
55 chmod -R u+w,go-w,a+rX-s .
61 -DCMAKE_C_FLAGS:STRING="$QICFLAGS" \
62 -DCMAKE_EXE_LINKER_FLAGS:STRING="$QILDFLAGS" \
63 -DCMAKE_SHARED_LINKER_FLAGS:STRING="$QILDFLAGS" \
64 -DCMAKE_INSTALL_PREFIX=/usr \
65 -DLIB_SUFFIX=/usr/lib${libSuffix} \
66 -DCMAKE_INSTALL_MANDIR=$mandir \
67 -DCMAKE_INSTALL_DOCDIR=$docsdir \
68 -DCMAKE_BUILD_TYPE=Release \
72 make -j${jobs} DESTDIR="$destdir" install
76 # Compress and link man pages (if needed)
77 if test -d "${destdir}/$mandir"
80 cd "${destdir}/$mandir"
81 find . -type f -exec lzip -9 '{}' +
82 find . -type l | while read -r file
84 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
91 mkdir -p "${destdir}${docsdir}"
92 cp -p $docs "${destdir}${docsdir}"