1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 fetchpatch,
6 cmake,
7 doxygen,
8 graphviz,
9 boost,
10 cgal,
11 gdal,
12 glew,
13 gmp,
14 libGL,
15 libGLU,
16 libSM,
17 mpfr,
18 proj,
19 python3,
20 qtxmlpatterns,
21 qwt,
22 wrapQtAppsHook,
23}:
24
25let
26 python = python3.withPackages (
27 ps: with ps; [
28 numpy
29 ]
30 );
31 boost' = boost.override {
32 enablePython = true;
33 inherit python;
34 };
35 cgal' = cgal.override {
36 boost = boost';
37 };
38in
39stdenv.mkDerivation (finalAttrs: {
40 pname = "gplates";
41 version = "2.5";
42
43 src = fetchFromGitHub {
44 owner = "GPlates";
45 repo = "GPlates";
46 rev = "GPlates-${finalAttrs.version}";
47 hash = "sha256-3fEwm5EKK9RcRbnyUejgwfjdsXaujjZjoMbq/BbVMeM=";
48 };
49
50 patches = [
51 (fetchpatch {
52 name = "qwt-6.3-compile-error-fix.patch";
53 url = "https://github.com/GPlates/GPlates/commit/c4680ebe54f4535909085feacecd66410a91ff98.patch";
54 hash = "sha256-mw5+GLayMrmcSDd1ai+0JTuY3iedHT9u2kx5Dd2wMjg=";
55 })
56 ];
57
58 nativeBuildInputs = [
59 cmake
60 doxygen
61 graphviz
62 wrapQtAppsHook
63 ];
64
65 buildInputs = [
66 boost'
67 cgal'
68 gdal
69 glew
70 gmp
71 libGL
72 libGLU
73 libSM
74 mpfr
75 proj
76 python
77 qtxmlpatterns
78 qwt
79 ];
80
81 meta = with lib; {
82 description = "Desktop software for the interactive visualisation of plate-tectonics";
83 mainProgram = "gplates";
84 homepage = "https://www.gplates.org";
85 license = licenses.gpl2Only;
86 platforms = platforms.all;
87 broken = stdenv.hostPlatform.isDarwin; # FIX: this check: https://github.com/GPlates/GPlates/blob/gplates/cmake/modules/Config_h.cmake#L72
88 };
89})