{ stdenv , fetchzip , openmpi , libbfd , libz , lib , which , ... }: with lib; stdenv.mkDerivation rec { pname = "scalasca"; version = "2.6.1"; src = fetchzip { url = "https://apps.fz-juelich.de/${pname}/releases/${pname}/${versions.majorMinor version}/dist/${pname}-${version}.tar.gz"; hash = "sha256-GENZD8ep9ukWR9SgZw4bocIO6XCAyYgT5G44zkt7hbc="; }; configureFlags = [ "--with-mpi=openmpi" ]; nativeBuildinputs = [ which ]; buildInputs = [ openmpi libbfd libz ]; preFixup = '' for f in "$out"/{bin,lib}/*; do if [ -f "$f" ] && isELF "$f"; then patchelf \ --add-rpath "$out"/lib \ "$f" patchelf \ --shrink-rpath \ --allowed-rpath-prefixes "$NIX_STORE" \ "$f" fi done ''; enableParallelBuilding = true; }