Merge staging-next into staging

This commit is contained in:
github-actions[bot]
2021-02-01 00:47:02 +00:00
committed by GitHub
32 changed files with 866 additions and 283 deletions
+50 -17
View File
@@ -1,31 +1,64 @@
{ stdenv, lib, fetchFromGitHub, libpcap, libjpeg , libungif, libpng
, giflib, glib, gtk2, cairo, pango, gdk-pixbuf, atk
, pkg-config, autoreconfHook }:
{ stdenv
, lib
, fetchFromGitHub
, fetchpatch
, autoreconfHook
, cairo
, giflib
, glib
, gtk2-x11
, libjpeg
, libpcap
, libpng
, libwebsockets
, pkg-config
, libuv
, openssl
}:
with lib;
stdenv.mkDerivation {
stdenv.mkDerivation rec {
pname = "driftnet";
version = "1.1.5";
nativeBuildInputs = [ pkg-config ];
buildInputs = [
libpcap libjpeg libungif libpng giflib
glib gtk2 glib cairo pango gdk-pixbuf atk autoreconfHook
];
version = "1.3.0";
src = fetchFromGitHub {
owner = "deiv";
repo = "driftnet";
rev = "0ae4a91";
sha256 = "1sagpx0mw68ggvqd9c3crjhghqmj7391mf2cb6cjw1cpd2hcddsj";
rev = "v${version}";
sha256 = "0kd22aqb25kf54jjv3ml8wy8xm7lmbf0xz1wfp31m08cbzsbizib";
};
meta = {
# https://github.com/deiv/driftnet/pull/33
# remove on version bump from 1.3.0
patches = [
(fetchpatch {
name = "fix-darwin-build";
url = "https://github.com/deiv/driftnet/pull/33/commits/bef5f3509ab5710161e9e21ea960a997eada534f.patch";
sha256 = "1b7p9fkgp7dxv965l7q7y632s80h3nnrkaqnak2h0hakwv0i4pvm";
})
];
enableParallelBuilding = true;
nativeBuildInputs = [ pkg-config autoreconfHook ];
buildInputs = [
cairo
giflib
glib
gtk2-x11
libjpeg
libpcap
libpng
libwebsockets
openssl
libuv
];
meta = with lib; {
description = "Watches network traffic, and picks out and displays JPEG and GIF images for display";
homepage = "https://github.com/deiv/driftnet";
maintainers = with maintainers; [ offline ];
platforms = platforms.linux;
platforms = platforms.linux ++ platforms.darwin;
license = licenses.gpl2;
};
}
@@ -0,0 +1,61 @@
diff --git a/src/compat/compat.h b/src/compat/compat.h
index 6add422..ea80406 100644
--- a/src/compat/compat.h
+++ b/src/compat/compat.h
@@ -17,7 +17,7 @@
#include <config.h>
#endif
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__APPLE__)
#include <sys/types.h>
#endif
diff --git a/src/network/layer2.c b/src/network/layer2.c
index 763f0ac..2497b72 100644
--- a/src/network/layer2.c
+++ b/src/network/layer2.c
@@ -14,7 +14,7 @@
#include <string.h>
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__APPLE__)
#include <netinet/in_systm.h>
#include <netinet/in.h>
#else
@@ -29,7 +29,7 @@
/*
* Freebsd and Cygwin doesn't define 'ethhdr'
*/
-#if defined(__FreeBSD__) || defined(__CYGWIN__)
+#if defined(__FreeBSD__) || defined(__CYGWIN__) || defined(__APPLE__)
#define ETH_ALEN 6 /* Octets in one ethernet addr */
#define ETH_P_IP 0x0800 /* Internet Protocol packet */
diff --git a/src/network/layer3.c b/src/network/layer3.c
index 7864126..aae2041 100644
--- a/src/network/layer3.c
+++ b/src/network/layer3.c
@@ -15,7 +15,7 @@
#include <string.h>
#include <assert.h>
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__APPLE__)
#include <netinet/in_systm.h>
#include <netinet/in.h>
#include <sys/socket.h>
diff --git a/src/pid.c b/src/pid.c
index 621834e..94e7dcc 100644
--- a/src/pid.c
+++ b/src/pid.c
@@ -14,7 +14,7 @@
#include "compat/compat.h"
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__APPLE__)
#include <sys/stat.h>
#endif
#include <fcntl.h>
@@ -0,0 +1,26 @@
diff --color -ur a/program/nikto.pl b/program/nikto.pl
--- a/program/nikto.pl 2021-01-30 12:05:54.915072538 +0100
+++ b/program/nikto.pl 2021-01-30 12:36:42.877729231 +0100
@@ -223,7 +223,8 @@
# Guess Nikto current directory
my $NIKTODIR = abs_path($0);
chomp($NIKTODIR);
- $NIKTODIR =~ s#[\\/]nikto.pl$##;
+ $NIKTODIR =~ s#[\\/]bin[\\/]\.nikto-wrapped$##;
+
# Guess user's home directory -- to support Windows
foreach my $var (split(/ /, "HOME USERPROFILE")) {
@@ -231,10 +232,10 @@
}
# Read the conf files in order (previous values are over-written with each, if multiple found)
- push(@CF,"$NIKTODIR/nikto.conf.default");
+ push(@CF,"$NIKTODIR/etc/nikto.conf.default");
push(@CF,"/etc/nikto.conf");
push(@CF,"$home/nikto.conf");
- push(@CF,"$NIKTODIR/nikto.conf");
+ push(@CF,"$NIKTODIR/etc/nikto.conf");
push(@CF,"nikto.conf");
push(@CF,"$VARIABLES{'configfile'}");
+64
View File
@@ -0,0 +1,64 @@
{ lib
, stdenv
, fetchFromGitHub
, perlPackages
, makeWrapper
, installShellFiles
}:
stdenv.mkDerivation rec {
pname = "nikto";
version = "2.2.0";
src = fetchFromGitHub {
owner = "sullo";
repo = "nikto";
rev = "c83d0461edd75c02677dea53da2896644f35ecab";
sha256 = "0vwq2zdxir67cn78ls11qf1smd54nppy266v7ajm5rqdc47q7fy2";
};
# Nikto searches its configuration file based on its current path
# This fixes the current path regex for the wrapped executable.
patches = [ ./NIKTODIR-nix-wrapper-fix.patch ];
postPatch = ''
# EXECDIR needs to be changed to the path where we copy the programs stuff
# Forcing SSLeay is needed for SSL support (the auto mode doesn't seem to work otherwise)
substituteInPlace program/nikto.conf.default \
--replace "# EXECDIR=/opt/nikto" "EXECDIR=$out/share" \
--replace "LW_SSL_ENGINE=auto" "LW_SSL_ENGINE=SSLeay"
'';
nativeBuildInputs = [ makeWrapper installShellFiles ];
propagatedBuildInputs = [ perlPackages.NetSSLeay ];
buildInputs = [
perlPackages.perl
];
installPhase = ''
runHook preInstall
install -d "$out/share"
cp -a program/* "$out/share"
install -Dm 755 "program/nikto.pl" "$out/bin/nikto"
install -Dm 644 program/nikto.conf.default "$out/etc/nikto.conf"
installManPage documentation/nikto.1
install -Dm 644 program/docs/nikto_manual.html "$out/share/doc/${pname}/manual.html"
install -Dm 644 README.md "$out/share/doc/${pname}/README"
runHook postInstall
'';
postInstall = ''
wrapProgram $out/bin/nikto \
--prefix PERL5LIB : $PERL5LIB
'';
meta = with lib; {
description = "Web server scanner";
license = licenses.gpl2Plus;
homepage = "https://cirt.net/Nikto2";
maintainers = with maintainers; [ shamilton ];
platforms = platforms.unix;
};
}