Files
haikuports/media-libs/libjpeg-turbo/libjpeg_turbo-2.1.5.1.recipe
2024-11-05 17:49:36 +01:00

142 lines
4.3 KiB
Bash

SUMMARY="MMX, SSE, and SSE2 SIMD accelerated JPEG library"
DESCRIPTION="libjpeg-turbo is a JPEG image codec that uses SIMD instructions \
(MMX, SSE2, AVX2, NEON, AltiVec) to accelerate baseline JPEG compression and \
decompression on x86, x86-64, ARM, and PowerPC systems. On such systems, \
libjpeg-turbo is generally 2-6x as fast as libjpeg, all else being equal. On \
other types of systems, libjpeg-turbo can still outperform libjpeg by a \
significant amount, by virtue of its highly-optimized Huffman coding routines.
In many cases, the performance of libjpeg-turbo rivals that of proprietary \
high-speed JPEG codecs.
libjpeg-turbo implements both the traditional libjpeg API as well as the less \
powerful but more straightforward TurboJPEG API. libjpeg-turbo also features \
colorspace extensions that allow it to compress from/decompress to 32-bit and \
big-endian pixel buffers (RGBX, XBGR, etc.), as well as a full-featured Java \
interface.
libjpeg-turbo was originally based on libjpeg/SIMD, an MMX-accelerated \
derivative of libjpeg v6b developed by Miyasaka Masaru. The TigerVNC and \
VirtualGL projects made numerous enhancements to the codec in 2009, and in \
early 2010, libjpeg-turbo spun off into an independent project, with the goal \
of making high-speed JPEG compression/decompression technology available to \
a broader range of users and developers."
HOMEPAGE="https://www.libjpeg-turbo.org/"
COPYRIGHT="1991-2019 Thomas G. Lane, Guido Vollbeding
1997-2010 Guido Vollbeding
2000-2023 D. R. Commander
2009 Bill Allombert
1999-2006 MIYASAKA Masaru
2011 Siarhei Siamashka
2013 Linaro Limited
2014 MIPS Technologies, Inc.
2015 Google, Inc.
2015-2022 Matthieu Darbois
2015 Viktor Szathmáry
2018 Matthias Räncker"
LICENSE="BSD (3-clause)
IJG
Zlib"
REVISION="1"
SOURCE_URI="https://downloads.sourceforge.net/libjpeg-turbo/libjpeg-turbo-$portVersion.tar.gz"
CHECKSUM_SHA256="2fdc3feb6e9deb17adec9bafa3321419aa19f8f4e5dea7bf8486844ca22207bf"
SOURCE_DIR="libjpeg-turbo-$portVersion"
ARCHITECTURES="all"
SECONDARY_ARCHITECTURES="x86"
libjpegVersion="62.3.0"
libjpegVersionCompat="$libjpegVersion compat >= ${libjpegVersion%%.*}"
libturbojpegVersion="0.2.0"
libturbojpegVersionCompat="$libturbojpegVersion compat >= ${libturbojpegVersion%%.*}"
PROVIDES="
libjpeg_turbo$secondaryArchSuffix = $portVersion
lib:libjpeg$secondaryArchSuffix = $libjpegVersionCompat
lib:libturbojpeg$secondaryArchSuffix = $libturbojpegVersionCompat
"
REQUIRES="
haiku$secondaryArchSuffix
"
PROVIDES_devel="
libjpeg_turbo${secondaryArchSuffix}_devel = $portVersion
devel:libjpeg$secondaryArchSuffix = $libjpegVersionCompat
devel:libturbojpeg$secondaryArchSuffix = $libturbojpegVersionCompat
"
REQUIRES_devel="
libjpeg_turbo$secondaryArchSuffix == $portVersion base
"
CONFLICTS_devel="
jpeg${secondaryArchSuffix}_devel
"
PROVIDES_tools="
libjpeg_turbo${secondaryArchSuffix}_tools = $portVersion
cmd:cjpeg$secondaryArchSuffix = $portVersion
cmd:djpeg$secondaryArchSuffix = $portVersion
cmd:jpegtran$secondaryArchSuffix = $portVersion
cmd:rdjpgcom$secondaryArchSuffix = $portVersion
cmd:tjbench$secondaryArchSuffix = $portVersion
cmd:wrjpgcom$secondaryArchSuffix = $portVersion
"
REQUIRES_tools="
haiku$secondaryArchSuffix
libjpeg_turbo$secondaryArchSuffix == $portVersion base
"
CONFLICTS_tools="
jpeg${secondaryArchSuffix}_tools
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
"
BUILD_PREREQUIRES="
cmd:cmake
cmd:gcc$secondaryArchSuffix
cmd:ld$secondaryArchSuffix
cmd:libtoolize$secondaryArchSuffix
cmd:make
cmd:nasm
cmd:pkg_config$secondaryArchSuffix
"
defineDebugInfoPackage libjpeg_turbo$secondaryArchSuffix \
$libDir/libjpeg.so.$libjpegVersion \
$libDir/libturbojpeg.so.$libturbojpegVersion
BUILD()
{
cmake -S. -Bbuild \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_INSTALL_PREFIX=$prefix \
-DCMAKE_INSTALL_BINDIR=$binDir \
-DCMAKE_INSTALL_DATAROOTDIR=$dataDir \
-DCMAKE_INSTALL_DOCDIR=$docDir \
-DCMAKE_INSTALL_INCLUDEDIR=$includeDir \
-DCMAKE_INSTALL_LIBDIR=$libDir \
-DCMAKE_INSTALL_MANDIR=$manDir \
-DENABLE_STATIC=OFF
make -C build $jobArgs
}
INSTALL()
{
make -C build install
prepareInstalledDevelLibs libjpeg libturbojpeg
fixPkgconfig
# devel package
packageEntries devel \
$developDir \
$libDir/cmake
# tools package
packageEntries tools \
$binDir \
$documentationDir
}
TEST()
{
make -C build test
}