python3.pkgs.typecode-libmagic: init at 21.4.4

This commit is contained in:
Cole Helbling 2021-04-19 22:34:18 -07:00
parent c27b9e0a68
commit 8c53f702cc
No known key found for this signature in database
GPG key ID: B37E0F2371016A4C
2 changed files with 55 additions and 0 deletions

View file

@ -0,0 +1,51 @@
{ lib
, fetchFromGitHub
, buildPythonPackage
, plugincode
, file
, zlib
, pytest
}:
buildPythonPackage rec {
pname = "typecode-libmagic";
version = "21.4.4";
src = fetchFromGitHub {
owner = "nexB";
repo = "scancode-plugins";
rev = "v${version}";
sha256 = "xnUGDMS34iMVMGo/nZwRarGzzbj3X4Rt+YHvvKpmy6A=";
};
sourceRoot = "source/builtins/typecode_libmagic-linux";
propagatedBuildInputs = [
plugincode
];
preBuild = ''
pushd src/typecode_libmagic
rm data/magic.mgc lib/libmagic.so lib/libz-lm539.so.1
ln -s ${file}/share/misc/magic.mgc data/magic.mgc
ln -s ${file}/lib/libmagic.so lib/libmagic.so
ln -s ${zlib}/lib/libz.so lib/libz-lm539.so.1
popd
'';
# no tests
doCheck = false;
pythonImportsCheck = [
"typecode_libmagic"
];
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/typecode_libmagic-linux";
license = licenses.asl20;
maintainers = teams.determinatesystems.members;
platforms = platforms.linux;
};
}

View file

@ -8756,6 +8756,10 @@ in {
typecode = callPackage ../development/python-modules/typecode { };
typecode-libmagic = callPackage ../development/python-modules/typecode/libmagic.nix {
inherit (pkgs) file zlib;
};
typed-ast = callPackage ../development/python-modules/typed-ast { };
typeguard = callPackage ../development/python-modules/typeguard { };