anchor.diff:          #   fi"
       done
     '' + /*
  +    # FIXME: make configurable at runtime
       The search path for the database is hardcoded and since the nix-store is
       read-only we create a symlink to a fixed location and copy the database
       to that location from the nix-store.
  
positive.code: 
      # Fail if executables contain broken RPATH's
      local executable
      for executable in "''${!PlexExecutableList[@]}" ; do
        echo "Testing rpath for: $executable"
        if [ -n "$(ldd "$out/lib/plexmediaserver/$executable" 2> /dev/null |
                   grep --only-matching 'not found')" ] ; then
          echo "ERROR: failed to patch RPATH's for:"
          echo "$executable"
          ldd "$out/lib/plexmediaserver/$executable"
  
negative.code:         "$out/bin/''${PlexExecutableList["$PlexExecutable"]}"
      done
  
      for PlexLibrary in "''${PlexLibraryList[@]}"; do
        if [ -n "$PlexLibrary" ]; then
          install -D -m 644 -v "usr/lib/plexmediaserver/$PlexLibrary" \
            "$out/lib/plexmediaserver/$PlexLibrary"
        fi
      done
  
      cp -dr --no-preserve='ownership' 'usr/lib/plexmediaserver/Resources' \
        "$out/lib/plexmediaserver"
    '';
  
    preFixup = ''
      for PlexExecutable in "''${!PlexExecutableList[@]}"; do
        patchelf \
          --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
          "$out/lib/plexmediaserver/$PlexExecutable"
  