2019-06-05 17:12:27 +02:00
|
|
|
{ stdenv, buildPythonPackage, fetchPypi, fetchpatch, python, coverage, lsof, glibcLocales }:
|
2018-10-24 16:10:04 +02:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "sh";
|
|
|
|
version = "1.12.14";
|
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
|
|
|
sha256 = "1z2hx357xp3v4cv44xmqp7lli3frndqpyfmpbxf7n76h7s1zaaxm";
|
|
|
|
};
|
|
|
|
|
2019-06-05 17:12:27 +02:00
|
|
|
patches = [
|
|
|
|
# Disable tests that fail on Darwin
|
|
|
|
# Some of the failures are due to Nix using GNU coreutils
|
|
|
|
./disable-broken-tests-darwin.patch
|
|
|
|
# Fix tests for Python 3.7. See: https://github.com/amoffat/sh/pull/468
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/amoffat/sh/commit/b6202f75706473f02084d819e0765056afa43664.patch";
|
|
|
|
sha256 = "1kzxyxcc88zhgn2kmfg9yrbs4n405b2jq7qykb453l52hy10vi94";
|
|
|
|
excludes = [ ".travis.yml" ];
|
|
|
|
})
|
|
|
|
];
|
2018-12-21 23:44:21 +01:00
|
|
|
|
2018-12-21 06:01:13 +01:00
|
|
|
postPatch = ''
|
|
|
|
sed -i 's#/usr/bin/env python#${python.interpreter}#' test.py
|
|
|
|
'';
|
|
|
|
|
|
|
|
checkInputs = [ coverage lsof glibcLocales ];
|
2018-10-24 16:10:04 +02:00
|
|
|
|
|
|
|
# A test needs the HOME directory to be different from $TMPDIR.
|
|
|
|
preCheck = ''
|
2018-12-21 06:01:13 +01:00
|
|
|
export LC_ALL="en_US.UTF-8"
|
2018-10-24 16:10:04 +02:00
|
|
|
HOME=$(mktemp -d)
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Python subprocess interface";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://pypi.python.org/pypi/sh/";
|
2018-10-24 16:10:04 +02:00
|
|
|
license = stdenv.lib.licenses.mit;
|
|
|
|
};
|
|
|
|
}
|