summary refs log tree commit diff
path: root/pkgs/applications/graphics/freepv
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/graphics/freepv')
-rw-r--r--pkgs/applications/graphics/freepv/default.nix24
1 files changed, 17 insertions, 7 deletions
diff --git a/pkgs/applications/graphics/freepv/default.nix b/pkgs/applications/graphics/freepv/default.nix
index e042b15855c8..6d82db4bac1a 100644
--- a/pkgs/applications/graphics/freepv/default.nix
+++ b/pkgs/applications/graphics/freepv/default.nix
@@ -1,25 +1,35 @@
 { stdenv, fetchurl, libjpeg, mesa, freeglut, zlib, cmake, libX11, libxml2, libpng,
-  libXxf86vm }:
+  libXxf86vm, gcc6 }:
 
 stdenv.mkDerivation {
-  name = "freepv-0.3.0_beta1";
+  name = "freepv-0.3.0";
 
   src = fetchurl {
-    url = mirror://sourceforge/freepv/freepv-0.3.0_beta1.tar.gz;
-    sha256 = "084qqa361np73anvqrv78ngw8hjxglmdm3akkpszbwnzniw89qla";
+    url = mirror://sourceforge/freepv/freepv-0.3.0.tar.gz;
+    sha256 = "1w19abqjn64w47m35alg7bcdl1p97nf11zn64cp4p0dydihmhv56";
   };
 
   buildInputs = [ libjpeg mesa freeglut zlib cmake libX11 libxml2 libpng
-    libXxf86vm ];
+    libXxf86vm gcc6 ];
 
-  patchPhase = ''
+  postPatch = ''
     sed -i -e '/GECKO/d' CMakeLists.txt
     sed -i -e '/mozilla/d' src/CMakeLists.txt
+    sed -i -e '1i \
+      #include <cstdio>' src/libfreepv/OpenGLRenderer.cpp
+    sed -i -e '1i \
+      #include <cstring>' src/libfreepv/Image.cpp
+    substituteInPlace src/libfreepv/Action.h \
+      --replace NULL nullptr
+    substituteInPlace src/libfreepv/pngReader.cpp \
+      --replace png_set_gray_1_2_4_to_8 png_set_expand_gray_1_2_4_to_8
   '';
 
+  NIX_CFLAGS_COMPILE = "-fpermissive -Wno-narrowing";
+
   meta = {
     description = "Open source panorama viewer using GL";
     homepage = http://freepv.sourceforge.net/;
-    license = "LGPL";
+    license = [ stdenv.lib.licenses.lgpl21 ];
   };
 }