11 , azure-static-sites-client
12 # "latest", "stable" or "backup"
13 , versionFlavor ? "stable"
16 versions = lib.importJSON ./versions.json;
17 flavor = with lib; head (filter (x: x.version == versionFlavor) versions);
18 fetchBinary = runtimeId: fetchurl {
19 url = flavor.files.${runtimeId}.url;
20 sha256 = flavor.files.${runtimeId}.sha;
23 "x86_64-linux" = fetchBinary "linux-x64";
24 "x86_64-darwin" = fetchBinary "osx-x64";
28 pname = "StaticSitesClient-${versionFlavor}";
29 version = flavor.buildId;
31 src = sources.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
53 install -m755 "$src" -D "$out/bin/StaticSitesClient"
55 for icu_lib in 'icui18n' 'icuuc' 'icudata'; do
56 patchelf --add-needed "lib''${icu_lib}.so.${with lib; head (splitVersion (getVersion icu70.name))}" "$out/bin/StaticSitesClient"
59 patchelf --add-needed 'libgssapi_krb5.so' \
60 --add-needed 'liblttng-ust.so' \
61 --add-needed 'libssl.so.3' \
62 "$out/bin/StaticSitesClient"
67 # Stripping kills the binary
70 # Just make sure the binary executes successfully
71 doInstallCheck = true;
72 installCheckPhase = ''
73 runHook preInstallCheck
75 $out/bin/StaticSitesClient version
77 runHook postInstallCheck
81 # Create tests for all flavors
82 tests = with lib; genAttrs (map (x: x.version) versions) (versionFlavor:
83 azure-static-sites-client.override { inherit versionFlavor; }
85 updateScript = ./update.sh;
89 description = "Azure static sites client";
90 homepage = "https://github.com/Azure/static-web-apps-cli";
91 sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
92 license = licenses.unfree;
93 mainProgram = "StaticSitesClient";
94 maintainers = with maintainers; [ veehaitch ];
95 platforms = [ "x86_64-linux" ];