Merge pull request #329823 from ExpidusOS/fix/pkgsllvm/elfutils
[NixPkgs.git] / pkgs / by-name / oo / ooklaserver / package.nix
blob0f265470b6fdff48f773b74f11c4eef9eb044f8d
1 { lib
2 , stdenv
3 , fetchurl
4 , unzip
5 }:
6 let
7   filenameMapping = {
8     "x86_64-linux" = "OoklaServer-linux-x86_64-static-musl.zip";
9     "aarch64-linux" = "OoklaServer-linux-aarch64-static-musl.zip";
10     # Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit executable x86_64] [arm64]
11     "x86_64-darwin" = "OoklaServer-macosx.zip";
12     "aarch64-darwin" = "OoklaServer-macosx.zip";
13     "x86_64-windows" = "OoklaServer-windows64.zip";
14     "i686-windows" = "OoklaServer-windows32.zip";
15     # OoklaServer-linux64-deb9.zip
16     # OoklaServer-freebsd12_64.zip
17     # OoklaServer-freebsd13_64.zip
18   };
20 stdenv.mkDerivation rec {
21   version = "2.11.1.2";
22   pname = "ooklaserver";
24   src = fetchurl {
25     url = "https://web.archive.org/web/20240703022648/https://install.speedtest.net/ooklaserver/stable/OoklaServer.tgz";
26     hash = "sha256-tctLtTGmrVHs+4pI1PRHrqY+a4ISs6TKvLRKlFdWw88=";
27   };
28   sourceRoot = ".";
30   dontConfigure = true;
31   dontBuild = true;
33   nativeBuildInputs = [ unzip ];
35   installPhase = ''
36     runHook preInstall
37     unzip ${filenameMapping.${stdenv.system}}
38     install -Dm555 OoklaServer${stdenv.hostPlatform.extensions.executable} "$out/bin/OoklaServer"
39     install -Dm444 OoklaServer.properties.default "$out/etc/OoklaServer.properties.default"
40     runHook postInstall
41   '';
43   meta = {
44     description = "Ookla TCP based server daemon that provides standalone testing";
45     homepage = "https://www.speedtest.net";
46     changelog = "https://support.ookla.com/hc/en-us/articles/234578608-Speedtest-Server-Release-Notes";
47     sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
48     license = lib.licenses.unfree;
49     maintainers = with lib.maintainers; [ neverbehave ];
50     platforms = builtins.attrNames filenameMapping;
51     mainProgram = "OoklaServer";
52   };