Merge pull request #173721 from waldheinz/nginx-module-sources

nginx: take care not to pull in module sources as runtime deps
This commit is contained in:
ajs124 2022-05-24 15:40:09 +02:00 committed by GitHub
commit 703280d031
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2,7 +2,7 @@ outer@{ lib, stdenv, fetchurl, fetchpatch, openssl, zlib, pcre, libxml2, libxslt
, nginx-doc
, nixosTests
, substituteAll, gd, geoip, perl
, substituteAll, removeReferencesTo, gd, geoip, perl
, withDebug ? false
, withKTLS ? false
, withStream ? true
@ -22,7 +22,7 @@ outer@{ lib, stdenv, fetchurl, fetchpatch, openssl, zlib, pcre, libxml2, libxslt
, extraPatches ? []
, fixPatch ? p: p
, preConfigure ? ""
, postInstall ? null
, postInstall ? ""
, meta ? null
, nginx-doc ? outer.nginx-doc
, passthru ? { tests = {}; }
@ -158,9 +158,14 @@ stdenv.mkDerivation {
cp -r ${nginx-doc}/* $doc
'';
postInstall = if postInstall != null then postInstall else ''
mv $out/sbin $out/bin
'';
nativeBuildInputs = [ removeReferencesTo ];
disallowedReferences = map (m: m.src) modules;
postInstall =
let
noSourceRefs = lib.concatMapStrings (m: "remove-references-to -t ${m.src} $out/sbin/nginx\n") modules;
in noSourceRefs + postInstall;
passthru = {
modules = modules;