2024-01-25 14:12:00 +00:00
|
|
|
{ lib
|
|
|
|
, cosmic-icons
|
|
|
|
, fetchFromGitHub
|
|
|
|
, fontconfig
|
|
|
|
, freetype
|
|
|
|
, just
|
|
|
|
, libglvnd
|
|
|
|
, libinput
|
|
|
|
, libxkbcommon
|
|
|
|
, makeBinaryWrapper
|
|
|
|
, mesa
|
|
|
|
, pkg-config
|
|
|
|
, rustPlatform
|
|
|
|
, stdenv
|
|
|
|
, vulkan-loader
|
|
|
|
, wayland
|
|
|
|
, xorg
|
2024-01-13 08:15:51 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "cosmic-term";
|
2024-01-25 14:12:00 +00:00
|
|
|
version = "0-unstable-2024-01-19";
|
2024-01-13 08:15:51 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "pop-os";
|
|
|
|
repo = pname;
|
2024-01-25 14:12:00 +00:00
|
|
|
rev = "6d519018a070e25db0cd099a2752a7add4d6b138";
|
|
|
|
hash = "sha256-gfvBLrhq6Bz6cQdgiLH5o8vyptOT+q3xwUYoDG6eGTY=";
|
2024-01-13 08:15:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
cargoLock = {
|
|
|
|
lockFile = ./Cargo.lock;
|
|
|
|
outputHashes = {
|
|
|
|
"accesskit-0.11.0" = "sha256-xVhe6adUb8VmwIKKjHxwCwOo5Y1p3Or3ylcJJdLDrrE=";
|
|
|
|
"atomicwrites-0.4.2" = "sha256-QZSuGPrJXh+svMeFWqAXoqZQxLq/WfIiamqvjJNVhxA=";
|
2024-01-25 14:12:00 +00:00
|
|
|
"cosmic-config-0.1.0" = "sha256-uo4So9I/jD3LPfigyKwESUdZiK1wqm7rg9wYwyv4uKc=";
|
|
|
|
"cosmic-text-0.10.0" = "sha256-S0GkKUiUsSkL1CZHXhtpQy7Mf5+6fqNuu33RRtxG3mE=";
|
|
|
|
"glyphon-0.4.1" = "sha256-mwJXi63LTBIVFrFcywr/NeOJKfMjQaQkNl3CSdEgrZc=";
|
|
|
|
"libc-0.2.151" = "sha256-VcNTcLOnVXMlX86yeY0VDfIfKOZyyx/DO1Hbe30BsaI=";
|
2024-01-13 08:15:51 +00:00
|
|
|
"sctk-adwaita-0.5.4" = "sha256-yK0F2w/0nxyKrSiHZbx7+aPNY2vlFs7s8nu/COp2KqQ=";
|
|
|
|
"smithay-client-toolkit-0.16.1" = "sha256-z7EZThbh7YmKzAACv181zaEZmWxTrMkFRzP0nfsHK6c=";
|
2024-01-25 14:12:00 +00:00
|
|
|
"softbuffer-0.3.3" = "sha256-eKYFVr6C1+X6ulidHIu9SP591rJxStxwL9uMiqnXx4k=";
|
2024-01-13 08:15:51 +00:00
|
|
|
"taffy-0.3.11" = "sha256-SCx9GEIJjWdoNVyq+RZAGn0N71qraKZxf9ZWhvyzLaI=";
|
|
|
|
"winit-0.28.6" = "sha256-FhW6d2XnXCGJUMoT9EMQew9/OPXiehy/JraeCiVd76M=";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace justfile --replace '#!/usr/bin/env' "#!$(command -v env)"
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
just
|
|
|
|
pkg-config
|
|
|
|
makeBinaryWrapper
|
|
|
|
];
|
2024-01-25 14:12:00 +00:00
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
buildInputs = [
|
|
|
|
fontconfig
|
|
|
|
freetype
|
2024-01-25 14:12:00 +00:00
|
|
|
libglvnd
|
|
|
|
libinput
|
|
|
|
libxkbcommon
|
|
|
|
vulkan-loader
|
2024-01-13 08:15:51 +00:00
|
|
|
wayland
|
2024-01-25 14:12:00 +00:00
|
|
|
xorg.libX11
|
2024-01-13 08:15:51 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
dontUseJustBuild = true;
|
|
|
|
|
|
|
|
justFlags = [
|
|
|
|
"--set"
|
|
|
|
"prefix"
|
|
|
|
(placeholder "out")
|
|
|
|
"--set"
|
|
|
|
"bin-src"
|
2024-01-25 14:12:00 +00:00
|
|
|
"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"
|
2024-01-13 08:15:51 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
# 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" \
|
2024-01-25 14:12:00 +00:00
|
|
|
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [
|
|
|
|
libxkbcommon
|
|
|
|
mesa.drivers
|
|
|
|
vulkan-loader
|
|
|
|
xorg.libX11
|
|
|
|
xorg.libXcursor
|
|
|
|
xorg.libXi
|
|
|
|
xorg.libXrandr
|
|
|
|
]}
|
2024-01-13 08:15:51 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/pop-os/cosmic-term";
|
|
|
|
description = "Terminal for the COSMIC Desktop Environment";
|
|
|
|
license = licenses.gpl3Only;
|
2024-01-25 14:12:00 +00:00
|
|
|
maintainers = with maintainers; [ ahoneybun nyanbinary ];
|
2024-01-13 08:15:51 +00:00
|
|
|
platforms = platforms.linux;
|
2024-01-25 14:12:00 +00:00
|
|
|
mainProgram = "cosmic-term";
|
2024-01-13 08:15:51 +00:00
|
|
|
};
|
|
|
|
}
|