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 { 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";