File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2525let
2626 python_packages = my_python . pkgs ;
2727 unstable_python_packages = unstable_pkgs . my_python . pkgs ;
28+ python_doctr = pkgs . callPackage ./packages/doctr.nix {
29+ pkgs = pkgs ;
30+ my_python = my_python ;
31+ } ;
2832in {
2933 pkgs = pkgs ;
3034 lib = lib ;
3438 python_packages . numpy
3539 python_packages . torch-bin
3640 unstable_python_packages . pytorch-lightning
41+ python_doctr
3742 cudatoolkit
3843 ] ;
3944}
Original file line number Diff line number Diff line change 1+ { pkgs ? import <nixpkgs> { }
2+ , lib ? pkgs . lib
3+ , my_python ? pkgs . python311
4+ , buildPythonPackage ? my_python . pkgs . buildPythonPackage
5+ , fetchFromGitHub ? pkgs . fetchFromGitHub } :
6+
7+ buildPythonPackage rec {
8+ pname = "doctr" ;
9+ version = "0.8.1" ; # Update this to the latest release version
10+
11+ src = fetchFromGitHub {
12+ owner = "mindee" ;
13+ repo = pname ;
14+ rev = "v${ version } " ;
15+ sha256 = "rlIGq5iHDAEWy1I0sAXVSN2/Jh2ub/xLCLCLLp7+9ik=" ; # You can generate this with nix-prefetch-github
16+ } ;
17+
18+ nativeBuildInputs = [ my_python . pkgs . setuptools ] ;
19+ propagatedBuildInputs = [ my_python . pkgs . torch ] ;
20+
21+
22+ postInstall = let
23+ libPath = "lib/${ my_python . libPrefix } /site-packages" ;
24+ in
25+ ''
26+ mkdir -p $out/nix-support
27+ echo "$out/${ libPath } " > "$out/nix-support/propagated-build-inputs"
28+ '' ;
29+
30+ doCheck = false ;
31+
32+ meta = with lib ; {
33+ description = "Doctr Python package" ;
34+ homepage = https://github.com/mindee/doctr ;
35+ license = licenses . asl20 ; # Update as per project's licensing
36+ maintainers = [ ] ; # You need to add your name to the list of Nix maintainers
37+ } ;
38+ }
You can’t perform that action at this time.
0 commit comments