From 155b675882ae8e040fdf9dd2c2fb1f4b9bef5bc5 Mon Sep 17 00:00:00 2001 From: NeverBehave Date: Wed, 3 Jul 2024 20:46:24 +0000 Subject: [PATCH] ooklaserver: init at 2.11.1.2 --- pkgs/by-name/oo/ooklaserver/package.nix | 53 +++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 pkgs/by-name/oo/ooklaserver/package.nix diff --git a/pkgs/by-name/oo/ooklaserver/package.nix b/pkgs/by-name/oo/ooklaserver/package.nix new file mode 100644 index 000000000000..0f265470b6fd --- /dev/null +++ b/pkgs/by-name/oo/ooklaserver/package.nix @@ -0,0 +1,53 @@ +{ lib +, stdenv +, fetchurl +, unzip +}: +let + filenameMapping = { + "x86_64-linux" = "OoklaServer-linux-x86_64-static-musl.zip"; + "aarch64-linux" = "OoklaServer-linux-aarch64-static-musl.zip"; + # Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit executable x86_64] [arm64] + "x86_64-darwin" = "OoklaServer-macosx.zip"; + "aarch64-darwin" = "OoklaServer-macosx.zip"; + "x86_64-windows" = "OoklaServer-windows64.zip"; + "i686-windows" = "OoklaServer-windows32.zip"; + # OoklaServer-linux64-deb9.zip + # OoklaServer-freebsd12_64.zip + # OoklaServer-freebsd13_64.zip + }; +in +stdenv.mkDerivation rec { + version = "2.11.1.2"; + pname = "ooklaserver"; + + src = fetchurl { + url = "https://web.archive.org/web/20240703022648/https://install.speedtest.net/ooklaserver/stable/OoklaServer.tgz"; + hash = "sha256-tctLtTGmrVHs+4pI1PRHrqY+a4ISs6TKvLRKlFdWw88="; + }; + sourceRoot = "."; + + dontConfigure = true; + dontBuild = true; + + nativeBuildInputs = [ unzip ]; + + installPhase = '' + runHook preInstall + unzip ${filenameMapping.${stdenv.system}} + install -Dm555 OoklaServer${stdenv.hostPlatform.extensions.executable} "$out/bin/OoklaServer" + install -Dm444 OoklaServer.properties.default "$out/etc/OoklaServer.properties.default" + runHook postInstall + ''; + + meta = { + description = "Ookla TCP based server daemon that provides standalone testing"; + homepage = "https://www.speedtest.net"; + changelog = "https://support.ookla.com/hc/en-us/articles/234578608-Speedtest-Server-Release-Notes"; + sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ]; + license = lib.licenses.unfree; + maintainers = with lib.maintainers; [ neverbehave ]; + platforms = builtins.attrNames filenameMapping; + mainProgram = "OoklaServer"; + }; +}