3
0
Fork 0
forked from mirrors/nixpkgs

nginx: take care not to pull in module sources as runtime deps

Nginx likes to print the "configured with ..." stuff on startup,
containing the full configure command line. When built with
modules (which it seems to be by default), this causes the
module sources to appear as runtime dependencies. So just use
the remove-references-to script to patch those out.

For a default installation, the rtmp, dav and moreheaders
module sources are gone, for special cases potentially more.
This commit is contained in:
Matthias Treydte 2022-05-20 09:23:31 +02:00
parent a08963ed5a
commit 2fd6e6e264

View file

@ -2,7 +2,7 @@ outer@{ lib, stdenv, fetchurl, fetchpatch, openssl, zlib, pcre, libxml2, libxslt
, nginx-doc , nginx-doc
, nixosTests , nixosTests
, substituteAll, gd, geoip, perl , substituteAll, removeReferencesTo, gd, geoip, perl
, withDebug ? false , withDebug ? false
, withKTLS ? false , withKTLS ? false
, withStream ? true , withStream ? true
@ -158,9 +158,16 @@ stdenv.mkDerivation {
cp -r ${nginx-doc}/* $doc cp -r ${nginx-doc}/* $doc
''; '';
postInstall = if postInstall != null then postInstall else '' nativeBuildInputs = [ removeReferencesTo ];
mv $out/sbin $out/bin
''; 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 + (if postInstall != null then postInstall else ''
mv $out/sbin $out/bin
'');
passthru = { passthru = {
modules = modules; modules = modules;