From 90ee4c484bfd46ff41358ee6668dab72985b061d Mon Sep 17 00:00:00 2001 From: pi31415 Date: Fri, 15 Jun 2018 08:01:18 -0800 Subject: [PATCH] Adds package tinyscheme-extensions This package (once the extension is loaded) gives tinyscheme access to additional *nix system functionality, such as the `system` call, socket functions, and read access to environment variables. --- lang/tinyscheme-extensions/Makefile | 63 +++++++++++++++++++ .../patches/001-makefile.patch | 26 ++++++++ 2 files changed, 89 insertions(+) create mode 100644 lang/tinyscheme-extensions/Makefile create mode 100644 lang/tinyscheme-extensions/patches/001-makefile.patch diff --git a/lang/tinyscheme-extensions/Makefile b/lang/tinyscheme-extensions/Makefile new file mode 100644 index 0000000..a3f62ca --- /dev/null +++ b/lang/tinyscheme-extensions/Makefile @@ -0,0 +1,63 @@ +# The software `TinyScheme Extensions` was packaged for LibreCMC by +# Christopher Howard in June 2018. + +# This package configuration file is licensed under the GPL-3+. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# The upstream author of `TinyScheme Extensions` is Heras-Gilsanz +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=tinyscheme-extensions +PKG_VERSION:=1.1 +PKG_RELEASE:=1 + +PKG_BUILD_DIR:=$(BUILD_DIR)/tsx-$(PKG_VERSION) +PKG_SOURCE:=tsx-$(PKG_VERSION).tgz +PKG_SOURCE_URL:=http://heras-gilsanz.com/manuel +PKG_HASH:=f7e396a3ab41fb5eac3ef7020da0808766bd6ac2f5e5f7c9d80511df17f4a79b +PKG_CAT:=zcat +PKG_LICENSE:=BSD-3-Clause +PKG_LICENSE_FILES:=LICENSE + +include $(INCLUDE_DIR)/package.mk + +define Package/tinyscheme-extensions + SECTION:=lang + CATEGORY:=Languages + TITLE:=TinyScheme Extensions + URL:=http://heras-gilsanz.com/manuel/tsx.html + MAINTAINER=Christopher Howard + DEPENDS:=tinyscheme +endef + +define Package/tinyscheme-extensions/description +TSX is a set of extensions for the TinyScheme implementation (as an +interpreter) of the Scheme programming language +endef + +# May need to override SCHEME_H_DIR if tinyscheme version ever changes + +define Build/Compile + $(call Build/Compile/Default,CFLAGS='-fPIC -Wall') +endef + +define Package/tinyscheme-extensions/install + $(INSTALL_DIR) $(1)/usr/lib/tinyscheme + $(INSTALL_DATA) $(PKG_BUILD_DIR)/tsx.so $(1)/usr/lib/tinyscheme/tsx.so +endef + +$(eval $(call BuildPackage,tinyscheme-extensions)) diff --git a/lang/tinyscheme-extensions/patches/001-makefile.patch b/lang/tinyscheme-extensions/patches/001-makefile.patch new file mode 100644 index 0000000..a689ef0 --- /dev/null +++ b/lang/tinyscheme-extensions/patches/001-makefile.patch @@ -0,0 +1,26 @@ +--- a/Makefile 2002-04-09 00:37:57.000000000 -0800 ++++ b/Makefile 2018-06-15 07:29:32.882566233 -0800 +@@ -1,16 +1,16 @@ + #DEBUG=-g + DEBUG= +-SCHEME_H_DIR=.. ++SCHEME_H_DIR=../tinyscheme-1.41 + CC=gcc +-CFLAGS=-DUSE_DL=1 -I $(SCHEME_H_DIR) ++CFLAGS=-fPIC -Wall ++FEATURES=-DUSE_DL=1 ++LDFLAGS=-shared + + tsx.so : tsx.c tsx.h Makefile +- $(CC) -shared -Wall -fPIC $(CFLAGS) -o tsx.so $(DEBUG) tsx.c +- strip tsx.so +- ls -l tsx.so ++ $(CC) $(LDFLAGS) $(CFLAGS) -I $(SCHEME_H_DIR) $(FEATURES) -o tsx.so $(DEBUG) tsx.c + + .PHONY : clean + clean: + rm -f *.o + rm -f tsx.so +- rm -f *~ +\ No newline at end of file ++ rm -f *~ -- 2.25.1