From 10e5003d200f4763ccd3122b22be3706cdfb74b9 Mon Sep 17 00:00:00 2001 From: Tom Repetti Date: Mon, 24 Aug 2020 23:57:20 -0400 Subject: [PATCH] flatcam: init at 8.5 --- .../science/electronics/flatcam/default.nix | 56 +++++++++++++++++++ .../science/electronics/flatcam/release.patch | 13 +++++ pkgs/top-level/all-packages.nix | 2 + 3 files changed, 71 insertions(+) create mode 100644 pkgs/applications/science/electronics/flatcam/default.nix create mode 100644 pkgs/applications/science/electronics/flatcam/release.patch diff --git a/pkgs/applications/science/electronics/flatcam/default.nix b/pkgs/applications/science/electronics/flatcam/default.nix new file mode 100644 index 000000000000..247f99485bb4 --- /dev/null +++ b/pkgs/applications/science/electronics/flatcam/default.nix @@ -0,0 +1,56 @@ +{ lib +, python3Packages +, fetchFromBitbucket +, fetchpatch +}: + +python3Packages.buildPythonApplication rec { + pname = "flatcam"; + version = "8.5"; + + src = fetchFromBitbucket { + owner = "jpcgt"; + repo = "${pname}"; + rev = "533afd6a1772857cb633c011b5e0a15b60b1e92e"; # 8.5 with Red Hat packaging. + sha256 = "199kiiml18k34z1zhk2hbhibphmnv0kb11kxiajq52alps0mjb3m"; + }; + + propagatedBuildInputs = with python3Packages; [ + matplotlib + numpy + pyqt4 + Rtree + scipy + setuptools + shapely + simplejson + six + svg-path + ]; + + packaging_fix_pull_request_patch = fetchpatch { + name = "packaging_fix_pull_request.patch"; + url = "https://bitbucket.org/trepetti/flatcam/commits/5591ed889d1f48a5190fe237b562cb932cb5876c/raw"; + sha256 = "19rhjdrf1n1q29cgpcry6pl2kl90zq0d613hhkwdir9bhq5bkknp"; + }; + + patches = [ + packaging_fix_pull_request_patch + ./release.patch + ]; + + # Only non-GUI tests can be run deterministically in the Nix build environment. + checkPhase = '' + python -m unittest tests.test_excellon + python -m unittest tests.test_gerber_buffer + python -m unittest tests.test_paint + python -m unittest tests.test_pathconnect + ''; + + meta = with lib; { + description = "2-D post processing for PCB fabrication on CNC routers."; + homepage = "https://bitbucket.org/jpcgt/flatcam"; + license = licenses.mit; + maintainers = with maintainers; [ trepetti ]; + }; +} diff --git a/pkgs/applications/science/electronics/flatcam/release.patch b/pkgs/applications/science/electronics/flatcam/release.patch new file mode 100644 index 000000000000..945228e35bab --- /dev/null +++ b/pkgs/applications/science/electronics/flatcam/release.patch @@ -0,0 +1,13 @@ +diff --git a/FlatCAMVersion.py b/FlatCAMVersion.py +index ba9e04a5..2c64d5a6 100644 +--- a/FlatCAMVersion.py ++++ b/FlatCAMVersion.py +@@ -16,7 +16,7 @@ version = { + "number": 8.5, + "date": (2016, 7, 1), # Year, Month, Day + "name": None, +- "release": False, ++ "release": True, + } + + diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 8c6d61f7099a..e51b84c3f5c5 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -25829,6 +25829,8 @@ in csxcad = callPackage ../applications/science/electronics/csxcad { }; + flatcam = callPackage ../applications/science/electronics/flatcam { }; + fparser = callPackage ../applications/science/electronics/fparser { }; geda = callPackage ../applications/science/electronics/geda {