nixpkgs/pkgs/development/python-modules/pykickstart/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

39 lines
920 B
Nix

{ lib, stdenv
, buildPythonPackage
, fetchurl
, urlgrabber
, python
, isPy3k
}:
buildPythonPackage rec {
pname = "pykickstart";
version = "1.99.39";
md5_path = "d249f60aa89b1b4facd63f776925116d";
disabled = isPy3k;
src = fetchurl {
url = "https://src.fedoraproject.org/repo/pkgs/pykickstart/"
+ "${pname}-${version}.tar.gz/${md5_path}/${pname}-${version}.tar.gz";
sha256 = "e0d0f98ac4c5607e6a48d5c1fba2d50cc804de1081043f9da68cbfc69cad957a";
};
postPatch = ''
sed -i -e "s/for tst in tstList/for tst in sorted(tstList, \
key=lambda m: m.__name__)/" tests/baseclass.py
'';
propagatedBuildInputs = [ urlgrabber ];
checkPhase = ''
${python.interpreter} tests/baseclass.py -vv
'';
meta = with lib; {
homepage = "http://fedoraproject.org/wiki/Pykickstart";
description = "Read and write Fedora kickstart files";
license = licenses.gpl2Plus;
};
}