Merge pull request #29184 from Ma27/yabar/install-hooks

yabar: minor derivation improvements
This commit is contained in:
Robert Helgesson 2017-09-12 22:27:05 +02:00 committed by GitHub
commit 3c14ef0c4a
4 changed files with 70 additions and 35 deletions

View file

@ -0,0 +1,51 @@
{ stdenv, fetchFromGitHub, cairo, gdk_pixbuf, libconfig, pango, pkgconfig
, xcbutilwm, alsaLib, wirelesstools, asciidoc, libxslt, makeWrapper, docbook_xsl
, configFile ? null, lib
, rev, sha256, version
}:
stdenv.mkDerivation {
name = "yabar-${version}";
src = fetchFromGitHub {
inherit rev sha256;
owner = "geommer";
repo = "yabar";
};
hardeningDisable = [ "format" ];
buildInputs = [
cairo gdk_pixbuf libconfig pango pkgconfig xcbutilwm docbook_xsl
alsaLib wirelesstools asciidoc libxslt makeWrapper
];
postPatch = ''
substituteInPlace ./Makefile \
--replace "\$(shell git describe)" "${version}" \
--replace "a2x" "${asciidoc}/bin/a2x --no-xmllint"
'';
makeFlags = [ "DESTDIR=$(out)" "PREFIX=/" ];
postInstall = ''
mkdir -p $out/share/yabar/examples
cp -v examples/*.config $out/share/yabar/examples
${lib.optionalString (configFile != null)
''
wrapProgram "$out/bin/yabar" \
--add-flags "-c ${configFile}"
''
}
'';
meta = with stdenv.lib; {
description = "A modern and lightweight status bar for X window managers";
homepage = https://github.com/geommer/yabar;
license = licenses.mit;
platforms = platforms.linux;
maintainers = with maintainers; [ ma27 ];
};
}

View file

@ -1,38 +1,10 @@
{ stdenv, fetchFromGitHub, cairo, gdk_pixbuf, libconfig, pango, pkgconfig, xcbutilwm }:
{ callPackage, attrs ? {} }:
stdenv.mkDerivation rec {
name = "yabar-${version}";
version = "0.4.0";
let
overrides = {
version = "0.4.0";
src = fetchFromGitHub {
owner = "geommer";
repo = "yabar";
rev = "746387f0112f9b7aa2e2e27b3d69cb2892d8c63b";
rev = "746387f0112f9b7aa2e2e27b3d69cb2892d8c63b";
sha256 = "1nw9dar1caqln5fr0dqk7dg6naazbpfwwzxwlkxz42shsc3w30a6";
};
buildInputs = [ cairo gdk_pixbuf libconfig pango pkgconfig xcbutilwm ];
hardeningDisable = [ "format" ];
postPatch = ''
substituteInPlace ./Makefile --replace "\$(shell git describe)" "${version}"
'';
buildPhase = ''
make DESTDIR=$out PREFIX=/
'';
installPhase = ''
make DESTDIR=$out PREFIX=/ install
mkdir -p $out/share/yabar/examples
cp -v examples/*.config $out/share/yabar/examples
'';
meta = with stdenv.lib; {
description = "A modern and lightweight status bar for X window managers";
homepage = "https://github.com/geommer/yabar";
license = licenses.mit;
platforms = platforms.linux;
};
}
} // attrs;
in callPackage ./build.nix overrides

View file

@ -0,0 +1,10 @@
{ callPackage, attrs ? {} }:
let
overrides = {
version = "unstable-2017-09-09";
rev = "d3934344ba27f5bdf122bf74daacee6d49284dab";
sha256 = "14zrlzva8i83ffg426mrf6yli8afwq6chvc7yi78ngixyik5gzhx";
} // attrs;
in callPackage ./build.nix overrides

View file

@ -17119,6 +17119,8 @@ with pkgs;
yabar = callPackage ../applications/window-managers/yabar { };
yabar-unstable = callPackage ../applications/window-managers/yabar/unstable.nix { };
yakuake = libsForQt5.callPackage ../applications/misc/yakuake {
inherit (kdeApplications) konsole;
};