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 1 { 2 2 lib, 3 - cosmic-icons, 3 + stdenv, 4 + rustPlatform, 4 5 fetchFromGitHub, 6 + pkg-config, 7 + just, 8 + libcosmicAppHook, 5 9 fontconfig, 6 10 freetype, 7 - just, 8 - libglvnd, 9 11 libinput, 10 - libxkbcommon, 11 - makeBinaryWrapper, 12 - pkg-config, 13 - rustPlatform, 14 - stdenv, 15 - vulkan-loader, 16 - wayland, 17 - xorg, 12 + nix-update-script, 18 13 }: 19 14 20 - rustPlatform.buildRustPackage rec { 15 + rustPlatform.buildRustPackage (finalAttrs: { 21 16 pname = "cosmic-term"; 22 17 version = "1.0.0-alpha.6"; 23 18 24 19 src = fetchFromGitHub { 25 20 owner = "pop-os"; 26 21 repo = "cosmic-term"; 27 - rev = "epoch-${version}"; 22 + tag = "epoch-${finalAttrs.version}"; 28 23 hash = "sha256-sdeRkT6UcyBKIFnJZn3aGf8LZQimqVPqtXo7RtwUs5M="; 29 24 }; 30 25 ··· 33 28 34 29 # COSMIC applications now uses vergen for the About page 35 30 # 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 - ''; 31 + env = { 32 + VERGEN_GIT_COMMIT_DATE = "2025-02-21"; 33 + VERGEN_GIT_SHA = finalAttrs.src.tag; 34 + }; 42 35 43 36 nativeBuildInputs = [ 44 37 just 45 38 pkg-config 46 - makeBinaryWrapper 39 + libcosmicAppHook 47 40 ]; 48 41 49 42 buildInputs = [ 50 43 fontconfig 51 44 freetype 52 - libglvnd 53 45 libinput 54 - libxkbcommon 55 - vulkan-loader 56 - wayland 57 - xorg.libX11 58 46 ]; 59 47 60 48 dontUseJustBuild = true; 49 + dontUseJustCheck = true; 61 50 62 51 justFlags = [ 63 52 "--set" ··· 68 57 "target/${stdenv.hostPlatform.rust.cargoShortTarget}/release/cosmic-term" 69 58 ]; 70 59 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 - ''; 60 + passthru.updateScript = nix-update-script { 61 + extraArgs = [ 62 + "--version" 63 + "unstable" 64 + "--version-regex" 65 + "epoch-(.*)" 66 + ]; 67 + }; 85 68 86 - meta = with lib; { 69 + meta = { 87 70 homepage = "https://github.com/pop-os/cosmic-term"; 88 71 description = "Terminal for the COSMIC Desktop Environment"; 89 - license = licenses.gpl3Only; 90 - maintainers = with maintainers; [ 72 + license = lib.licenses.gpl3Only; 73 + maintainers = with lib.maintainers; [ 91 74 ahoneybun 92 75 nyabinary 76 + HeitorAugustoLN 93 77 ]; 94 - platforms = platforms.linux; 78 + platforms = lib.platforms.linux; 95 79 mainProgram = "cosmic-term"; 96 80 }; 97 - } 81 + })