about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/libjpeg-turbo
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2019-01-07 02:18:36 +0000
committerAlyssa Ross <hi@alyssa.is>2019-01-07 02:18:47 +0000
commit36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2 (patch)
treeb3faaf573407b32aa645237a4d16b82778a39a92 /nixpkgs/pkgs/development/libraries/libjpeg-turbo
parent4e31070265257dc67d120c27e0f75c2344fdfa9a (diff)
parentabf060725d7614bd3b9f96764262dfbc2f9c2199 (diff)
downloadnixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.gz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.bz2
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.lz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.xz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.zst
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.zip
Add 'nixpkgs/' from commit 'abf060725d7614bd3b9f96764262dfbc2f9c2199'
git-subtree-dir: nixpkgs
git-subtree-mainline: 4e31070265257dc67d120c27e0f75c2344fdfa9a
git-subtree-split: abf060725d7614bd3b9f96764262dfbc2f9c2199
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/libjpeg-turbo')
-rw-r--r--nixpkgs/pkgs/development/libraries/libjpeg-turbo/default.nix40
-rw-r--r--nixpkgs/pkgs/development/libraries/libjpeg-turbo/mingw-boolean.patch19
2 files changed, 59 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/libjpeg-turbo/default.nix b/nixpkgs/pkgs/development/libraries/libjpeg-turbo/default.nix
new file mode 100644
index 000000000000..4e654168d4b4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libjpeg-turbo/default.nix
@@ -0,0 +1,40 @@
+{ stdenv, fetchurl, cmake, nasm }:
+
+stdenv.mkDerivation rec {
+  name = "libjpeg-turbo-${version}";
+  version = "2.0.1";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/libjpeg-turbo/${name}.tar.gz";
+    sha256 = "1zv6z093l3x3jzygvni7b819j7xhn6d63jhcdrckj7fz67n6ry75";
+  };
+
+  patches =
+    stdenv.lib.optional (stdenv.hostPlatform.libc or null == "msvcrt")
+      ./mingw-boolean.patch;
+
+  outputs = [ "bin" "dev" "out" "man" "doc" ];
+
+  nativeBuildInputs = [ cmake nasm ];
+
+  preConfigure = ''
+    cmakeFlagsArray+=(
+      "-DCMAKE_INSTALL_BINDIR=$bin/bin"
+      "-DENABLE_STATIC=0"
+    )
+  '';
+
+  doCheck = true; # not cross;
+  checkTarget = "test";
+  preCheck = ''
+    export LD_LIBRARY_PATH="$NIX_BUILD_TOP/${name}:$LD_LIBRARY_PATH"
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = http://libjpeg-turbo.virtualgl.org/;
+    description = "A faster (using SIMD) libjpeg implementation";
+    license = licenses.ijg; # and some parts under other BSD-style licenses
+    maintainers = [ maintainers.vcunat ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libjpeg-turbo/mingw-boolean.patch b/nixpkgs/pkgs/development/libraries/libjpeg-turbo/mingw-boolean.patch
new file mode 100644
index 000000000000..9b9483d63987
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libjpeg-turbo/mingw-boolean.patch
@@ -0,0 +1,19 @@
+Ported to updated libjpeg-turbo from
+https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-libjpeg-turbo/jpeg-typedefs.patch
+--- a/jmorecfg.h	2012-02-10 06:47:55 +0300
++++ b/jmorecfg.h	2012-05-03 10:29:13 +0400
+@@ -224,7 +224,13 @@
+  * Defining HAVE_BOOLEAN before including jpeglib.h should make it work.
+  */
+ 
+-#ifndef HAVE_BOOLEAN
++#if defined(_WIN32) && !defined(HAVE_BOOLEAN)
++#ifndef __RPCNDR_H__
++typedef unsigned char boolean;
++#endif
++#define HAVE_BOOLEAN
++#endif
++#if !defined(HAVE_BOOLEAN) && !defined(__RPCNDR_H__)
+ typedef int boolean;
+ #endif
+ #ifndef FALSE			/* in case these macros already exist */