forgejo-lts: 7.0.10 -> 7.0.11
[NixPkgs.git] / pkgs / by-name / co / cosmic-store / package.nix
blob48456a1130a1c6a214821942c2885594fe814c54
1 { lib, stdenv, fetchFromGitHub, rustPlatform, appstream, makeBinaryWrapper
2 , cosmic-icons, glib, just, pkg-config, libglvnd, libxkbcommon, libinput
3 , fontconfig, flatpak, freetype, openssl, wayland, xorg, vulkan-loader
4 , vulkan-validation-layers, }:
6 rustPlatform.buildRustPackage rec {
7   pname = "cosmic-store";
8   version = "1.0.0-alpha.2";
10   src = fetchFromGitHub {
11     owner = "pop-os";
12     repo = "cosmic-store";
13     rev = "epoch-${version}";
14     hash = "sha256-mq94ZMVOdXAPR52ID5x8nppJ9mNoTOPBfn7Eouj3T1U=";
15     fetchSubmodules = true;
16   };
18   cargoLock = {
19     lockFile = ./Cargo.lock;
20     outputHashes = {
21       "accesskit-0.12.2" = "sha256-1UwgRyUe0PQrZrpS7574oNLi13fg5HpgILtZGW6JNtQ=";
22       "appstream-0.2.2" = "sha256-OWeNXxvqU8s0ksdY9v5bZeNfDYgMBVd1DhEAjjZxEmo=";
23       "atomicwrites-0.4.2" = "sha256-QZSuGPrJXh+svMeFWqAXoqZQxLq/WfIiamqvjJNVhxA=";
24       "clipboard_macos-0.1.0" = "sha256-cG5vnkiyDlQnbEfV2sPbmBYKv1hd3pjJrymfZb8ziKk=";
25       "cosmic-config-0.1.0" = "sha256-gXrMEoAN+7nYAEcs4w6wROhQTjMCxkGn+muJutktLyk=";
26       "cosmic-text-0.12.1" = "sha256-u2Tw+XhpIKeFg8Wgru/sjGw6GUZ2m50ZDmRBJ1IM66w=";
27       "d3d12-0.19.0" = "sha256-usrxQXWLGJDjmIdw1LBXtBvX+CchZDvE8fHC0LjvhD4=";
28       "glyphon-0.5.0" = "sha256-j1HrbEpUBqazWqNfJhpyjWuxYAxkvbXzRKeSouUoPWg=";
29       "smithay-clipboard-0.8.0" = "sha256-4InFXm0ahrqFrtNLeqIuE3yeOpxKZJZx+Bc0yQDtv34=";
30       "softbuffer-0.4.1" = "sha256-a0bUFz6O8CWRweNt/OxTvflnPYwO5nm6vsyc/WcXyNg=";
31       "taffy-0.3.11" = "sha256-SCx9GEIJjWdoNVyq+RZAGn0N71qraKZxf9ZWhvyzLaI=";
32       "winit-0.29.10" = "sha256-ScTII2AzK3SC8MVeASZ9jhVWsEaGrSQ2BnApTxgfxK4=";
33     };
34   };
36   postPatch = ''
37     substituteInPlace justfile --replace '#!/usr/bin/env' "#!$(command -v env)"
38   '';
40   nativeBuildInputs = [ just pkg-config makeBinaryWrapper ];
41   buildInputs = [
42     appstream
43     glib
44     libxkbcommon
45     libinput
46     libglvnd
47     fontconfig
48     flatpak
49     freetype
50     openssl
51     xorg.libX11
52     wayland
53     vulkan-loader
54     vulkan-validation-layers
55   ];
57   dontUseJustBuild = true;
59   justFlags = [
60     "--set"
61     "prefix"
62     (placeholder "out")
63     "--set"
64     "bin-src"
65     "target/${stdenv.hostPlatform.rust.cargoShortTarget}/release/cosmic-store"
66   ];
68   # Force linking to libEGL, which is always dlopen()ed, and to
69   # libwayland-client, which is always dlopen()ed except by the
70   # obscure winit backend.
71   RUSTFLAGS = map (a: "-C link-arg=${a}") [
72     "-Wl,--push-state,--no-as-needed"
73     "-lEGL"
74     "-lwayland-client"
75     "-Wl,--pop-state"
76   ];
78   # LD_LIBRARY_PATH can be removed once tiny-xlib is bumped above 0.2.2
79   postInstall = ''
80     wrapProgram "$out/bin/cosmic-store" \
81       --suffix XDG_DATA_DIRS : "${cosmic-icons}/share" \
82       --prefix LD_LIBRARY_PATH : ${
83         lib.makeLibraryPath [
84           xorg.libX11
85           xorg.libXcursor
86           xorg.libXi
87           xorg.libXrandr
88           libxkbcommon
89           vulkan-loader
90         ]
91       }
92   '';
94   meta = with lib; {
95     homepage = "https://github.com/pop-os/cosmic-store";
96     description = "App Store for the COSMIC Desktop Environment";
97     license = licenses.gpl3Only;
98     maintainers = with maintainers; [ ahoneybun nyabinary ];
99     platforms = platforms.linux;
100   };