about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/graphics/displaycal/default.nix
blob: 5b324a5974d7c316f7e727be56edd5eff0b20513 (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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
{ python2
, stdenv
, fetchurl
, pkgconfig
, libXext
, libXxf86vm
, libX11
, libXrandr
, libXinerama
, libXScrnSaver
, argyllcms
 }:

let
  inherit (python2.pkgs) buildPythonApplication wxPython numpy dbus-python;
in buildPythonApplication rec {
  pname = "displaycal";
  version = "3.8.9.3";

  enableParallelBuilding = true;

  src = fetchurl {
    url = "mirror://sourceforge/project/dispcalgui/release/${version}/DisplayCAL-${version}.tar.gz";
    sha256 = "1sivi4q7sqsrc95qg5gh37bsm2761md4mpl89hflzwk6kyyxyd3w";
  };

  propagatedBuildInputs = [
    libXext
    libXxf86vm
    libX11
    libXrandr
    libXinerama
    libXScrnSaver
    argyllcms
    wxPython
    numpy
    dbus-python
  ];

  nativeBuildInputs = [
    pkgconfig
  ];

  preConfigure = ''
    mkdir dist
    cp {misc,dist}/net.displaycal.DisplayCAL.appdata.xml
    touch dist/copyright
    mkdir -p $out
    ln -s $out/share/DisplayCAL $out/Resources
  '';

  # no idea why it looks there - symlink .json lang (everything)
  postInstall = ''
    for x in $out/share/DisplayCAL/*; do
      ln -s $x $out/lib/python2.7/site-packages/DisplayCAL
    done

    for prog in "$out/bin/"*; do
      wrapProgram "$prog" \
        --prefix PYTHONPATH : "$PYTHONPATH" \
        --prefix PATH : ${argyllcms}/bin
    done
  '';

  meta = {
    description = "Display Calibration and Characterization powered by Argyll CMS";
    homepage = "https://displaycal.net/";
    license = stdenv.lib.licenses.gpl3;
    maintainers = [stdenv.lib.maintainers.marcweber];
    platforms = stdenv.lib.platforms.linux;
  };
}