systemd: nixpkgs-fmt

This was recently introduced, and apparently not nixpkgs-fmt'ed.

While there's no global consensus on nixpkgs-fmt'ing everything,
indenting this by 2 more spaces won't hurt.
This commit is contained in:
Florian Klink 2021-02-03 18:54:07 +01:00
parent 49cb525712
commit f61a3bf8e8

View File

@ -160,8 +160,8 @@ stdenv.mkDerivation {
--replace \
"find_program('objcopy'" \
"find_program('${stdenv.cc.bintools.targetPrefix}objcopy'"
'' + (let
'' + (
let
# The folllowing dlopen patches ensure that all the features that are
# implemented via dlopen(3) are available (or explicitly deactivated) by
# pointing dlopen to the absolute store path instead of relying on the
@ -215,9 +215,11 @@ stdenv.mkDerivation {
{ name = "libpcre2-8.so.0"; pkg = pcre2; }
];
patchDlOpen = dl: let
patchDlOpen = dl:
let
library = "${lib.makeLibraryPath [ dl.pkg ]}/${dl.name}";
in if dl.pkg == null then ''
in
if dl.pkg == null then ''
# remove the dependency on the library by replacing it with an invalid path
for file in $(grep -lr 'dlopen("${dl.name}"' src); do
echo "patching dlopen(\"${dl.name}\", ) in $file to an invalid store path ("/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-not-implemented/${dl.name}")"
@ -235,8 +237,10 @@ stdenv.mkDerivation {
substituteInPlace "$file" --replace 'dlopen("${dl.name}"' 'dlopen("${library}"'
done
'';
in # patch all the dlopen calls to contain absolute paths to the libraries
lib.concatMapStringsSep "\n" patchDlOpen dlopenLibs)
in
# patch all the dlopen calls to contain absolute paths to the libraries
lib.concatMapStringsSep "\n" patchDlOpen dlopenLibs
)
# finally ensure that there are no left-over dlopen calls that we didn't handle
+ ''
if grep -qr 'dlopen("[^/]' src; then