From 96d50327bc590822210fae445fa6f3261a8f4642 Mon Sep 17 00:00:00 2001 From: Las Date: Sun, 3 Jan 2021 19:26:08 +0000 Subject: [PATCH] libtiff: export private headers for freeimage They are exported under the dev_private output so that they aren't available automatically to dependening libraries. This also switches to cmake to simplify the patch. --- pkgs/development/libraries/libtiff/default.nix | 17 ++++++++++++++--- .../development/libraries/libtiff/headers.patch | 13 +++++++++++++ 2 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 pkgs/development/libraries/libtiff/headers.patch diff --git a/pkgs/development/libraries/libtiff/default.nix b/pkgs/development/libraries/libtiff/default.nix index 6d4109621826..2f5ccc8c98f3 100644 --- a/pkgs/development/libraries/libtiff/default.nix +++ b/pkgs/development/libraries/libtiff/default.nix @@ -2,6 +2,7 @@ , fetchurl , pkgconfig +, cmake , zlib , libjpeg @@ -17,15 +18,25 @@ stdenv.mkDerivation rec { sha256 = "0d46bdvxdiv59lxnb0xz9ywm8arsr6xsapi5s6y6vnys2wjz6aax"; }; - outputs = [ "bin" "dev" "out" "man" "doc" ]; + # FreeImage needs this patch + patches = [ ./headers.patch ]; - nativeBuildInputs = [ pkgconfig ]; + outputs = [ "bin" "dev" "dev_private" "out" "man" "doc" ]; + + postFixup = '' + moveToOutput include/tif_dir.h $dev_private + moveToOutput include/tif_config.h $dev_private + moveToOutput include/tiffiop.h $dev_private + ''; + + nativeBuildInputs = [ cmake pkgconfig ]; propagatedBuildInputs = [ zlib libjpeg xz ]; #TODO: opengl support (bogus configure detection) enableParallelBuilding = true; - doCheck = true; # not cross; + doInstallCheck = true; + installCheckTarget = "test"; meta = with stdenv.lib; { description = "Library and utilities for working with the TIFF image file format"; diff --git a/pkgs/development/libraries/libtiff/headers.patch b/pkgs/development/libraries/libtiff/headers.patch new file mode 100644 index 000000000000..5a00502ef281 --- /dev/null +++ b/pkgs/development/libraries/libtiff/headers.patch @@ -0,0 +1,13 @@ +diff -ruN a/libtiff/CMakeLists.txt b/libtiff/CMakeLists.txt +--- a/libtiff/CMakeLists.txt 2019-05-31 13:05:22.849705817 +0000 ++++ b/libtiff/CMakeLists.txt 2020-11-27 21:50:03.527831837 +0000 +@@ -42,6 +42,9 @@ + libtiffxx.map) + + set(tiff_HEADERS ++ tiffiop.h ++ ${CMAKE_CURRENT_BINARY_DIR}/tif_config.h ++ tif_dir.h + tiff.h + tiffio.h + tiffvers.h)