@@ -0,0 +1,33 @@
1+{ stdenv, fetchurl, python, utillinux, openssl, http-parser, zlib, nightly ? false }:
2+
3+let
4+ version = if nightly then "1.2.1-nightly20150213f0296933f8" else "1.2.0";
5+ inherit (stdenv.lib) optional maintainers licenses platforms;
6+in stdenv.mkDerivation {
7+ name = "iojs-${version}";
8+
9+ src = fetchurl {
10+ url = if nightly
11+ then "https://iojs.org/download/nightly/v${version}/iojs-v${version}.tar.gz"
12+ else "https://iojs.org/dist/v${version}/iojs-v${version}.tar.gz";
13+ sha256 = if nightly
14+ then "0v9njaggddi128v58rd34qknph8pn9c653gqd4y29l1mwjvqg62s"
15+ else "17axqswpl252gliak1wjc2l9jk6n5jqdfa9f1vv7x9acj776yrik";
16+ };
17+
18+ prePatch = ''
19+ sed -e 's|^#!/usr/bin/env python$|#!${python}/bin/python|g' -i configure
20+ '';
21+
22+ configureFlags = [ "--shared-openssl" "--shared-http-parser" "--shared-zlib" ];
23+
24+ buildInputs = [ python openssl http-parser zlib ] ++ (optional stdenv.isLinux utillinux);
25+ setupHook = ../nodejs/setup-hook.sh;
26+
27+ meta = {
28+ description = "A friendly fork of Node.js with an open governance model";
29+ homepage = https://iojs.org/;
30+ license = licenses.mit;
31+ platforms = platforms.linux;
32+ };
33+}