rockcraft: use packageOverrides

This commit is contained in:
Robert Schütz
2024-07-24 09:34:05 -07:00
parent 80056a63da
commit b2701cdfbd
+29 -7
View File
@@ -1,13 +1,34 @@
{
lib,
python3Packages,
python3,
fetchFromGitHub,
dpkg,
nix-update-script,
python3,
}:
python3Packages.buildPythonApplication rec {
let
python = python3.override {
packageOverrides = self: super: {
craft-application = super.craft-application.overridePythonAttrs (old: rec {
version = "1.2.1";
src = fetchFromGitHub {
owner = "canonical";
repo = "craft-application";
rev = "refs/tags/${version}";
hash = "sha256-CXZEWVoE66dlQJp4G8tinufjyaDJaH1Muxz/qd/81oA=";
};
postPatch = ''
substituteInPlace pyproject.toml \
--replace-fail "setuptools==67.7.2" "setuptools"
'';
preCheck = ''
export HOME=$(mktemp -d)
'';
});
};
};
in
python.pkgs.buildPythonApplication rec {
pname = "rockcraft";
version = "1.2.3";
@@ -26,20 +47,21 @@ python3Packages.buildPythonApplication rec {
--replace-fail "distutils.util" "setuptools.dist"
'';
propagatedBuildInputs = with python3Packages; [
craft-application-1
build-system = with python.pkgs; [ setuptools-scm ];
dependencies = with python.pkgs; [
craft-application
craft-archives
spdx-lookup
];
nativeCheckInputs =
with python3Packages;
with python.pkgs;
[
pytest-check
pytest-mock
pytest-subprocess
pytestCheckHook
setuptools
]
++ [ dpkg ];