electron_32: fix log spam when building on aarch64-linux (#378988)
[NixPkgs.git] / pkgs / by-name / pf / pforth / package.nix
blob4c7766cc964324291fa504342e1af0b4cce02a7f
2   lib,
3   stdenv,
4   fetchFromGitHub,
5   buildPackages,
6 }:
8 stdenv.mkDerivation (finalAttrs: {
9   pname = "pforth";
10   version = "2.0.1";
12   src = fetchFromGitHub {
13     owner = "philburk";
14     repo = "pforth";
15     rev = "v${finalAttrs.version}";
16     hash = "sha256-vEjFeHSJl+yAtatYJEnu+r9hmOr/kZOgIbSUXR/c8WU=";
17   };
19   # We build the dictionary in a cross-compile compatible way.
20   # For that, we perform steps, that the Makefile would otherwise do.
21   buildPhase = ''
22     runHook preBuild
23     make -C platforms/unix pfdicapp
24     pushd fth/
25     ${stdenv.hostPlatform.emulator buildPackages} ../platforms/unix/pforth -i system.fth
26     ${stdenv.hostPlatform.emulator buildPackages} ../platforms/unix/pforth -d pforth.dic <<< "include savedicd.fth sdad bye"
27     mv pforth.dic pfdicdat.h ../platforms/unix/
28     popd
29     make -C platforms/unix pforthapp
30     runHook postBuild
31   '';
33   installPhase = ''
34     runHook preInstall
35     install -Dm755 platforms/unix/pforth_standalone $out/bin/pforth
36     mkdir -p $out/share/pforth
37     cp -r fth/* $out/share/pforth/
38     runHook postInstall
39   '';
41   meta = {
42     homepage = "https://www.softsynth.com/pforth/";
43     description = "Portable Portable ANS-like Forth written in ANSI 'C'";
44     mainProgram = "pforth";
45     changelog = "https://github.com/philburk/pforth/blob/v${finalAttrs.version}/RELEASES.md";
46     license = lib.licenses.bsd0;
47     maintainers = with lib.maintainers; [
48       AndersonTorres
49       yrashk
50     ];
51     platforms = lib.platforms.unix;
52   };
54 # TODO: option for install the non-standalone executable