forked from OSGeo/grass
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
80 lines (70 loc) · 2.16 KB
/
flake.nix
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
{
description = "GRASS GIS";
nixConfig = {
bash-prompt = "\\[\\033[1m\\][grass-dev]\\[\\033\[m\\]\\040\\w >\\040";
};
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
};
outputs = inputs@{ flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [ "x86_64-linux" ];
perSystem = { config, self', inputs', pkgs, system, ... }: {
packages.grass = pkgs.callPackage ./package.nix { };
devShells.default = pkgs.mkShell {
buildInputs =
# from package nativeBuildInputs
with pkgs; [
bison
flex
gdal # for `gdal-config`
geos # for `geos-config`
netcdf # for `nc-config`
pkg-config
] ++ (with python3Packages; [ pytest python-dateutil numpy wxPython_4_2 ])
# from package buildInputs
++ [
blas
cairo
ffmpeg
fftw
freetype
gdal
geos
lapack
libGLU
libpng
libsvm
libtiff
libxml2
netcdf
pdal
postgresql
proj
readline
sqlite
wxGTK32
zlib
zstd
] ++ lib.optionals stdenv.isDarwin [ libiconv ];
shellHook = ''
echo -e "\nWelcome to a GRASS development environment !"
echo "Build GRASS using following commands:"
echo
echo " 1. ./configure --prefix=\$(pwd)/app"
echo " 2. make -j$(nproc)"
echo " 3. make install"
echo
echo "Run tests:"
echo
echo " 1. export PYTHONPATH=\$(app/bin/grass --config python_path):\$PYTHONPATH"
echo " 2. export LD_LIBRARY_PATH=\$(app/bin/grass --config path)/lib:\$LD_LIBRARY_PATH"
echo " 3. pytest"
echo
echo "Note: run 'nix flake update' from time to time to update dependencies."
'';
};
};
flake = { };
};
}