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.4";
15
16 src = fetchFromGitHub {
17 owner = "grisha";
18 repo = "mod_python";
19 tag = finalAttrs.version;
20 hash = "sha256-bZ0w61+0If70KD3UW24JllY6vD0vQX2C7FssYG1YLPI=";
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 (
38 ps: with ps; [
39 distutils
40 packaging
41 setuptools
42 ]
43 ))
44 ]
45 ++ lib.optionals stdenv.hostPlatform.isDarwin [
46 libintl
47 ];
48
49 passthru = {
50 inherit apacheHttpd;
51 updateScript = nix-update-script { };
52 };
53
54 meta = {
55 homepage = "https://modpython.org/";
56 changelog = "https://github.com/grisha/mod_python/blob/master/NEWS";
57 description = "Apache module that embeds the Python interpreter within the server";
58 mainProgram = "mod_python";
59 platforms = lib.platforms.unix;
60 maintainers = [ ];
61 };
62})