nload: add patch to enable darwin and enable darwin

This commit is contained in:
Finn Behrens 2023-10-03 22:52:24 +02:00 committed by Weijia Wang
parent 1a6b49ed47
commit 9673ba41d3

View File

@ -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";
};