nixpkgs/pkgs/by-name/co/cosmic-term/package.nix

119 lines
3.2 KiB
Nix

{ lib
, cosmic-icons
, fetchFromGitHub
, fontconfig
, freetype
, just
, libglvnd
, libinput
, libxkbcommon
, makeBinaryWrapper
, mesa
, pkg-config
, rustPlatform
, stdenv
, vulkan-loader
, wayland
, xorg
}:
rustPlatform.buildRustPackage rec {
pname = "cosmic-term";
version = "unstable-2024-02-28";
src = fetchFromGitHub {
owner = "pop-os";
repo = pname;
rev = "36477e06dc6d05bd01dc08b3f20e0a6e388d6c7e";
hash = "sha256-VkRVfV4sC+5+/8g1FOlBjJCeR/KGb5gP0SWy5bmFo+Y=";
};
cargoLock = {
lockFile = ./Cargo.lock;
outputHashes = {
"accesskit-0.12.2" = "sha256-ksaYMGT/oug7isQY8/1WD97XDUsX2ShBdabUzxWffYw=";
"atomicwrites-0.4.2" = "sha256-QZSuGPrJXh+svMeFWqAXoqZQxLq/WfIiamqvjJNVhxA=";
"cosmic-config-0.1.0" = "sha256-Zyi95zcBAohM1WBropLzJczSIfNNNBK2odB4AmW4h5I=";
"cosmic-files-0.1.0" = "sha256-64An0MPgnFgyVlWmtBGBs+IV2z+4vmEY2uRPetZM4/M=";
"cosmic-text-0.11.2" = "sha256-Y9i5stMYpx+iqn4y5DJm1O1+3UIGp0/fSsnNq3Zloug=";
"d3d12-0.19.0" = "sha256-usrxQXWLGJDjmIdw1LBXtBvX+CchZDvE8fHC0LjvhD4=";
"glyphon-0.5.0" = "sha256-j1HrbEpUBqazWqNfJhpyjWuxYAxkvbXzRKeSouUoPWg=";
"libc-0.2.151" = "sha256-VcNTcLOnVXMlX86yeY0VDfIfKOZyyx/DO1Hbe30BsaI=";
"softbuffer-0.4.1" = "sha256-a0bUFz6O8CWRweNt/OxTvflnPYwO5nm6vsyc/WcXyNg=";
"systemicons-0.7.0" = "sha256-zzAI+6mnpQOh+3mX7/sJ+w4a7uX27RduQ99PNxLNF78=";
"taffy-0.3.11" = "sha256-SCx9GEIJjWdoNVyq+RZAGn0N71qraKZxf9ZWhvyzLaI=";
"winit-0.29.10" = "sha256-ScTII2AzK3SC8MVeASZ9jhVWsEaGrSQ2BnApTxgfxK4=";
};
};
# COSMIC applications now uses vergen for the About page
# Update the COMMIT_DATE to match when the commit was made
env.VERGEN_GIT_COMMIT_DATE = "2024-02-28";
env.VERGEN_GIT_SHA = src.rev;
postPatch = ''
substituteInPlace justfile --replace '#!/usr/bin/env' "#!$(command -v env)"
'';
nativeBuildInputs = [
just
pkg-config
makeBinaryWrapper
];
buildInputs = [
fontconfig
freetype
libglvnd
libinput
libxkbcommon
vulkan-loader
wayland
xorg.libX11
];
dontUseJustBuild = true;
justFlags = [
"--set"
"prefix"
(placeholder "out")
"--set"
"bin-src"
"target/${stdenv.hostPlatform.rust.cargoShortTarget}/release/cosmic-term"
];
# Force linking to libEGL, which is always dlopen()ed, and to
# libwayland-client, which is always dlopen()ed except by the
# obscure winit backend.
RUSTFLAGS = map (a: "-C link-arg=${a}") [
"-Wl,--push-state,--no-as-needed"
"-lEGL"
"-lwayland-client"
"-Wl,--pop-state"
];
# LD_LIBRARY_PATH can be removed once tiny-xlib is bumped above 0.2.2
postInstall = ''
wrapProgram "$out/bin/${pname}" \
--suffix XDG_DATA_DIRS : "${cosmic-icons}/share" \
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [
libxkbcommon
mesa.drivers
vulkan-loader
xorg.libX11
xorg.libXcursor
xorg.libXi
xorg.libXrandr
]}
'';
meta = with lib; {
homepage = "https://github.com/pop-os/cosmic-term";
description = "Terminal for the COSMIC Desktop Environment";
license = licenses.gpl3Only;
maintainers = with maintainers; [ ahoneybun nyanbinary ];
platforms = platforms.linux;
mainProgram = "cosmic-term";
};
}