2024-01-20 16:54:13 +00:00
|
|
|
{ lib
|
|
|
|
, cosmic-icons
|
|
|
|
, fetchFromGitHub
|
|
|
|
, fontconfig
|
|
|
|
, freetype
|
|
|
|
, just
|
|
|
|
, libglvnd
|
|
|
|
, libinput
|
|
|
|
, libxkbcommon
|
|
|
|
, makeBinaryWrapper
|
|
|
|
, pkg-config
|
|
|
|
, rustPlatform
|
|
|
|
, stdenv
|
|
|
|
, vulkan-loader
|
|
|
|
, wayland
|
|
|
|
, xorg
|
2023-12-26 18:38:59 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "cosmic-term";
|
2024-07-24 19:01:49 +01:00
|
|
|
version = "1.0.0-alpha.1";
|
|
|
|
|
2023-12-26 18:38:59 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "pop-os";
|
2024-08-20 23:56:55 +01:00
|
|
|
repo = "cosmic-term";
|
2024-07-24 19:01:49 +01:00
|
|
|
rev = "epoch-${version}";
|
2024-08-13 15:31:55 +01:00
|
|
|
hash = "sha256-dY4QGQXJFL+yjCYRGCg3NfMLMjlEBSEmxHn68PvhCAQ=";
|
2023-12-26 18:38:59 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
cargoLock = {
|
|
|
|
lockFile = ./Cargo.lock;
|
|
|
|
outputHashes = {
|
2024-08-13 15:31:55 +01:00
|
|
|
"accesskit-0.12.2" = "sha256-1UwgRyUe0PQrZrpS7574oNLi13fg5HpgILtZGW6JNtQ=";
|
2023-12-26 18:38:59 +00:00
|
|
|
"atomicwrites-0.4.2" = "sha256-QZSuGPrJXh+svMeFWqAXoqZQxLq/WfIiamqvjJNVhxA=";
|
2024-08-13 15:31:55 +01:00
|
|
|
"clipboard_macos-0.1.0" = "sha256-cG5vnkiyDlQnbEfV2sPbmBYKv1hd3pjJrymfZb8ziKk=";
|
|
|
|
"cosmic-config-0.1.0" = "sha256-DgMh0gqWUmXjBhBySR0CMnv/8O3XbS2BwomU9eNt+4o=";
|
|
|
|
"cosmic-files-0.1.0" = "sha256-QDkHhU0zE0szFwGuVuSYrXd7AUdTU1rYxlAsaHr2YvQ=";
|
|
|
|
"cosmic-text-0.12.1" = "sha256-x0XTxzbmtE2d4XCG/Nuq3DzBpz15BbnjRRlirfNJEiU=";
|
2024-02-13 19:57:09 +00:00
|
|
|
"d3d12-0.19.0" = "sha256-usrxQXWLGJDjmIdw1LBXtBvX+CchZDvE8fHC0LjvhD4=";
|
|
|
|
"glyphon-0.5.0" = "sha256-j1HrbEpUBqazWqNfJhpyjWuxYAxkvbXzRKeSouUoPWg=";
|
2024-08-13 15:31:55 +01:00
|
|
|
"libc-0.2.154" = "sha256-/pkmpCxzRTjBiLFKauqUqGTBTxNUQX4zwPWYpDsjwVQ=";
|
|
|
|
"smithay-clipboard-0.8.0" = "sha256-4InFXm0ahrqFrtNLeqIuE3yeOpxKZJZx+Bc0yQDtv34=";
|
2024-02-13 19:57:09 +00:00
|
|
|
"softbuffer-0.4.1" = "sha256-a0bUFz6O8CWRweNt/OxTvflnPYwO5nm6vsyc/WcXyNg=";
|
2023-12-26 18:38:59 +00:00
|
|
|
"taffy-0.3.11" = "sha256-SCx9GEIJjWdoNVyq+RZAGn0N71qraKZxf9ZWhvyzLaI=";
|
2024-02-13 19:57:09 +00:00
|
|
|
"winit-0.29.10" = "sha256-ScTII2AzK3SC8MVeASZ9jhVWsEaGrSQ2BnApTxgfxK4=";
|
2023-12-26 18:38:59 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-02-13 19:57:09 +00:00
|
|
|
# COSMIC applications now uses vergen for the About page
|
|
|
|
# Update the COMMIT_DATE to match when the commit was made
|
2024-07-24 19:01:49 +01:00
|
|
|
env.VERGEN_GIT_COMMIT_DATE = "2024-08-03";
|
2024-02-13 19:57:09 +00:00
|
|
|
env.VERGEN_GIT_SHA = src.rev;
|
|
|
|
|
2023-12-26 18:38:59 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace justfile --replace '#!/usr/bin/env' "#!$(command -v env)"
|
|
|
|
'';
|
|
|
|
|
2024-01-20 16:54:13 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
just
|
|
|
|
pkg-config
|
|
|
|
makeBinaryWrapper
|
|
|
|
];
|
|
|
|
|
2023-12-26 18:38:59 +00:00
|
|
|
buildInputs = [
|
|
|
|
fontconfig
|
|
|
|
freetype
|
2024-01-20 16:54:13 +00:00
|
|
|
libglvnd
|
|
|
|
libinput
|
|
|
|
libxkbcommon
|
2024-01-18 20:33:27 +00:00
|
|
|
vulkan-loader
|
2024-01-20 16:54:13 +00:00
|
|
|
wayland
|
|
|
|
xorg.libX11
|
2023-12-26 18:38:59 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
dontUseJustBuild = true;
|
|
|
|
|
|
|
|
justFlags = [
|
|
|
|
"--set"
|
|
|
|
"prefix"
|
|
|
|
(placeholder "out")
|
|
|
|
"--set"
|
|
|
|
"bin-src"
|
2024-01-18 20:33:27 +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"
|
2023-12-26 18:38:59 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
# LD_LIBRARY_PATH can be removed once tiny-xlib is bumped above 0.2.2
|
|
|
|
postInstall = ''
|
2024-08-20 23:56:55 +01:00
|
|
|
wrapProgram "$out/bin/cosmic-term" \
|
2023-12-26 18:38:59 +00:00
|
|
|
--suffix XDG_DATA_DIRS : "${cosmic-icons}/share" \
|
2024-01-18 20:33:27 +00:00
|
|
|
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [
|
2024-01-20 16:54:13 +00:00
|
|
|
libxkbcommon
|
|
|
|
vulkan-loader
|
|
|
|
xorg.libX11
|
|
|
|
xorg.libXcursor
|
|
|
|
xorg.libXi
|
|
|
|
xorg.libXrandr
|
2024-01-18 20:33:27 +00:00
|
|
|
]}
|
2023-12-26 18:38:59 +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-20 04:01:56 +00:00
|
|
|
maintainers = with maintainers; [ ahoneybun nyanbinary ];
|
2023-12-26 18:38:59 +00:00
|
|
|
platforms = platforms.linux;
|
2024-01-20 16:54:13 +00:00
|
|
|
mainProgram = "cosmic-term";
|
2023-12-26 18:38:59 +00:00
|
|
|
};
|
|
|
|
}
|