diff --git a/pkgs/by-name/ap/appium-inspector/Fix-Open-File.patch b/pkgs/by-name/ap/appium-inspector/Fix-Open-File.patch new file mode 100644 index 000000000000..07654292c45b --- /dev/null +++ b/pkgs/by-name/ap/appium-inspector/Fix-Open-File.patch @@ -0,0 +1,13 @@ +diff --git a/app/main.js b/app/main.js +index a6607a8..b81c8cb 100644 +--- a/app/main.js ++++ b/app/main.js +@@ -6,7 +6,7 @@ import {setupMainWindow} from './main/windows'; + + const isDev = process.env.NODE_ENV === 'development'; + +-export let openFilePath = getAppiumSessionFilePath(process.argv, app.isPackaged, isDev); ++export let openFilePath = getAppiumSessionFilePath(process.argv, false, isDev); + + app.on('open-file', (event, filePath) => { + openFilePath = filePath; diff --git a/pkgs/by-name/ap/appium-inspector/package.nix b/pkgs/by-name/ap/appium-inspector/package.nix new file mode 100644 index 000000000000..7cdfca26459c --- /dev/null +++ b/pkgs/by-name/ap/appium-inspector/package.nix @@ -0,0 +1,62 @@ +{ fetchFromGitHub +, buildNpmPackage +, makeWrapper +, electron_13 +, copyDesktopItems +, makeDesktopItem +, nix-update-script +, stdenv +, lib +}: +let + electron = electron_13; +in buildNpmPackage rec { + pname = "appium-inspector"; + version = "2024.3.1"; + + patches = [ ./Fix-Open-File.patch ]; + + src = fetchFromGitHub { + owner = "appium"; + repo = "appium-inspector"; + rev = "v${version}"; + hash = "sha256-X384CjAX3glsPpXqc6Rht6OqXB8imclwXv26tYaYfxk="; + }; + + npmDepsHash = "sha256-9/wf/psbn9uZ+9ZYTSV4IKjgprWYaMSYorVgStR9yVU="; + npmFlags = ["--ignore-scripts"]; + + nativeBuildInputs = [ makeWrapper copyDesktopItems ]; + + installPhase = '' + mkdir -p "$out/share/appium-inspector" + + cp -r './node_modules' "$out/share/appium-inspector/node_modules" + cp -r './dist' "$out/share/appium-inspector/" + cp './package.json' "$out/share/appium-inspector/package.json" + + # executable wrapper + makeWrapper '${electron}/bin/electron' "$out/bin/appium-inspector" \ + --add-flags "$out/share/appium-inspector/dist/main.js" \ + --set NODE_ENV production + ''; + + desktopItem = makeDesktopItem { + name = "appium-inspector"; + exec = "appium-inspector %u"; + desktopName = "Appium Inspector"; + comment = meta.description; + categories = [ "Development" ]; + }; + + passthru.updateScript = nix-update-script { }; + + meta = { + description = "A GUI inspector for mobile apps and more, powered by a (separately installed) Appium server"; + homepage = "https://appium.github.io/appium-inspector"; + license = lib.licenses.asl20; + mainProgram = "appium-inspector"; + maintainers = with lib.maintainers; [ marie ]; + inherit (electron.meta) platforms; + }; +}