mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-31 09:14:28 +00:00
xcolor: unstable -> 0.5.0 (#134937)
* xcolor: unstable -> 0.5.0 Also create a desktop item so xcolor shows up in application launchers. * xcolor: cleanup install phase Use available utility functions for installing man pages and desktop items. Also cleanup redundant icon copy lines.
This commit is contained in:
parent
396b561e2d
commit
2f2c1a900b
@ -1,29 +1,42 @@
|
|||||||
{ lib, rustPlatform, fetchFromGitHub, fetchpatch, pkg-config, libX11, libXcursor, libxcb, python3 }:
|
{ lib, rustPlatform, fetchFromGitHub, pkg-config, libX11, libXcursor
|
||||||
|
, libxcb, python3, installShellFiles, makeDesktopItem, copyDesktopItems }:
|
||||||
|
|
||||||
rustPlatform.buildRustPackage rec {
|
rustPlatform.buildRustPackage rec {
|
||||||
pname = "xcolor";
|
pname = "xcolor";
|
||||||
version = "unstable-2021-02-02";
|
version = "0.5.0";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "Soft";
|
owner = "Soft";
|
||||||
repo = pname;
|
repo = pname;
|
||||||
rev = "0e99e67cd37000bf563aa1e89faae796ec25f163";
|
rev = version;
|
||||||
sha256 = "sha256-rHqK05dN5lrvDNbRCWGghI7KJwWzNCuRDEThEeMzmio=";
|
sha256 = "0i04jwvjasrypnsfwdnvsvcygp8ckf1a5sxvjxaivy73cdvy34vk";
|
||||||
};
|
};
|
||||||
|
|
||||||
cargoPatches = [
|
cargoSha256 = "1r2s4iy5ls0svw5ww51m37jhrbvnj690ig6n9c60hzw1hl4krk30";
|
||||||
# Update Cargo.lock, lexical_core doesn't build on Rust 1.52.1
|
|
||||||
(fetchpatch {
|
nativeBuildInputs = [ pkg-config python3 installShellFiles copyDesktopItems ];
|
||||||
url = "https://github.com/Soft/xcolor/commit/324d80a18a39a11f2f7141b226f492e2a862d2ce.patch";
|
|
||||||
sha256 = "sha256-5VzXitpl/gMef40UQBh1EoHezXPyB08aflqp0mSMAVI=";
|
buildInputs = [ libX11 libXcursor libxcb ];
|
||||||
|
|
||||||
|
desktopItems = [
|
||||||
|
(makeDesktopItem {
|
||||||
|
name = "XColor";
|
||||||
|
exec = "xcolor -s";
|
||||||
|
desktopName = "XColor";
|
||||||
|
comment = "Select colors visible anywhere on the screen to get their RGB representation";
|
||||||
|
icon = "xcolor";
|
||||||
|
categories = "Graphics;";
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
|
||||||
cargoSha256 = "sha256-yD4pX+dCJvbDecsdB8tNt1VsEcyAJxNrB5WsZUhPGII=";
|
postInstall = ''
|
||||||
|
mkdir -p $out/share/applications
|
||||||
|
|
||||||
nativeBuildInputs = [ pkg-config python3 ];
|
installManPage man/xcolor.1
|
||||||
|
for x in 16 24 32 48 256 512; do
|
||||||
buildInputs = [ libX11 libXcursor libxcb ];
|
install -D -m644 extra/icons/xcolor-''${x}.png $out/share/icons/hicolor/''${x}x''${x}/apps/xcolor.png
|
||||||
|
done
|
||||||
|
'';
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
description = "Lightweight color picker for X11";
|
description = "Lightweight color picker for X11";
|
||||||
|
Loading…
Reference in New Issue
Block a user