summary refs log tree commit diff
path: root/pkgs/applications/misc/therion/default.nix
blob: f0ea721f12799ccde8e1b01c3e504b9f06326414 (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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
{ lib
, stdenv
, fetchFromGitHub
, cmake
, pkg-config
, perl
, tcl
, tcllib
, tk
, expat
, bwidget
, python3
, texlive
, survex
, makeWrapper
, fmt
, proj
, wxGTK32
, vtk
, freetype
, libjpeg
, gettext
, libGL
, libGLU
, sqlite
, libtiff
, curl
, tkimg
}:

stdenv.mkDerivation rec {
  pname = "therion";
  version = "6.1.8";

  src = fetchFromGitHub {
    owner = "therion";
    repo = "therion";
    rev = "v${version}";
    hash = "sha256-bmp0IZ4uAqDpe2e8UeIDUdFaaocx4OBIYuhnaHirqGc=";
  };

  nativeBuildInputs = [
    cmake
    pkg-config
    perl
    python3
    texlive.combined.scheme-tetex
    makeWrapper
    tcl.tclPackageHook
  ];

  preConfigure = ''
    export OUTDIR=$out
  '';

  cmakeFlags = [
    "-DBUILD_THBOOK=OFF"
  ];

  buildInputs = [
    expat
    tkimg
    proj
    wxGTK32
    vtk
    tk
    freetype
    libjpeg
    gettext
    libGL
    libGLU
    sqlite
    libtiff
    curl
    fmt
    tcl
    tcllib
    bwidget
  ];

  fixupPhase = ''
    runHook preFixup
    wrapProgram $out/bin/therion \
      --prefix PATH : ${lib.makeBinPath [ survex texlive.combined.scheme-tetex ]}
    wrapProgram $out/bin/xtherion \
      --prefix PATH : ${lib.makeBinPath [ tk ]}
    runHook postFixup
  '';

  meta = with lib; {
    description = "Therion – cave surveying software";
    homepage = "https://therion.speleo.sk/";
    changelog = "https://github.com/therion/therion/blob/${src.rev}/CHANGES";
    license = licenses.gpl2Only;
    maintainers = with maintainers; [ matthewcroughan ];
  };
}