cosmic-term: refactor (#387686)

authored by Peder Bergebakken Sundt and committed by GitHub ab0c5b18 60a902a9

+28 -44
+28 -44
pkgs/by-name/co/cosmic-term/package.nix
··· 1 { 2 lib, 3 - cosmic-icons, 4 fetchFromGitHub, 5 fontconfig, 6 freetype, 7 - just, 8 - libglvnd, 9 libinput, 10 - libxkbcommon, 11 - makeBinaryWrapper, 12 - pkg-config, 13 - rustPlatform, 14 - stdenv, 15 - vulkan-loader, 16 - wayland, 17 - xorg, 18 }: 19 20 - rustPlatform.buildRustPackage rec { 21 pname = "cosmic-term"; 22 version = "1.0.0-alpha.6"; 23 24 src = fetchFromGitHub { 25 owner = "pop-os"; 26 repo = "cosmic-term"; 27 - rev = "epoch-${version}"; 28 hash = "sha256-sdeRkT6UcyBKIFnJZn3aGf8LZQimqVPqtXo7RtwUs5M="; 29 }; 30 ··· 33 34 # COSMIC applications now uses vergen for the About page 35 # Update the COMMIT_DATE to match when the commit was made 36 - env.VERGEN_GIT_COMMIT_DATE = "2025-02-21"; 37 - env.VERGEN_GIT_SHA = src.rev; 38 - 39 - postPatch = '' 40 - substituteInPlace justfile --replace-fail '#!/usr/bin/env' "#!$(command -v env)" 41 - ''; 42 43 nativeBuildInputs = [ 44 just 45 pkg-config 46 - makeBinaryWrapper 47 ]; 48 49 buildInputs = [ 50 fontconfig 51 freetype 52 - libglvnd 53 libinput 54 - libxkbcommon 55 - vulkan-loader 56 - wayland 57 - xorg.libX11 58 ]; 59 60 dontUseJustBuild = true; 61 62 justFlags = [ 63 "--set" ··· 68 "target/${stdenv.hostPlatform.rust.cargoShortTarget}/release/cosmic-term" 69 ]; 70 71 - # Force linking to libEGL, which is always dlopen()ed, and to 72 - # libwayland-client, which is always dlopen()ed except by the 73 - # obscure winit backend. 74 - RUSTFLAGS = map (a: "-C link-arg=${a}") [ 75 - "-Wl,--push-state,--no-as-needed" 76 - "-lEGL" 77 - "-lwayland-client" 78 - "-Wl,--pop-state" 79 - ]; 80 - 81 - postInstall = '' 82 - wrapProgram "$out/bin/cosmic-term" \ 83 - --suffix XDG_DATA_DIRS : "${cosmic-icons}/share" 84 - ''; 85 86 - meta = with lib; { 87 homepage = "https://github.com/pop-os/cosmic-term"; 88 description = "Terminal for the COSMIC Desktop Environment"; 89 - license = licenses.gpl3Only; 90 - maintainers = with maintainers; [ 91 ahoneybun 92 nyabinary 93 ]; 94 - platforms = platforms.linux; 95 mainProgram = "cosmic-term"; 96 }; 97 - }
··· 1 { 2 lib, 3 + stdenv, 4 + rustPlatform, 5 fetchFromGitHub, 6 + pkg-config, 7 + just, 8 + libcosmicAppHook, 9 fontconfig, 10 freetype, 11 libinput, 12 + nix-update-script, 13 }: 14 15 + rustPlatform.buildRustPackage (finalAttrs: { 16 pname = "cosmic-term"; 17 version = "1.0.0-alpha.6"; 18 19 src = fetchFromGitHub { 20 owner = "pop-os"; 21 repo = "cosmic-term"; 22 + tag = "epoch-${finalAttrs.version}"; 23 hash = "sha256-sdeRkT6UcyBKIFnJZn3aGf8LZQimqVPqtXo7RtwUs5M="; 24 }; 25 ··· 28 29 # COSMIC applications now uses vergen for the About page 30 # Update the COMMIT_DATE to match when the commit was made 31 + env = { 32 + VERGEN_GIT_COMMIT_DATE = "2025-02-21"; 33 + VERGEN_GIT_SHA = finalAttrs.src.tag; 34 + }; 35 36 nativeBuildInputs = [ 37 just 38 pkg-config 39 + libcosmicAppHook 40 ]; 41 42 buildInputs = [ 43 fontconfig 44 freetype 45 libinput 46 ]; 47 48 dontUseJustBuild = true; 49 + dontUseJustCheck = true; 50 51 justFlags = [ 52 "--set" ··· 57 "target/${stdenv.hostPlatform.rust.cargoShortTarget}/release/cosmic-term" 58 ]; 59 60 + passthru.updateScript = nix-update-script { 61 + extraArgs = [ 62 + "--version" 63 + "unstable" 64 + "--version-regex" 65 + "epoch-(.*)" 66 + ]; 67 + }; 68 69 + meta = { 70 homepage = "https://github.com/pop-os/cosmic-term"; 71 description = "Terminal for the COSMIC Desktop Environment"; 72 + license = lib.licenses.gpl3Only; 73 + maintainers = with lib.maintainers; [ 74 ahoneybun 75 nyabinary 76 + HeitorAugustoLN 77 ]; 78 + platforms = lib.platforms.linux; 79 mainProgram = "cosmic-term"; 80 }; 81 + })