anchor.diff:      preConfigure =
         ''
           configureFlags="$configureFlags -Dprefix=$out -Dman1dir=$out/share/man/man1 -Dman3dir=$out/share/man/man3"
  -
  -        ${optionalString stdenv.isArm ''
  -          configureFlagsArray=(-Dldflags="-lm -lrt")
  -        ''}
  +    '' + optionalString stdenv.isArm ''
  +      configureFlagsArray=(-Dldflags="-lm -lrt")
         '' + optionalString stdenv.isDarwin ''
           substituteInPlace hints/darwin.sh --replace "env MACOSX_DEPLOYMENT_TARGET=10.3" ""
         '' + optionalString (!enableThreading) ''
  
positive.code:         substituteInPlace dist/PathTools/Cwd.pm --replace "'/bin/pwd'" "'$(type -tP pwd)'"
        '';
  
      # Inspired by nuke-references, which I can't depend on because it uses perl. Perhaps it should just use sed :)
      postInstall = ''
        self=$(echo $out | sed -n "s|^$NIX_STORE/\\([a-z0-9]\{32\}\\)-.*|\1|p")
  
        sed -i "/$self/b; s|$NIX_STORE/[a-z0-9]\{32\}-|$NIX_STORE/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-|g" "$out"/lib/perl5/*/*/Config.pm
        sed -i "/$self/b; s|$NIX_STORE/[a-z0-9]\{32\}-|$NIX_STORE/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-|g" "$out"/lib/perl5/*/*/Config_heavy.pl
      '';
  
      setupHook = ./setup-hook.sh;
  
      passthru.libPrefix = "lib/perl5/site_perl";
  
      meta = {
        homepage = https://www.perl.org/;
  
negative.code:       ++ optional stdenv.isSunOS ./ld-shared.patch
        ++ optional stdenv.isDarwin [ ./cpp-precomp.patch ];
  
      postPatch = ''
        pwd="$(type -P pwd)"
        substituteInPlace dist/PathTools/Cwd.pm \
          --replace "/bin/pwd" "$pwd"
      '';
      sandboxProfile = sandbox.allow "ipc-sysv-sem";
  
      # Build a thread-safe Perl with a dynamic libperls.o.  We need the
  