1{ stdenv, lib, fetchFromGitHub, python, cmake, pyqt5, numpy, scipy, libarcus, doxygen, gettext }:
2
3if lib.versionOlder python.version "3.5.0"
4then throw "Uranium not supported for interpreter ${python.executable}"
5else
6
7stdenv.mkDerivation rec {
8 version = "3.2.1";
9 pname = "uranium";
10 name = "${pname}-${version}";
11
12 src = fetchFromGitHub {
13 owner = "Ultimaker";
14 repo = "Uranium";
15 rev = version;
16 sha256 = "1p05iw1x3rvb51p6hj57yq6nsjawjba3pyyr4jx924iq96vcc3fz";
17 };
18
19 buildInputs = [ python gettext ];
20 propagatedBuildInputs = [ pyqt5 numpy scipy libarcus ];
21 nativeBuildInputs = [ cmake doxygen ];
22
23 postPatch = ''
24 sed -i 's,/python''${PYTHON_VERSION_MAJOR}/dist-packages,/python''${PYTHON_VERSION_MAJOR}.''${PYTHON_VERSION_MINOR}/site-packages,g' CMakeLists.txt
25 sed -i \
26 -e "s,Resources.addSearchPath(os.path.join(os.path.abspath(os.path.dirname(__file__)).*,Resources.addSearchPath(\"$out/share/uranium/resources\")," \
27 -e "s,self._plugin_registry.addPluginLocation(os.path.join(os.path.abspath(os.path.dirname(__file__)).*,self._plugin_registry.addPluginLocation(\"$out/lib/uranium/plugins\")," \
28 UM/Application.py
29 '';
30
31 meta = with stdenv.lib; {
32 description = "A Python framework for building Desktop applications";
33 homepage = https://github.com/Ultimaker/Uranium;
34 license = licenses.agpl3;
35 platforms = platforms.linux;
36 maintainers = with maintainers; [ abbradar ];
37 };
38}