From 1109081215228c66b62d5f884ede0d5f48e3193a Mon Sep 17 00:00:00 2001 From: Chris Ostrouchov Date: Mon, 29 Oct 2018 11:35:29 -0400 Subject: [PATCH] pythonPAckages.worldengine: refactor move to python-modules --- .../python-modules/worldengine/default.nix | 63 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 48 +------------- 2 files changed, 64 insertions(+), 47 deletions(-) create mode 100644 pkgs/development/python-modules/worldengine/default.nix diff --git a/pkgs/development/python-modules/worldengine/default.nix b/pkgs/development/python-modules/worldengine/default.nix new file mode 100644 index 000000000000..0a49c2566409 --- /dev/null +++ b/pkgs/development/python-modules/worldengine/default.nix @@ -0,0 +1,63 @@ +{ stdenv +, buildPythonPackage +, fetchFromGitHub +, nose +, noise +, numpy +, pyplatec +, protobuf +, purepng +, argparse +, h5py +, gdal +}: + +buildPythonPackage rec { + pname = "worldengine"; + version = "0.19.0"; + + src = fetchFromGitHub { + owner = "Mindwerks"; + repo = "worldengine"; + rev = "v${version}"; + sha256 = "1xrckb0dn2841gvp32n18gib14bpi77hmjw3r9jiyhg402iip7ry"; + }; + + src-data = fetchFromGitHub { + owner = "Mindwerks"; + repo = "worldengine-data"; + rev = "029051e"; + sha256 = "06xbf8gj3ljgr11v1n8jbs2q8pdf9wz53xdgkhpm8hdnjahgdxdm"; + }; + + postUnpack = '' + ln -s ${src-data} worldengine-data + ''; + + buildInputs = [ nose ]; + propagatedBuildInputs = [ noise numpy pyplatec protobuf purepng argparse h5py gdal ]; + + prePatch = '' + substituteInPlace setup.py \ + --replace pypng>=0.0.18 purepng \ + --replace 'numpy>=1.9.2, <= 1.10.0.post2' 'numpy' \ + --replace 'argparse==1.2.1' "" \ + --replace 'protobuf==3.0.0a3' 'protobuf' \ + --replace 'noise==1.2.2' 'noise' \ + --replace 'PyPlatec==1.4.0' 'PyPlatec' \ + ''; + + doCheck = true; + + postCheck = '' + nosetests tests + ''; + + meta = with stdenv.lib; { + homepage = http://world-engine.org; + description = "World generator using simulation of plates, rain shadow, erosion, etc"; + license = licenses.mit; + maintainers = with maintainers; [ rardiol ]; + }; + +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index fd74e18e35f5..8874569c2400 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -4274,53 +4274,7 @@ in { whisper = callPackage ../development/python-modules/whisper { }; - worldengine = buildPythonPackage rec { - name = "worldengine-${version}"; - version = "0.19.0"; - - src = pkgs.fetchFromGitHub { - owner = "Mindwerks"; - repo = "worldengine"; - rev = "v${version}"; - sha256 = "1xrckb0dn2841gvp32n18gib14bpi77hmjw3r9jiyhg402iip7ry"; - }; - - src-data = pkgs.fetchFromGitHub { - owner = "Mindwerks"; - repo = "worldengine-data"; - rev = "029051e"; - sha256 = "06xbf8gj3ljgr11v1n8jbs2q8pdf9wz53xdgkhpm8hdnjahgdxdm"; - }; - - postUnpack = '' - ln -s ${src-data} worldengine-data - ''; - - buildInputs = with self; [ nose ]; - propagatedBuildInputs = with self; [ noise numpy pyplatec protobuf purepng argparse h5py gdal ]; - - prePatch = '' - substituteInPlace setup.py \ - --replace pypng>=0.0.18 purepng \ - --replace 'numpy>=1.9.2, <= 1.10.0.post2' 'numpy' \ - --replace 'argparse==1.2.1' "" \ - --replace 'protobuf==3.0.0a3' 'protobuf' \ - --replace 'noise==1.2.2' 'noise' \ - --replace 'PyPlatec==1.4.0' 'PyPlatec' \ - ''; - - doCheck = true; - postCheck = '' - nosetests tests - ''; - - meta = { - homepage = http://world-engine.org; - description = "World generator using simulation of plates, rain shadow, erosion, etc"; - platforms = platforms.all; - maintainers = with maintainers; [ rardiol ]; - }; - }; + worldengine = callPackage ../development/python-modules/worldengine { }; carbon = callPackage ../development/python-modules/carbon { };