Unverified Commit f4cd4143 authored by Vladimír Čunát's avatar Vladimír Čunát
Browse files

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

Just like commit 3af97fc9
parent 1f4ccf11
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -103,15 +103,21 @@ in mkDerivation rec {
    cp src/hidapi/libusb/.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
    mkdir -p "$out/etc/udev/rules.d"
    ${copyUdevRuleToOutput "51-hid-digitalbox.rules" udevRule51}
    ${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;

  meta = with lib; {
+6 −3
Original line number Diff line number Diff line
@@ -117,10 +117,13 @@ stdenv.mkDerivation {
    cp -r doc/doxygen/output/html $devdoc/share/devhelp/openafs/doxygen
  '';

  # Avoid references to $TMPDIR by removing it and let patchelf cleanup the
  # binaries.
  # remove forbidden references to $TMPDIR
  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; {