Loading pkgs/development/python-modules/sphinxcontrib-svg2pdfconverter/default.nix 0 → 100644 +59 −0 Original line number Diff line number Diff line { lib, buildPythonPackage, setuptools, sphinx, cairosvg, inkscape, librsvg, fetchPypi, withCairosvg ? false, withInkscape ? false, withLibrsvg ? true, }: assert (withCairosvg || withInkscape || withLibrsvg); buildPythonPackage rec { pname = "sphinxcontrib-svg2pdfconverter"; version = "1.3.0"; pyproject = true; src = fetchPypi { inherit version; pname = "sphinxcontrib_svg2pdfconverter"; hash = "sha256-ZBGkzC9X7tlqDXu/oTn2jL55gwGIgeHm18RgU81pkR8="; }; # for enabled modules: provide the full path to the binary postPatch = lib.optionalString withLibrsvg '' substituteInPlace sphinxcontrib/rsvgconverter.py \ --replace-fail "'rsvg_converter_bin', 'rsvg-convert'" "'rsvg_converter_bin', '${lib.getExe' librsvg "rsvg-convert"}'" '' + lib.optionalString withInkscape '' substituteInPlace sphinxcontrib/inkscapeconverter.py \ --replace-fail "'inkscape_converter_bin', 'inkscape'" "'inkscape_converter_bin', '${lib.getExe inkscape}'" ''; build-system = [ setuptools ]; dependencies = [ sphinx ] ++ lib.optional withCairosvg cairosvg; doCheck = false; # no tests pythonImportsCheck = lib.optional withCairosvg "sphinxcontrib.cairosvgconverter" ++ lib.optional withInkscape "sphinxcontrib.inkscapeconverter" ++ lib.optional withLibrsvg "sphinxcontrib.rsvgconverter"; pythonNamespaces = [ "sphinxcontrib" ]; meta = { description = "Sphinx SVG to PDF converter extension"; homepage = "https://github.com/missinglinkelectronics/sphinxcontrib-svg2pdfconverter"; license = lib.licenses.bsd2; maintainers = with lib.maintainers; [ dansbandit ]; }; } pkgs/top-level/python-packages.nix +2 −0 Original line number Diff line number Diff line Loading @@ -15728,6 +15728,8 @@ self: super: with self; { sphinxcontrib-spelling = callPackage ../development/python-modules/sphinxcontrib-spelling { }; sphinxcontrib-svg2pdfconverter = callPackage ../development/python-modules/sphinxcontrib-svg2pdfconverter { }; sphinxcontrib-tikz = callPackage ../development/python-modules/sphinxcontrib-tikz { }; sphinxcontrib-wavedrom = callPackage ../development/python-modules/sphinxcontrib-wavedrom { }; Loading
pkgs/development/python-modules/sphinxcontrib-svg2pdfconverter/default.nix 0 → 100644 +59 −0 Original line number Diff line number Diff line { lib, buildPythonPackage, setuptools, sphinx, cairosvg, inkscape, librsvg, fetchPypi, withCairosvg ? false, withInkscape ? false, withLibrsvg ? true, }: assert (withCairosvg || withInkscape || withLibrsvg); buildPythonPackage rec { pname = "sphinxcontrib-svg2pdfconverter"; version = "1.3.0"; pyproject = true; src = fetchPypi { inherit version; pname = "sphinxcontrib_svg2pdfconverter"; hash = "sha256-ZBGkzC9X7tlqDXu/oTn2jL55gwGIgeHm18RgU81pkR8="; }; # for enabled modules: provide the full path to the binary postPatch = lib.optionalString withLibrsvg '' substituteInPlace sphinxcontrib/rsvgconverter.py \ --replace-fail "'rsvg_converter_bin', 'rsvg-convert'" "'rsvg_converter_bin', '${lib.getExe' librsvg "rsvg-convert"}'" '' + lib.optionalString withInkscape '' substituteInPlace sphinxcontrib/inkscapeconverter.py \ --replace-fail "'inkscape_converter_bin', 'inkscape'" "'inkscape_converter_bin', '${lib.getExe inkscape}'" ''; build-system = [ setuptools ]; dependencies = [ sphinx ] ++ lib.optional withCairosvg cairosvg; doCheck = false; # no tests pythonImportsCheck = lib.optional withCairosvg "sphinxcontrib.cairosvgconverter" ++ lib.optional withInkscape "sphinxcontrib.inkscapeconverter" ++ lib.optional withLibrsvg "sphinxcontrib.rsvgconverter"; pythonNamespaces = [ "sphinxcontrib" ]; meta = { description = "Sphinx SVG to PDF converter extension"; homepage = "https://github.com/missinglinkelectronics/sphinxcontrib-svg2pdfconverter"; license = lib.licenses.bsd2; maintainers = with lib.maintainers; [ dansbandit ]; }; }
pkgs/top-level/python-packages.nix +2 −0 Original line number Diff line number Diff line Loading @@ -15728,6 +15728,8 @@ self: super: with self; { sphinxcontrib-spelling = callPackage ../development/python-modules/sphinxcontrib-spelling { }; sphinxcontrib-svg2pdfconverter = callPackage ../development/python-modules/sphinxcontrib-svg2pdfconverter { }; sphinxcontrib-tikz = callPackage ../development/python-modules/sphinxcontrib-tikz { }; sphinxcontrib-wavedrom = callPackage ../development/python-modules/sphinxcontrib-wavedrom { };