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:
Bart Bakker 2021-08-20 19:48:01 +00:00 committed by GitHub
parent 396b561e2d
commit 2f2c1a900b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 {
pname = "xcolor";
version = "unstable-2021-02-02";
version = "0.5.0";
src = fetchFromGitHub {
owner = "Soft";
repo = pname;
rev = "0e99e67cd37000bf563aa1e89faae796ec25f163";
sha256 = "sha256-rHqK05dN5lrvDNbRCWGghI7KJwWzNCuRDEThEeMzmio=";
rev = version;
sha256 = "0i04jwvjasrypnsfwdnvsvcygp8ckf1a5sxvjxaivy73cdvy34vk";
};
cargoPatches = [
# Update Cargo.lock, lexical_core doesn't build on Rust 1.52.1
(fetchpatch {
url = "https://github.com/Soft/xcolor/commit/324d80a18a39a11f2f7141b226f492e2a862d2ce.patch";
sha256 = "sha256-5VzXitpl/gMef40UQBh1EoHezXPyB08aflqp0mSMAVI=";
cargoSha256 = "1r2s4iy5ls0svw5ww51m37jhrbvnj690ig6n9c60hzw1hl4krk30";
nativeBuildInputs = [ pkg-config python3 installShellFiles copyDesktopItems ];
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 ];
buildInputs = [ libX11 libXcursor libxcb ];
installManPage man/xcolor.1
for x in 16 24 32 48 256 512; do
install -D -m644 extra/icons/xcolor-''${x}.png $out/share/icons/hicolor/''${x}x''${x}/apps/xcolor.png
done
'';
meta = with lib; {
description = "Lightweight color picker for X11";