diff --git a/pkgs/development/compilers/pforth/default.nix b/pkgs/development/compilers/pforth/default.nix index 59994b26aeed5..d0766fe13768d 100644 --- a/pkgs/development/compilers/pforth/default.nix +++ b/pkgs/development/compilers/pforth/default.nix @@ -1,6 +1,7 @@ { lib , stdenv , fetchFromGitHub +, buildPackages }: stdenv.mkDerivation (finalAttrs: { @@ -14,14 +15,26 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-vEjFeHSJl+yAtatYJEnu+r9hmOr/kZOgIbSUXR/c8WU="; }; - dontConfigure = true; - - preBuild = '' - cd platforms/unix + # We build the dictionary in a cross-compile compatible way. + # For that, we perform steps, that the Makefile would otherwise do. + buildPhase = '' + runHook preBuild + make -C platforms/unix pfdicapp + pushd fth/ + ${stdenv.hostPlatform.emulator buildPackages} ../platforms/unix/pforth -i system.fth + ${stdenv.hostPlatform.emulator buildPackages} ../platforms/unix/pforth -d pforth.dic <<< "include savedicd.fth sdad bye" + mv pforth.dic pfdicdat.h ../platforms/unix/ + popd + make -C platforms/unix pforthapp + runHook postBuild ''; installPhase = '' - install -Dm755 pforth_standalone $out/bin/pforth + runHook preInstall + install -Dm755 platforms/unix/pforth_standalone $out/bin/pforth + mkdir -p $out/share/pforth + cp -r fth/* $out/share/pforth/ + runHook postInstall ''; meta = {