From 0b70b350291075b0e135cb1ade181c28bda132e0 Mon Sep 17 00:00:00 2001 From: eljamm Date: Tue, 26 Aug 2025 18:43:04 +0200 Subject: [PATCH 1/2] python313Packages.liberty-parser: init at 0.0.25 --- .../python-modules/liberty-parser/default.nix | 65 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 67 insertions(+) create mode 100644 pkgs/development/python-modules/liberty-parser/default.nix diff --git a/pkgs/development/python-modules/liberty-parser/default.nix b/pkgs/development/python-modules/liberty-parser/default.nix new file mode 100644 index 000000000000..820ea8ed201d --- /dev/null +++ b/pkgs/development/python-modules/liberty-parser/default.nix @@ -0,0 +1,65 @@ +{ + lib, + buildPythonPackage, + fetchFromGitea, + setuptools, + lark, + numpy, + sympy, + pytestCheckHook, +}: + +buildPythonPackage rec { + pname = "liberty-parser"; + version = "0.0.25"; + pyproject = true; + + src = fetchFromGitea { + domain = "codeberg.org"; + owner = "tok"; + repo = "liberty-parser"; + tag = version; + hash = "sha256-Nl+FRG93DeP1ctDphaTKZqkukEywmGprj6JORJQTunw="; + }; + + # Tests try to write to /tmp directly. use $TMPDIR instead. + postPatch = '' + substituteInPlace src/liberty/parser.py \ + --replace-fail "/tmp" "$TMPDIR" + ''; + + build-system = [ + setuptools + ]; + + dependencies = [ + lark + numpy + sympy + ]; + + nativeCheckInputs = [ + pytestCheckHook + ]; + + enabledTestPaths = [ + "src/liberty/*.py" + ]; + + pythonImportsCheck = [ + "liberty.parser" + ]; + + meta = { + description = "Liberty parser for Python"; + homepage = "https://codeberg.org/tok/liberty-parser"; + license = with lib.licenses; [ + asl20 + cc-by-sa-40 + cc0 + gpl3Plus + ]; + maintainers = with lib.maintainers; [ eljamm ]; + teams = with lib.teams; [ ngi ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 63a2b6385f5d..1722c722ba15 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -8123,6 +8123,8 @@ self: super: with self; { libear = callPackage ../development/python-modules/libear { }; + liberty-parser = callPackage ../development/python-modules/liberty-parser { }; + libevdev = callPackage ../development/python-modules/libevdev { }; libfdt = toPythonModule ( From 230ef104b552ef0e67192778afdda49cc16f534b Mon Sep 17 00:00:00 2001 From: eljamm Date: Tue, 26 Aug 2025 18:43:17 +0200 Subject: [PATCH 2/2] lctime: init at 0.0.26 --- pkgs/by-name/lc/lctime/package.nix | 100 +++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 pkgs/by-name/lc/lctime/package.nix diff --git a/pkgs/by-name/lc/lctime/package.nix b/pkgs/by-name/lc/lctime/package.nix new file mode 100644 index 000000000000..08db563674bd --- /dev/null +++ b/pkgs/by-name/lc/lctime/package.nix @@ -0,0 +1,100 @@ +{ + lib, + stdenv, + python3Packages, + fetchFromGitea, + runCommand, + lctime, + ngspice, + writableTmpDirAsHomeHook, +}: + +python3Packages.buildPythonApplication rec { + pname = "lctime"; + version = "0.0.26"; + pyproject = true; + + src = fetchFromGitea { + domain = "codeberg.org"; + owner = "librecell"; + repo = "lctime"; + tag = version; + hash = "sha256-oNmeV8r1dtO2y27jAJnlx4mKGjhzL07ad2yBdOLwgF0="; + }; + + build-system = with python3Packages; [ + setuptools + ]; + + dependencies = with python3Packages; [ + joblib + klayout + liberty-parser + matplotlib + networkx + numpy + pyspice + scipy + sympy + ]; + + nativeCheckInputs = with python3Packages; [ + pytestCheckHook + ngspice + ]; + + enabledTestPaths = [ + "src/lctime/*/*.py" + ]; + + disabledTestPaths = [ + # hangs indefinitely + "src/lctime/characterization/test_ngspice_subprocess.py::test_ngspice_interactive_simple" + "src/lctime/characterization/test_ngspice_subprocess.py::test_ngspice_subprocess_class" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # causes python to abort + "src/lctime/characterization/test_ngspice_subprocess.py::test_simple_simulation" + # broken pipe + "src/lctime/characterization/test_ngspice_subprocess.py::test_interactive_subprocess" + ]; + + pythonImportsCheck = [ + "lctime" + ]; + + passthru = { + tests = + runCommand "lctime-tests" + { + nativeBuildInputs = [ + lctime + ngspice + writableTmpDirAsHomeHook + ]; + } + '' + cd "$HOME" + + cp -R "${src}/tests/"* . + patchShebangs *.sh + + mkdir -p $out + ./run_tests.sh &> $out/result.log + ''; + }; + + meta = { + description = "Characterization tool for CMOS digital standard-cells"; + homepage = "https://codeberg.org/librecell/lctime"; + license = with lib.licenses; [ + agpl3Plus + asl20 + cc-by-sa-40 + cc0 + ]; + maintainers = with lib.maintainers; [ eljamm ]; + teams = with lib.teams; [ ngi ]; + mainProgram = "lctime"; + }; +}