diff options
author | Alyssa Ross <hi@alyssa.is> | 2019-01-07 02:18:36 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2019-01-07 02:18:47 +0000 |
commit | 36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2 (patch) | |
tree | b3faaf573407b32aa645237a4d16b82778a39a92 /nixpkgs/pkgs/development/tools/phantomjs | |
parent | 4e31070265257dc67d120c27e0f75c2344fdfa9a (diff) | |
parent | abf060725d7614bd3b9f96764262dfbc2f9c2199 (diff) | |
download | nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.gz nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.bz2 nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.lz nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.xz nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.zst nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.zip |
Add 'nixpkgs/' from commit 'abf060725d7614bd3b9f96764262dfbc2f9c2199'
git-subtree-dir: nixpkgs git-subtree-mainline: 4e31070265257dc67d120c27e0f75c2344fdfa9a git-subtree-split: abf060725d7614bd3b9f96764262dfbc2f9c2199
Diffstat (limited to 'nixpkgs/pkgs/development/tools/phantomjs')
-rw-r--r-- | nixpkgs/pkgs/development/tools/phantomjs/default.nix | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/tools/phantomjs/default.nix b/nixpkgs/pkgs/development/tools/phantomjs/default.nix new file mode 100644 index 000000000000..43fdeff9090b --- /dev/null +++ b/nixpkgs/pkgs/development/tools/phantomjs/default.nix @@ -0,0 +1,70 @@ +{ stdenv, lib, fetchurl, freetype, fontconfig, openssl, unzip }: + +let + platforms = [ "i686-linux" "x86_64-linux" "x86_64-darwin" ]; +in + +stdenv.mkDerivation rec { + name = "phantomjs-1.9.8"; + + # I chose to use the binary build for now. + # The source version is quite nasty to compile + # because it has bundled a lot of external libraries (like QT and Webkit) + # and no easy/nice way to use the system versions of these + + src = if stdenv.hostPlatform.system == "i686-linux" then + fetchurl { + url = "https://bitbucket.org/ariya/phantomjs/downloads/${name}-linux-i686.tar.bz2"; + sha256 = "11fzmssz9pqf3arh4f36w06sl2nyz8l9h8iyxyd7w5aqnq5la0j1"; + } + else + if stdenv.hostPlatform.system == "x86_64-linux" then + fetchurl { + url = "https://bitbucket.org/ariya/phantomjs/downloads/${name}-linux-x86_64.tar.bz2"; + sha256 = "0fhnqxxsxhy125fmif1lwgnlhfx908spy7fx9mng4w72320n5nd1"; + } + else # x86_64-darwin + fetchurl { + url = "https://bitbucket.org/ariya/phantomjs/downloads/${name}-macosx.zip"; + sha256 = "0j0aq8dgzmb210xdrh0v3d4nblskl3zsckl8bzf1a603wcx085cg"; + }; + + buildInputs = lib.optional stdenv.isDarwin unzip; + + buildPhase = lib.optionalString (!stdenv.isDarwin) '' + patchelf \ + --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ + --set-rpath "${stdenv.lib.makeLibraryPath [ freetype fontconfig stdenv.cc.cc stdenv.cc.cc openssl ]}" \ + bin/phantomjs + ''; + + dontPatchELF = true; + dontStrip = true; + + installPhase = '' + mkdir -p $out/share/doc/phantomjs + cp -a bin $out + cp -a ChangeLog examples LICENSE.BSD README.md third-party.txt $out/share/doc/phantomjs + ''; + + meta = { + description = "Headless WebKit with JavaScript API"; + longDescription = '' + PhantomJS is a headless WebKit with JavaScript API. + It has fast and native support for various web standards: + DOM handling, CSS selector, JSON, Canvas, and SVG. + + PhantomJS is an optimal solution for: + - Headless Website Testing + - Screen Capture + - Page Automation + - Network Monitoring + ''; + + homepage = http://phantomjs.org/; + license = lib.licenses.bsd3; + + maintainers = [ lib.maintainers.bluescreen303 ]; + inherit platforms; + }; +} |