nixpkgs/pkgs/applications/window-managers/yabar/build.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

74 lines
1.5 KiB
Nix
Raw Permalink Normal View History

{ stdenv, fetchFromGitHub, cairo, gdk-pixbuf, libconfig, pango, pkg-config
, xcbutilwm, alsa-lib, wirelesstools, asciidoc, libxslt, makeWrapper, docbook_xsl
2017-09-11 00:53:53 +02:00
, configFile ? null, lib
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.
2018-06-21 23:28:59 +02:00
, rev, sha256, version, patches ? []
2017-09-11 00:53:53 +02:00
}:
stdenv.mkDerivation {
2019-08-13 23:52:01 +02:00
pname = "yabar";
inherit version;
2017-09-11 00:53:53 +02:00
src = fetchFromGitHub {
inherit rev sha256;
owner = "geommer";
repo = "yabar";
};
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.
2018-06-21 23:28:59 +02:00
inherit patches;
2017-09-11 00:53:53 +02:00
hardeningDisable = [ "format" ];
strictDeps = true;
depsBuildBuild = [
pkg-config
];
nativeBuildInputs = [
pkg-config
asciidoc
docbook_xsl
libxslt
makeWrapper
libconfig
pango
];
2017-09-11 00:53:53 +02:00
buildInputs = [
cairo
gdk-pixbuf
libconfig
pango
xcbutilwm
alsa-lib
wirelesstools
2017-09-11 00:53:53 +02:00
];
postPatch = ''
substituteInPlace ./Makefile \
--replace "\$(shell git describe)" "${version}" \
--replace "a2x" "a2x --no-xmllint"
2017-09-11 00:53:53 +02:00
'';
makeFlags = [ "DESTDIR=$(out)" "PREFIX=/" ];
2017-09-11 00:53:53 +02:00
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; {
2017-09-11 00:53:53 +02:00
description = "A modern and lightweight status bar for X window managers";
homepage = "https://github.com/geommer/yabar";
2017-09-11 00:53:53 +02:00
license = licenses.mit;
platforms = platforms.linux;
maintainers = with maintainers; [ ];
2023-11-27 02:17:53 +01:00
mainProgram = "yabar";
2017-09-11 00:53:53 +02:00
};
}