mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-09-28 10:50:15 +00:00
msedgedriver: refactor, add darwin support
This commit is contained in:
@@ -14,39 +14,44 @@ stdenvNoCC.mkDerivation (finalAttrs: {
|
||||
pname = "msedgedriver";
|
||||
version = "154.0.4258.37";
|
||||
|
||||
src = fetchzip {
|
||||
url = "https://msedgedriver.microsoft.com/${finalAttrs.version}/edgedriver_linux64.zip";
|
||||
hash = "sha256-XbOQl9FyckF3Qybb+40474ImJDKahBkekPoydf/TxV0=";
|
||||
stripRoot = false;
|
||||
};
|
||||
src =
|
||||
let
|
||||
driverArch =
|
||||
{
|
||||
aarch64-darwin = "mac64_m1";
|
||||
x86_64-linux = "linux64";
|
||||
}
|
||||
.${stdenvNoCC.hostPlatform.system};
|
||||
in
|
||||
fetchzip {
|
||||
url = "https://msedgedriver.microsoft.com/${finalAttrs.version}/edgedriver_${driverArch}.zip";
|
||||
hash =
|
||||
{
|
||||
mac64_m1 = "sha256-6nwe/vRPh5MkQLTiZNXepfFsLtILwoK925mgLCUUVNg=";
|
||||
linux64 = "sha256-XbOQl9FyckF3Qybb+40474ImJDKahBkekPoydf/TxV0=";
|
||||
}
|
||||
.${driverArch};
|
||||
stripRoot = false;
|
||||
};
|
||||
|
||||
buildInputs = [
|
||||
buildInputs = lib.optionals stdenvNoCC.hostPlatform.isLinux [
|
||||
glib
|
||||
libxcb
|
||||
nspr
|
||||
nss
|
||||
];
|
||||
|
||||
nativeBuildInputs = [ autoPatchelfHook ];
|
||||
nativeBuildInputs = lib.optionals stdenvNoCC.hostPlatform.isLinux [
|
||||
autoPatchelfHook
|
||||
];
|
||||
|
||||
installPhase =
|
||||
if stdenvNoCC.hostPlatform.isDarwin then
|
||||
''
|
||||
runHook preInstall
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p $out/{Applications/msedgedriver,bin}
|
||||
cp -R . $out/Applications/msedgedriver
|
||||
install -D msedgedriver $out/bin/msedgedriver
|
||||
|
||||
runHook postInstall
|
||||
''
|
||||
else
|
||||
''
|
||||
runHook preInstall
|
||||
|
||||
install -m777 -D "msedgedriver" $out/bin/msedgedriver
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
meta = {
|
||||
homepage = "https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver";
|
||||
@@ -54,7 +59,7 @@ stdenvNoCC.mkDerivation (finalAttrs: {
|
||||
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
|
||||
license = lib.licenses.unfree;
|
||||
maintainers = microsoft-edge.meta.maintainers;
|
||||
platforms = [
|
||||
platforms = lib.platforms.darwin ++ [
|
||||
"x86_64-linux"
|
||||
];
|
||||
mainProgram = "msedgedriver";
|
||||
|
||||
Reference in New Issue
Block a user