From 9673ba41d3ecb9835be20bba13e682aabbc6b7d3 Mon Sep 17 00:00:00 2001 From: Finn Behrens Date: Tue, 3 Oct 2023 22:52:24 +0200 Subject: [PATCH] nload: add patch to enable darwin and enable darwin --- .../applications/networking/nload/default.nix | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/networking/nload/default.nix b/pkgs/applications/networking/nload/default.nix index e46a95d71e49..a2b2731b3b03 100644 --- a/pkgs/applications/networking/nload/default.nix +++ b/pkgs/applications/networking/nload/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, fetchpatch, ncurses }: +{ lib, stdenv, fetchurl, fetchpatch, ncurses, autoreconfHook }: stdenv.mkDerivation rec { version = "0.7.4"; @@ -20,8 +20,23 @@ stdenv.mkDerivation rec { name = "nload-0.7.4-Eliminate-flicker-on-some-terminals.patch"; sha256 = "10yppy5l50wzpcvagsqkbyf1rcan6aj30am4rw8hmkgnbidf4zbq"; }) + # Patches configure.in file to make configure compile on macOS. + # Patch taken from MacPorts. + (fetchpatch { + url = "https://github.com/macports/macports-ports/raw/28814c34711e7545929fd391feb6ce079bd73fd4/net/nload/files/patch-configure.in.diff"; + extraPrefix = ""; + hash = "sha256-lGbBG5ZOgMVnrwlwXVFGbUZx6RkmQwYSVLB3oqkAWRs="; + }) + # Fixes crash on F2 and garbage in adapter name. + # Patch taken from Homebrew. + (fetchpatch { + url = "https://sourceforge.net/p/nload/bugs/_discuss/thread/c9b68d8e/4a65/attachment/devreader-bsd.cpp.patch"; + extraPrefix = ""; + hash = "sha256-umRQDqcRUOGELOx5iB6CPFRkjaD8HXkMCWiKsYdaUa0="; + }) ]; + nativeBuildInputs = lib.optional stdenv.isDarwin autoreconfHook; buildInputs = [ ncurses ]; meta = { @@ -34,7 +49,7 @@ stdenv.mkDerivation rec { ''; homepage = "http://www.roland-riegel.de/nload/index.html"; license = lib.licenses.gpl2; - platforms = lib.platforms.linux; + platforms = lib.platforms.unix; maintainers = [ lib.maintainers.devhell ]; mainProgram = "nload"; };