From c27b9e0a68bd568f11c63a956605733c5467aebb Mon Sep 17 00:00:00 2001 From: Cole Helbling Date: Mon, 19 Apr 2021 22:33:51 -0700 Subject: [PATCH] python3.pkgs.extractcode-libarchive: init at 21.4.4 --- .../python-modules/extractcode/libarchive.nix | 62 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 12 ++++ 2 files changed, 74 insertions(+) create mode 100644 pkgs/development/python-modules/extractcode/libarchive.nix diff --git a/pkgs/development/python-modules/extractcode/libarchive.nix b/pkgs/development/python-modules/extractcode/libarchive.nix new file mode 100644 index 000000000000..0d5e7f318589 --- /dev/null +++ b/pkgs/development/python-modules/extractcode/libarchive.nix @@ -0,0 +1,62 @@ +{ lib +, fetchFromGitHub +, buildPythonPackage +, libarchive +, libb2 +, bzip2 +, expat +, lz4 +, lzma +, zlib +, zstd +, plugincode +, pytestCheckHook +}: +buildPythonPackage rec { + pname = "extractcode-libarchive"; + version = "21.4.4"; + + src = fetchFromGitHub { + owner = "nexB"; + repo = "scancode-plugins"; + rev = "v${version}"; + sha256 = "xnUGDMS34iMVMGo/nZwRarGzzbj3X4Rt+YHvvKpmy6A="; + }; + + sourceRoot = "source/builtins/extractcode_libarchive-linux"; + + preBuild = '' + pushd src/extractcode_libarchive/lib + + rm *.so *.so.* + ln -s ${lib.getLib libarchive}/lib/libarchive.so libarchive.so + ln -s ${lib.getLib libb2}/lib/libb2.so libb2-la3511.so.1 + ln -s ${lib.getLib bzip2}/lib/libbz2.so libbz2-la3511.so.1.0 + ln -s ${lib.getLib expat}/lib/libexpat.so libexpat-la3511.so.1 + ln -s ${lib.getLib lz4}/lib/liblz4.so liblz4-la3511.so.1 + ln -s ${lib.getLib lzma}/lib/liblzma.so liblzma-la3511.so.5 + ln -s ${lib.getLib zlib}/lib/libz.so libz-la3511.so.1 + ln -s ${lib.getLib zstd}/lib/libzstd.so libzstd-la3511.so.1 + + popd + ''; + + propagatedBuildInputs = [ + plugincode + ]; + + # no tests + doCheck = false; + + pythonImportsCheck = [ + "extractcode_libarchive" + ]; + + meta = with lib; { + description = "A ScanCode Toolkit plugin to provide pre-built binary libraries and utilities and their locations"; + homepage = "https://github.com/nexB/scancode-plugins/tree/main/builtins/extractcode_libarchive-linux"; + license = with licenses; [ asl20 bsd2 ]; + maintainers = teams.determinatesystems.members; + platforms = platforms.linux; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 1c0b73a36b46..34aa137c7137 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -2307,6 +2307,18 @@ in { inherit (pkgs) p7zip; }; + extractcode-libarchive = callPackage ../development/python-modules/extractcode/libarchive.nix { + inherit (pkgs) + libarchive + libb2 + bzip2 + expat + lz4 + lzma + zlib + zstd; + }; + extras = callPackage ../development/python-modules/extras { }; eyeD3 = callPackage ../development/python-modules/eyed3 { };