diff --git a/ports/ports/lynx.mk b/ports/ports/lynx.mk new file mode 100644 index 0000000000..8b3cb06e6a --- /dev/null +++ b/ports/ports/lynx.mk @@ -0,0 +1,19 @@ +LYNX = lynx-2.8.8.dev12 +LYNX_TGZ = $(LYNX).tar.gz +LYNX_URL = http://lynx.isc.org/gnumatic/$(LYNX_TGZ) +# +# Interface to top-level prepare Makefile +# +PORTS += $(LYNX) + +prepare:: $(CONTRIB_DIR)/$(LYNX) + +# +# Port-specific local rules +# +$(DOWNLOAD_DIR)/$(LYNX_TGZ): + $(VERBOSE)wget -c -P $(DOWNLOAD_DIR) -O $@ $(LYNX_URL) && touch $@ + +$(CONTRIB_DIR)/$(LYNX): $(DOWNLOAD_DIR)/$(LYNX_TGZ) + $(VERBOSE)tar xfz $< -C $(CONTRIB_DIR) && touch $@ + $(VERBOSE)patch -d contrib/ -N -p0 < src/noux-pkg/lynx/build.patch diff --git a/ports/run/noux_net_lynx_interactive.run b/ports/run/noux_net_lynx_interactive.run new file mode 100644 index 0000000000..5f0776f0d8 --- /dev/null +++ b/ports/run/noux_net_lynx_interactive.run @@ -0,0 +1,204 @@ +if {![have_spec x86]} { + puts "\nThis runscript is supported on the x86 architecture only\n" + exit 0 +} + +# +# Uncomment the following line when working on the VIM source code. Otherwise, +# the package may get recompiled, yet it does not get reinstalled into 'bin/'. +# +#exec rm -rf noux-pkg/bash bin/bash + +set build_components { + core init drivers/timer + noux/net lib/libc_noux + drivers/framebuffer drivers/pci drivers/input + drivers/nic + drivers/timer + server/terminal server/ram_fs + test/libports/ncurses + test/libports/readline + test/libports/zlib +} + +# +# Build Noux packages only once +# +set noux_pkgs "bash coreutils lynx noux-etc" + +foreach pkg $noux_pkgs { + lappend_if [expr ![file exists bin/$pkg]] build_components noux-pkg/$pkg } + +build $build_components + +# strip all binaries prior archiving +set find_args "" +foreach pkg $noux_pkgs { append find_args " bin/$pkg/" } +exec sh -c "find $find_args -type f | (xargs [cross_dev_prefix]strip || true) 2>/dev/null" + +# add bash as sh +exec cp bin/bash/bin/bash bin/bash/bin/sh + +foreach pkg $noux_pkgs { + exec tar cfv bin/$pkg.tar -h -C bin/$pkg . } + +create_boot_directory + +append config { + + + + + + + + + + + + + + + + + + + + + } + +append_if [have_spec sdl] config { + + + + + + + } + +append_if [have_spec pci] config { + + + + } + +append_if [have_spec vesa] config { + + + + } + +append_if [have_spec pl11x] config { + + + + } + +append_if [have_spec ps2] config { + + + + } + +append config { + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +} + +foreach pkg $noux_pkgs { + append config " " } + +append config { + + + + + + + + + + + + + + + + + + +} + +install_config $config + + +# +# Boot modules +# + +# generic modules +set boot_modules { + core init timer ld.lib.so noux_net nic_drv terminal ram_fs + libc.lib.so libm.lib.so libc_noux.lib.so libc_resolv.lib.so + lwip.lib.so ncurses.lib.so + readline.lib.so zlib.lib.so libcrypto.lib.so libssl.lib.so +} + +foreach pkg $noux_pkgs { + lappend boot_modules "$pkg.tar" } + +# platform-specific modules +lappend_if [have_spec linux] boot_modules fb_sdl +lappend_if [have_spec pci] boot_modules pci_drv +lappend_if [have_spec vesa] boot_modules vesa_drv +lappend_if [have_spec ps2] boot_modules ps2_drv +lappend_if [have_spec pl11x] boot_modules pl11x_drv + +build_boot_image $boot_modules + +if {[have_spec x86_64]} { + # bash.tar is really huge when built for x86_64 + append qemu_args " -m 320 " +} + +append_if [have_spec x86] qemu_args " -net nic,model=e1000" +append_if [have_spec lan9118] qemu_args " -net nic,model=lan9118 " + +append qemu_args " -net user " + +run_genode_until forever + +#exec rm bin/bash.tar diff --git a/ports/src/noux-pkg/lynx/build.patch b/ports/src/noux-pkg/lynx/build.patch new file mode 100644 index 0000000000..80ca44d30b --- /dev/null +++ b/ports/src/noux-pkg/lynx/build.patch @@ -0,0 +1,11 @@ +--- lynx-2.8.8.dev12.orig/src/makefile.in 2012-06-18 15:44:22.237274112 +0200 ++++ lynx-2.8.8.dev12/src/makefile.in 2012-06-18 15:44:37.774023653 +0200 +@@ -102,7 +102,7 @@ + + lynx$x: message do_chartrans_stuff $(top_builddir)/LYHelp.h $(OBJS) $(WWWLIB) + @echo "Linking and creating Lynx executable" +- $(CC) $(CC_OPTS) $(LDFLAGS) -o $@ $(OBJS) $(WWWLIB) $(LDFLAGS) $(LIBS) $(INTLLIB) ++ $(CC) $(CC_OPTS) $(LDFLAGS) -o $@ $(OBJS) $(WWWLIB) $(LIBS) $(INTLLIB) + @echo "Copying Lynx executable into top-level directory" + rm -f $(top_builddir)/$@ + cp $@ $(top_builddir)/ diff --git a/ports/src/noux-pkg/lynx/target.mk b/ports/src/noux-pkg/lynx/target.mk new file mode 100644 index 0000000000..8d606cee96 --- /dev/null +++ b/ports/src/noux-pkg/lynx/target.mk @@ -0,0 +1,35 @@ +NOUX_CONFIGURE_ARGS = --with-ssl \ + --with-zlib \ + --disable-nls \ + --disable-ipv6 \ + --disable-rpath-hack \ + --with-cfg-file=/etc/lynx.cfg \ + --with-lss-file=/etc/lynx.lss + +# +# Needed for +# +NOUX_CFLAGS += -D__BSD_VISIBLE + +LIBS += ncurses zlib libssl libc_resolv + +# +# Make the zlib linking test succeed +# +Makefile: dummy_libs + +NOUX_LDFLAGS += -L$(PWD) + +dummy_libs: libcrypto.a libssl.a libz.a + +libcrypto.a: + $(VERBOSE)$(AR) -rc $@ + +libssl.a: + $(VERBOSE)$(AR) -rc $@ + +libz.a: + $(VERBOSE)$(AR) -rc $@ + + +include $(REP_DIR)/mk/noux.mk