forgejo-lts: 7.0.10 -> 7.0.11
[NixPkgs.git] / pkgs / by-name / co / cosmic-files / package.nix
blob31f238b10d643458ffbe032db2892fcec3873947
1 { lib
2 , stdenv
3 , fetchFromGitHub
4 , rustPlatform
5 , makeBinaryWrapper
6 , cosmic-icons
7 , just
8 , pkg-config
9 , glib
10 , libxkbcommon
11 , wayland
12 , xorg
15 rustPlatform.buildRustPackage rec {
16   pname = "cosmic-files";
17   version = "1.0.0-alpha.1";
19   src = fetchFromGitHub {
20     owner = "pop-os";
21     repo = "cosmic-files";
22     rev = "epoch-${version}";
23     hash = "sha256-UwQwZRzOyMvLRRmU2noxGrqblezkR8J2PNMVoyG0M0w=";
24   };
26   cargoLock = {
27     lockFile = ./Cargo.lock;
28     outputHashes = {
29       "accesskit-0.12.2" = "sha256-1UwgRyUe0PQrZrpS7574oNLi13fg5HpgILtZGW6JNtQ=";
30       "atomicwrites-0.4.2" = "sha256-QZSuGPrJXh+svMeFWqAXoqZQxLq/WfIiamqvjJNVhxA=";
31       "clipboard_macos-0.1.0" = "sha256-cG5vnkiyDlQnbEfV2sPbmBYKv1hd3pjJrymfZb8ziKk=";
32       "cosmic-client-toolkit-0.1.0" = "sha256-1XtyEvednEMN4MApxTQid4eed19dEN5ZBDt/XRjuda0=";
33       "cosmic-config-0.1.0" = "sha256-d2R5xytwf0BIbllG6elc/nn7nmiC3+VI1g3EiW8WEHA=";
34       "cosmic-text-0.12.1" = "sha256-x0XTxzbmtE2d4XCG/Nuq3DzBpz15BbnjRRlirfNJEiU=";
35       "d3d12-0.19.0" = "sha256-usrxQXWLGJDjmIdw1LBXtBvX+CchZDvE8fHC0LjvhD4=";
36       "fs_extra-1.3.0" = "sha256-ftg5oanoqhipPnbUsqnA4aZcyHqn9XsINJdrStIPLoE=";
37       "glyphon-0.5.0" = "sha256-j1HrbEpUBqazWqNfJhpyjWuxYAxkvbXzRKeSouUoPWg=";
38       "smithay-clipboard-0.8.0" = "sha256-4InFXm0ahrqFrtNLeqIuE3yeOpxKZJZx+Bc0yQDtv34=";
39       "softbuffer-0.4.1" = "sha256-a0bUFz6O8CWRweNt/OxTvflnPYwO5nm6vsyc/WcXyNg=";
40       "taffy-0.3.11" = "sha256-SCx9GEIJjWdoNVyq+RZAGn0N71qraKZxf9ZWhvyzLaI=";
41       "trash-5.0.0" = "sha256-6cMo2GtMJjU+fbehlsGNmj3LbzSP+vOjA4en3OgmZ54=";
42       "winit-0.29.10" = "sha256-ScTII2AzK3SC8MVeASZ9jhVWsEaGrSQ2BnApTxgfxK4=";
43     };
44   };
46   # COSMIC applications now uses vergen for the About page
47   # Update the COMMIT_DATE to match when the commit was made
48   env.VERGEN_GIT_COMMIT_DATE = "2024-08-05";
49   env.VERGEN_GIT_SHA = src.rev;
51   postPatch = ''
52     substituteInPlace justfile --replace '#!/usr/bin/env' "#!$(command -v env)"
53   '';
55   nativeBuildInputs = [ just pkg-config makeBinaryWrapper ];
56   buildInputs = [ glib libxkbcommon wayland ];
58   dontUseJustBuild = true;
60   justFlags = [
61     "--set"
62     "prefix"
63     (placeholder "out")
64     "--set"
65     "bin-src"
66     "target/${stdenv.hostPlatform.rust.cargoShortTarget}/release/cosmic-files"
67   ];
69   # LD_LIBRARY_PATH can be removed once tiny-xlib is bumped above 0.2.2
70   postInstall = ''
71     wrapProgram "$out/bin/cosmic-files" \
72       --suffix XDG_DATA_DIRS : "${cosmic-icons}/share" \
73       --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ xorg.libX11 xorg.libXcursor xorg.libXrandr xorg.libXi wayland ]}
74   '';
76   meta = with lib; {
77     homepage = "https://github.com/pop-os/cosmic-files";
78     description = "File Manager for the COSMIC Desktop Environment";
79     license = licenses.gpl3Only;
80     maintainers = with maintainers; [ ahoneybun nyabinary ];
81     platforms = platforms.linux;
82   };