about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFelix Buehler <account@buehler.rocks>2021-09-19 19:10:07 +0200
committerFelix Buehler <account@buehler.rocks>2021-09-22 17:54:10 +0200
commit51aa71bffb699ba086161379f05a80f0eecb4274 (patch)
tree28600b1da1d1e803d3f9cc9b1b0aec49f5ba0f4c
parent95222c9d85b9972222cce0d4515c168e3933ef4f (diff)
tcptraceroute: switch to fetchFromGitHub
-rw-r--r--pkgs/tools/networking/tcptraceroute/default.nix46
1 files changed, 26 insertions, 20 deletions
diff --git a/pkgs/tools/networking/tcptraceroute/default.nix b/pkgs/tools/networking/tcptraceroute/default.nix
index 1eacd685463ea..379caedaaf1bf 100644
--- a/pkgs/tools/networking/tcptraceroute/default.nix
+++ b/pkgs/tools/networking/tcptraceroute/default.nix
@@ -1,28 +1,34 @@
-{ lib, stdenv  , fetchurl, libpcap, libnet
+{ lib
+, stdenv
+, fetchFromGitHub
+, libpcap
+, libnet
 }:
 
 stdenv.mkDerivation rec {
-   pkgname = "tcptraceroute";
-   name = "${pkgname}-${version}";
-   version = "1.5beta7";
+  pname = "tcptraceroute";
+  version = "1.5beta7";
 
-   src = fetchurl {
-     url = "https://github.com/mct/${pkgname}/archive/${name}.tar.gz";
-     sha256 = "1rz8bgc6r1isb40awv1siirpr2i1paa2jc1cd3l5pg1m9522xzap";
-   };
+  src = fetchFromGitHub {
+    owner = "mct";
+    repo = "tcptraceroute";
+    rev = "${pname}-${version}";
+    hash = "sha256-KU4MLWtOFzzNr+I99fRbhBokhS1JUNL+OgVltkOGav4=";
+  };
 
-   # for reasons unknown --disable-static configure flag doesn't disable static
-   # linking.. we instead override CFLAGS with -static omitted
-   preBuild = ''
-      makeFlagsArray=(CFLAGS=" -g -O2 -Wall")
-   '';
 
-   buildInputs = [ libpcap libnet ];
+  # for reasons unknown --disable-static configure flag doesn't disable static
+  # linking.. we instead override CFLAGS with -static omitted
+  preBuild = ''
+    makeFlagsArray=(CFLAGS=" -g -O2 -Wall")
+  '';
 
-   meta = {
-     description = "A traceroute implementation using TCP packets";
-     homepage = "https://github.com/mct/tcptraceroute";
-     license = lib.licenses.gpl2;
-     maintainers = [ ];
-   };
+  buildInputs = [ libpcap libnet ];
+
+  meta = {
+    description = "A traceroute implementation using TCP packets";
+    homepage = "https://github.com/mct/tcptraceroute";
+    license = lib.licenses.gpl2;
+    maintainers = [ ];
+  };
 }