about summary refs log tree commit diff
path: root/pkgs/by-name/ap
diff options
context:
space:
mode:
authorSandro <sandro.jaeckel@gmail.com>2024-03-24 22:12:54 +0100
committerGitHub <noreply@github.com>2024-03-24 22:12:54 +0100
commit03e5c55bdfaa2f7c64b50e4cdb17d524faaf5124 (patch)
treeb9da1e6976581cedbec17ec484ff414be22b5db4 /pkgs/by-name/ap
parent1740a345840b47caf4ac2ad19630411785a4e769 (diff)
parent11a38e6cc597de46c55b42aac734e127148f9524 (diff)
Merge pull request #286487 from NyCodeGHG/nixpkgs-appium-inspector
appium-inspector: init at 2024.3.1
Diffstat (limited to 'pkgs/by-name/ap')
-rw-r--r--pkgs/by-name/ap/appium-inspector/Fix-Open-File.patch13
-rw-r--r--pkgs/by-name/ap/appium-inspector/package.nix62
2 files changed, 75 insertions, 0 deletions
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 0000000000000..07654292c45bf
--- /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 0000000000000..7cdfca26459c9
--- /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;
+  };
+}