From 9c529749fc00729a987e9724cf157fbe76d34d78 Mon Sep 17 00:00:00 2001 From: Daniel Kempkens Date: Tue, 24 May 2022 10:14:27 +0200 Subject: [PATCH] Add phantomjs --- README.md | 1 + overlay.nix | 1 + packages.nix | 1 + packages/phantomjs.nix | 36 ++++++++++++++++++++++++++++++++++++ 4 files changed, 39 insertions(+) create mode 100644 packages/phantomjs.nix diff --git a/README.md b/README.md index 27e9c97..4fa85cd 100644 --- a/README.md +++ b/README.md @@ -4,4 +4,5 @@ * [agilebits-op](https://app-updates.agilebits.com/product_history/CLI2) * [cliclick](https://github.com/BlueM/cliclick) +* [phantomjs](https://github.com/ariya/phantomjs) * [proximity-sort](https://github.com/jonhoo/proximity-sort) diff --git a/overlay.nix b/overlay.nix index d248c24..16f21ac 100644 --- a/overlay.nix +++ b/overlay.nix @@ -5,5 +5,6 @@ let custom = super.callPackage ./packages.nix { }; in { inherit (custom) agilebits-op; inherit (custom) cliclick; + inherit (custom) phantomjs; inherit (custom) proximity-sort; } diff --git a/packages.nix b/packages.nix index 56a53c4..775c9f3 100644 --- a/packages.nix +++ b/packages.nix @@ -3,5 +3,6 @@ { agilebits-op = import ./packages/agilebits-op.nix { inherit system lib pkgs; }; cliclick = import ./packages/cliclick.nix { inherit system lib pkgs; }; + phantomjs = import ./packages/phantomjs.nix { inherit system lib pkgs; }; proximity-sort = import ./packages/proximity-sort.nix { inherit system lib pkgs; }; } diff --git a/packages/phantomjs.nix b/packages/phantomjs.nix new file mode 100644 index 0000000..618ebbe --- /dev/null +++ b/packages/phantomjs.nix @@ -0,0 +1,36 @@ +{ system, lib, pkgs }: + +pkgs.stdenv.mkDerivation rec { + pname = "phantomjs"; + version = "2.1.1"; + + src = pkgs.fetchurl { + url = "https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-${version}-macosx.zip"; + sha256 = "U4z0iCGasn4wnq/GKeK87pl2mQ/pCx7DNPVBd5FQ+ME="; + }; + + buildInputs = with pkgs; [ unzip ]; + + unpackPhase = '' + unzip $src + ''; + + dontStrip = true; + + installPhase = '' + install -D phantomjs-${version}-macosx/bin/phantomjs $out/bin/phantomjs + ''; + + doInstallCheck = true; + + installCheckPhase = '' + $out/bin/phantomjs --version + ''; + + meta = with lib; { + description = "Scriptable Headless WebKit"; + homepage = "https://github.com/ariya/phantomjs"; + license = licenses.bsd3; + platforms = [ "x86_64-darwin" ]; + }; +}