biome: 1.9.2 -> 1.9.3
[NixPkgs.git] / pkgs / by-name / co / cosmic-edit / package.nix
blob40d6eb082dd4b8e768ce815c64314d0dc0068ba6
2   lib,
3   stdenv,
4   fetchFromGitHub,
5   rustPlatform,
6   makeBinaryWrapper,
7   cosmic-icons,
8   just,
9   pkg-config,
10   libglvnd,
11   libxkbcommon,
12   libinput,
13   fontconfig,
14   freetype,
15   mesa,
16   wayland,
17   xorg,
18   vulkan-loader,
21 rustPlatform.buildRustPackage rec {
22   pname = "cosmic-edit";
23   version = "1.0.0-alpha.1";
25   src = fetchFromGitHub {
26     owner = "pop-os";
27     repo = "cosmic-edit";
28     rev = "epoch-${version}";
29     hash = "sha256-ZG5Ctyp2crTDS0WxhQqwN4T6WR5qW79HTbICMlOA3P8=";
30   };
32   cargoLock = {
33     lockFile = ./Cargo.lock;
34     outputHashes = {
35       "accesskit-0.12.2" = "sha256-1UwgRyUe0PQrZrpS7574oNLi13fg5HpgILtZGW6JNtQ=";
36       "atomicwrites-0.4.2" = "sha256-QZSuGPrJXh+svMeFWqAXoqZQxLq/WfIiamqvjJNVhxA=";
37       "clipboard_macos-0.1.0" = "sha256-cG5vnkiyDlQnbEfV2sPbmBYKv1hd3pjJrymfZb8ziKk=";
38       "cosmic-config-0.1.0" = "sha256-DgMh0gqWUmXjBhBySR0CMnv/8O3XbS2BwomU9eNt+4o=";
39       "cosmic-files-0.1.0" = "sha256-QDkHhU0zE0szFwGuVuSYrXd7AUdTU1rYxlAsaHr2YvQ=";
40       "cosmic-syntax-theme-0.1.0" = "sha256-BNb9wrryD5FJImboD3TTdPRIfiBqPpItqwGdT1ZiNng=";
41       "cosmic-text-0.12.1" = "sha256-x0XTxzbmtE2d4XCG/Nuq3DzBpz15BbnjRRlirfNJEiU=";
42       "d3d12-0.19.0" = "sha256-usrxQXWLGJDjmIdw1LBXtBvX+CchZDvE8fHC0LjvhD4=";
43       "glyphon-0.5.0" = "sha256-j1HrbEpUBqazWqNfJhpyjWuxYAxkvbXzRKeSouUoPWg=";
44       "smithay-clipboard-0.8.0" = "sha256-4InFXm0ahrqFrtNLeqIuE3yeOpxKZJZx+Bc0yQDtv34=";
45       "softbuffer-0.4.1" = "sha256-a0bUFz6O8CWRweNt/OxTvflnPYwO5nm6vsyc/WcXyNg=";
46       "taffy-0.3.11" = "sha256-SCx9GEIJjWdoNVyq+RZAGn0N71qraKZxf9ZWhvyzLaI=";
47       "winit-0.29.10" = "sha256-ScTII2AzK3SC8MVeASZ9jhVWsEaGrSQ2BnApTxgfxK4=";
48     };
49   };
51   # COSMIC applications now uses vergen for the About page
52   # Update the COMMIT_DATE to match when the commit was made
53   env.VERGEN_GIT_COMMIT_DATE = "2024-08-02";
54   env.VERGEN_GIT_SHA = src.rev;
56   postPatch = ''
57     substituteInPlace justfile --replace '#!/usr/bin/env' "#!$(command -v env)"
58   '';
60   nativeBuildInputs = [ just pkg-config makeBinaryWrapper ];
61   buildInputs = [
62     libxkbcommon
63     xorg.libX11
64     libinput
65     libglvnd
66     fontconfig
67     freetype
68     mesa
69     wayland
70     vulkan-loader
71   ];
73   dontUseJustBuild = true;
75   justFlags = [
76     "--set"
77     "prefix"
78     (placeholder "out")
79     "--set"
80     "bin-src"
81     "target/${stdenv.hostPlatform.rust.cargoShortTarget}/release/cosmic-edit"
82   ];
84   # Force linking to libEGL, which is always dlopen()ed, and to
85   # libwayland-client, which is always dlopen()ed except by the
86   # obscure winit backend.
87   RUSTFLAGS = map (a: "-C link-arg=${a}") [
88     "-Wl,--push-state,--no-as-needed"
89     "-lEGL"
90     "-lwayland-client"
91     "-Wl,--pop-state"
92   ];
94   # LD_LIBRARY_PATH can be removed once tiny-xlib is bumped above 0.2.2
95   postInstall = ''
96     wrapProgram "$out/bin/cosmic-edit" \
97       --suffix XDG_DATA_DIRS : "${cosmic-icons}/share" \
98       --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [
99         xorg.libX11 xorg.libXcursor xorg.libXi xorg.libXrandr vulkan-loader libxkbcommon wayland
100       ]}
101   '';
103   meta = with lib; {
104     homepage = "https://github.com/pop-os/cosmic-edit";
105     description = "Text Editor for the COSMIC Desktop Environment";
106     mainProgram = "cosmic-edit";
107     license = licenses.gpl3Only;
108     maintainers = with maintainers; [ ahoneybun nyabinary ];
109     platforms = platforms.linux;
110   };