about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/window-managers/yabar
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/applications/window-managers/yabar')
-rw-r--r--nixpkgs/pkgs/applications/window-managers/yabar/build.nix73
-rw-r--r--nixpkgs/pkgs/applications/window-managers/yabar/default.nix18
-rw-r--r--nixpkgs/pkgs/applications/window-managers/yabar/unstable.nix25
3 files changed, 116 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/applications/window-managers/yabar/build.nix b/nixpkgs/pkgs/applications/window-managers/yabar/build.nix
new file mode 100644
index 000000000000..e68dcdcd0e81
--- /dev/null
+++ b/nixpkgs/pkgs/applications/window-managers/yabar/build.nix
@@ -0,0 +1,73 @@
+{ stdenv, fetchFromGitHub, cairo, gdk-pixbuf, libconfig, pango, pkg-config
+, xcbutilwm, alsa-lib, wirelesstools, asciidoc, libxslt, makeWrapper, docbook_xsl
+, configFile ? null, lib
+, rev, sha256, version, patches ? []
+}:
+
+stdenv.mkDerivation {
+  pname = "yabar";
+  inherit version;
+
+  src = fetchFromGitHub {
+    inherit rev sha256;
+
+    owner = "geommer";
+    repo  = "yabar";
+  };
+
+  inherit patches;
+
+  hardeningDisable = [ "format" ];
+
+  strictDeps = true;
+  depsBuildBuild = [
+    pkg-config
+  ];
+  nativeBuildInputs = [
+    pkg-config
+    asciidoc
+    docbook_xsl
+    libxslt
+    makeWrapper
+    libconfig
+    pango
+  ];
+  buildInputs = [
+    cairo
+    gdk-pixbuf
+    libconfig
+    pango
+    xcbutilwm
+    alsa-lib
+    wirelesstools
+  ];
+
+  postPatch = ''
+    substituteInPlace ./Makefile \
+      --replace "\$(shell git describe)" "${version}" \
+      --replace "a2x" "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 lib; {
+    description = "Modern and lightweight status bar for X window managers";
+    homepage    = "https://github.com/geommer/yabar";
+    license     = licenses.mit;
+    platforms   = platforms.linux;
+    maintainers = with maintainers; [ ];
+    mainProgram = "yabar";
+  };
+}
diff --git a/nixpkgs/pkgs/applications/window-managers/yabar/default.nix b/nixpkgs/pkgs/applications/window-managers/yabar/default.nix
new file mode 100644
index 000000000000..a33a75676ee9
--- /dev/null
+++ b/nixpkgs/pkgs/applications/window-managers/yabar/default.nix
@@ -0,0 +1,18 @@
+{ callPackage, attrs ? {}, fetchpatch }:
+
+let
+  overrides = rec {
+    version = "0.4.0";
+
+    rev = version;
+    sha256 = "1nw9dar1caqln5fr0dqk7dg6naazbpfwwzxwlkxz42shsc3w30a6";
+
+    patches = [
+      (fetchpatch {
+        url = "https://github.com/geommer/yabar/commit/9779a5e04bd6e8cdc1c9fcf5d7ac31416af85a53.patch";
+        sha256 = "1szhr3k1kq6ixgnp74wnzgfvgxm6r4zpc3ny2x2wzy6lh2czc07s";
+      })
+    ];
+
+  } // attrs;
+in callPackage ./build.nix overrides
diff --git a/nixpkgs/pkgs/applications/window-managers/yabar/unstable.nix b/nixpkgs/pkgs/applications/window-managers/yabar/unstable.nix
new file mode 100644
index 000000000000..47c8f6c5e568
--- /dev/null
+++ b/nixpkgs/pkgs/applications/window-managers/yabar/unstable.nix
@@ -0,0 +1,25 @@
+{ fetchpatch, playerctl, libxkbcommon, callPackage, attrs ? {} }:
+
+let
+  pkg = callPackage ./build.nix ({
+    version = "unstable-2018-01-18";
+
+    rev    = "c516e8e78d39dd2b339acadc4c175347171150bb";
+    sha256 = "1p9lx78cayyn7qc2q66id2xfs76jyddnqv2x1ypsvixaxwcvqgdb";
+  } // attrs);
+in pkg.overrideAttrs (o: {
+  buildInputs = o.buildInputs ++ [
+    playerctl libxkbcommon
+  ];
+
+  makeFlags = o.makeFlags ++ [
+    "PLAYERCTL=1"
+  ];
+
+  patches = (o.patches or []) ++ [
+    (fetchpatch {
+      url = "https://github.com/geommer/yabar/commit/008dc1420ff684cf12ce2ef3ac9d642e054e39f5.patch";
+      sha256 = "1q7nd66ai6nr2m6iqxn55gvbr4r5gjc00c8wyjc3riv31qcbqbhv";
+    })
+  ];
+})