btrbk: add mainProgram (#356350)
[NixPkgs.git] / pkgs / by-name / oc / oculante / package.nix
blob643cddcf2aca14f4e78699c80e8058e82ae2b9d6
2   lib,
3   rustPlatform,
4   fetchFromGitHub,
5   cmake,
6   pkg-config,
7   openssl,
8   fontconfig,
9   nasm,
10   libX11,
11   libXcursor,
12   libXrandr,
13   libXi,
14   libGL,
15   libxkbcommon,
16   wayland,
17   stdenv,
18   gtk3,
19   darwin,
20   perl,
21   wrapGAppsHook3,
24 rustPlatform.buildRustPackage rec {
25   pname = "oculante";
26   version = "0.9.1";
28   src = fetchFromGitHub {
29     owner = "woelper";
30     repo = "oculante";
31     rev = version;
32     hash = "sha256-6jow0ektqmEcwFEaJgPqhJPs8LlYmPRLE+zqk1T4wDk=";
33   };
35   cargoHash = "sha256-0e4FoWhZwq6as0JYHGj1zoAOSr71ztqtWJEY3QXDs9s=";
37   nativeBuildInputs = [
38     cmake
39     pkg-config
40     nasm
41     perl
42     wrapGAppsHook3
43   ];
45   buildInputs =
46     [
47       openssl
48       fontconfig
49     ]
50     ++ lib.optionals stdenv.hostPlatform.isLinux [
51       libGL
52       libX11
53       libXcursor
54       libXi
55       libXrandr
56       gtk3
58       libxkbcommon
59       wayland
60     ]
61     ++ lib.optionals stdenv.hostPlatform.isDarwin [
62       darwin.libobjc
63     ];
65   checkFlags = [
66     "--skip=bench"
67     "--skip=tests::net" # requires network access
68     "--skip=tests::flathub"
69   ];
71   postInstall = ''
72     install -Dm444 $src/res/icons/icon.png -t $out/share/icons/hicolor/128x128/apps/
73     install -Dm444 $src/res/oculante.desktop -t $out/share/applications
74     wrapProgram $out/bin/oculante \
75       --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ libGL ]}
76   '';
78   meta = with lib; {
79     broken = stdenv.hostPlatform.isDarwin;
80     description = "Minimalistic crossplatform image viewer written in Rust";
81     homepage = "https://github.com/woelper/oculante";
82     changelog = "https://github.com/woelper/oculante/blob/${version}/CHANGELOG.md";
83     license = licenses.mit;
84     mainProgram = "oculante";
85     maintainers = with maintainers; [
86       dit7ya
87       figsoda
88     ];
89   };