uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
43
pkgs/development/python-modules/python-magic/default.nix
Normal file
43
pkgs/development/python-modules/python-magic/default.nix
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
{ lib
|
||||
, stdenv
|
||||
, python
|
||||
, buildPythonPackage
|
||||
, fetchFromGitHub
|
||||
, substituteAll
|
||||
, file
|
||||
, pytestCheckHook
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "python-magic";
|
||||
version = "0.4.26";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "ahupp";
|
||||
repo = "python-magic";
|
||||
rev = version;
|
||||
sha256 = "sha256-RcKldMwSRroNZNEl0jwuJG9C+3OIPBzk+CjqkxKK/eY=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
(substituteAll {
|
||||
src = ./libmagic-path.patch;
|
||||
libmagic = "${file}/lib/libmagic${stdenv.hostPlatform.extensions.sharedLibrary}";
|
||||
})
|
||||
];
|
||||
|
||||
preCheck = ''
|
||||
export LC_ALL=en_US.UTF-8
|
||||
'';
|
||||
|
||||
checkInputs = [
|
||||
pytestCheckHook
|
||||
];
|
||||
|
||||
meta = with lib; {
|
||||
description = "A python interface to the libmagic file type identification library";
|
||||
homepage = "https://github.com/ahupp/python-magic";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ SuperSandro2000 ];
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
diff --git i/magic/loader.py w/magic/loader.py
|
||||
index 931f161..b8096d1 100644
|
||||
--- i/magic/loader.py
|
||||
+++ w/magic/loader.py
|
||||
@@ -35,16 +35,12 @@ def _lib_candidates():
|
||||
|
||||
|
||||
def load_lib():
|
||||
+ lib = '@libmagic@'
|
||||
|
||||
- for lib in _lib_candidates():
|
||||
- # find_library returns None when lib not found
|
||||
- if lib is None:
|
||||
- continue
|
||||
- try:
|
||||
- return ctypes.CDLL(lib)
|
||||
- except OSError:
|
||||
- pass
|
||||
- else:
|
||||
- # It is better to raise an ImportError since we are importing magic module
|
||||
- raise ImportError('failed to find libmagic. Check your installation')
|
||||
+ try:
|
||||
+ return ctypes.CDLL(lib)
|
||||
+ except OSError:
|
||||
+ pass
|
||||
|
||||
+ # It is better to raise an ImportError since we are importing magic module
|
||||
+ raise ImportError('failed to find libmagic. Check your installation')
|
||||
Loading…
Add table
Add a link
Reference in a new issue