Loading pkgs/by-name/su/suricata/bpf_stubs_workaround.patch +11 −19 Original line number Diff line number Diff line *** suricata-5.0.0/ebpf/Makefile.in 2019-10-16 22:39:13.174649416 +0200 --- suricata-5.0.0/ebpf/Makefile.in.fixed 2019-10-16 22:38:41.822201802 +0200 *************** *** 527,533 **** --- a/ebpf/Makefile.in +++ b/ebpf/Makefile.in @@ -530,7 +530,7 @@ @BUILD_EBPF_TRUE@$(BPF_TARGETS): %.bpf: %.c # From C-code to LLVM-IR format suffix .ll (clang -S -emit-llvm) @BUILD_EBPF_TRUE@ ${CLANG} -Wall $(BPF_CFLAGS) -O2 \ ! @BUILD_EBPF_TRUE@ -I/usr/include/$(build_cpu)-$(build_os)/ \ @BUILD_EBPF_TRUE@ -D__KERNEL__ -D__ASM_SYSREG_H \ @BUILD_EBPF_TRUE@ -target bpf -S -emit-llvm $< -o ${@:.bpf=.ll} # From LLVM-IR to BPF-bytecode in ELF-obj file --- 527,533 ---- @BUILD_EBPF_TRUE@$(BPF_TARGETS): %.bpf: %.c # From C-code to LLVM-IR format suffix .ll (clang -S -emit-llvm) @BUILD_EBPF_TRUE@ ${CLANG} -Wall $(BPF_CFLAGS) -O2 \ ! @BUILD_EBPF_TRUE@ -idirafter ../bpf_stubs_workaround \ @BUILD_EBPF_TRUE@ ${CLANG} -Wall $(BPF_CFLAGS) -O2 -g \ -@BUILD_EBPF_TRUE@ -I/usr/include/$(build_cpu)-$(build_os)/ \ +@BUILD_EBPF_TRUE@ -idirafter ../bpf_stubs_workaround \ @BUILD_EBPF_TRUE@ -D__KERNEL__ -D__ASM_SYSREG_H \ @BUILD_EBPF_TRUE@ -target bpf -S -emit-llvm $< -o ${@:.bpf=.ll} # From LLVM-IR to BPF-bytecode in ELF-obj file pkgs/by-name/su/suricata/package.nix +11 −25 Original line number Diff line number Diff line Loading @@ -5,7 +5,6 @@ clang, llvm, pkg-config, makeWrapper, elfutils, file, jansson, Loading Loading @@ -39,17 +38,21 @@ let in stdenv.mkDerivation rec { pname = "suricata"; version = "7.0.10"; version = "8.0.2"; src = fetchurl { url = "https://www.openinfosecfoundation.org/download/${pname}-${version}.tar.gz"; hash = "sha256-GX+SXqcBvctKFaygJLBlRrACZ0zZWLWJWPKaW7IU11k="; hash = "sha256-nUUMosrb4QGZPpkDOmI0nSvanf2QpqzBvLbMbbdutVE="; }; patches = lib.optionals stdenv.hostPlatform.is64bit [ # Provide empty gnu/stubs-32.h for eBPF build ./bpf_stubs_workaround.patch ]; nativeBuildInputs = [ clang llvm makeWrapper pkg-config ] ++ lib.optionals rustSupport [ Loading Loading @@ -90,14 +93,7 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; patches = lib.optional stdenv.hostPlatform.is64bit ./bpf_stubs_workaround.patch; postPatch = '' substituteInPlace ./configure \ --replace "/usr/bin/file" "${file}/bin/file" substituteInPlace ./libhtp/configure \ --replace "/usr/bin/file" "${file}/bin/file" mkdir -p bpf_stubs_workaround/gnu touch bpf_stubs_workaround/gnu/stubs-32.h ''; Loading @@ -116,6 +112,7 @@ stdenv.mkDerivation rec { "--enable-python" "--enable-unix-socket" "--localstatedir=/var" "--runstatedir=/run" "--sysconfdir=/etc" "--with-libhs-includes=${lib.getDev vectorscan}/include/hs" "--with-libhs-libraries=${lib.getLib vectorscan}/lib" Loading @@ -142,17 +139,8 @@ stdenv.mkDerivation rec { doCheck = true; installFlags = [ "e_datadir=\${TMPDIR}" "e_localstatedir=\${TMPDIR}" "e_logdir=\${TMPDIR}" "e_logcertsdir=\${TMPDIR}" "e_logfilesdir=\${TMPDIR}" "e_rundir=\${TMPDIR}" "e_sysconfdir=\${out}/etc/suricata" "e_sysconfrulesdir=\${out}/etc/suricata/rules" "localstatedir=\${TMPDIR}" "runstatedir=\${TMPDIR}" "sysconfdir=\${out}/etc" "DESTDIR=\${out}" "prefix=/" ]; installTargets = [ Loading @@ -161,10 +149,8 @@ stdenv.mkDerivation rec { ]; postInstall = '' wrapProgram "$out/bin/suricatasc" \ --prefix PYTHONPATH : $PYTHONPATH:$(toPythonPath "$out") substituteInPlace "$out/etc/suricata/suricata.yaml" \ --replace "/etc/suricata" "$out/etc/suricata" --replace-fail "/etc/suricata" "${placeholder "out"}/etc/suricata" ''; passthru.tests = { inherit (nixosTests) suricata; }; Loading Loading
pkgs/by-name/su/suricata/bpf_stubs_workaround.patch +11 −19 Original line number Diff line number Diff line *** suricata-5.0.0/ebpf/Makefile.in 2019-10-16 22:39:13.174649416 +0200 --- suricata-5.0.0/ebpf/Makefile.in.fixed 2019-10-16 22:38:41.822201802 +0200 *************** *** 527,533 **** --- a/ebpf/Makefile.in +++ b/ebpf/Makefile.in @@ -530,7 +530,7 @@ @BUILD_EBPF_TRUE@$(BPF_TARGETS): %.bpf: %.c # From C-code to LLVM-IR format suffix .ll (clang -S -emit-llvm) @BUILD_EBPF_TRUE@ ${CLANG} -Wall $(BPF_CFLAGS) -O2 \ ! @BUILD_EBPF_TRUE@ -I/usr/include/$(build_cpu)-$(build_os)/ \ @BUILD_EBPF_TRUE@ -D__KERNEL__ -D__ASM_SYSREG_H \ @BUILD_EBPF_TRUE@ -target bpf -S -emit-llvm $< -o ${@:.bpf=.ll} # From LLVM-IR to BPF-bytecode in ELF-obj file --- 527,533 ---- @BUILD_EBPF_TRUE@$(BPF_TARGETS): %.bpf: %.c # From C-code to LLVM-IR format suffix .ll (clang -S -emit-llvm) @BUILD_EBPF_TRUE@ ${CLANG} -Wall $(BPF_CFLAGS) -O2 \ ! @BUILD_EBPF_TRUE@ -idirafter ../bpf_stubs_workaround \ @BUILD_EBPF_TRUE@ ${CLANG} -Wall $(BPF_CFLAGS) -O2 -g \ -@BUILD_EBPF_TRUE@ -I/usr/include/$(build_cpu)-$(build_os)/ \ +@BUILD_EBPF_TRUE@ -idirafter ../bpf_stubs_workaround \ @BUILD_EBPF_TRUE@ -D__KERNEL__ -D__ASM_SYSREG_H \ @BUILD_EBPF_TRUE@ -target bpf -S -emit-llvm $< -o ${@:.bpf=.ll} # From LLVM-IR to BPF-bytecode in ELF-obj file
pkgs/by-name/su/suricata/package.nix +11 −25 Original line number Diff line number Diff line Loading @@ -5,7 +5,6 @@ clang, llvm, pkg-config, makeWrapper, elfutils, file, jansson, Loading Loading @@ -39,17 +38,21 @@ let in stdenv.mkDerivation rec { pname = "suricata"; version = "7.0.10"; version = "8.0.2"; src = fetchurl { url = "https://www.openinfosecfoundation.org/download/${pname}-${version}.tar.gz"; hash = "sha256-GX+SXqcBvctKFaygJLBlRrACZ0zZWLWJWPKaW7IU11k="; hash = "sha256-nUUMosrb4QGZPpkDOmI0nSvanf2QpqzBvLbMbbdutVE="; }; patches = lib.optionals stdenv.hostPlatform.is64bit [ # Provide empty gnu/stubs-32.h for eBPF build ./bpf_stubs_workaround.patch ]; nativeBuildInputs = [ clang llvm makeWrapper pkg-config ] ++ lib.optionals rustSupport [ Loading Loading @@ -90,14 +93,7 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; patches = lib.optional stdenv.hostPlatform.is64bit ./bpf_stubs_workaround.patch; postPatch = '' substituteInPlace ./configure \ --replace "/usr/bin/file" "${file}/bin/file" substituteInPlace ./libhtp/configure \ --replace "/usr/bin/file" "${file}/bin/file" mkdir -p bpf_stubs_workaround/gnu touch bpf_stubs_workaround/gnu/stubs-32.h ''; Loading @@ -116,6 +112,7 @@ stdenv.mkDerivation rec { "--enable-python" "--enable-unix-socket" "--localstatedir=/var" "--runstatedir=/run" "--sysconfdir=/etc" "--with-libhs-includes=${lib.getDev vectorscan}/include/hs" "--with-libhs-libraries=${lib.getLib vectorscan}/lib" Loading @@ -142,17 +139,8 @@ stdenv.mkDerivation rec { doCheck = true; installFlags = [ "e_datadir=\${TMPDIR}" "e_localstatedir=\${TMPDIR}" "e_logdir=\${TMPDIR}" "e_logcertsdir=\${TMPDIR}" "e_logfilesdir=\${TMPDIR}" "e_rundir=\${TMPDIR}" "e_sysconfdir=\${out}/etc/suricata" "e_sysconfrulesdir=\${out}/etc/suricata/rules" "localstatedir=\${TMPDIR}" "runstatedir=\${TMPDIR}" "sysconfdir=\${out}/etc" "DESTDIR=\${out}" "prefix=/" ]; installTargets = [ Loading @@ -161,10 +149,8 @@ stdenv.mkDerivation rec { ]; postInstall = '' wrapProgram "$out/bin/suricatasc" \ --prefix PYTHONPATH : $PYTHONPATH:$(toPythonPath "$out") substituteInPlace "$out/etc/suricata/suricata.yaml" \ --replace "/etc/suricata" "$out/etc/suricata" --replace-fail "/etc/suricata" "${placeholder "out"}/etc/suricata" ''; passthru.tests = { inherit (nixosTests) suricata; }; Loading