2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, darwin, python2 }:
|
2018-06-09 21:13:01 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
version = "1.2.1";
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "iproute2mac";
|
2018-06-09 21:13:01 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "brona";
|
|
|
|
repo = "iproute2mac";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "1n6la7blbxza2m79cpnywsavhzsdv4gzdxrkly4dppyidjg6jy1h";
|
|
|
|
};
|
|
|
|
|
2020-01-13 09:47:37 +00:00
|
|
|
buildInputs = [ python2 ];
|
2018-06-09 21:13:01 +01:00
|
|
|
|
|
|
|
postPatch = ''
|
2018-06-09 22:12:16 +01:00
|
|
|
substituteInPlace src/ip.py \
|
2020-01-13 09:47:37 +00:00
|
|
|
--replace /usr/bin/python ${python2}/bin/python \
|
2018-06-09 22:12:16 +01:00
|
|
|
--replace /sbin/ifconfig ${darwin.network_cmds}/bin/ifconfig \
|
|
|
|
--replace /sbin/route ${darwin.network_cmds}/bin/route \
|
|
|
|
--replace /usr/sbin/netstat ${darwin.network_cmds}/bin/netstat \
|
|
|
|
--replace /usr/sbin/ndp ${darwin.network_cmds}/bin/ndp \
|
|
|
|
--replace /usr/sbin/arp ${darwin.network_cmds}/bin/arp \
|
|
|
|
--replace /usr/sbin/networksetup ${darwin.network_cmds}/bin/networksetup
|
2018-06-09 21:13:01 +01:00
|
|
|
'';
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
install -D -m 755 src/ip.py $out/bin/ip
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/brona/iproute2mac";
|
2018-06-09 21:13:01 +01:00
|
|
|
description = "CLI wrapper for basic network utilites on Mac OS X inspired with iproute2 on Linux systems - ip command.";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ flokli ];
|
|
|
|
platforms = platforms.darwin;
|
|
|
|
};
|
|
|
|
}
|