summary refs log tree commit diff
path: root/pkgs/applications/window-managers/yabar
diff options
context:
space:
mode:
authorMaximilian Bosch <maximilian@mbosch.me>2018-06-21 23:28:59 +0200
committerMaximilian Bosch <maximilian@mbosch.me>2018-06-21 23:38:13 +0200
commit2ae32923ed6a5650841f904ee0dcec434daeb432 (patch)
tree69ec5a9bf7bccd6acd6dbe3fa052aaeed44cbca4 /pkgs/applications/window-managers/yabar
parent3813d5dcec27eeb85fd300a18e5342a7e4bf7af3 (diff)
downloadnixpkgs-2ae32923ed6a5650841f904ee0dcec434daeb432.tar
nixpkgs-2ae32923ed6a5650841f904ee0dcec434daeb432.tar.gz
nixpkgs-2ae32923ed6a5650841f904ee0dcec434daeb432.tar.bz2
nixpkgs-2ae32923ed6a5650841f904ee0dcec434daeb432.tar.lz
nixpkgs-2ae32923ed6a5650841f904ee0dcec434daeb432.tar.xz
nixpkgs-2ae32923ed6a5650841f904ee0dcec434daeb432.tar.zst
nixpkgs-2ae32923ed6a5650841f904ee0dcec434daeb432.zip
yabar: fix build
The stable build for `yabar` is currently broken: https://hydra.nixos.org/build/75989172

Main reason is that the inline function `ya_setup_prefix_suffix` is
supposed to be an inline function, but was insufficiently declared as
such which broke the compiler recently with the following message:

```
gcc -std=c99 -Iinclude -pedantic -Wall -Os `pkg-config --cflags pango pangocairo libconfig` -DVERSION=\"0.4.0\" -D_POSIX_C_SOURCE=199309L -DYA_INTERNAL -DYA_DYN_COL -DYA_ENV_VARS -DYA_INTERNAL_EWMH  -c -o src/intern_blks/ya_intern.o src/intern_blks/ya_intern.c
gcc -o yabar src/ya_main.o src/ya_draw.o src/ya_exec.o src/ya_parse.o src/intern_blks/ya_intern.o -lxcb -lpthread -lxcb-randr -lxcb-ewmh `pkg-config --libs pango pangocairo libconfig`
src/intern_blks/ya_intern.o: In function `ya_int_date':
ya_intern.c:(.text+0x49): undefined reference to `ya_setup_prefix_suffix'
src/intern_blks/ya_intern.o: In function `ya_int_uptime':
ya_intern.c:(.text+0xf4): undefined reference to `ya_setup_prefix_suffix'
src/intern_blks/ya_intern.o: In function `ya_int_brightness':
ya_intern.c:(.text+0x1d8): undefined reference to `ya_setup_prefix_suffix'
src/intern_blks/ya_intern.o: In function `ya_int_bandwidth':
ya_intern.c:(.text+0x377): undefined reference to `ya_setup_prefix_suffix'
src/intern_blks/ya_intern.o: In function `ya_int_cpu':
ya_intern.c:(.text+0x6de): undefined reference to `ya_setup_prefix_suffix'
src/intern_blks/ya_intern.o:ya_intern.c:(.text+0x924): more undefined references to `ya_setup_prefix_suffix' follow
collect2: error: ld returned 1 exit status
make: *** [Makefile:18: yabar] Error 1
```

This issue has been fixed on master (see
https://github.com/geommer/yabar/commit/9779a5e04bd6e8cdc1c9fcf5d7ac31416af85a53)
which is why `nixos.yabar-unstable` remained functional.
Diffstat (limited to 'pkgs/applications/window-managers/yabar')
-rw-r--r--pkgs/applications/window-managers/yabar/build.nix4
-rw-r--r--pkgs/applications/window-managers/yabar/default.nix14
2 files changed, 14 insertions, 4 deletions
diff --git a/pkgs/applications/window-managers/yabar/build.nix b/pkgs/applications/window-managers/yabar/build.nix
index a5d02093e3f..6fc1797dd25 100644
--- a/pkgs/applications/window-managers/yabar/build.nix
+++ b/pkgs/applications/window-managers/yabar/build.nix
@@ -1,7 +1,7 @@
 { stdenv, fetchFromGitHub, cairo, gdk_pixbuf, libconfig, pango, pkgconfig
 , xcbutilwm, alsaLib, wirelesstools, asciidoc, libxslt, makeWrapper, docbook_xsl
 , configFile ? null, lib
-, rev, sha256, version
+, rev, sha256, version, patches ? []
 }:
 
 stdenv.mkDerivation {
@@ -14,6 +14,8 @@ stdenv.mkDerivation {
     repo  = "yabar";
   };
 
+  inherit patches;
+
   hardeningDisable = [ "format" ];
 
   nativeBuildInputs = [ pkgconfig ];
diff --git a/pkgs/applications/window-managers/yabar/default.nix b/pkgs/applications/window-managers/yabar/default.nix
index 4d42e3082f3..a33a75676ee 100644
--- a/pkgs/applications/window-managers/yabar/default.nix
+++ b/pkgs/applications/window-managers/yabar/default.nix
@@ -1,10 +1,18 @@
-{ callPackage, attrs ? {} }:
+{ callPackage, attrs ? {}, fetchpatch }:
 
 let
-  overrides = {
+  overrides = rec {
     version = "0.4.0";
 
-    rev = "746387f0112f9b7aa2e2e27b3d69cb2892d8c63b";
+    rev = version;
     sha256 = "1nw9dar1caqln5fr0dqk7dg6naazbpfwwzxwlkxz42shsc3w30a6";
+
+    patches = [
+      (fetchpatch {
+        url = "https://github.com/geommer/yabar/commit/9779a5e04bd6e8cdc1c9fcf5d7ac31416af85a53.patch";
+        sha256 = "1szhr3k1kq6ixgnp74wnzgfvgxm6r4zpc3ny2x2wzy6lh2czc07s";
+      })
+    ];
+
   } // attrs;
 in callPackage ./build.nix overrides