about summary refs log tree commit diff
path: root/nixpkgs/pkgs/servers/http/apache-modules/mod_python/default.nix
blob: 1b8ef94fae95c18b847749a14613bbf4cba72a4a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{ lib, stdenv, fetchurl, apacheHttpd, python2, libintl }:

stdenv.mkDerivation rec {
  pname = "mod_python";
  version = "3.5.0";

  src = fetchurl {
    url = "http://dist.modpython.org/dist/${pname}-${version}.tgz";
    sha256 = "146apll3yfqk05s8fkf4acmxzqncl08bgn4rv0c1rd4qxmc91w0f";
  };

  patches = [ ./install.patch ];

  postPatch = ''
    substituteInPlace dist/version.sh \
        --replace 'GIT=`git describe --always`' "" \
        --replace '-$GIT' ""
  '';

  installFlags = [ "LIBEXECDIR=${placeholder "out"}/modules" ];

  preInstall = ''
    mkdir -p $out/modules $out/bin
  '';

  passthru = { inherit apacheHttpd; };

  buildInputs = [ apacheHttpd python2 ]
    ++ lib.optional stdenv.isDarwin libintl;

  meta = {
    homepage = "http://modpython.org/";
    description = "An Apache module that embeds the Python interpreter within the server";
    platforms = lib.platforms.unix;
  };
}