From 2ad6f04da778ff06bb6bd4685204854c6e08ca94 Mon Sep 17 00:00:00 2001 From: xeji Date: Sat, 24 Feb 2018 00:56:02 +0100 Subject: [PATCH] bwm-ng: fix build error with gcc7 patch some gcc7 issues with inline functions --- pkgs/tools/networking/bwm-ng/default.nix | 28 +++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/pkgs/tools/networking/bwm-ng/default.nix b/pkgs/tools/networking/bwm-ng/default.nix index cfcd051f2816..128ebc155b56 100644 --- a/pkgs/tools/networking/bwm-ng/default.nix +++ b/pkgs/tools/networking/bwm-ng/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, ncurses }: +{ writeText, stdenv, fetchurl, ncurses }: let version = "0.6.1"; @@ -13,6 +13,32 @@ stdenv.mkDerivation rec { buildInputs = [ ncurses ]; + # gcc7 has some issues with inline functions + patches = [ + (writeText "gcc7.patch" + '' + --- a/src/bwm-ng.c + +++ b/src/bwm-ng.c + @@ -27,5 +27,5 @@ + /* handle interrupt signal */ + void sigint(int sig) FUNCATTR_NORETURN; + -inline void init(void); + +static inline void init(void); + + /* clear stuff and exit */ + --- a/src/options.c + +++ b/src/options.c + @@ -35,5 +35,5 @@ + inline int str2output_type(char *optarg); + #endif + -inline int str2out_method(char *optarg); + +static inline int str2out_method(char *optarg); + inline int str2in_method(char *optarg); + + '') + ]; + + # This code uses inline in the gnu89 sense: see http://clang.llvm.org/compatibility.html#inline NIX_CFLAGS_COMPILE = if stdenv.cc.isClang then "-std=gnu89" else null;