1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 gitUpdater,
6 setuptools,
7 pytest,
8 click,
9 numpy,
10 scipy,
11 rtree,
12}:
13
14buildPythonPackage rec {
15 pname = "gerbonara";
16 version = "1.4.0";
17 src = fetchFromGitHub {
18 owner = "jaseg";
19 repo = "gerbonara";
20 rev = "v${version}";
21 hash = "sha256-SwXoCA9ru5VgH4geKUDgdcPrgEYgNoVwNb5YUBAcXlo=";
22 };
23
24 format = "setuptools";
25
26 nativeBuildInputs = [ setuptools ];
27
28 propagatedBuildInputs = [
29 click
30 numpy
31 scipy
32 rtree
33 ];
34
35 preConfigure = ''
36 # setup.py tries to execute a call to git in a subprocess, this avoids it.
37 substituteInPlace setup.py \
38 --replace "version=version()," \
39 "version='${version}',"
40 '';
41
42 pythonImportsCheck = [ "gerbonara" ];
43
44 # Test environment is exceptionally tricky to get set up, so skip for now.
45 doCheck = false;
46
47 passthru.updateScript = gitUpdater { rev-prefix = "v"; };
48
49 meta = with lib; {
50 description = "Pythonic library for reading/modifying/writing Gerber/Excellon/IPC-356 files";
51 mainProgram = "gerbonara";
52 homepage = "https://github.com/jaseg/gerbonara";
53 license = with licenses; [ asl20 ];
54 maintainers = with maintainers; [ wulfsta ];
55 };
56}