diff --git a/repos/ports/ports/tcl.hash b/repos/ports/ports/tcl.hash new file mode 100644 index 000000000..46a119e3b --- /dev/null +++ b/repos/ports/ports/tcl.hash @@ -0,0 +1 @@ +429dbe862c9a0b57914f9b07155669c976758805 diff --git a/repos/ports/ports/tcl.port b/repos/ports/ports/tcl.port new file mode 100644 index 000000000..679b7b22d --- /dev/null +++ b/repos/ports/ports/tcl.port @@ -0,0 +1,8 @@ +LICENSE := BSD +VERSION := 8.6.8 +DOWNLOADS := tcl.archive + +URL(tcl) := https://prdownloads.sourceforge.net/tcl/tcl$(VERSION)-src.tar.gz +SHA(tcl) := 0d014d97ca38534d4be1dfc6c563a7a3a6aa737f +DIR(tcl) := src/noux-pkg/tcl + diff --git a/repos/ports/recipes/src/tclsh/content.mk b/repos/ports/recipes/src/tclsh/content.mk new file mode 100644 index 000000000..cf1366765 --- /dev/null +++ b/repos/ports/recipes/src/tclsh/content.mk @@ -0,0 +1,26 @@ +content: src/noux-pkg/tcl src/noux-pkg/tclsh LICENSE README + +PORT_DIR := $(call port_dir,$(REP_DIR)/ports/tcl) + +TCL_CONTENT := unix generic compat libtommath + +src/noux-pkg/tcl: + mkdir -p $@/library + cp -a $(addprefix $(PORT_DIR)/src/noux-pkg/tcl/,$(TCL_CONTENT)) $@ + cp -a $(PORT_DIR)/src/noux-pkg/tcl/library/init.tcl $@/library/ + +src/noux-pkg/tclsh: + mkdir -p $@ + cp -a $(REP_DIR)/src/noux-pkg/tclsh/* $@ + +LICENSE: + cp $(PORT_DIR)/src/noux-pkg/tcl/license.terms $@ + +include $(REP_DIR)/ports/tcl.port + +README: + ( echo "This archive is a stripped-down version of the Tcl source archive"; \ + echo "that merely contains the source codes needed to build tclsh for Genode."; \ + echo "For the original source archive, refer to:"; \ + echo "${URL(tcl)}" ) > $@ + diff --git a/repos/ports/recipes/src/tclsh/hash b/repos/ports/recipes/src/tclsh/hash new file mode 100644 index 000000000..ad8c11111 --- /dev/null +++ b/repos/ports/recipes/src/tclsh/hash @@ -0,0 +1 @@ +2018-01-19 6f25b1412da846b21ca863fb51c194bec94bde07 diff --git a/repos/ports/recipes/src/tclsh/used_apis b/repos/ports/recipes/src/tclsh/used_apis new file mode 100644 index 000000000..6abd7b790 --- /dev/null +++ b/repos/ports/recipes/src/tclsh/used_apis @@ -0,0 +1,4 @@ +base +libc +noux +posix diff --git a/repos/ports/src/noux-pkg/tclsh/target.mk b/repos/ports/src/noux-pkg/tclsh/target.mk new file mode 100644 index 000000000..92b16eaa3 --- /dev/null +++ b/repos/ports/src/noux-pkg/tclsh/target.mk @@ -0,0 +1,47 @@ +PKG_DIR := $(call select_from_ports,tcl)/src/noux-pkg/tcl + +MAKE_TARGET := tclsh + +# +# Override default install rules. We just want to keep the 'tclsh' binary. +#/ +INSTALL_TARGET := + +INSTALL_LIB_DIR := install/lib/tcl8.6 + +installed.tag: + @$(MSG_INST)$(TARGET) + $(VERBOSE)mkdir -p install/bin $(INSTALL_LIB_DIR) + $(VERBOSE)$(STRIP) tclsh -o install/bin/tclsh + $(VERBOSE)cp $(PKG_DIR)/library/init.tcl $(INSTALL_LIB_DIR) + @touch $@ + +include $(call select_from_repositories,mk/noux.mk) + +LDFLAGS += -L$(PWD) + +CONFIGURE_ARGS += --disable-shared --disable-threads --disable-rpath \ + --srcdir $(PKG_DIR)/unix + +CONFIGURE_SCRIPT = $(PKG_DIR)/unix/configure + +# +# By default, tclsh is generated with a hidden 'main' symbol, which cannot +# be found by Genode's dynamic linker. Since this behavior is not configurable, +# we need to patch the Makefile generated by the configure script. +# +tweak_makefile.tag: Makefile +tweak_makefile.tag: + $(VERBOSE)echo "AC_FLAGS += -UMODULE_SCOPE" >> Makefile + @touch $@ +built.tag: tweak_makefile.tag + + +Makefile: dummy_libs + +.SECONDARY: dummy_libs +dummy_libs: libdl.a + +libdl.a: + $(VERBOSE)$(AR) -rc $@ +