# Build the final output package once all the ground work has been laid { pkgs, name, src, idris2Pkg, idris2Prefix, ipkg, extraDeps, extraNativeDeps , extraBuildArgs }: pkgs.stdenv.mkDerivation (rec { inherit name src; nativeBuildInputs = [ idris2Pkg pkgs.autoPatchelfHook pkgs.makeBinaryWrapper ] ++ (extraNativeDeps pkgs); buildInputs = [ idris2Prefix ] ++ extraDeps pkgs; buildPhase = '' export IDRIS2_PREFIX=${idris2Prefix} idris2 --build ${ipkg} ''; installPhase = '' mkdir -p $out cp -r ./build/exec $out/bin wrapProgram "$out/bin/${name}" --prefix LD_LIBRARY_PATH : ${ pkgs.lib.makeLibraryPath buildInputs } ''; } // (extraBuildArgs pkgs))