Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{
2 lib,
3 python3Packages,
4 fetchFromGitHub,
5 dpkg,
6 nix-update-script,
7 versionCheckHook,
8 writableTmpDirAsHomeHook,
9}:
10
11python3Packages.buildPythonApplication rec {
12 pname = "rockcraft";
13 version = "1.13.0";
14
15 src = fetchFromGitHub {
16 owner = "canonical";
17 repo = "rockcraft";
18 rev = version;
19 hash = "sha256-pIOCgOC969Fj3lNnmsb6QTEV8z1KWxrUSsdl6Aogd4Q=";
20 };
21
22 pyproject = true;
23
24 build-system = with python3Packages; [ setuptools-scm ];
25
26 postPatch = ''
27 substituteInPlace pyproject.toml --replace-fail "setuptools~=80.8.0" "setuptools"
28 '';
29
30 dependencies = with python3Packages; [
31 craft-application
32 craft-archives
33 craft-platforms
34 spdx-lookup
35 tabulate
36 ];
37
38 pythonRelaxDeps = [
39 "craft-providers"
40 ];
41
42 nativeCheckInputs =
43 with python3Packages;
44 [
45 craft-platforms
46 pytest-check
47 pytest-mock
48 pytest-subprocess
49 pytestCheckHook
50 versionCheckHook
51 writableTmpDirAsHomeHook
52 ]
53 ++ [ dpkg ];
54
55 enabledTestPaths = [ "tests/unit" ];
56
57 disabledTests = [
58 "test_project_all_platforms_invalid"
59 "test_run_init_flask"
60 "test_run_init_django"
61 # Mock is broken for Unix FHS reasons.
62 "test_run_pack_services"
63 # Later version of craft-application is being used, which adds an
64 # additional kind of file to be ignored, and invalidates a somewhat
65 # static assertion. Can be removed in a later version once rockcraft
66 # catches up with craft-application version.
67 "test_lifecycle_args"
68 ];
69
70 versionCheckProgramArg = "--version";
71 versionCheckKeepEnvironment = [ "SSL_CERT_FILE" ];
72
73 passthru.updateScript = nix-update-script { };
74
75 meta = {
76 mainProgram = "rockcraft";
77 description = "Create OCI images using the language from Snapcraft and Charmcraft";
78 homepage = "https://github.com/canonical/rockcraft";
79 changelog = "https://github.com/canonical/rockcraft/releases/tag/${version}";
80 license = lib.licenses.gpl3Only;
81 maintainers = with lib.maintainers; [ jnsgruk ];
82 platforms = lib.platforms.linux;
83 };
84}