depot/pkgs/by-name/ms/msedgedriver/package.nix
Luke Granger-Brown 57725ef3ec Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce
git-subtree-dir: third_party/nixpkgs
git-subtree-split: 76612b17c0ce71689921ca12d9ffdc9c23ce40b2
2024-11-10 23:59:47 +00:00

84 lines
2.2 KiB
Nix

{
autoPatchelfHook,
fetchzip,
glib,
lib,
libxcb,
nspr,
nss,
stdenvNoCC,
}:
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "msedgedriver";
# finding a version that has all 4 builds is a pain
# https://msedgewebdriverstorage.z22.web.core.windows.net/?form=MA13LH
version = "130.0.2849.1";
src =
let
inherit (stdenvNoCC.hostPlatform) system;
selectSystem = attrs: attrs.${system} or (throw "Unsupported system: ${system}");
suffix = selectSystem {
x86_64-linux = "linux64";
aarch64-linux = "arm64";
x86_64-darwin = "mac64";
aarch64-darwin = "mac64_m1";
};
hash = selectSystem {
x86_64-linux = "sha256-U6YGD2PAhVUa7f+R5pmKLazGLOBbf3bRqzlwIJewA+w=";
aarch64-linux = "sha256-QJ1jRw8kkWbT8US5qI8DMZI/7Q8yJWpFXrfzGdxDWKE=";
x86_64-darwin = "sha256-Ejcv1DtuEiLJvTsv48AwoCQlFO3xM9PkM3HvZG65AC4=";
aarch64-darwin = "sha256-ykn4bYREE6xmJY02WiCRGsGnyWjnmnZM8FemK4XZqhc=";
};
in
fetchzip {
url = "https://msedgedriver.azureedge.net/${finalAttrs.version}/edgedriver_${suffix}.zip";
inherit hash;
stripRoot = false;
};
buildInputs = [
glib
libxcb
nspr
nss
];
nativeBuildInputs = lib.optionals (!stdenvNoCC.hostPlatform.isDarwin) [ autoPatchelfHook ];
installPhase =
if stdenvNoCC.hostPlatform.isDarwin then
''
runHook preInstall
mkdir -p $out/{Applications/msedgedriver,bin}
cp -R . $out/Applications/msedgedriver
runHook postInstall
''
else
''
runHook preInstall
install -m777 -D "msedgedriver" $out/bin/msedgedriver
runHook postInstall
'';
meta = {
homepage = "https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver";
description = "WebDriver implementation that controls an Edge browser running on the local machine";
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
license = lib.licenses.unfree;
maintainers = with lib.maintainers; [ cholli ];
platforms = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
mainProgram = "msedgedriver";
};
})