summary refs log tree commit diff
path: root/pkgs/development/libraries/libtiff
diff options
context:
space:
mode:
authortoonn <toonn@toonn.io>2021-07-04 15:40:04 +0200
committerJonathan Ringer <jonringer@users.noreply.github.com>2021-11-24 15:17:13 -0800
commitd0c5ac23835e11ee5d01fd91e4739e9d5cab01e8 (patch)
treea4ffb15a1a4a8f6d060618e11278ffc938aa51d9 /pkgs/development/libraries/libtiff
parent63a3ead0848d7d8edc985871130fcafc1dd2d260 (diff)
downloadnixpkgs-d0c5ac23835e11ee5d01fd91e4739e9d5cab01e8.tar
nixpkgs-d0c5ac23835e11ee5d01fd91e4739e9d5cab01e8.tar.gz
nixpkgs-d0c5ac23835e11ee5d01fd91e4739e9d5cab01e8.tar.bz2
nixpkgs-d0c5ac23835e11ee5d01fd91e4739e9d5cab01e8.tar.lz
nixpkgs-d0c5ac23835e11ee5d01fd91e4739e9d5cab01e8.tar.xz
nixpkgs-d0c5ac23835e11ee5d01fd91e4739e9d5cab01e8.tar.zst
nixpkgs-d0c5ac23835e11ee5d01fd91e4739e9d5cab01e8.zip
libtiff: Disable OpenGL entirely for Darwin
On the Hydra builders and with Clang 7, CMake fails to find OpenGL. With
Clang 11 it manages to find the the OpenGL and GLUT system frameworks
for me. It does not find `gl.h` however. So the tests for `tiffgt` fail
on a missing include.

Since previously OpenGL wasn't detected I've opted to disable the CMake
check for OpenGL for darwin. This means `tiffgt.c` is never built and
tested. Ideally we'd provide the proper headers so the tests can
succeed.
Diffstat (limited to 'pkgs/development/libraries/libtiff')
-rw-r--r--pkgs/development/libraries/libtiff/0001-Disable-OpenGL.patch26
-rw-r--r--pkgs/development/libraries/libtiff/default.nix7
2 files changed, 32 insertions, 1 deletions
diff --git a/pkgs/development/libraries/libtiff/0001-Disable-OpenGL.patch b/pkgs/development/libraries/libtiff/0001-Disable-OpenGL.patch
new file mode 100644
index 00000000000..60ce8ed49b1
--- /dev/null
+++ b/pkgs/development/libraries/libtiff/0001-Disable-OpenGL.patch
@@ -0,0 +1,26 @@
+From 6385dfa45c86b79da4f84df10f481f0ba260ab1f Mon Sep 17 00:00:00 2001
+From: toonn <toonn@toonn.io>
+Date: Sat, 3 Jul 2021 20:38:25 +0200
+Subject: [PATCH] Disable OpenGL
+
+---
+ CMakeLists.txt | 3 ---
+ 1 file changed, 3 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index efe857d..e72897b 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -611,9 +611,6 @@ endif()
+ find_package(OpenGL)
+ find_package(GLUT)
+ set(HAVE_OPENGL FALSE)
+-if(OPENGL_FOUND AND OPENGL_GLU_FOUND AND GLUT_FOUND)
+-  set(HAVE_OPENGL TRUE)
+-endif()
+ # Purely to satisfy the generated headers:
+ check_include_file(GL/gl.h HAVE_GL_GL_H)
+ check_include_file(GL/glu.h HAVE_GL_GLU_H)
+-- 
+2.17.2 (Apple Git-113)
+
diff --git a/pkgs/development/libraries/libtiff/default.nix b/pkgs/development/libraries/libtiff/default.nix
index ea246790020..d004f35d3f1 100644
--- a/pkgs/development/libraries/libtiff/default.nix
+++ b/pkgs/development/libraries/libtiff/default.nix
@@ -22,7 +22,12 @@ stdenv.mkDerivation rec {
   };
 
   # FreeImage needs this patch
-  patches = [ ./headers.patch ];
+  patches = [ ./headers.patch ]
+    # CMake manages to detect the OpenGL and GLUT system frameworks but doesn't
+    # find the `gl.h` header, making the tests fail. With older Clangs OpenGL
+    # wasn't detected so the simplest fix was to keep CMake from checking for
+    # it. This means `tiffgt` isn't built and tested.
+    ++ lib.optional stdenv.isDarwin ./0001-Disable-OpenGL.patch;
 
   outputs = [ "bin" "dev" "dev_private" "out" "man" "doc" ];