summary refs log tree commit diff
path: root/pkgs/applications/graphics/antimony/default.nix
blob: f9ea2b9aa84e7a199ede8c9b899356225f1128f7 (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
{ stdenv, fetchFromGitHub, libpng, python3, boost, mesa, qtbase, ncurses, cmake, flex, lemon }:

let
  gitRev    = "020910c25614a3752383511ede5a1f5551a8bd39";
  gitBranch = "master";
  gitTag    = "0.9.3";
in
  stdenv.mkDerivation rec {
    name    = "antimony-${version}";
    version = gitTag;

    src = fetchFromGitHub {
      owner = "mkeeter";
      repo = "antimony";
      rev = gitTag;
      sha256 = "1vm5h5py8l3b8h4pbmm8s3wlxvlw492xfwnlwx0nvl0cjs8ba6r4";
    };

    patches = [ ./paths-fix.patch ];

    postPatch = ''
       sed -i "s,/usr/local,$out,g" app/CMakeLists.txt app/app/app.cpp app/app/main.cpp
    '';

    buildInputs = [
      libpng python3 (boost.override { python = python3; })
      mesa qtbase ncurses
    ];

    nativeBuildInputs = [ cmake flex lemon ];

    cmakeFlags= [
      "-DGITREV=${gitRev}"
      "-DGITTAG=${gitTag}"
      "-DGITBRANCH=${gitBranch}"
    ];

    enableParallelBuilding = true;

    meta = with stdenv.lib; {
      description = "A computer-aided design (CAD) tool from a parallel universe";
      homepage    = "https://github.com/mkeeter/antimony";
      license     = licenses.mit;
      platforms   = platforms.linux;
    };
  }