Browse Source

Merge branch 'tinyscheme' of pi31415/librecmc-package-feed into v1.4

RISCI_ATOM 6 years ago
parent
commit
67c4b46aed
2 changed files with 70 additions and 18 deletions
  1. 31 7
      lang/tinyscheme/Makefile
  2. 39 11
      lang/tinyscheme/patches/001-makefile.patch

+ 31 - 7
lang/tinyscheme/Makefile

@@ -23,7 +23,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=tinyscheme
 PKG_VERSION:=1.41
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/tinyscheme-$(PKG_VERSION)
 PKG_SOURCE:=tinyscheme-$(PKG_VERSION).tar.gz
@@ -38,18 +38,35 @@ include $(INCLUDE_DIR)/package.mk
 define Package/tinyscheme
 	SECTION:=lang
 	CATEGORY:=Languages
-	TITLE:=TinyScheme programming language
+	TITLE:=Interpreter for the TinyScheme programming language
 	URL:=http://tinyscheme.sourceforge.net
+	MAINTAINER=Christopher Howard <christopher.howard@qlfiles.net>
+endef
+
+define Package/tinyscheme-embedded
+	SECTION:=lang
+	CATEGORY:=Languages
+	TITLE:=Library for embedding the TinyScheme programming language
+	URL:=http://tinyscheme.sourceforge.net
+	MAINTAINER=Christopher Howard <christopher.howard@qlfiles.net>
+	DEPENDS:=tinyscheme
 endef
 
 define Package/tinyscheme/description
-	TinyScheme is a lightweight Scheme interpreter that implements as large a
-	subset of R5RS as was possible without getting very large and complicated.
-        This package installs only the tinyscheme binary, not the shared library.
+TinyScheme is a lightweight Scheme interpreter that implements as large
+a subset of R5RS as was possible without getting very large and complicated.
+This package installs the tinyscheme interpreter and init file.
 endef
 
-define Build/Configure
-	$(call Build/Configure/Default,--with-linux-headers=$(LINUX_DIR))
+define Package/tinyscheme-embedded/description
+TinyScheme is a lightweight Scheme interpreter that implements as large
+a subset of R5RS as was possible without getting very large and complicated.
+This package installs the library required for embedding TinyScheme in a C
+program.
+endef
+
+define Build/Compile
+	$(call Build/Compile/Default,PLATFORM_FEATURES='-fPIC -DInitFile="\"/usr/lib/tinyscheme/init.scm\""')
 endef
 
 define Package/tinyscheme/install
@@ -59,4 +76,11 @@ define Package/tinyscheme/install
 	$(INSTALL_DATA) $(PKG_BUILD_DIR)/init.scm $(1)/usr/lib/tinyscheme/init.scm
 endef
 
+define Package/tinyscheme-embedded/install
+	$(INSTALL_DIR) $(1)/usr/lib
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/libtinyscheme.so $(1)/usr/lib/libtinyscheme.so
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/libtinyscheme.a $(1)/usr/lib/libtinyscheme.a
+endef
+
 $(eval $(call BuildPackage,tinyscheme))
+$(eval $(call BuildPackage,tinyscheme-embedded))

+ 39 - 11
lang/tinyscheme/patches/001-makefile.patch

@@ -1,20 +1,48 @@
 --- a/makefile	2013-04-14 12:08:33.000000000 -0800
-+++ a/makefile	2018-05-01 09:12:00.895474940 -0800
-@@ -34,7 +34,7 @@
++++ b/makefile	2018-05-23 07:18:29.251203367 -0800
+@@ -18,8 +18,8 @@
+ #AR= echo
+ 
+ # Unix, generally
+-CC = gcc -fpic -pedantic
+-DEBUG=-g -Wall -Wno-char-subscripts -O
++CC = gcc -fPIC -pedantic
++# DEBUG=-g -Wall -Wno-char-subscripts -O
+ Osuf=o
+ SOsuf=so
+ LIBsuf=a
+@@ -27,14 +27,15 @@
+ LIBPREFIX=lib
+ OUT = -o $@
+ RM= -rm -f
+-AR= ar crs
++AR= ar
++AR_OPTS= crs
+ 
+ # Linux
+ LD = gcc
  LDFLAGS = -shared
- DEBUG=-g -Wno-char-subscripts -O
+-DEBUG=-g -Wno-char-subscripts -O
++DEBUG=-Wall -Wno-char-subscripts -O
  SYS_LIBS= -ldl -lm
 -PLATFORM_FEATURES= -DSUN_DL=1
-+PLATFORM_FEATURES= -DSUN_DL=1 -DInitFile=\"/usr/lib/tinyscheme/init.scm\"
++# PLATFORM_FEATURES= -DInitFile=\"/usr/lib/tinyscheme/init.scm\"
  
  # Cygwin
  #PLATFORM_FEATURES = -DUSE_STRLWR=0
-@@ -68,7 +68,7 @@
- LIBTARGET = $(LIBPREFIX)tinyscheme.$(SOsuf)
- STATICLIBTARGET = $(LIBPREFIX)tinyscheme.$(LIBsuf)
+@@ -74,13 +75,13 @@
+ 	$(CC) -I. -c $(DEBUG) $(FEATURES) $(DL_FLAGS) $<
  
--all: $(LIBTARGET) $(STATICLIBTARGET) scheme$(EXE_EXT)
-+all: scheme$(EXE_EXT)
+ $(LIBTARGET): $(OBJS)
+-	$(LD) $(LDFLAGS) $(OUT) $(OBJS) $(SYS_LIBS)
++	$(CC) $(LDFLAGS) $(OUT) $(OBJS) $(SYS_LIBS)
  
- %.$(Osuf): %.c
- 	$(CC) -I. -c $(DEBUG) $(FEATURES) $(DL_FLAGS) $<
+ scheme$(EXE_EXT): $(OBJS)
+ 	$(CC) -o $@ $(DEBUG) $(OBJS) $(SYS_LIBS)
+ 
+ $(STATICLIBTARGET): $(OBJS)
+-	$(AR) $@ $(OBJS)
++	$(AR) $(AR_OPTS) $@ $(OBJS)
+ 
+ $(OBJS): scheme.h scheme-private.h opdefines.h
+ dynload.$(Osuf): dynload.h