1- { lib , stdenv , fetchurl , cmake , curl , Accelerate , CoreGraphics , CoreVideo
2- , fftwSinglePrec , netcdf , pcre , gdal , blas , lapack , glibc , ghostscript , dcw-gmt
3- , gshhg-gmt } :
1+ {
2+ lib ,
3+ stdenv ,
4+ fetchFromGitHub ,
5+ cmake ,
6+ curl ,
7+ Accelerate ,
8+ CoreGraphics ,
9+ CoreVideo ,
10+ fftwSinglePrec ,
11+ netcdf ,
12+ libxml2 ,
13+ pcre ,
14+ gdal ,
15+ blas ,
16+ lapack ,
17+ glibc ,
18+ ghostscript ,
19+ dcw-gmt ,
20+ gshhg-gmt ,
21+ } :
422
5- /* The onus is on the user to also install:
6- - ffmpeg for webm or mp4 output
7- - graphicsmagick for gif output
23+ /*
24+ The onus is on the user to also install:
25+ - ffmpeg for webm or mp4 output
26+ - graphicsmagick for gif output
827*/
928
10- stdenv . mkDerivation rec {
29+ let
30+ # Certainly not an ideal situation, See:
31+ # https://github.com/NixOS/nixpkgs/pull/340707#issuecomment-2361894717
32+ netcdf' = netcdf . override {
33+ libxml2 = libxml2 . override {
34+ enableHttp = true ;
35+ } ;
36+ } ;
37+ in stdenv . mkDerivation ( finalAttrs : {
1138 pname = "gmt" ;
12- version = "6.4.0" ;
13- src = fetchurl {
14- url = "https://github.com/GenericMappingTools/gmt/releases/download/${ version } /gmt-${ version } -src.tar.gz" ;
15- sha256 = "sha256-0mfAx9b7MMnqfgKe8n2tsm/9e5LLS0cD+aO6Do85Ohs=" ;
39+ version = "6.5.0" ;
40+ src = fetchFromGitHub {
41+ owner = "GenericMappingTools" ;
42+ repo = "gmt" ;
43+ rev = "refs/tags/${ finalAttrs . version } " ;
44+ hash = "sha256-KKIYhljCtk9t9CuvTLsSGvUkUwazWTm9ymBB3wLwSoI=" ;
1645 } ;
1746
18- nativeBuildInputs = [ cmake ] ;
47+ nativeBuildInputs = [
48+ cmake
49+ ] ;
1950
20- buildInputs = [ curl gdal netcdf pcre dcw-gmt gshhg-gmt ]
21- ++ ( if stdenv . hostPlatform . isDarwin then [
22- Accelerate
23- CoreGraphics
24- CoreVideo
25- ] else [
26- glibc
27- fftwSinglePrec
28- blas
29- lapack
30- ] ) ;
51+ buildInputs =
52+ [
53+ curl
54+ gdal
55+ netcdf'
56+ pcre
57+ dcw-gmt
58+ gshhg-gmt
59+ ]
60+ ++ (
61+ if stdenv . hostPlatform . isDarwin then
62+ [
63+ Accelerate
64+ CoreGraphics
65+ CoreVideo
66+ ]
67+ else
68+ [
69+ glibc
70+ fftwSinglePrec
71+ blas
72+ lapack
73+ ]
74+ ) ;
3175
32- propagatedBuildInputs = [ ghostscript ] ;
76+ propagatedBuildInputs = [
77+ ghostscript
78+ ] ;
3379
34- cmakeFlags = [
35- "-DGMT_DOCDIR=share/doc/gmt"
36- "-DGMT_MANDIR=share/man"
37- "-DGMT_LIBDIR=lib"
38- "-DCOPY_GSHHG:BOOL=FALSE"
39- "-DGSHHG_ROOT=${ gshhg-gmt . out } /share/gshhg-gmt"
40- "-DCOPY_DCW:BOOL=FALSE"
41- "-DDCW_ROOT=${ dcw-gmt . out } /share/dcw-gmt"
42- "-DGDAL_ROOT=${ gdal . out } "
43- "-DNETCDF_ROOT=${ netcdf . out } "
44- "-DPCRE_ROOT=${ pcre . out } "
45- "-DGMT_INSTALL_TRADITIONAL_FOLDERNAMES:BOOL=FALSE"
46- "-DGMT_ENABLE_OPENMP:BOOL=TRUE"
47- "-DGMT_INSTALL_MODULE_LINKS:BOOL=FALSE"
48- "-DLICENSE_RESTRICTED=LGPL" # "GPL" and "no" also valid
49- ] ++ ( with stdenv ;
50- lib . optionals ( ! isDarwin ) [
51- "-DFFTW3_ROOT=${ fftwSinglePrec . dev } "
52- "-DLAPACK_LIBRARY=${ lapack } /lib/liblapack.so"
53- "-DBLAS_LIBRARY=${ blas } /lib/libblas.so"
54- ] ) ;
80+ cmakeFlags =
81+ [
82+ "-DGMT_DOCDIR=share/doc/gmt"
83+ "-DGMT_MANDIR=share/man"
84+ "-DGMT_LIBDIR=lib"
85+ "-DCOPY_GSHHG:BOOL=FALSE"
86+ "-DGSHHG_ROOT=${ gshhg-gmt . out } /share/gshhg-gmt"
87+ "-DCOPY_DCW:BOOL=FALSE"
88+ "-DDCW_ROOT=${ dcw-gmt . out } /share/dcw-gmt"
89+ "-DGMT_INSTALL_TRADITIONAL_FOLDERNAMES:BOOL=FALSE"
90+ "-DGMT_ENABLE_OPENMP:BOOL=TRUE"
91+ "-DGMT_INSTALL_MODULE_LINKS:BOOL=FALSE"
92+ "-DLICENSE_RESTRICTED=LGPL" # "GPL" and "no" also valid
93+ ] ;
5594
56- meta = with lib ; {
95+ meta = {
5796 homepage = "https://www.generic-mapping-tools.org" ;
5897 description = "Tools for manipulating geographic and cartesian data sets" ;
5998 longDescription = ''
@@ -65,9 +104,9 @@ stdenv.mkDerivation rec {
65104 transformations and includes supporting data such as coastlines, rivers,
66105 and political boundaries and optionally country polygons.
67106 '' ;
68- platforms = [ "x86_64-linux" "x86_64-darwin" ] ;
69- license = licenses . lgpl3Plus ;
70- maintainers = with maintainers ; [ tviti ] ;
107+ platforms = lib . platforms . unix ;
108+ license = lib . licenses . lgpl3Plus ;
109+ maintainers = with lib . maintainers ; [ tviti ] ;
71110 } ;
72111
73- }
112+ } )
0 commit comments