summaryrefslogtreecommitdiffstats
path: root/pkgs/by-name/im/image-roll/package.nix
blob: f04c8cd4b4e06c836a0b5bb24dece9e1bdb68ec2 (plain)
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
{
  lib,
  rustPlatform,
  fetchFromGitHub,
  glib,
  pkg-config,
  wrapGAppsHook4,
  gtk4,
}:

rustPlatform.buildRustPackage (finalAttrs: {
  pname = "image-roll";
  version = "2.1.0";

  src = fetchFromGitHub {
    owner = "weclaw1";
    repo = "image-roll";
    rev = finalAttrs.version;
    sha256 = "sha256-CC40TU38bJFnbJl2EHqeB9RBvbVUrBmRdZVS2GxqGu4=";
  };

  cargoHash = "sha256-oKJknLKkoutPU85gbgi+369fczLghDuvT+t7R0nHwOI=";

  nativeBuildInputs = [
    glib
    pkg-config
    wrapGAppsHook4
  ];

  buildInputs = [ gtk4 ];

  checkFlags = [
    # fails in the sandbox
    "--skip=file_list::tests"

    # sometimes fails on darwin
    "--skip=image_list::tests::save_current_image_overwrites_image_at_current_image_path_when_filename_is_set_to_none"
  ];

  postInstall = ''
    install -Dm444 src/resources/com.github.weclaw1.ImageRoll.desktop -t $out/share/applications/
    install -Dm444 src/resources/com.github.weclaw1.ImageRoll.svg -t $out/share/icons/hicolor/scalable/apps/
    install -Dm444 src/resources/com.github.weclaw1.ImageRoll.metainfo.xml -t $out/share/metainfo/
  '';

  meta = {
    description = "Simple and fast GTK image viewer with basic image manipulation tools";
    mainProgram = "image-roll";
    homepage = "https://github.com/weclaw1/image-roll";
    license = lib.licenses.mit;
    maintainers = [ ];
  };
})