fluffychat: 1.22.1 -> 1.23.0 (#364091)
[NixPkgs.git] / pkgs / by-name / cz / czkawka / package.nix
blob0ec3c8d6d00f40de65f6c5c5f00cec24445a90a8
2   lib,
3   atk,
4   cairo,
5   callPackage,
6   darwin,
7   fetchFromGitHub,
8   gdk-pixbuf,
9   glib,
10   gobject-introspection,
11   gtk4,
12   overrideSDK,
13   pango,
14   pkg-config,
15   rustPlatform,
16   stdenv,
17   testers,
18   wrapGAppsHook4,
19   xvfb-run,
20   versionCheckHook,
23 let
24   buildRustPackage' = rustPlatform.buildRustPackage.override {
25     stdenv = if stdenv.hostPlatform.isDarwin then overrideSDK stdenv "11.0" else stdenv;
26   };
28   self = buildRustPackage' {
29     pname = "czkawka";
30     version = "8.0.0";
32     src = fetchFromGitHub {
33       owner = "qarmin";
34       repo = "czkawka";
35       rev = "refs/tags/${self.version}";
36       hash = "sha256-Uxko2TRIjqQvd7n9C+P7oMUrm3YY5j7TVzvijEjDwOM=";
37     };
39     cargoHash = "sha256-DR2JU+QcGWliNoRMjSjJns7FsicpNAX5gTariFuQ/dw=";
41     nativeBuildInputs = [
42       gobject-introspection
43       pkg-config
44       wrapGAppsHook4
45     ];
47     buildInputs =
48       [
49         atk
50         cairo
51         gdk-pixbuf
52         glib
53         gtk4
54         pango
55       ]
56       ++ lib.optionals stdenv.hostPlatform.isDarwin (
57         with darwin.apple_sdk.frameworks;
58         [
59           AppKit
60           Foundation
61         ]
62       );
64     nativeCheckInputs = [ xvfb-run ];
66     strictDeps = true;
68     doCheck = stdenv.hostPlatform.isLinux && (stdenv.hostPlatform == stdenv.buildPlatform);
70     checkPhase = ''
71       runHook preCheck
72       xvfb-run cargo test
73       runHook postCheck
74     '';
76     # Desktop items, icons and metainfo are not installed automatically
77     postInstall = ''
78       install -Dm444 -t $out/share/applications data/com.github.qarmin.czkawka.desktop
79       install -Dm444 -t $out/share/icons/hicolor/scalable/apps data/icons/com.github.qarmin.czkawka.svg
80       install -Dm444 -t $out/share/icons/hicolor/scalable/apps data/icons/com.github.qarmin.czkawka-symbolic.svg
81       install -Dm444 -t $out/share/metainfo data/com.github.qarmin.czkawka.metainfo.xml
82     '';
84     nativeInstallCheckInputs = [
85       versionCheckHook
86     ];
87     versionCheckProgram = "${placeholder "out"}/bin/czkawka_cli";
88     versionCheckProgramArg = [ "--version" ];
89     doInstallCheck = true;
91     passthru = {
92       tests.version = testers.testVersion {
93         package = self;
94         command = "czkawka_cli --version";
95       };
96       wrapper = callPackage ./wrapper.nix {
97         czkawka = self;
98       };
99     };
101     meta = {
102       homepage = "https://github.com/qarmin/czkawka";
103       description = "Simple, fast and easy to use app to remove unnecessary files from your computer";
104       changelog = "https://github.com/qarmin/czkawka/raw/${self.version}/Changelog.md";
105       license = with lib.licenses; [ mit ];
106       mainProgram = "czkawka_gui";
107       maintainers = with lib.maintainers; [
108         AndersonTorres
109         yanganto
110         _0x4A6F
111       ];
112     };
113   };
115 self