1{ stdenv
2, buildPythonPackage
3, fetchFromGitHub
4, nose
5, noise
6, numpy
7, pyplatec
8, protobuf
9, purepng
10, h5py
11, gdal
12}:
13
14buildPythonPackage rec {
15 pname = "worldengine";
16 version = "0.19.0";
17
18 src = fetchFromGitHub {
19 owner = "Mindwerks";
20 repo = "worldengine";
21 rev = "v${version}";
22 sha256 = "1xrckb0dn2841gvp32n18gib14bpi77hmjw3r9jiyhg402iip7ry";
23 };
24
25 src-data = fetchFromGitHub {
26 owner = "Mindwerks";
27 repo = "worldengine-data";
28 rev = "029051e";
29 sha256 = "06xbf8gj3ljgr11v1n8jbs2q8pdf9wz53xdgkhpm8hdnjahgdxdm";
30 };
31
32 postUnpack = ''
33 ln -s ${src-data} worldengine-data
34 '';
35
36 buildInputs = [ nose ];
37 propagatedBuildInputs = [ noise numpy pyplatec protobuf purepng h5py gdal ];
38
39 prePatch = ''
40 substituteInPlace setup.py \
41 --replace pypng>=0.0.18 purepng \
42 --replace 'numpy>=1.9.2, <= 1.10.0.post2' 'numpy' \
43 --replace 'argparse==1.2.1' "" \
44 --replace 'protobuf==3.0.0a3' 'protobuf' \
45 --replace 'noise==1.2.2' 'noise' \
46 --replace 'PyPlatec==1.4.0' 'PyPlatec' \
47 '';
48
49 doCheck = true;
50
51 postCheck = ''
52 nosetests tests
53 '';
54
55 meta = with stdenv.lib; {
56 homepage = http://world-engine.org;
57 description = "World generator using simulation of plates, rain shadow, erosion, etc";
58 license = licenses.mit;
59 maintainers = with maintainers; [ rardiol ];
60 };
61
62}