meteor: enable on darwin

+49 -38
+49 -38
pkgs/servers/meteor/default.nix
··· 2 3 let 4 version = "1.12"; 5 in 6 7 stdenv.mkDerivation { 8 inherit version; 9 pname = "meteor"; 10 - src = fetchurl { 11 - url = "https://static-meteor.netdna-ssl.com/packages-bootstrap/${version}/meteor-bootstrap-os.linux.x86_64.tar.gz"; 12 - sha256 = "0l3zc76djzypvc0dm5ikv5ybb6574qd6kdbbkarzc2dxx64wkyvb"; 13 - }; 14 15 #dontStrip = true; 16 ··· 30 toolsDir=$(dirname $(find $out/packages -print | grep "meteor-tool/.*/tools/index.js$")) 31 ln -s $toolsDir $out/tools 32 33 - # Patch Meteor to dynamically fixup shebangs and ELF metadata where 34 - # necessary. 35 - pushd $out 36 - patch -p1 < ${./main.patch} 37 - popd 38 - substituteInPlace $out/tools/cli/main.js \ 39 - --replace "@INTERPRETER@" "$(cat $NIX_CC/nix-support/dynamic-linker)" \ 40 - --replace "@RPATH@" "${lib.makeLibraryPath [ stdenv.cc.cc zlib ]}" \ 41 - --replace "@PATCHELF@" "${patchelf}/bin/patchelf" 42 - 43 - # Patch node. 44 - node=$devBundle/bin/node 45 - patchelf \ 46 - --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \ 47 - --set-rpath "$(patchelf --print-rpath $node):${stdenv.cc.cc.lib}/lib" \ 48 - $node 49 - 50 - # Patch mongo. 51 - for p in $devBundle/mongodb/bin/mongo{,d}; do 52 - patchelf \ 53 - --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \ 54 - --set-rpath "$(patchelf --print-rpath $p):${lib.makeLibraryPath [ stdenv.cc.cc zlib ]}" \ 55 - $p 56 - done 57 - 58 - # Patch node dlls. 59 - for p in $(find $out/packages -name '*.node'); do 60 - patchelf \ 61 - --set-rpath "$(patchelf --print-rpath $p):${stdenv.cc.cc.lib}/lib" \ 62 - $p || true 63 - done 64 - 65 # Meteor needs an initial package-metadata in $HOME/.meteor, 66 # otherwise it fails spectacularly. 67 mkdir -p $out/bin ··· 75 chmod +w "\$HOME/.meteor/package-metadata/v2.0.1/packages.data.db" 76 fi 77 78 - $node \''${TOOL_NODE_FLAGS} $out/tools/index.js "\$@" 79 EOF 80 chmod +x $out/bin/meteor 81 ''; 82 83 meta = with lib; { 84 description = "Complete open source platform for building web and mobile apps in pure JavaScript"; 85 homepage = "http://www.meteor.com"; 86 license = licenses.mit; 87 - platforms = [ "x86_64-linux" ]; 88 maintainers = with maintainers; [ cstrahan ]; 89 }; 90 }
··· 2 3 let 4 version = "1.12"; 5 + 6 + inherit (stdenv.hostPlatform) system; 7 + 8 + srcs = { 9 + x86_64-linux = fetchurl { 10 + url = "https://static-meteor.netdna-ssl.com/packages-bootstrap/${version}/meteor-bootstrap-os.linux.x86_64.tar.gz"; 11 + sha256 = "0l3zc76djzypvc0dm5ikv5ybb6574qd6kdbbkarzc2dxx64wkyvb"; 12 + }; 13 + x86_64-darwin = fetchurl { 14 + url = "https://static-meteor.netdna-ssl.com/packages-bootstrap/${version}/meteor-bootstrap-os.osx.x86_64.tar.gz"; 15 + sha256 = "01gn3m6qacp3ibvp0rcvm2pq7fi1xds02ws0irypldh7vz3930jl"; 16 + }; 17 + }; 18 in 19 20 stdenv.mkDerivation { 21 inherit version; 22 pname = "meteor"; 23 + src = srcs.${system}; 24 25 #dontStrip = true; 26 ··· 40 toolsDir=$(dirname $(find $out/packages -print | grep "meteor-tool/.*/tools/index.js$")) 41 ln -s $toolsDir $out/tools 42 43 # Meteor needs an initial package-metadata in $HOME/.meteor, 44 # otherwise it fails spectacularly. 45 mkdir -p $out/bin ··· 53 chmod +w "\$HOME/.meteor/package-metadata/v2.0.1/packages.data.db" 54 fi 55 56 + $out/dev_bundle/bin/node --no-wasm-code-gc \''${TOOL_NODE_FLAGS} $out/tools/index.js "\$@" 57 EOF 58 chmod +x $out/bin/meteor 59 ''; 60 61 + postFixup = lib.optionalString stdenv.isLinux '' 62 + # Patch Meteor to dynamically fixup shebangs and ELF metadata where 63 + # necessary. 64 + pushd $out 65 + patch -p1 < ${./main.patch} 66 + popd 67 + substituteInPlace $out/tools/cli/main.js \ 68 + --replace "@INTERPRETER@" "$(cat $NIX_CC/nix-support/dynamic-linker)" \ 69 + --replace "@RPATH@" "${lib.makeLibraryPath [ stdenv.cc.cc zlib ]}" \ 70 + --replace "@PATCHELF@" "${patchelf}/bin/patchelf" 71 + 72 + # Patch node. 73 + patchelf \ 74 + --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \ 75 + --set-rpath "$(patchelf --print-rpath $out/dev_bundle/bin/node):${stdenv.cc.cc.lib}/lib" \ 76 + $out/dev_bundle/bin/node 77 + 78 + # Patch mongo. 79 + for p in $out/dev_bundle/mongodb/bin/mongo{,d}; do 80 + patchelf \ 81 + --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \ 82 + --set-rpath "$(patchelf --print-rpath $p):${lib.makeLibraryPath [ stdenv.cc.cc zlib ]}" \ 83 + $p 84 + done 85 + 86 + # Patch node dlls. 87 + for p in $(find $out/packages -name '*.node'); do 88 + patchelf \ 89 + --set-rpath "$(patchelf --print-rpath $p):${stdenv.cc.cc.lib}/lib" \ 90 + $p || true 91 + done 92 + ''; 93 + 94 meta = with lib; { 95 description = "Complete open source platform for building web and mobile apps in pure JavaScript"; 96 homepage = "http://www.meteor.com"; 97 license = licenses.mit; 98 + platforms = builtins.attrNames srcs; 99 maintainers = with maintainers; [ cstrahan ]; 100 }; 101 }