about summary refs log tree commit diff
path: root/pkgs/tools/graphics/pfstools
diff options
context:
space:
mode:
authorViktor Kronvall <viktor.kronvall@gmail.com>2022-11-09 19:53:34 +0900
committerViktor Kronvall <viktor.kronvall@gmail.com>2022-11-09 19:53:34 +0900
commit69b41f98809c7a3bfe79dae28c31917927ee9f64 (patch)
tree01480bbf65345d9d2a0b20f558fb492a044f364b /pkgs/tools/graphics/pfstools
parent29e71a7193d4d8252031984d9c1f4b1b9fb4c443 (diff)
pfstools: fix netpbm inclusion
The main CMakeLists.txt no longer includes the FindNETPBM.cmake file.
This commit removes the comment on the `include` statement to re-enable
including the FindNETPBM.cmake file.

Moreover the netpbm libraries weren't found due to the name searched for
included an extraneous `.` The
`stdenv.hostPlatform.extensions.sharedLibrary` expressions resolves to
".so" on x86_64-linux which means that the `-name` flag gets passed
"*..so*" instead of "*.so*". This commit ensures that "*.so*" is passed
when looking for the netpbm shared objects.
Diffstat (limited to 'pkgs/tools/graphics/pfstools')
-rw-r--r--pkgs/tools/graphics/pfstools/default.nix6
1 files changed, 4 insertions, 2 deletions
diff --git a/pkgs/tools/graphics/pfstools/default.nix b/pkgs/tools/graphics/pfstools/default.nix
index 2bc40f1cc7889..888842aea6ffc 100644
--- a/pkgs/tools/graphics/pfstools/default.nix
+++ b/pkgs/tools/graphics/pfstools/default.nix
@@ -18,9 +18,11 @@ mkDerivation rec {
   cmakeFlags = [ "-DWITH_MATLAB=false" ];
 
   preConfigure = ''
+    sed -e 's|#include( ''${PROJECT_SRC_DIR}/cmake/FindNETPBM.cmake )|include( ''${PROJECT_SOURCE_DIR}/cmake/FindNETPBM.cmake )|' -i CMakeLists.txt
+
     rm cmake/FindNETPBM.cmake
-    echo "SET(NETPBM_LIBRARY `find ${lib.getLib netpbm} -name "*.${stdenv.hostPlatform.extensions.sharedLibrary}*" -type f`)" >> cmake/FindNETPBM.cmake
-    echo "SET(NETPBM_LIBRARIES `find ${lib.getLib netpbm} -name "*.${stdenv.hostPlatform.extensions.sharedLibrary}*" -type f`)" >> cmake/FindNETPBM.cmake
+    echo "SET(NETPBM_LIBRARY `find ${lib.getLib netpbm} -name "*${stdenv.hostPlatform.extensions.sharedLibrary}*" -type f`)" >> cmake/FindNETPBM.cmake
+    echo "SET(NETPBM_LIBRARIES `find ${lib.getLib netpbm} -name "*${stdenv.hostPlatform.extensions.sharedLibrary}*" -type f`)" >> cmake/FindNETPBM.cmake
     echo "SET(NETPBM_INCLUDE_DIR ${lib.getDev netpbm}/include/netpbm)" >> cmake/FindNETPBM.cmake
     echo "INCLUDE(FindPackageHandleStandardArgs)" >> cmake/FindNETPBM.cmake
     echo "FIND_PACKAGE_HANDLE_STANDARD_ARGS(NETPBM DEFAULT_MSG NETPBM_LIBRARY NETPBM_INCLUDE_DIR)" >> cmake/FindNETPBM.cmake