From 3b46176295ebb11c793ee93784fb635332e4ca4e Mon Sep 17 00:00:00 2001 From: zi3m5f <113244000+zi3m5f@users.noreply.github.com> Date: Fri, 1 Nov 2024 22:17:47 +0100 Subject: [PATCH 1/2] apacheHttpdPackages.mod_python: nixfmt --- .../http/apache-modules/mod_python/default.nix | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/pkgs/servers/http/apache-modules/mod_python/default.nix b/pkgs/servers/http/apache-modules/mod_python/default.nix index bebd1278acc2..bcebd835229f 100644 --- a/pkgs/servers/http/apache-modules/mod_python/default.nix +++ b/pkgs/servers/http/apache-modules/mod_python/default.nix @@ -26,12 +26,14 @@ stdenv.mkDerivation rec { "BINDIR=$(out)/bin" ]; - buildInputs = [ - apacheHttpd - python3 - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libintl - ]; + buildInputs = + [ + apacheHttpd + python3 + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libintl + ]; passthru = { inherit apacheHttpd; From cb47906e8529c5144eacbaa25ab5b7962d337499 Mon Sep 17 00:00:00 2001 From: zi3m5f <113244000+zi3m5f@users.noreply.github.com> Date: Fri, 1 Nov 2024 22:31:28 +0100 Subject: [PATCH 2/2] apacheHttpdPackages.mod_python: fix for python3.12 adding distutils, packaging and setuptools to fix: - ModuleNotFoundError: No module named 'distutils' - ModuleNotFoundError: No module named 'packaging' - error: invalid command 'install' and ensureNewerSourcesForZipFilesHook for: - ValueError: ZIP does not support timestamps before 1980 --- .../apache-modules/mod_python/default.nix | 27 ++++++++++++------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/pkgs/servers/http/apache-modules/mod_python/default.nix b/pkgs/servers/http/apache-modules/mod_python/default.nix index bcebd835229f..c45da6cdd48f 100644 --- a/pkgs/servers/http/apache-modules/mod_python/default.nix +++ b/pkgs/servers/http/apache-modules/mod_python/default.nix @@ -1,5 +1,6 @@ { apacheHttpd, + ensureNewerSourcesForZipFilesHook, fetchFromGitHub, lib, libintl, @@ -8,15 +9,15 @@ stdenv, }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "mod_python"; version = "3.5.0.2"; src = fetchFromGitHub { owner = "grisha"; - repo = pname; - rev = "refs/tags/${version}"; - hash = "sha256-EH8wrXqUAOFWyPKfysGeiIezgrVc789RYO4AHeSA6t4="; + repo = "mod_python"; + rev = "refs/tags/${finalAttrs.version}"; + hash = "sha256-++yHNKVe1u3w47DaB0zvYyuTrBcQdmuDm22areAeejs="; }; patches = [ ./install.patch ]; @@ -26,10 +27,18 @@ stdenv.mkDerivation rec { "BINDIR=$(out)/bin" ]; + nativeBuildInputs = [ + ensureNewerSourcesForZipFilesHook + ]; + buildInputs = [ apacheHttpd - python3 + (python3.withPackages (ps: with ps; [ + distutils + packaging + setuptools + ])) ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ libintl @@ -40,12 +49,12 @@ stdenv.mkDerivation rec { updateScript = nix-update-script { }; }; - meta = with lib; { + meta = { homepage = "https://modpython.org/"; - changelog = "https://github.com/grisha/mod_python/blob/${version}/NEWS"; + changelog = "https://github.com/grisha/mod_python/blob/master/NEWS"; description = "Apache module that embeds the Python interpreter within the server"; mainProgram = "mod_python"; - platforms = platforms.unix; + platforms = lib.platforms.unix; maintainers = [ ]; }; -} +})