openafs, digitalbitbox: amend hacks of removing $(pwd)

Just like commit 3af97fc9ee
This commit is contained in:
Vladimír Čunát 2023-08-05 18:07:55 +02:00
parent 1f4ccf115c
commit f4cd4143bb
No known key found for this signature in database
GPG Key ID: E747DF1F9575A3AA
2 changed files with 15 additions and 6 deletions

View File

@ -103,15 +103,21 @@ in mkDerivation rec {
cp src/hidapi/libusb/.libs/*.so* $out/lib cp src/hidapi/libusb/.libs/*.so* $out/lib
cp src/univalue/.libs/*.so* $out/lib cp src/univalue/.libs/*.so* $out/lib
# [RPATH][patchelf] Avoid forbidden reference error
rm -rf $PWD
# Provide udev rules as documented in https://digitalbitbox.com/start_linux # Provide udev rules as documented in https://digitalbitbox.com/start_linux
mkdir -p "$out/etc/udev/rules.d" mkdir -p "$out/etc/udev/rules.d"
${copyUdevRuleToOutput "51-hid-digitalbox.rules" udevRule51} ${copyUdevRuleToOutput "51-hid-digitalbox.rules" udevRule51}
${copyUdevRuleToOutput "52-hid-digitalbox.rules" udevRule52} ${copyUdevRuleToOutput "52-hid-digitalbox.rules" udevRule52}
''; '';
# remove forbidden references to $TMPDIR
preFixup = ''
for f in "$out"/{bin,lib}/*; do
if [ -f "$f" ] && isELF "$f"; then
patchelf --shrink-rpath --allowed-rpath-prefixes "$NIX_STORE" "$f"
fi
done
'';
enableParallelBuilding = true; enableParallelBuilding = true;
meta = with lib; { meta = with lib; {

View File

@ -117,10 +117,13 @@ stdenv.mkDerivation {
cp -r doc/doxygen/output/html $devdoc/share/devhelp/openafs/doxygen cp -r doc/doxygen/output/html $devdoc/share/devhelp/openafs/doxygen
''; '';
# Avoid references to $TMPDIR by removing it and let patchelf cleanup the # remove forbidden references to $TMPDIR
# binaries.
preFixup = '' preFixup = ''
rm -rf "$(pwd)" && mkdir "$(pwd)" for f in "$out"/bin/*; do
if isELF "$f"; then
patchelf --shrink-rpath --allowed-rpath-prefixes "$NIX_STORE" "$f"
fi
done
''; '';
meta = with lib; { meta = with lib; {