nixpkgs/pkgs/development/python-modules/uranium/default.nix
Profpatsch 4a7f99d55d treewide: with stdenv.lib; in meta -> with lib;
Part of: https://github.com/NixOS/nixpkgs/issues/108938

meta = with stdenv.lib;

is a widely used pattern. We want to slowly remove
the `stdenv.lib` indirection and encourage people
to use `lib` directly. Thus let’s start with the meta
field.

This used a rewriting script to mostly automatically
replace all occurances of this pattern, and add the
`lib` argument to the package header if it doesn’t
exist yet.

The script in its current form is available at
https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
2021-01-11 10:38:22 +01:00

38 lines
1.4 KiB
Nix

{ lib, stdenv, buildPythonPackage, fetchFromGitHub, python, cmake
, pyqt5, numpy, scipy, shapely, libarcus, doxygen, gettext, pythonOlder }:
buildPythonPackage rec {
version = "4.7.1";
pname = "uranium";
format = "other";
src = fetchFromGitHub {
owner = "Ultimaker";
repo = "Uranium";
rev = version;
sha256 = "1h5d3scy3cnbyhh0pbavflpqklhn2lbp7hl193rc5gx8yzr3mqbh";
};
disabled = pythonOlder "3.5.0";
buildInputs = [ python gettext ];
propagatedBuildInputs = [ pyqt5 numpy scipy shapely libarcus ];
nativeBuildInputs = [ cmake doxygen ];
postPatch = ''
sed -i 's,/python''${PYTHON_VERSION_MAJOR}/dist-packages,/python''${PYTHON_VERSION_MAJOR}.''${PYTHON_VERSION_MINOR}/site-packages,g' CMakeLists.txt
sed -i \
-e "s,Resources.addSearchPath(os.path.join(os.path.abspath(os.path.dirname(__file__)).*,Resources.addSearchPath(\"$out/share/uranium/resources\")," \
-e "s,self._plugin_registry.addPluginLocation(os.path.join(os.path.abspath(os.path.dirname(__file__)).*,self._plugin_registry.addPluginLocation(\"$out/lib/uranium/plugins\")," \
UM/Application.py
'';
meta = with lib; {
description = "A Python framework for building Desktop applications";
homepage = "https://github.com/Ultimaker/Uranium";
license = licenses.lgpl3Plus;
platforms = platforms.linux;
maintainers = with maintainers; [ abbradar gebner ];
};
}