gforth: enable swig bindings

This commit is contained in:
Herwig Hochleitner 2022-02-08 02:33:52 +01:00
parent 1a5c6d8d55
commit 08836b254e
3 changed files with 30 additions and 48 deletions

View file

@ -1,40 +1,32 @@
{ lib, stdenv, callPackage, autoreconfHook, texinfo, fetchFromGitHub { lib, stdenv, fetchFromGitHub, callPackage
, swig, libffi , autoreconfHook, texinfo, libffi
}: }:
let
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 { let
pname = "gforth"; swig = callPackage ./swig.nix { };
inherit version; bootForth = callPackage ./boot-forth.nix { };
in stdenv.mkDerivation rec {
name = "gforth-${version}";
version = "0.7.9_20220127";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "forthy42"; owner = "forthy42";
repo = "gforth"; repo = "gforth";
rev = version; rev = version;
inherit sha256; sha256 = "sha256-3+ObHhsPvW44UFiN0GWOhwo7aiqhjwxNY8hw2Wv4MK0=";
}; };
patches = [ ./fix-install-txt.patch ];
nativeBuildInputs = [ nativeBuildInputs = [
autoreconfHook texinfo bootForth autoreconfHook texinfo bootForth swig
]; ];
buildInputs = [ buildInputs = [
swig libffi libffi
]; ];
passthru = { inherit bootForth; }; passthru = { inherit bootForth; };
configureFlags = configureFlags = lib.optional stdenv.isDarwin [ "--build=x86_64-apple-darwin" ];
lib.optional stdenv.isDarwin [ "--build=x86_64-apple-darwin" ];
postInstall = '' postInstall = ''
mkdir -p $out/share/emacs/site-lisp mkdir -p $out/share/emacs/site-lisp
@ -47,5 +39,4 @@ in stdenv.mkDerivation {
license = lib.licenses.gpl3; license = lib.licenses.gpl3;
platforms = lib.platforms.all; platforms = lib.platforms.all;
}; };
} }

View file

@ -1,25 +0,0 @@
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

View file

@ -0,0 +1,16 @@
{ swig3, fetchFromGitHub }:
## for updating to swig4, see
## https://github.com/GeraldWodni/swig/pull/6
swig3.overrideDerivation (old: {
version = "3.0.9-forth";
src = fetchFromGitHub {
owner = "GeraldWodni";
repo = "swig";
rev = "a45b807e5f9d8ca1a43649c8265d2741a393862a";
sha256 = "sha256-6nOOPFGFNaQInEkul0ZAh+ks9n3wqCQ6/tbduvG/To0=";
};
configureFlags = old.configureFlags ++ [
"--enable-forth"
];
})