python3Packages.slothy: init at 0.2.0

This commit is contained in:
Matthias J. Kannwischer
2026-05-21 22:19:44 +08:00
parent 25390f5536
commit 774c5a22ff
3 changed files with 74 additions and 0 deletions
+6
View File
@@ -18272,6 +18272,12 @@
githubId = 16974598;
name = "Mike Playle";
};
mkannwischer = {
email = "matthias@kannwischer.eu";
github = "mkannwischer";
githubId = 3984960;
name = "Matthias Kannwischer";
};
mkez = {
email = "matias+nix@zwinger.fi";
github = "mk3z";
@@ -0,0 +1,66 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
setuptools,
gcc,
llvm,
ortools,
sympy,
unicorn,
}:
buildPythonPackage rec {
pname = "slothy";
version = "0.2.0";
pyproject = true;
src = fetchFromGitHub {
owner = "slothy-optimizer";
repo = "slothy";
tag = version;
hash = "sha256-1seD/wqAyEcv5HJFO8j53ARd64fddGropA6xk0dq2yk=";
};
build-system = [ setuptools ];
dependencies = [
ortools
sympy
unicorn
];
# slothy shells out to `gcc` and the llvm binutils at runtime; extend
# PATH at import time so the library works in a plain withPackages env.
postPatch = ''
substituteInPlace slothy/__init__.py \
--replace-fail 'from slothy.core.slothy import Slothy' \
'import os
os.environ["PATH"] = "${
lib.makeBinPath [
gcc
llvm
]
}" + os.pathsep + os.environ.get("PATH", "")
from slothy.core.slothy import Slothy'
'';
pythonRelaxDeps = true;
pythonImportsCheck = [ "slothy" ];
installCheckPhase = ''
runHook preInstallCheck
python3 test.py --silent --tests aarch64_simple0_a55
runHook postInstallCheck
'';
meta = {
description = "Assembly superoptimization via constraint solving";
homepage = "https://slothy-optimizer.github.io/slothy";
changelog = "https://github.com/slothy-optimizer/slothy/releases/tag/${version}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ mkannwischer ];
platforms = lib.platforms.linux ++ lib.platforms.darwin;
};
}
+2
View File
@@ -18114,6 +18114,8 @@ self: super: with self; {
slob = callPackage ../development/python-modules/slob { };
slothy = callPackage ../development/python-modules/slothy { };
slovnet = callPackage ../development/python-modules/slovnet { };
slowapi = callPackage ../development/python-modules/slowapi { };