summaryrefslogtreecommitdiffstats
path: root/pkgs/development/compilers/gforth
diff options
context:
space:
mode:
authorHerwig Hochleitner <herwig@bendlas.net>2021-10-21 16:27:36 +0200
committerHerwig Hochleitner <herwig@bendlas.net>2021-11-16 12:53:17 +0100
commit43cab046883d2869f57a440047cefd6ab945cb0a (patch)
treec798512a02e34c67e291708cdbb8ac2e488b3931 /pkgs/development/compilers/gforth
parent0e3dc39c42897d53b2d14e0e94c43e6477fc9a4b (diff)
gforth: 0.7.3 -> 0.7.9_20211111
This updates to forthy42's version, which the community seems to have transitioned to.
Diffstat (limited to 'pkgs/development/compilers/gforth')
-rw-r--r--pkgs/development/compilers/gforth/boot-forth.nix24
-rw-r--r--pkgs/development/compilers/gforth/default.nix46
-rw-r--r--pkgs/development/compilers/gforth/fix-install-txt.patch25
3 files changed, 83 insertions, 12 deletions
diff --git a/pkgs/development/compilers/gforth/boot-forth.nix b/pkgs/development/compilers/gforth/boot-forth.nix
new file mode 100644
index 000000000000..fc7b5ffa982d
--- /dev/null
+++ b/pkgs/development/compilers/gforth/boot-forth.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, fetchurl, m4 }:
+
+let
+ version = "0.7.3";
+in
+stdenv.mkDerivation {
+ pname = "gforth-boot";
+ inherit version;
+ src = fetchurl {
+ url = "https://ftp.gnu.org/gnu/gforth/gforth-${version}.tar.gz";
+ sha256 = "1c1bahc9ypmca8rv2dijiqbangm1d9av286904yw48ph7ciz4qig";
+ };
+
+ buildInputs = [ m4 ];
+
+ configureFlags = lib.optional stdenv.isDarwin [ "--build=x86_64-apple-darwin" ];
+
+ meta = {
+ description = "The Forth implementation of the GNU project (outdated version used to bootstrap)";
+ homepage = "https://www.gnu.org/software/gforth/";
+ license = lib.licenses.gpl3;
+ platforms = lib.platforms.all;
+ };
+}
diff --git a/pkgs/development/compilers/gforth/default.nix b/pkgs/development/compilers/gforth/default.nix
index bdf172cb9b99..a36f8f4a2d38 100644
--- a/pkgs/development/compilers/gforth/default.nix
+++ b/pkgs/development/compilers/gforth/default.nix
@@ -1,19 +1,40 @@
-{ lib, stdenv, fetchurl, m4 }:
-
+{ lib, stdenv, callPackage, autoreconfHook, texinfo, fetchFromGitHub
+, swig, libffi
+}:
let
- version = "0.7.3";
-in
-stdenv.mkDerivation {
- pname = "gforth";
+ version = "0.7.9_20211111";
+ sha256 = "sha256-KwYPMWdsL9o8SVcNdENMs4C9ioFBEfyVMqe5bgIrfzs=";
+ ## FIXME build https://github.com/GeraldWodni/swig with gforth, then rebuild
+ #### This will get rid of the configuration warning
+ # swigf = swig.overrideDerivation (old: {
+ # configureFlags = old.configureFlags ++ [
+ # "--enable-forth"
+ # ];
+ # });
+ bootForth = callPackage ./boot-forth.nix { };
+
+in stdenv.mkDerivation {
+ name = "gforth-${version}";
inherit version;
- src = fetchurl {
- url = "https://ftp.gnu.org/gnu/gforth/gforth-${version}.tar.gz";
- sha256 = "1c1bahc9ypmca8rv2dijiqbangm1d9av286904yw48ph7ciz4qig";
+ src = fetchFromGitHub {
+ owner = "forthy42";
+ repo = "gforth";
+ rev = version;
+ inherit sha256;
};
+ patches = [ ./fix-install-txt.patch ];
- buildInputs = [ m4 ];
+ nativeBuildInputs = [
+ autoreconfHook texinfo bootForth
+ ];
+ buildInputs = [
+ swig libffi
+ ];
- configureFlags = lib.optional stdenv.isDarwin [ "--build=x86_64-apple-darwin" ];
+ passthru = { inherit bootForth; };
+
+ configureFlags = # [ "--enable-lib" ] ++
+ lib.optional stdenv.isDarwin [ "--build=x86_64-apple-darwin" ];
postInstall = ''
mkdir -p $out/share/emacs/site-lisp
@@ -22,8 +43,9 @@ stdenv.mkDerivation {
meta = {
description = "The Forth implementation of the GNU project";
- homepage = "https://www.gnu.org/software/gforth/";
+ homepage = "https://github.com/forthy42/gforth";
license = lib.licenses.gpl3;
platforms = lib.platforms.all;
};
+
}
diff --git a/pkgs/development/compilers/gforth/fix-install-txt.patch b/pkgs/development/compilers/gforth/fix-install-txt.patch
new file mode 100644
index 000000000000..71f67e6fe65e
--- /dev/null
+++ b/pkgs/development/compilers/gforth/fix-install-txt.patch
@@ -0,0 +1,25 @@
+From c03408921ee8f5592e19cfcb64132a320fbd6279 Mon Sep 17 00:00:00 2001
+From: Herwig Hochleitner <herwig@bendlas.net>
+Date: Thu, 9 Sep 2021 18:19:42 +0200
+Subject: [PATCH 1/2] fix install-txt task
+
+---
+ Makefile.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index 5fe49787..51ad67c6 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -839,7 +839,7 @@ install-gensources:
+ done
+ echo "\\ empty site-init" > $(siteforthdir)/siteinit.fs
+
+-install-txt: doc
++install-txt: txt
+ $(INSTALL_DATA) doc/gforth.txt $(datadir)/gforth/$(VERSION)/doc/gforth.txt
+
+ install-images: install-txt
+--
+2.33.0
+