about summary refs log tree commit diff
path: root/pkgs/applications/graphics/pixeluvo/default.nix
blob: 2c94b4645c562cec06b374616592f82381240f13 (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
{ lib, stdenv, fetchurl, dpkg, autoPatchelfHook, makeWrapper
, gtk3-x11 }:

stdenv.mkDerivation rec {
  pname = "pixeluvo";
  version = "1.6.0-2";

  src = fetchurl {
    url = "http://www.pixeluvo.com/downloads/${pname}_${version}_amd64.deb";
    sha256 = "sha256-QYSuD6o3kHg0DrFihYEcf9e3b8U1bu4Zf78+Akmm8yo=";
  };

  nativeBuildInputs = [
    dpkg
    makeWrapper
    autoPatchelfHook
  ];

  buildInputs = [
    gtk3-x11
    stdenv.cc.cc
  ];

  libPath = lib.makeLibraryPath buildInputs;

  dontBuild = true;
  dontConfigure = true;

  unpackPhase = ''
    dpkg-deb -x ${src} ./
  '';

  installPhase = ''
    runHook preInstall

    mv usr $out
    mv opt $out
    install -Dm644 $out/opt/pixeluvo/pixeluvo.png -t $out/share/pixmaps/

    substituteInPlace $out/share/applications/pixeluvo.desktop \
      --replace '/opt/pixeluvo/pixeluvo.png' pixeluvo

    makeWrapper $out/opt/pixeluvo/bin/Pixeluvo64 $out/bin/pixeluvo \
      --prefix LD_LIBRARY_PATH : ${libPath}

    runHook postInstall
  '';

  meta = with lib; {
    description = "A Beautifully Designed Image and Photo Editor for Windows and Linux";
    homepage = "http://www.pixeluvo.com/";
    sourceProvenance = with sourceTypes; [ binaryNativeCode ];
    license = licenses.unfree;
    platforms = [ "x86_64-linux" ];
    maintainers = with maintainers; [ wolfangaukang ];
    mainProgram = "pixeluvo";
  };
}