1{
2 apacheHttpd,
3 ensureNewerSourcesForZipFilesHook,
4 fetchFromGitHub,
5 lib,
6 libintl,
7 nix-update-script,
8 python3,
9 stdenv,
10}:
11
12stdenv.mkDerivation (finalAttrs: {
13 pname = "mod_python";
14 version = "3.5.0.2";
15
16 src = fetchFromGitHub {
17 owner = "grisha";
18 repo = "mod_python";
19 rev = "refs/tags/${finalAttrs.version}";
20 hash = "sha256-++yHNKVe1u3w47DaB0zvYyuTrBcQdmuDm22areAeejs=";
21 };
22
23 patches = [ ./install.patch ];
24
25 installFlags = [
26 "LIBEXECDIR=$(out)/modules"
27 "BINDIR=$(out)/bin"
28 ];
29
30 nativeBuildInputs = [
31 ensureNewerSourcesForZipFilesHook
32 ];
33
34 buildInputs =
35 [
36 apacheHttpd
37 (python3.withPackages (ps: with ps; [
38 distutils
39 packaging
40 setuptools
41 ]))
42 ]
43 ++ lib.optionals stdenv.hostPlatform.isDarwin [
44 libintl
45 ];
46
47 passthru = {
48 inherit apacheHttpd;
49 updateScript = nix-update-script { };
50 };
51
52 meta = {
53 homepage = "https://modpython.org/";
54 changelog = "https://github.com/grisha/mod_python/blob/master/NEWS";
55 description = "Apache module that embeds the Python interpreter within the server";
56 mainProgram = "mod_python";
57 platforms = lib.platforms.unix;
58 maintainers = [ ];
59 };
60})