Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at devShellTools-shell 90 lines 2.1 kB view raw
1{ 2 lib, 3 stdenv, 4 mkDerivation, 5 fetchurl, 6 cmake, 7 pkg-config, 8 openexr, 9 zlib, 10 imagemagick6, 11 libGLU, 12 libGL, 13 libglut, 14 fftwFloat, 15 fftw, 16 gsl, 17 libexif, 18 perl, 19 qtbase, 20 netpbm, 21 enableUnfree ? false, 22 opencv, 23}: 24 25mkDerivation rec { 26 pname = "pfstools"; 27 version = "2.2.0"; 28 29 src = fetchurl { 30 url = "mirror://sourceforge/${pname}/${version}/${pname}-${version}.tgz"; 31 sha256 = "sha256-m/aESYVmMibCGZjutDwmGsuOSziRuakbcpVUQGKJ18o="; 32 }; 33 34 outputs = [ 35 "out" 36 "dev" 37 "man" 38 ]; 39 40 cmakeFlags = [ "-DWITH_MATLAB=false" ]; 41 42 preConfigure = '' 43 sed -e 's|#include( ''${PROJECT_SRC_DIR}/cmake/FindNETPBM.cmake )|include( ''${PROJECT_SOURCE_DIR}/cmake/FindNETPBM.cmake )|' -i CMakeLists.txt 44 45 rm cmake/FindNETPBM.cmake 46 echo "SET(NETPBM_LIBRARY `find ${lib.getLib netpbm} -name "*${stdenv.hostPlatform.extensions.sharedLibrary}*" -type f`)" >> cmake/FindNETPBM.cmake 47 echo "SET(NETPBM_LIBRARIES `find ${lib.getLib netpbm} -name "*${stdenv.hostPlatform.extensions.sharedLibrary}*" -type f`)" >> cmake/FindNETPBM.cmake 48 echo "SET(NETPBM_INCLUDE_DIR ${lib.getDev netpbm}/include/netpbm)" >> cmake/FindNETPBM.cmake 49 echo "INCLUDE(FindPackageHandleStandardArgs)" >> cmake/FindNETPBM.cmake 50 echo "FIND_PACKAGE_HANDLE_STANDARD_ARGS(NETPBM DEFAULT_MSG NETPBM_LIBRARY NETPBM_INCLUDE_DIR)" >> cmake/FindNETPBM.cmake 51 ''; 52 53 nativeBuildInputs = [ 54 cmake 55 pkg-config 56 ]; 57 buildInputs = [ 58 openexr 59 zlib 60 imagemagick6 61 fftwFloat 62 fftw 63 gsl 64 libexif 65 perl 66 qtbase 67 netpbm 68 ] 69 ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ 70 libGLU 71 libGL 72 libglut 73 ] 74 ++ lib.optional enableUnfree (opencv.override { enableUnfree = true; }); 75 76 patches = [ 77 ./glut.patch 78 ./threads.patch 79 ./pfstools.patch 80 ./pfsalign.patch 81 ]; 82 83 meta = with lib; { 84 homepage = "https://pfstools.sourceforge.net/"; 85 description = "Toolkit for manipulation of HDR images"; 86 platforms = platforms.linux; 87 license = licenses.lgpl2; 88 maintainers = [ maintainers.juliendehos ]; 89 }; 90}