From 591fd5ee9b4c1a5f1847b090eed83b13e784ff63 Mon Sep 17 00:00:00 2001
From: xeji <xeji@cat3.de>
Date: Tue, 13 Mar 2018 22:40:07 +0100
Subject: [PATCH] libsemanage: fix build w/gcc7

---
 pkgs/os-specific/linux/libsemanage/default.nix | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/pkgs/os-specific/linux/libsemanage/default.nix b/pkgs/os-specific/linux/libsemanage/default.nix
index c60d96bba784..587349e4067e 100644
--- a/pkgs/os-specific/linux/libsemanage/default.nix
+++ b/pkgs/os-specific/linux/libsemanage/default.nix
@@ -13,7 +13,13 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ bison flex ];
   buildInputs = [ libsepol libselinux ustr bzip2 libaudit ];
 
-  NIX_CFLAGS_COMPILE = "-fstack-protector-all -std=gnu89";
+  NIX_CFLAGS_COMPILE = [
+    "-fstack-protector-all"
+    "-std=gnu89"
+    # these were added to fix build with gcc7. review on update
+    "-Wno-error=format-truncation"
+    "-Wno-error=implicit-fallthrough"
+  ];
 
   preBuild = ''
     makeFlagsArray+=("PREFIX=$out")