depot/third_party/nixpkgs/pkgs/by-name/oo/ooklaserver/package.nix
Default email f34ce41345 Project import generated by Copybara.
GitOrigin-RevId: b73c2221a46c13557b1b3be9c2070cc42cf01eb3
2024-07-27 08:49:29 +02:00

53 lines
1.8 KiB
Nix

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