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