about summary refs log tree commit diff
path: root/pkgs/by-name/ro/rockcraft/package.nix
blob: e1b29f50061b082ca37e0307744f26374fd045bb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
{ lib
, python3Packages
, fetchFromGitHub
, dpkg
, nix-update-script
, python3
}:

python3Packages.buildPythonApplication rec {
  pname = "rockcraft";
  version = "1.2.3";

  src = fetchFromGitHub {
    owner = "canonical";
    repo = "rockcraft";
    rev = "refs/tags/${version}";
    hash = "sha256-Qk7Fi4I/5TCf9llGTsTBQsAxUkeVmAlH6tFNYMsyZ1c=";
  };

  postPatch = ''
    substituteInPlace rockcraft/__init__.py \
      --replace-fail "dev" "${version}"
  '';

  propagatedBuildInputs = with python3Packages; [
    craft-application-1
    craft-archives
    spdx-lookup
  ];

  nativeCheckInputs = with python3Packages; [
    pytest-check
    pytest-mock
    pytest-subprocess
    pytestCheckHook
  ] ++ [
    dpkg
  ];

  preCheck = ''
    mkdir -p check-phase
    export HOME="$(pwd)/check-phase"
  '';

  disabledTests = [ "test_expand_extensions" ];

  passthru.updateScript = nix-update-script { };

  meta = {
    mainProgram = "rockcraft";
    description = "Create OCI images using the language from Snapcraft and Charmcraft";
    homepage = "https://github.com/canonical/rockcraft";
    changelog = "https://github.com/canonical/rockcraft/releases/tag/${version}";
    license = lib.licenses.gpl3Only;
    maintainers = with lib.maintainers; [ jnsgruk ];
    platforms = lib.platforms.linux;
  };
}