2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, cmake, nasm
|
2021-01-05 17:05:55 +00:00
|
|
|
, enableStatic ? stdenv.hostPlatform.isStatic
|
|
|
|
, enableShared ? !stdenv.hostPlatform.isStatic
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
|
|
|
|
pname = "libjpeg-turbo";
|
2020-12-07 07:45:13 +00:00
|
|
|
version = "2.0.6";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-10-16 20:44:37 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "libjpeg-turbo";
|
|
|
|
repo = "libjpeg-turbo";
|
|
|
|
rev = version;
|
2020-12-07 07:45:13 +00:00
|
|
|
sha256 = "0njdxfmyk8smj8bbd6fs3lxjaq3lybivwgg16gpnbiyl984dpi9b";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
# This is needed by freeimage
|
|
|
|
patches = [ ./0001-Compile-transupp.c-as-part-of-the-library.patch ]
|
|
|
|
++ lib.optional (stdenv.hostPlatform.libc or null == "msvcrt")
|
2020-04-24 23:36:52 +00:00
|
|
|
./mingw-boolean.patch;
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
outputs = [ "bin" "dev" "dev_private" "out" "man" "doc" ];
|
|
|
|
|
|
|
|
postFixup = ''
|
|
|
|
moveToOutput include/transupp.h $dev_private
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake nasm ];
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DENABLE_STATIC=${if enableStatic then "1" else "0"}"
|
2020-08-20 17:08:02 +00:00
|
|
|
"-DENABLE_SHARED=${if enableShared then "1" else "0"}"
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
doInstallCheck = true;
|
|
|
|
installCheckTarget = "test";
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-10-16 20:44:37 +00:00
|
|
|
homepage = "https://libjpeg-turbo.org/";
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A faster (using SIMD) libjpeg implementation";
|
|
|
|
license = licenses.ijg; # and some parts under other BSD-style licenses
|
|
|
|
maintainers = with maintainers; [ vcunat colemickens ];
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|