about summary refs log tree commit diff
path: root/pkgs/tools/security/nsjail
diff options
context:
space:
mode:
authorNick Cao <nickcao@nichi.co>2022-09-16 17:39:20 +0800
committerNick Cao <nickcao@nichi.co>2022-09-16 17:39:58 +0800
commit0016b767455857295159e94a2e0d597ae0dcce87 (patch)
treefa7e1c5bb855d84ef5cacd270e77d15e965fe6cd /pkgs/tools/security/nsjail
parent8051e9c4ae6811190e05dcacc62dc41065b4266d (diff)
nsjail: 3.0 -> 3.1
Diffstat (limited to 'pkgs/tools/security/nsjail')
-rw-r--r--pkgs/tools/security/nsjail/001-fix-bison-link-error.patch30
-rw-r--r--pkgs/tools/security/nsjail/default.nix18
2 files changed, 6 insertions, 42 deletions
diff --git a/pkgs/tools/security/nsjail/001-fix-bison-link-error.patch b/pkgs/tools/security/nsjail/001-fix-bison-link-error.patch
deleted file mode 100644
index 427cea5b02b62..0000000000000
--- a/pkgs/tools/security/nsjail/001-fix-bison-link-error.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From 8e309a0af0851ab54ca7c6d51b6f3d19ee42c8ee Mon Sep 17 00:00:00 2001
-From: Evangelos Foutras <evangelos@foutrelis.com>
-Date: Wed, 17 Mar 2021 16:36:40 +0200
-Subject: [PATCH] Replace YYUSE call with void cast in src/parser.y
-
-The YYUSE macro was renamed to YY_USE in bison 3.7.5; we might as well
-avoid using it altogether and cast the unused variable to void instead.
-
-Fixes the following linker error:
-
-/usr/bin/ld: kafel/libkafel.a(libkafel.o): in function `kafel_yyerror':
-arm_syscalls.c:(.text+0x6984): undefined reference to `YYUSE'
----
- src/parser.y | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/parser.y b/src/parser.y
-index e0f109c..0e01373 100644
---- a/kafel/src/parser.y
-+++ b/kafel/src/parser.y
-@@ -420,8 +420,8 @@ const_def
- 
- void yyerror(YYLTYPE * loc, struct kafel_ctxt* ctxt, yyscan_t scanner,
-              const char *msg) {
-+  (void)scanner; /* suppress unused-parameter warning */
-   if (!ctxt->lexical_error) {
--    YYUSE(scanner);
-     if (loc->filename != NULL) {
-       append_error(ctxt, "%s:%d:%d: %s", loc->filename, loc->first_line, loc->first_column, msg);
-     } else {
diff --git a/pkgs/tools/security/nsjail/default.nix b/pkgs/tools/security/nsjail/default.nix
index 568113368a084..c86fcb7ace57b 100644
--- a/pkgs/tools/security/nsjail/default.nix
+++ b/pkgs/tools/security/nsjail/default.nix
@@ -1,36 +1,30 @@
 { lib, stdenv, fetchFromGitHub, autoconf, bison, flex, libtool, pkg-config, which
-, libnl, protobuf, protobufc, shadow
+, libnl, protobuf, protobufc, shadow, installShellFiles
 }:
 
 stdenv.mkDerivation rec {
   pname = "nsjail";
-  version = "3.0"; # Bumping? Remove the bison patch.
+  version = "3.1";
 
   src = fetchFromGitHub {
     owner           = "google";
     repo            = "nsjail";
     rev             = version;
     fetchSubmodules = true;
-    sha256          = "1w6x8xcrs0i1y3q41gyq8z3cq9x24qablklc4jiydf855lhqn4dh";
+    sha256          = "sha256-ICJpD7iCT7tLRX+52XvayOUuO1g0L0jQgk60S2zLz6c=";
   };
 
-  nativeBuildInputs = [ autoconf bison flex libtool pkg-config which ];
+  nativeBuildInputs = [ autoconf bison flex libtool pkg-config which installShellFiles ];
   buildInputs = [ libnl protobuf protobufc ];
   enableParallelBuilding = true;
 
-  patches = [
-    # To remove after bumping 3.0
-    ./001-fix-bison-link-error.patch
-  ];
-
   preBuild = ''
     makeFlagsArray+=(USER_DEFINES='-DNEWUIDMAP_PATH=${shadow}/bin/newuidmap -DNEWGIDMAP_PATH=${shadow}/bin/newgidmap')
   '';
 
   installPhase = ''
-    mkdir -p $out/bin $out/share/man/man1
-    install nsjail $out/bin/
-    install nsjail.1 $out/share/man/man1/
+    install -Dm755 nsjail "$out/bin/nsjail"
+    installManPage nsjail.1
   '';
 
   meta = with lib; {