nixpkgs/pkgs/by-name/ge/gerbolyze/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

104 lines
2.5 KiB
Nix
Raw Normal View History

2024-02-04 04:32:30 +00:00
{
lib,
stdenv,
python3Packages,
fetchFromGitHub,
2024-07-04 00:28:51 +00:00
gitUpdater,
2024-02-04 04:32:30 +00:00
resvg,
}:
let
2024-07-06 04:04:01 +00:00
version = "3.1.9";
2024-02-04 04:32:30 +00:00
src = fetchFromGitHub {
owner = "jaseg";
repo = "gerbolyze";
rev = "v${version}";
2024-07-06 04:04:01 +00:00
hash = "sha256-bisLln3Y239HuJt0MkrCU+6vLLbEDxfTjEJMkcbE/wE=";
2024-02-04 04:32:30 +00:00
fetchSubmodules = true;
};
svg-flatten = stdenv.mkDerivation rec {
inherit version src;
pname = "svg-flatten";
sourceRoot = "${src.name}/svg-flatten";
postPatch = ''
substituteInPlace Makefile \
--replace "$(INSTALL) $(BUILDDIR)/$(BINARY) $(PREFIX)/bin" \
"$(INSTALL) $(BUILDDIR)/$(BINARY) $(PREFIX)/bin/svg-flatten" \
'';
installPhase = ''
runHook preInstall
mkdir -p $out/bin
PREFIX=$out make install
runHook postInstall
'';
meta = with lib; {
description = "svg-flatten SVG downconverter";
homepage = "https://github.com/jaseg/gerbolyze";
2024-03-19 12:26:06 +00:00
license = with licenses; [ agpl3Plus ];
2024-02-04 04:32:30 +00:00
maintainers = with maintainers; [ wulfsta ];
mainProgram = "svg-flatten";
platforms = platforms.linux;
};
};
in
python3Packages.buildPythonApplication rec {
inherit version src;
pname = "gerbolyze";
format = "setuptools";
nativeBuildInputs = [
python3Packages.setuptools
];
propagatedBuildInputs = [
python3Packages.beautifulsoup4
python3Packages.click
python3Packages.numpy
python3Packages.scipy
python3Packages.python-slugify
python3Packages.lxml
python3Packages.gerbonara
2024-07-04 00:26:17 +00:00
resvg
2024-02-04 04:32:30 +00:00
svg-flatten
];
preConfigure = ''
# setup.py tries to execute a call to git in a subprocess, this avoids it.
substituteInPlace setup.py \
--replace "version = get_version()," \
"version = '${version}'," \
# setup.py tries to execute a call to git in a subprocess, this avoids it.
substituteInPlace setup.py \
--replace "long_description=format_readme_for_pypi()," \
"long_description='\n'.join(Path('README.rst').read_text().splitlines()),"
'';
pythonImportsCheck = [ "gerbolyze" ];
2024-07-04 00:26:17 +00:00
nativeCheckInputs = [
python3Packages.pytestCheckHook
resvg
svg-flatten
];
2024-02-04 04:32:30 +00:00
2024-07-04 00:28:51 +00:00
passthru.updateScript = gitUpdater {
rev-prefix = "v";
};
2024-02-04 04:32:30 +00:00
meta = with lib; {
description = "Directly render SVG overlays into Gerber and Excellon files";
homepage = "https://github.com/jaseg/gerbolyze";
2024-03-19 12:26:06 +00:00
license = with licenses; [ agpl3Plus ];
2024-02-04 04:32:30 +00:00
maintainers = with maintainers; [ wulfsta ];
mainProgram = "gerbolyze";
platforms = platforms.linux;
};
}