{ stdenv, papi, }: if stdenv.hostPlatform == stdenv.buildPlatform then papi else papi.overrideAttrs (old: { configureFlags = (old.configureFlags or [ ]) ++ [ "--enable-perf_event_uncore=no" "--with-sysdetect=no" "--with-ffsll" "--with-tls=__thread" "--with-virtualtimer=clock_thread_cputime_id" "--with-walltimer=clock_realtime" "--with-perf-events" "--with-CPU=${stdenv.hostPlatform.uname.processor}" "--with-arch=${stdenv.hostPlatform.uname.processor}" ]; patches = (old.patches or [ ]) ++ [ ./fix-ar-cross.patch ]; })