mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-17 07:13:23 +01: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 changed files with 26 additions and 13 deletions
|
@ -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";
|
||||
|
|
Loading…
Reference in a new issue