From ec8b25b652947c7caf661503c18f7a3558e18c2a Mon Sep 17 00:00:00 2001 From: Sarah Clark Date: Thu, 1 May 2025 15:02:51 -0700 Subject: [PATCH] python313Packages.hieroglyph: fix build failure --- .../python-modules/hieroglyph/default.nix | 51 ++++++++++++++++--- 1 file changed, 43 insertions(+), 8 deletions(-) diff --git a/pkgs/development/python-modules/hieroglyph/default.nix b/pkgs/development/python-modules/hieroglyph/default.nix index 30670a8716c2..848bb9cac979 100644 --- a/pkgs/development/python-modules/hieroglyph/default.nix +++ b/pkgs/development/python-modules/hieroglyph/default.nix @@ -1,23 +1,58 @@ { lib, - fetchPypi, buildPythonPackage, - isPy27, + fetchFromGitHub, + fetchpatch, + + # build-system + setuptools, + + # dependencies sphinx, }: buildPythonPackage rec { pname = "hieroglyph"; version = "2.1.0"; - format = "setuptools"; - disabled = isPy27; # python2 compatible sphinx is too low - src = fetchPypi { - inherit pname version; - sha256 = "b4b5db13a9d387438e610c2ca1d81386ccd206944d9a9dd273f21874486cddaf"; + src = fetchFromGitHub { + owner = "nyergler"; + repo = "hieroglyph"; + tag = "hieroglyph-${version}"; + hash = "sha256-nr5cHF0Lg2mjQvnOoM5HCmMUiGh1QOeTD0nc8BvCBOE="; }; - propagatedBuildInputs = [ sphinx ]; + pyproject = true; + + build-system = [ setuptools ]; + + patches = [ + # https://github.com/nyergler/hieroglyph/pull/177hieroglyph-quickstart + (fetchpatch { + name = "hieroglyph-upgrade-versioneer"; + url = "https://github.com/nyergler/hieroglyph/commit/9cebee269ac10964b2436c0204156b7bd620a3d4.patch"; + hash = "sha256-ZvU7uASU727/NUAW8I7k9idzMpEdnuwRshdHm2/GQ3w="; + }) + # https://github.com/nyergler/hieroglyph/pull/174 + (fetchpatch { + name = "hieroglyph-slide-builder-type-error"; + url = "https://github.com/nyergler/hieroglyph/pull/174/commits/d75c550f797e3635d33db11f50968755288962a7.patch"; + hash = "sha256-qNQVgWL9jy0cwtxKUbWi3Qc77RU2H3raN0BzBjDk9C8="; + }) + ]; + + # load_additional_themes has been deprecated, need to use its deprecated name + postPatch = '' + substituteInPlace src/hieroglyph/builder.py \ + --replace-fail "theme_factory.load_additional_themes" "theme_factory._load_additional_themes" + ''; + + dependencies = [ + setuptools + sphinx + ]; + + pythonImportsCheck = [ "hieroglyph" ]; # all tests fail; don't know why: # test_absolute_paths_made_relative (hieroglyph.tests.test_path_fixing.PostProcessImageTests) ... ERROR