summary refs log tree commit diff
path: root/pkgs/applications/graphics/freepv/default.nix
blob: 0bd3421f1b10feee5c386511003d1e3f26cf034f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
{ stdenv, fetchurl, libjpeg, libGLU_combined, freeglut, zlib, cmake, libX11, libxml2, libpng,
  libXxf86vm }:

stdenv.mkDerivation {
  name = "freepv-0.3.0";

  src = fetchurl {
    url = mirror://sourceforge/freepv/freepv-0.3.0.tar.gz;
    sha256 = "1w19abqjn64w47m35alg7bcdl1p97nf11zn64cp4p0dydihmhv56";
  };

  buildInputs = [ libjpeg libGLU_combined freeglut zlib cmake libX11 libxml2 libpng
    libXxf86vm ];

  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 = [ stdenv.lib.licenses.lgpl21 ];
  };
}