1{
2 lib,
3 fetchFromGitHub,
4 buildPythonPackage,
5 plugincode,
6 p7zip,
7}:
8
9buildPythonPackage rec {
10 pname = "extractcode-7z";
11 version = "21.5.31";
12
13 src = fetchFromGitHub {
14 owner = "nexB";
15 repo = "scancode-plugins";
16 rev = "v${version}";
17 sha256 = "02qinla281fc6pmg5xzsrmqnf9js76f2qcbf98zq7m2dkn70as4w";
18 };
19
20 sourceRoot = "${src.name}/builtins/extractcode_7z-linux";
21
22 propagatedBuildInputs = [ plugincode ];
23
24 preBuild = ''
25 pushd src/extractcode_7z/bin
26
27 rm 7z 7z.so
28 ln -s ${p7zip}/bin/7z 7z
29 ln -s ${lib.getLib p7zip}/lib/p7zip/7z.so 7z.so
30
31 popd
32 '';
33
34 # no tests
35 doCheck = false;
36
37 pythonImportsCheck = [ "extractcode_7z" ];
38
39 meta = with lib; {
40 description = "A ScanCode Toolkit plugin to provide pre-built binary libraries and utilities and their locations";
41 homepage = "https://github.com/nexB/scancode-plugins/tree/main/builtins/extractcode_7z-linux";
42 license = with licenses; [
43 asl20
44 lgpl21
45 ];
46 maintainers = [ ];
47 platforms = platforms.linux;
48 };
49}