From e4a5147cf83fd571a603bda27ed0e8db0209eff5 Mon Sep 17 00:00:00 2001 From: Francesco Gazzetta Date: Mon, 6 Mar 2023 18:35:35 +0100 Subject: [PATCH] gbforth: init at unstable-2023-03-02 --- .../development/compilers/gbforth/default.nix | 54 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 56 insertions(+) create mode 100644 pkgs/development/compilers/gbforth/default.nix diff --git a/pkgs/development/compilers/gbforth/default.nix b/pkgs/development/compilers/gbforth/default.nix new file mode 100644 index 000000000000..e85e621cff16 --- /dev/null +++ b/pkgs/development/compilers/gbforth/default.nix @@ -0,0 +1,54 @@ +{ lib +, stdenv +, fetchFromGitHub +, makeWrapper +, gforth +}: + +stdenv.mkDerivation { + pname = "gbforth"; + version = "unstable-2023-03-02"; + + src = fetchFromGitHub { + owner = "ams-hackers"; + repo = "gbforth"; + rev = "428fcf5054fe301e90ac74b1d920ee3ecc375b5b"; + hash = "sha256-v1bdwT15Wg1VKpo74Cc3tsTl1uOKvKdlHWtbZkJ/qbA="; + }; + + nativeBuildInputs = [ + makeWrapper + ]; + + dontBuild = true; + + installPhase = '' + runHook preInstall + mkdir -p $out/share/gbforth $out/bin + cp -r lib shared src gbforth.fs $out/share/gbforth/ + makeWrapper ${gforth}/bin/gforth $out/bin/gbforth \ + --set GBFORTH_PATH $out/share/gbforth/lib \ + --add-flags $out/share/gbforth/gbforth.fs + runHook postInstall + ''; + + doInstallCheck = true; + installCheckPhase = '' + runHook preInstallCheck + $out/bin/gbforth examples/simon/simon.fs + runHook postInstallCheck + ''; + + meta = with lib; { + homepage = "https://gbforth.org/"; + description = "A Forth-based Game Boy development kit"; + longDescription = '' + A Forth-based Game Boy development kit. + It features a Forth-based assembler, a cross-compiler with support for + lazy code generation and a library of useful words. + ''; + license = licenses.mit; + platforms = platforms.all; + maintainers = with maintainers; [ fgaz ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 2ca57f83d833..4f9e59b1361a 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -14295,6 +14295,8 @@ with pkgs; gerbil-support = callPackage ../development/compilers/gerbil/gerbil-support.nix { }; gerbilPackages-unstable = gerbil-support.gerbilPackages-unstable; # NB: don't recurseIntoAttrs for (unstable!) libraries + gbforth = callPackage ../development/compilers/gbforth { }; + inherit (let num = if (with stdenv.targetPlatform; isVc4 || libc == "relibc") then 6