-
-
Notifications
You must be signed in to change notification settings - Fork 14.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
python39Packages.pylibdmtx: init at 0.1.10
- Loading branch information
Showing
2 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
{ fetchFromGitHub | ||
, buildPythonPackage | ||
, pillow | ||
, numpy | ||
, libdmtx | ||
, lib | ||
}: | ||
|
||
buildPythonPackage rec { | ||
pname = "pylibdmtx"; | ||
version = "0.1.10"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "NaturalHistoryMuseum"; | ||
repo = pname; | ||
rev = "v${version}"; | ||
hash = "sha256-vNWzhO4V0mj4eItZ0Z5UG9RBCqprIcgMGNyIe1+mXWY="; | ||
}; | ||
|
||
# Change: | ||
# def load(): | ||
# """Loads the libdmtx shared library. | ||
# | ||
# To: | ||
# def load(): | ||
# return cdll.LoadLibrary("/nix/store/.../lib/libdmtx.so") | ||
# """Loads the libdmtx shared library. | ||
postPatch = '' | ||
sed -i '\#def load.*#a\ return cdll.LoadLibrary("${libdmtx}/lib/libdmtx.so")' \ | ||
pylibdmtx/dmtx_library.py | ||
# Checks that the loader works in various scenarios, but we just | ||
# forced it to only work one way. | ||
rm pylibdmtx/tests/test_dmtx_library.py | ||
''; | ||
|
||
propagatedBuildInputs = [ pillow numpy ]; | ||
|
||
pythonImportsCheck = [ "pylibdmtx" ]; | ||
|
||
meta = with lib; { | ||
description = "Read and write Data Matrix barcodes from Python 2 and 3 using the libdmtx library"; | ||
homepage = "https://github.com/NaturalHistoryMuseum/pylibdmtx/"; | ||
license = licenses.mit; | ||
maintainers = with maintainers; [ grahamc ]; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters