about summary refs log tree commit diff
path: root/pkgs/applications/graphics/autopanosiftc/default.nix
blob: 424d8dcaf97b3cb08b36a22afc8b643bf2ebe7be (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
36
37
38
39
{stdenv, fetchurl, cmake, libpng, libtiff, libjpeg, panotools, libxml2 }:

stdenv.mkDerivation {
  name = "autopano-sift-C-2.5.0";

  src = fetchurl {
    url = mirror://sourceforge/hugin/autopano-sift-C-2.5.0.tar.gz;
    sha256 = "0pvkapjg7qdkjg151wjc7islly9ag8fg6bj0g5nbllv981ixjql3";
  };

  buildInputs = [ cmake libpng libtiff libjpeg panotools libxml2 ];

  # I added these flags to get all the rpaths right, which I guess they are
  # taken from the qt4 sources. Not very nice.
  cmakeFlags = "-DCMAKE_SHARED_LINKER_FLAGS=\"-Wl,-rpath,$out/lib\"" +
    " -DCMAKE_EXE_LINKER_FLAGS=\"-Wl,-rpath,$out/lib" +
    " -lpng12 -lpano13 -ljpeg -ltiff -lz -lxml2 \"" +
    " -DCMAKE_SKIP_BUILD_RPATH=ON" +
    " -DCMAKE_BUILD_TYPE=Release" +
    " -DCMAKE_INSTALL_PREFIX=$out";

  dontUseCmakeConfigure = true;

  # I rewrote the configure phase to get the $out references evaluated in
  # cmakeFlags
  configurePhase = ''
    set -x
    mkdir -p build;
    cd build
    eval -- "cmake .. $cmakeFlags"
    set +x
    '';

  meta = {
    homepage = http://hugin.sourceforge.net/;
    description = "Implementation in C of the autopano-sift algorithm for automatically stitching panoramas";
    license = "GPLv2";
  };
}