about summary refs log tree commit diff
path: root/nixpkgs/pkgs/servers/http/apache-modules/mod_python
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/servers/http/apache-modules/mod_python')
-rw-r--r--nixpkgs/pkgs/servers/http/apache-modules/mod_python/default.nix33
-rw-r--r--nixpkgs/pkgs/servers/http/apache-modules/mod_python/install.patch12
2 files changed, 45 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/servers/http/apache-modules/mod_python/default.nix b/nixpkgs/pkgs/servers/http/apache-modules/mod_python/default.nix
new file mode 100644
index 000000000000..f947bf535cc9
--- /dev/null
+++ b/nixpkgs/pkgs/servers/http/apache-modules/mod_python/default.nix
@@ -0,0 +1,33 @@
+{ stdenv, fetchurl, apacheHttpd, python2 }:
+
+stdenv.mkDerivation rec {
+  name = "mod_python-3.5.0";
+
+  src = fetchurl {
+    url = "http://dist.modpython.org/dist/${name}.tgz";
+    sha256 = "146apll3yfqk05s8fkf4acmxzqncl08bgn4rv0c1rd4qxmc91w0f";
+  };
+
+  patches = [ ./install.patch ];
+
+  postPatch = ''
+    substituteInPlace dist/version.sh \
+        --replace 'GIT=`git describe --always`' "" \
+        --replace '-$GIT' ""
+  '';
+
+  preInstall = ''
+    installFlags="LIBEXECDIR=$out/modules $installFlags"
+    mkdir -p $out/modules $out/bin
+  '';
+
+  passthru = { inherit apacheHttpd; };
+
+  buildInputs = [ apacheHttpd python2 ];
+
+  meta = {
+    homepage = http://modpython.org/;
+    description = "An Apache module that embeds the Python interpreter within the server";
+    platforms = stdenv.lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/servers/http/apache-modules/mod_python/install.patch b/nixpkgs/pkgs/servers/http/apache-modules/mod_python/install.patch
new file mode 100644
index 000000000000..29667e11ed8e
--- /dev/null
+++ b/nixpkgs/pkgs/servers/http/apache-modules/mod_python/install.patch
@@ -0,0 +1,12 @@
+diff -ru -x '*~' mod_python-3.5.0-orig/dist/Makefile.in mod_python-3.5.0/dist/Makefile.in
+--- mod_python-3.5.0-orig/dist/Makefile.in	2013-11-12 04:21:34.000000000 +0100
++++ mod_python-3.5.0/dist/Makefile.in	2014-11-07 11:28:24.466377733 +0100
+@@ -34,7 +34,7 @@
+ install_py_lib: mod_python src
+ 	@cd src; $(MAKE) psp_parser.c
+ 	if test -z "$(DESTDIR)" ; then \
+-		$(PYTHON_BIN) setup.py install --optimize 2 --force ; \
++		$(PYTHON_BIN) setup.py install --optimize 2 --force --prefix $(out) ; \
+ 	else \
+ 		$(PYTHON_BIN) setup.py install --optimize 2 --force --root $(DESTDIR) ; \
+ 	fi