summary refs log tree commit diff
path: root/pkgs/applications/graphics/awesomebump/default.nix
blob: c02140e1905dfe0776656ec23bfca14738c515f3 (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
{ lib, stdenv, fetchgit, qtbase, qmake, makeWrapper, qtscript, flex, bison, qtdeclarative }:


let
  version = "5.1";

  src = fetchgit {
    url = "https://github.com/kmkolasinski/AwesomeBump.git";
    rev = "Winx32v${version}";
    sha256 = "1c8b9jki0v8kzkvsvyv7q1w3s7j40br6ph15hh2xi0a1mpwckq56";
    fetchSubmodules = true;
  };

  qtnproperty = stdenv.mkDerivation {
    name = "qtnproperty";
    inherit src;
    sourceRoot = "AwesomeBump/Sources/utils/QtnProperty";
    patches = [ ./qtnproperty-parallel-building.patch ];
    buildInputs = [ qtscript qtbase qtdeclarative ];
    nativeBuildInputs = [ qmake flex bison ];
    postInstall = ''
      install -D bin-linux/QtnPEG $out/bin/QtnPEG
    '';
  };
in stdenv.mkDerivation {
  pname = "awesomebump";
  inherit version;

  inherit src;

  buildInputs = [ qtbase qtscript qtdeclarative ];

  nativeBuildInputs = [ qmake makeWrapper ];

  preBuild = ''
    ln -sf ${qtnproperty}/bin/QtnPEG Sources/utils/QtnProperty/bin-linux/QtnPEG
  '';

  postInstall = ''
    d=$out/libexec/AwesomeBump

    mkdir -p $d
    cp -vr workdir/`cat workdir/current`/bin/AwesomeBump $d/
    cp -prd Bin/Configs Bin/Core $d/

    # AwesomeBump expects to find Core and Configs in its current directory.
    makeWrapper $d/AwesomeBump $out/bin/AwesomeBump \
        --run "cd $d"
  '';

  # $ cd Sources; qmake; make ../workdir/linux-g++-dgb-gl4/obj/glwidget.o
  # fatal error: properties/ImageProperties.peg.h: No such file or directory
  enableParallelBuilding = false;

  meta = {
    homepage = "https://github.com/kmkolasinski/AwesomeBump";
    description = "A program to generate normal, height, specular or ambient occlusion textures from a single image";
    license = lib.licenses.gpl3Plus;
    maintainers = [ lib.maintainers.eelco ];
    platforms = lib.platforms.linux;
  };
}