add phantomjs to darwin platform

This commit is contained in:
Rok Garbas 2014-02-11 23:46:46 +00:00
parent 3f70dabad3
commit 671a369634
2 changed files with 22 additions and 10 deletions

View file

@ -1,6 +1,6 @@
{ stdenv, fetchurl, freetype, fontconfig, openssl }: { stdenv, fetchurl, freetype, fontconfig, openssl, unzip }:
assert stdenv.lib.elem stdenv.system [ "i686-linux" "x86_64-linux" ]; assert stdenv.lib.elem stdenv.system [ "i686-linux" "x86_64-linux" "x86_64-darwin" ];
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "phantomjs-1.9.7"; name = "phantomjs-1.9.7";
@ -15,13 +15,21 @@ stdenv.mkDerivation rec {
url = "https://bitbucket.org/ariya/phantomjs/downloads/${name}-linux-i686.tar.bz2"; url = "https://bitbucket.org/ariya/phantomjs/downloads/${name}-linux-i686.tar.bz2";
sha256 = "1ffd5544wnkww5cgwsims4bk4bymvm6pm19p32nbhwabxqhbnj9a"; sha256 = "1ffd5544wnkww5cgwsims4bk4bymvm6pm19p32nbhwabxqhbnj9a";
} }
else # x86_64-linux else
fetchurl { if stdenv.system == "x86_64-linux" then
url = "https://bitbucket.org/ariya/phantomjs/downloads/${name}-linux-x86_64.tar.bz2"; fetchurl {
sha256 = "06mhvj8rx298j0mrijw48zfm28hqgy81vdr1vv0jp4ncxbvijfs7"; url = "https://bitbucket.org/ariya/phantomjs/downloads/${name}-linux-x86_64.tar.bz2";
}; sha256 = "06mhvj8rx298j0mrijw48zfm28hqgy81vdr1vv0jp4ncxbvijfs7";
}
else # x86_64-darwin
fetchurl {
url = "https://bitbucket.org/ariya/phantomjs/downloads/${name}-macosx.zip";
sha256 = "0vsagvx181gnypi6kgmxp4br6hnvd81vyy3cbz5pxccdys7iywvj";
};
buildPhase = '' buildInputs = if stdenv.isDarwin then [ unzip ] else [];
buildPhase = if stdenv.isDarwin then "" else ''
patchelf \ patchelf \
--set-interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \ --set-interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
--set-rpath "${freetype}/lib:${fontconfig}/lib:${stdenv.gcc.gcc}/lib64:${stdenv.gcc.gcc}/lib:${openssl}/lib" \ --set-rpath "${freetype}/lib:${fontconfig}/lib:${stdenv.gcc.gcc}/lib64:${stdenv.gcc.gcc}/lib:${openssl}/lib" \
@ -55,6 +63,6 @@ stdenv.mkDerivation rec {
license = stdenv.lib.licenses.bsd3; license = stdenv.lib.licenses.bsd3;
maintainers = [ stdenv.lib.maintainers.bluescreen303 ]; maintainers = [ stdenv.lib.maintainers.bluescreen303 ];
platforms = ["i686-linux" "x86_64-linux" ]; platforms = ["i686-linux" "x86_64-linux" "x86_64-darwin" ];
}; };
} }

View file

@ -3685,7 +3685,11 @@ let
peg = callPackage ../development/tools/parsing/peg { }; peg = callPackage ../development/tools/parsing/peg { };
phantomjs = callPackage ../development/tools/phantomjs { }; phantomjs = callPackage ../development/tools/phantomjs {
stdenv = if stdenv.isDarwin
then overrideGCC stdenv gccApple
else stdenv;
};
pmccabe = callPackage ../development/tools/misc/pmccabe { }; pmccabe = callPackage ../development/tools/misc/pmccabe { };