1{ lib
2, buildPythonPackage
3, coreutils
4, fetchFromGitHub
5, icontract
6, pytestCheckHook
7, pythonOlder
8, typing-extensions
9}:
10
11buildPythonPackage rec {
12 pname = "pylddwrap";
13 version = "1.2.2";
14 format = "setuptools";
15 disabled = pythonOlder "3.6";
16
17 src = fetchFromGitHub {
18 owner = "Parquery";
19 repo = pname;
20 rev = "v${version}";
21 hash = "sha256-Gm82VRu8GP52BohQzpMUJfh6q2tiUA2GJWOcG7ymGgg=";
22 };
23
24 postPatch = ''
25 substituteInPlace lddwrap/__init__.py \
26 --replace '/usr/bin/env' '${coreutils}/bin/env'
27 '';
28
29 # Upstream adds some plain text files direct to the package's root directory
30 # https://github.com/Parquery/pylddwrap/blob/master/setup.py#L71
31 postInstall = ''
32 rm -f $out/{LICENSE,README.rst,requirements.txt}
33 '';
34
35 propagatedBuildInputs = [
36 icontract
37 typing-extensions
38 ];
39
40 checkInputs = [ pytestCheckHook ];
41
42 pythonImportsCheck = [ "lddwrap" ];
43
44 meta = with lib; {
45 description = "Python wrapper around ldd *nix utility to determine shared libraries of a program";
46 homepage = "https://github.com/Parquery/pylddwrap";
47 changelog = "https://github.com/Parquery/pylddwrap/blob/v${version}/CHANGELOG.rst";
48 license = licenses.mit;
49 maintainers = with maintainers; [ thiagokokada ];
50 };
51}