about summary refs log tree commit diff
path: root/pkgs/by-name
diff options
context:
space:
mode:
authorMario Rodas <marsam@users.noreply.github.com>2024-04-09 00:11:04 -0500
committerGitHub <noreply@github.com>2024-04-09 00:11:04 -0500
commit53d6d286e6d737e6782d3f6b925c40809eadda57 (patch)
treed1c5953e66f6503e613b9c959852647f2907e413 /pkgs/by-name
parenta29010fe79b07b603982d9e44c2a5face9dc9977 (diff)
parent4d3478f52b90b41e1d0266407dc00eadc1e2266e (diff)
Merge pull request #302697 from marsam/refactor-passt
passt: 0.2023_11_10.5ec3634 -> 2024_04_05.954589b
Diffstat (limited to 'pkgs/by-name')
-rw-r--r--pkgs/by-name/pa/passt/package.nix53
1 files changed, 32 insertions, 21 deletions
diff --git a/pkgs/by-name/pa/passt/package.nix b/pkgs/by-name/pa/passt/package.nix
index e577b2152503c..3ce1715d2a361 100644
--- a/pkgs/by-name/pa/passt/package.nix
+++ b/pkgs/by-name/pa/passt/package.nix
@@ -1,27 +1,37 @@
-{ stdenv, lib, fetchgit }:
+{ lib
+, stdenv
+, fetchurl
+, gitUpdater
+, testers
+}:
 
-stdenv.mkDerivation {
+stdenv.mkDerivation (finalAttrs: {
   pname = "passt";
-  version = "0.2023_11_10.5ec3634";
-  src = fetchgit {
-    url = "git://passt.top/passt";
-    rev = "5ec3634b07215337c2e69d88f9b1d74711897d7d";
-    hash = "sha256-76CD9PYD/NcBkmRYFSZaYl381QJjuWo0VsNdh31d6/M=";
+  version = "2024_04_05.954589b";
+
+  src = fetchurl {
+    url = "https://passt.top/passt/snapshot/passt-${finalAttrs.version}.tar.gz";
+    hash = "sha256-lwiHjr7rv1xBwXktKAsYIjDzNDkHGjZsW/FsQyFbLng=";
+  };
+
+  makeFlags = [
+    "prefix=${placeholder "out"}"
+    "VERSION=${finalAttrs.version}"
+  ];
+
+  passthru = {
+    tests.version = testers.testVersion {
+      package = finalAttrs.finalPackage;
+    };
+
+    updateScript = gitUpdater {
+      url = "https://passt.top/passt";
+    };
   };
-  nativeBuildInputs = [ ];
-  buildInputs = [];
-  installPhase = ''
-    runHook preInstall
-    mkdir -p $out/bin $out/share/man/man1
-    cp passt pasta qrap $out/bin/
-    cp passt.1 pasta.1 qrap.1 $out/share/man/man1/
-  '' + (lib.optionalString stdenv.hostPlatform.avx2Support ''
-    cp passt.avx2 pasta.avx2 $out/bin/
-    runHook postInstall
-  '');
+
   meta = with lib; {
     homepage = "https://passt.top/passt/about/";
-    description = "Translation layer between a Layer-2 network interface and native Layer-4 sockets";
+    description = "Plug A Simple Socket Transport";
     longDescription = ''
       passt implements a translation layer between a Layer-2 network interface
       and native Layer-4 sockets (TCP, UDP, ICMP/ICMPv6 echo) on a host.
@@ -34,8 +44,9 @@ stdenv.mkDerivation {
       interfaces on the host, hence not requiring any capabilities or
       privileges.
     '';
-    license = lib.licenses.gpl2Plus;
+    license = [ licenses.bsd3 /* and */ licenses.gpl2Plus ];
     platforms = platforms.linux;
     maintainers = with maintainers; [ _8aed ];
+    mainProgram = "passt";
   };
-}
+})