summary refs log tree commit diff
path: root/pkgs/servers/nosql/mongodb/default.nix
diff options
context:
space:
mode:
authorPeter Simons <simons@cryp.to>2012-01-18 20:32:41 +0000
committerPeter Simons <simons@cryp.to>2012-01-18 20:32:41 +0000
commit89857081311a65d0714aa84c897f8285479adc71 (patch)
tree633518e67a1e1c29394d7be7ab4a091b63d6070c /pkgs/servers/nosql/mongodb/default.nix
parente58052514b3c61aa1fd26d4d3f94fe7af281d375 (diff)
downloadnixpkgs-89857081311a65d0714aa84c897f8285479adc71.tar
nixpkgs-89857081311a65d0714aa84c897f8285479adc71.tar.gz
nixpkgs-89857081311a65d0714aa84c897f8285479adc71.tar.bz2
nixpkgs-89857081311a65d0714aa84c897f8285479adc71.tar.lz
nixpkgs-89857081311a65d0714aa84c897f8285479adc71.tar.xz
nixpkgs-89857081311a65d0714aa84c897f8285479adc71.tar.zst
nixpkgs-89857081311a65d0714aa84c897f8285479adc71.zip
mongodb: new package (nosql database) - nixos integration available
svn path=/nixpkgs/trunk/; revision=31655
Diffstat (limited to 'pkgs/servers/nosql/mongodb/default.nix')
-rw-r--r--pkgs/servers/nosql/mongodb/default.nix44
1 files changed, 44 insertions, 0 deletions
diff --git a/pkgs/servers/nosql/mongodb/default.nix b/pkgs/servers/nosql/mongodb/default.nix
new file mode 100644
index 00000000000..29261455c8d
--- /dev/null
+++ b/pkgs/servers/nosql/mongodb/default.nix
@@ -0,0 +1,44 @@
+{ stdenv, fetchurl, scons, which, boost, gnutar, v8 ? null, useV8 ? false}:
+
+assert useV8 -> v8 != null;
+
+stdenv.mkDerivation rec {
+  name = "mongodb-2.0.2";
+
+  src = fetchurl {
+    url = "http://downloads.mongodb.org/src/mongodb-src-r2.0.2.tar.gz";
+    sha256 = "13xcwaz9rqn0xgh5jijpqxhz1q2qjl8x18bymbl7092k6p29i974";
+  };
+
+  buildInputs = [scons which boost] ++ stdenv.lib.optional useV8 v8;
+
+  enableParallelBuilding = true;
+
+  patchPhase = ''
+    substituteInPlace SConstruct --replace "Environment( MSVS_ARCH=msarch , tools = [\"default\", \"gch\"], toolpath = '.' )" "Environment( MSVS_ARCH=msarch , tools = [\"default\", \"gch\"], toolpath = '.', ENV = os.environ )"
+    substituteInPlace SConstruct --replace "../v8" "${v8}"
+    substituteInPlace SConstruct --replace "LIBPATH=[\"${v8}/\"]" "LIBPATH=[\"${v8}/lib\"]"
+  '';
+
+  buildPhase = ''
+    export TERM=""
+    scons all --cc=`which gcc` --cxx=`which g++` --libpath=${boost}/lib --cpppath=${boost}/include ${if useV8 then "--usev8" else ""}
+  '';
+
+  installPhase = ''
+    scons install --cc=`which gcc` --cxx=`which g++` --libpath=${boost}/lib --cpppath=${boost}/include --full --prefix=$out
+    if [ -d $out/lib64 ]; then
+      mv $out/lib64 $out/lib
+    fi
+  '';
+
+  meta = {
+    description = "a scalable, high-performance, open source NoSQL database";
+    homepage = http://www.mongodb.org;
+    license = "AGPLv3";
+
+    maintainers = [ stdenv.lib.maintainers.bluescreen303 ];
+    platforms = stdenv.lib.platforms.all;
+  };
+}
+