4a7f99d55d
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
49 lines
1.4 KiB
Nix
49 lines
1.4 KiB
Nix
{ lib, stdenv
|
|
, buildPythonPackage
|
|
, fetchPypi
|
|
, setuptoolsDarcs
|
|
, setuptoolsTrial
|
|
, simplejson
|
|
, twisted
|
|
, isPyPy
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "pyutil";
|
|
version = "3.3.0";
|
|
|
|
src = fetchPypi {
|
|
inherit pname version;
|
|
sha256 = "8c4d4bf668c559186389bb9bce99e4b1b871c09ba252a756ccaacd2b8f401848";
|
|
};
|
|
|
|
buildInputs = [ setuptoolsDarcs setuptoolsTrial ] ++ (if doCheck then [ simplejson ] else []);
|
|
propagatedBuildInputs = [ twisted ];
|
|
|
|
# Tests fail because they try to write new code into the twisted
|
|
# package, apparently some kind of plugin.
|
|
doCheck = false;
|
|
|
|
prePatch = stdenv.lib.optionalString isPyPy ''
|
|
grep -rl 'utf-8-with-signature-unix' ./ | xargs sed -i -e "s|utf-8-with-signature-unix|utf-8|g"
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "Pyutil, a collection of mature utilities for Python programmers";
|
|
|
|
longDescription = ''
|
|
These are a few data structures, classes and functions which
|
|
we've needed over many years of Python programming and which
|
|
seem to be of general use to other Python programmers. Many of
|
|
the modules that have existed in pyutil over the years have
|
|
subsequently been obsoleted by new features added to the
|
|
Python language or its standard library, thus showing that
|
|
we're not alone in wanting tools like these.
|
|
'';
|
|
|
|
homepage = "http://allmydata.org/trac/pyutil";
|
|
license = licenses.gpl2Plus;
|
|
};
|
|
|
|
}
|