From 165d8e6db51dc8b5699f5d43263e174af876d930 Mon Sep 17 00:00:00 2001 From: Artturin Date: Sat, 7 May 2022 16:45:41 +0300 Subject: [PATCH 1/2] netcat-openbsd: init at 1.218-5 --- .../networking/netcat-openbsd/default.nix | 54 +++++++++++++++++++ pkgs/top-level/aliases.nix | 1 - pkgs/top-level/all-packages.nix | 2 + 3 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 pkgs/tools/networking/netcat-openbsd/default.nix diff --git a/pkgs/tools/networking/netcat-openbsd/default.nix b/pkgs/tools/networking/netcat-openbsd/default.nix new file mode 100644 index 000000000000..67d458dad1bd --- /dev/null +++ b/pkgs/tools/networking/netcat-openbsd/default.nix @@ -0,0 +1,54 @@ +{ lib, stdenv, fetchFromGitLab, pkg-config, libbsd, installShellFiles }: + +stdenv.mkDerivation rec { + pname = "netcat-openbsd"; + version = "1.218-5"; + + src = fetchFromGitLab { + domain = "salsa.debian.org"; + owner = "debian"; + repo = "netcat-openbsd"; + rev = "refs/tags/debian/${version}"; + sha256 = "sha256-jEJ8x49Z1UN2qOChGp173aQuPkgl2fWwUUJgUdOv60I="; + }; + + strictDeps = true; + nativeBuildInputs = [ pkg-config installShellFiles ]; + buildInputs = [ libbsd ]; + + NIX_CFLAGS_COMPILE = [ + "-I${lib.getDev libbsd}/include/libbsd" + ]; + + NIX_LDFLAGS = [ "-lbsd" ]; + + postPatch = '' + for file in $(cat debian/patches/series); do + patch -p1 < debian/patches/$file + done + ''; + + installPhase = '' + runHook preInstall + + mkdir -p $out/bin + mv nc $out/bin/nc + installManPage nc.1 + + runHook postInstall + ''; + + doInstallCheck = true; + installCheckPhase = '' + $out/bin/nc -h 2> /dev/null + ''; + + meta = with lib; { + description = "TCP/IP swiss army knife. OpenBSD variant"; + homepage = "https://salsa.debian.org/debian/netcat-openbsd"; + maintainers = with maintainers; [ artturin ]; + license = licenses.bsd3; + platforms = platforms.unix; + mainProgram = "nc"; + }; +} diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index d0c8cee8e24a..8315b70dbfc6 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -850,7 +850,6 @@ mapAliases ({ navit = throw "navit has been removed from nixpkgs, due to being unmaintained"; # Added 2021-06-07 ncat = throw "'ncat' has been renamed to/replaced by 'nmap'"; # Converted to throw 2022-02-22 neap = throw "neap was removed from nixpkgs, as it relies on python2"; # Added 2022-01-12 - netcat-openbsd = throw "'netcat-openbsd' has been renamed to/replaced by 'libressl.nc'"; # Converted to throw 2022-02-22 netease-cloud-music = throw "netease-cloud-music has been removed together with deepin"; # Added 2020-08-31 networkmanager_fortisslvpn = throw "'networkmanager_fortisslvpn' has been renamed to/replaced by 'networkmanager-fortisslvpn'"; # Converted to throw 2022-02-22 networkmanager_iodine = throw "'networkmanager_iodine' has been renamed to/replaced by 'networkmanager-iodine'"; # Converted to throw 2022-02-22 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 612f3dcd699f..44231edb22f2 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8544,6 +8544,8 @@ with pkgs; netcat-gnu = callPackage ../tools/networking/netcat { }; + netcat-openbsd = callPackage ../tools/networking/netcat-openbsd { }; + netdiscover = callPackage ../tools/networking/netdiscover { }; nethogs = callPackage ../tools/networking/nethogs { }; From 51838e184e797af125183e62c17a81116bc37942 Mon Sep 17 00:00:00 2001 From: Artturin Date: Sat, 7 May 2022 17:01:05 +0300 Subject: [PATCH 2/2] flashfocus: use make it possible to use nc_flash_window it is faster than flash_window it needs netcat-openbsd --- pkgs/misc/flashfocus/default.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/misc/flashfocus/default.nix b/pkgs/misc/flashfocus/default.nix index fd93260a4bca..b74464de4f68 100644 --- a/pkgs/misc/flashfocus/default.nix +++ b/pkgs/misc/flashfocus/default.nix @@ -1,4 +1,4 @@ -{ lib, python3 }: +{ lib, python3, netcat-openbsd }: python3.pkgs.buildPythonApplication rec { pname = "flashfocus"; @@ -12,6 +12,9 @@ python3.pkgs.buildPythonApplication rec { postPatch = '' substituteInPlace setup.py \ --replace "pyyaml>=5.1,<6.0" "pyyaml>=5.1" + + substituteInPlace bin/nc_flash_window \ + --replace "nc" "${lib.getExe netcat-openbsd}" ''; nativeBuildInputs = with python3.pkgs; [