2023-07-15 17:15:38 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, buildPackages
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "pforth";
|
2023-07-15 17:15:38 +00:00
|
|
|
version = "2.0.1";
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "philburk";
|
|
|
|
repo = "pforth";
|
2023-07-15 17:15:38 +00:00
|
|
|
rev = "v${finalAttrs.version}";
|
|
|
|
hash = "sha256-vEjFeHSJl+yAtatYJEnu+r9hmOr/kZOgIbSUXR/c8WU=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
# 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
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
2023-07-15 17:15:38 +00:00
|
|
|
runHook preInstall
|
|
|
|
install -Dm755 platforms/unix/pforth_standalone $out/bin/pforth
|
|
|
|
mkdir -p $out/share/pforth
|
|
|
|
cp -r fth/* $out/share/pforth/
|
|
|
|
runHook postInstall
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
2023-11-16 04:20:00 +00:00
|
|
|
homepage = "https://www.softsynth.com/pforth/";
|
2023-07-15 17:15:38 +00:00
|
|
|
description = "Portable Portable ANS-like Forth written in ANSI 'C'";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "pforth";
|
2023-07-15 17:15:38 +00:00
|
|
|
changelog = "https://github.com/philburk/pforth/blob/v${finalAttrs.version}/RELEASES.md";
|
|
|
|
license = lib.licenses.bsd0;
|
|
|
|
maintainers = with lib.maintainers; [ AndersonTorres yrashk ];
|
2021-02-05 17:12:51 +00:00
|
|
|
platforms = lib.platforms.unix;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2023-07-15 17:15:38 +00:00
|
|
|
})
|
|
|
|
# TODO: option for install the non-standalone executable
|