diff --git a/app-emulation/simh/patches/old_simh-4.0.0_git.patchset b/app-emulation/simh/patches/old_simh-4.0.0_git.patchset new file mode 100644 index 000000000..5f2cf5d13 --- /dev/null +++ b/app-emulation/simh/patches/old_simh-4.0.0_git.patchset @@ -0,0 +1,161 @@ +From 6554891108c0e2a9cc68eb28f033172f92280b95 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= +Date: Sat, 19 Jul 2014 18:27:44 +0200 +Subject: [PATCH 1/3] Add support for building under Haiku + +We need -lnetwork for sockets. +--- + makefile | 41 +++++++++++++++++++++++------------------ + 1 file changed, 23 insertions(+), 18 deletions(-) + +diff --git a/makefile b/makefile +index ec86998..2800826 100644 +--- a/makefile ++++ b/makefile +@@ -201,25 +201,30 @@ ifeq ($(WIN32),) #*nix Environments (&& cygwin) + OS_LDFLAGS += -L/opt/freeware/lib + endif + else +- ifeq (,$(findstring NetBSD,$(OSTYPE))) +- ifneq (no ldconfig,$(findstring no ldconfig,$(shell which ldconfig 2>&1))) +- LDSEARCH :=$(shell ldconfig -r | grep 'search directories' | awk '{print $$3}' | sed 's/:/ /g') +- endif +- ifneq (,$(LDSEARCH)) +- LIBPATH := $(LDSEARCH) +- else +- ifeq (,$(strip $(LPATH))) +- $(info *** Warning ***) +- $(info *** Warning *** The library search path on your $(OSTYPE) platform can't be) +- $(info *** Warning *** determined. This should be resolved before you can expect) +- $(info *** Warning *** to have fully working simulators.) +- $(info *** Warning ***) +- $(info *** Warning *** You can specify your library paths via the LPATH environment) +- $(info *** Warning *** variable.) +- $(info *** Warning ***) ++ ifneq (,$(findstring Haiku,$(OSTYPE))) ++ OS_LDFLAGS += -lnetwork ++ LIBPATH += $(subst :, ,$(LIBRARY_PATH)) ++ else ++ ifeq (,$(findstring NetBSD,$(OSTYPE))) ++ ifneq (no ldconfig,$(findstring no ldconfig,$(shell which ldconfig 2>&1))) ++ LDSEARCH :=$(shell ldconfig -r | grep 'search directories' | awk '{print $$3}' | sed 's/:/ /g') ++ endif ++ ifneq (,$(LDSEARCH)) ++ LIBPATH := $(LDSEARCH) + else +- LIBPATH = $(subst :, ,$(LPATH)) +- OS_LDFLAGS += $(patsubst %,-L%,$(LIBPATH)) ++ ifeq (,$(strip $(LPATH))) ++ $(info *** Warning ***) ++ $(info *** Warning *** The library search path on your $(OSTYPE) platform can't be) ++ $(info *** Warning *** determined. This should be resolved before you can expect) ++ $(info *** Warning *** to have fully working simulators.) ++ $(info *** Warning ***) ++ $(info *** Warning *** You can specify your library paths via the LPATH environment) ++ $(info *** Warning *** variable.) ++ $(info *** Warning ***) ++ else ++ LIBPATH = $(subst :, ,$(LPATH)) ++ OS_LDFLAGS += $(patsubst %,-L%,$(LIBPATH)) ++ endif + endif + endif + endif +-- +1.8.3.4 + + +From d050424a3c05924a2388ccfed6df6b74aabaeeab Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= +Date: Sat, 19 Jul 2014 18:29:06 +0200 +Subject: [PATCH 2/3] Work around missing nice() on Haiku + +--- + sim_console.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/sim_console.c b/sim_console.c +index d1bf515..7d6afef 100644 +--- a/sim_console.c ++++ b/sim_console.c +@@ -127,6 +127,10 @@ + #include "sim_timer.h" + #include + ++#ifdef __HAIKU__ ++#define nice(n) ({}) ++#endif ++ + /* Forward Declaraations of Platform specific routines */ + + static t_stat sim_os_poll_kbd (void); +-- +1.8.3.4 + + +From 868e7d40c686120493b06a64c7ca9f97b6326dbf Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= +Date: Sat, 19 Jul 2014 18:29:43 +0200 +Subject: [PATCH 3/3] Haiku has socklen_t + +--- + sim_sock.c | 15 ++++++++++----- + 1 file changed, 10 insertions(+), 5 deletions(-) + +diff --git a/sim_sock.c b/sim_sock.c +index 4773c65..ccccb4e 100644 +--- a/sim_sock.c ++++ b/sim_sock.c +@@ -775,7 +775,8 @@ if (fl == -1) + sta = fcntl (sock, F_SETFL, fl | O_NONBLOCK); /* set nonblock */ + if (sta == -1) + return SOCKET_ERROR; +-#if !defined (macintosh) && !defined (__EMX__) /* Unix only */ ++#if !defined (macintosh) && !defined (__EMX__) && \ ++ !defined (__HAIKU__) /* Unix only */ + sta = fcntl (sock, F_SETOWN, getpid()); /* set ownership */ + if (sta == -1) + return SOCKET_ERROR; +@@ -1029,7 +1030,8 @@ int32 sta, err; + #if defined (macintosh) || defined (__linux) || defined (__linux__) || \ + defined (__APPLE__) || defined (__OpenBSD__) || \ + defined(__NetBSD__) || defined(__FreeBSD__) || \ +- (defined(__hpux) && defined(_XOPEN_SOURCE_EXTENDED)) ++ (defined(__hpux) && defined(_XOPEN_SOURCE_EXTENDED)) || \ ++ defined (__HAIKU__) + socklen_t size; + #elif defined (_WIN32) || defined (__EMX__) || \ + (defined (__ALPHA) && defined (__unix__)) || \ +@@ -1087,7 +1089,8 @@ struct sockaddr_storage peername; + #if defined (macintosh) || defined (__linux) || defined (__linux__) || \ + defined (__APPLE__) || defined (__OpenBSD__) || \ + defined(__NetBSD__) || defined(__FreeBSD__) || \ +- (defined(__hpux) && defined(_XOPEN_SOURCE_EXTENDED)) ++ (defined(__hpux) && defined(_XOPEN_SOURCE_EXTENDED)) || \ ++ defined (__HAIKU__) + socklen_t peernamesize = (socklen_t)sizeof(peername); + #elif defined (_WIN32) || defined (__EMX__) || \ + (defined (__ALPHA) && defined (__unix__)) || \ +@@ -1121,7 +1124,8 @@ static int32 _sim_getaddrname (struct sockaddr *addr, size_t addrsize, char *hos + #if defined (macintosh) || defined (__linux) || defined (__linux__) || \ + defined (__APPLE__) || defined (__OpenBSD__) || \ + defined(__NetBSD__) || defined(__FreeBSD__) || \ +- (defined(__hpux) && defined(_XOPEN_SOURCE_EXTENDED)) ++ (defined(__hpux) && defined(_XOPEN_SOURCE_EXTENDED)) || \ ++ defined (__HAIKU__) + socklen_t size = (socklen_t)addrsize; + #elif defined (_WIN32) || defined (__EMX__) || \ + (defined (__ALPHA) && defined (__unix__)) || \ +@@ -1154,7 +1158,8 @@ struct sockaddr_storage sockname, peername; + #if defined (macintosh) || defined (__linux) || defined (__linux__) || \ + defined (__APPLE__) || defined (__OpenBSD__) || \ + defined(__NetBSD__) || defined(__FreeBSD__) || \ +- (defined(__hpux) && defined(_XOPEN_SOURCE_EXTENDED)) ++ (defined(__hpux) && defined(_XOPEN_SOURCE_EXTENDED)) || \ ++ defined (__HAIKU__) + socklen_t socknamesize = (socklen_t)sizeof(sockname); + socklen_t peernamesize = (socklen_t)sizeof(peername); + #elif defined (_WIN32) || defined (__EMX__) || \ +-- +1.8.3.4 + diff --git a/app-emulation/simh/patches/simh-4.0.0_git.patchset b/app-emulation/simh/patches/simh-4.0.0_git.patchset index 5f2cf5d13..68ebbadfe 100644 --- a/app-emulation/simh/patches/simh-4.0.0_git.patchset +++ b/app-emulation/simh/patches/simh-4.0.0_git.patchset @@ -1,161 +1,23 @@ -From 6554891108c0e2a9cc68eb28f033172f92280b95 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= -Date: Sat, 19 Jul 2014 18:27:44 +0200 -Subject: [PATCH 1/3] Add support for building under Haiku - -We need -lnetwork for sockets. ---- - makefile | 41 +++++++++++++++++++++++------------------ - 1 file changed, 23 insertions(+), 18 deletions(-) - -diff --git a/makefile b/makefile -index ec86998..2800826 100644 ---- a/makefile -+++ b/makefile -@@ -201,25 +201,30 @@ ifeq ($(WIN32),) #*nix Environments (&& cygwin) - OS_LDFLAGS += -L/opt/freeware/lib - endif - else -- ifeq (,$(findstring NetBSD,$(OSTYPE))) -- ifneq (no ldconfig,$(findstring no ldconfig,$(shell which ldconfig 2>&1))) -- LDSEARCH :=$(shell ldconfig -r | grep 'search directories' | awk '{print $$3}' | sed 's/:/ /g') -- endif -- ifneq (,$(LDSEARCH)) -- LIBPATH := $(LDSEARCH) -- else -- ifeq (,$(strip $(LPATH))) -- $(info *** Warning ***) -- $(info *** Warning *** The library search path on your $(OSTYPE) platform can't be) -- $(info *** Warning *** determined. This should be resolved before you can expect) -- $(info *** Warning *** to have fully working simulators.) -- $(info *** Warning ***) -- $(info *** Warning *** You can specify your library paths via the LPATH environment) -- $(info *** Warning *** variable.) -- $(info *** Warning ***) -+ ifneq (,$(findstring Haiku,$(OSTYPE))) -+ OS_LDFLAGS += -lnetwork -+ LIBPATH += $(subst :, ,$(LIBRARY_PATH)) -+ else -+ ifeq (,$(findstring NetBSD,$(OSTYPE))) -+ ifneq (no ldconfig,$(findstring no ldconfig,$(shell which ldconfig 2>&1))) -+ LDSEARCH :=$(shell ldconfig -r | grep 'search directories' | awk '{print $$3}' | sed 's/:/ /g') -+ endif -+ ifneq (,$(LDSEARCH)) -+ LIBPATH := $(LDSEARCH) - else -- LIBPATH = $(subst :, ,$(LPATH)) -- OS_LDFLAGS += $(patsubst %,-L%,$(LIBPATH)) -+ ifeq (,$(strip $(LPATH))) -+ $(info *** Warning ***) -+ $(info *** Warning *** The library search path on your $(OSTYPE) platform can't be) -+ $(info *** Warning *** determined. This should be resolved before you can expect) -+ $(info *** Warning *** to have fully working simulators.) -+ $(info *** Warning ***) -+ $(info *** Warning *** You can specify your library paths via the LPATH environment) -+ $(info *** Warning *** variable.) -+ $(info *** Warning ***) -+ else -+ LIBPATH = $(subst :, ,$(LPATH)) -+ OS_LDFLAGS += $(patsubst %,-L%,$(LIBPATH)) -+ endif - endif - endif - endif --- -1.8.3.4 +From 68c7b23429476c19c4ad22548950b8a913291ae8 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= +Date: Sat, 8 Jul 2017 18:51:36 +0200 +Subject: HAIKU: Build fix -From d050424a3c05924a2388ccfed6df6b74aabaeeab Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= -Date: Sat, 19 Jul 2014 18:29:06 +0200 -Subject: [PATCH 2/3] Work around missing nice() on Haiku - ---- - sim_console.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/sim_console.c b/sim_console.c -index d1bf515..7d6afef 100644 ---- a/sim_console.c -+++ b/sim_console.c -@@ -127,6 +127,10 @@ - #include "sim_timer.h" - #include - +diff --git a/sim_defs.h b/sim_defs.h +index 328f02c..dcdc153 100644 +--- a/sim_defs.h ++++ b/sim_defs.h +@@ -189,6 +189,9 @@ typedef signed int int32; + typedef unsigned char uint8; + typedef unsigned short uint16; + typedef unsigned int uint32; +#ifdef __HAIKU__ -+#define nice(n) ({}) ++typedef unsigned char Uint8; +#endif -+ - /* Forward Declaraations of Platform specific routines */ - - static t_stat sim_os_poll_kbd (void); + #endif + typedef int t_stat; /* status */ + typedef int t_bool; /* boolean */ -- -1.8.3.4 - - -From 868e7d40c686120493b06a64c7ca9f97b6326dbf Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= -Date: Sat, 19 Jul 2014 18:29:43 +0200 -Subject: [PATCH 3/3] Haiku has socklen_t - ---- - sim_sock.c | 15 ++++++++++----- - 1 file changed, 10 insertions(+), 5 deletions(-) - -diff --git a/sim_sock.c b/sim_sock.c -index 4773c65..ccccb4e 100644 ---- a/sim_sock.c -+++ b/sim_sock.c -@@ -775,7 +775,8 @@ if (fl == -1) - sta = fcntl (sock, F_SETFL, fl | O_NONBLOCK); /* set nonblock */ - if (sta == -1) - return SOCKET_ERROR; --#if !defined (macintosh) && !defined (__EMX__) /* Unix only */ -+#if !defined (macintosh) && !defined (__EMX__) && \ -+ !defined (__HAIKU__) /* Unix only */ - sta = fcntl (sock, F_SETOWN, getpid()); /* set ownership */ - if (sta == -1) - return SOCKET_ERROR; -@@ -1029,7 +1030,8 @@ int32 sta, err; - #if defined (macintosh) || defined (__linux) || defined (__linux__) || \ - defined (__APPLE__) || defined (__OpenBSD__) || \ - defined(__NetBSD__) || defined(__FreeBSD__) || \ -- (defined(__hpux) && defined(_XOPEN_SOURCE_EXTENDED)) -+ (defined(__hpux) && defined(_XOPEN_SOURCE_EXTENDED)) || \ -+ defined (__HAIKU__) - socklen_t size; - #elif defined (_WIN32) || defined (__EMX__) || \ - (defined (__ALPHA) && defined (__unix__)) || \ -@@ -1087,7 +1089,8 @@ struct sockaddr_storage peername; - #if defined (macintosh) || defined (__linux) || defined (__linux__) || \ - defined (__APPLE__) || defined (__OpenBSD__) || \ - defined(__NetBSD__) || defined(__FreeBSD__) || \ -- (defined(__hpux) && defined(_XOPEN_SOURCE_EXTENDED)) -+ (defined(__hpux) && defined(_XOPEN_SOURCE_EXTENDED)) || \ -+ defined (__HAIKU__) - socklen_t peernamesize = (socklen_t)sizeof(peername); - #elif defined (_WIN32) || defined (__EMX__) || \ - (defined (__ALPHA) && defined (__unix__)) || \ -@@ -1121,7 +1124,8 @@ static int32 _sim_getaddrname (struct sockaddr *addr, size_t addrsize, char *hos - #if defined (macintosh) || defined (__linux) || defined (__linux__) || \ - defined (__APPLE__) || defined (__OpenBSD__) || \ - defined(__NetBSD__) || defined(__FreeBSD__) || \ -- (defined(__hpux) && defined(_XOPEN_SOURCE_EXTENDED)) -+ (defined(__hpux) && defined(_XOPEN_SOURCE_EXTENDED)) || \ -+ defined (__HAIKU__) - socklen_t size = (socklen_t)addrsize; - #elif defined (_WIN32) || defined (__EMX__) || \ - (defined (__ALPHA) && defined (__unix__)) || \ -@@ -1154,7 +1158,8 @@ struct sockaddr_storage sockname, peername; - #if defined (macintosh) || defined (__linux) || defined (__linux__) || \ - defined (__APPLE__) || defined (__OpenBSD__) || \ - defined(__NetBSD__) || defined(__FreeBSD__) || \ -- (defined(__hpux) && defined(_XOPEN_SOURCE_EXTENDED)) -+ (defined(__hpux) && defined(_XOPEN_SOURCE_EXTENDED)) || \ -+ defined (__HAIKU__) - socklen_t socknamesize = (socklen_t)sizeof(sockname); - socklen_t peernamesize = (socklen_t)sizeof(peername); - #elif defined (_WIN32) || defined (__EMX__) || \ --- -1.8.3.4 +2.12.2 diff --git a/app-emulation/simh/simh-4.0.0_git.recipe b/app-emulation/simh/simh-4.0.0_git.recipe index 4a762926d..9b549f46a 100644 --- a/app-emulation/simh/simh-4.0.0_git.recipe +++ b/app-emulation/simh/simh-4.0.0_git.recipe @@ -17,11 +17,11 @@ PDP-11, PDP-15, VAX HOMEPAGE="http://simh.trailing-edge.com/" COPYRIGHT="1993-2008 Robert M Supnik" LICENSE="MIT" -REVISION="3" -SOURCE_URI="https://github.com/simh/simh/archive/18175040523db4d6195d1d32696d4c2178490c11.tar.gz" -CHECKSUM_SHA256="4f6b475188039e209b930b76a58013f14e41da65a1895be0a8714b33d8519070" -SOURCE_DIR="simh-18175040523db4d6195d1d32696d4c2178490c11" -#PATCHES="simh-4.0.0_git.patchset" +REVISION="4" +SOURCE_URI="https://github.com/simh/simh/archive/7ed68aed6a60160c58b5d5ffc8be5228221a6f6c.tar.gz" +CHECKSUM_SHA256="fb74be15f7e96f79c0ca9d91eb3d22468806767b0671e079d23803db5a5e105c" +SOURCE_DIR="simh-7ed68aed6a60160c58b5d5ffc8be5228221a6f6c" +PATCHES="simh-4.0.0_git.patchset" ARCHITECTURES="!x86_gcc2 x86 ?x86_64" SECONDARY_ARCHITECTURES="x86" @@ -30,16 +30,24 @@ PROVIDES=" simh$secondaryArchSuffix = $portVersion cmd:altair = $portVersion cmd:altairz80 = $portVersion + cmd:b5500 = $portVersion + cmd:cdc1700 = $portVersion cmd:eclipse = $portVersion cmd:gri = $portVersion cmd:h316 = $portVersion cmd:hp2100 = $portVersion + cmd:hp3000 = $portVersion cmd:i1401 = $portVersion cmd:i1620 = $portVersion cmd:i7094 = $portVersion cmd:ibm1130 = $portVersion cmd:id16 = $portVersion cmd:id32 = $portVersion + cmd:imds_225 = $portVersion + cmd:isys8010 = $portVersion + cmd:isys8020 = $portVersion + cmd:isys8024 = $portVersion + cmd:isys8030 = $portVersion cmd:lgp = $portVersion cmd:microvax1 = $portVersion cmd:microvax2 = $portVersion @@ -68,14 +76,17 @@ PROVIDES=" " REQUIRES=" haiku$secondaryArchSuffix - lib:libSDL2_2.0${secondaryArchSuffix} - #TODO:pcap + lib:libpcap$secondaryArchSuffix + lib:libSDL2_2.0$secondaryArchSuffix + lib:libSDL2_ttf$secondaryArchSuffix + dejavu " BUILD_REQUIRES=" haiku${secondaryArchSuffix}_devel + devel:libpcap$secondaryArchSuffix devel:libSDL2$secondaryArchSuffix - #TODO:pcap + devel:libSDL2_ttf$secondaryArchSuffix " BUILD_PREREQUIRES=" cmd:awk @@ -85,11 +96,18 @@ BUILD_PREREQUIRES=" cmd:make cmd:find cmd:which + dejavu " BUILD() { - make $jobArgs + # Something wrong with the include and lib detection + # Let's do it manually for now. + make \ + VIDEO_CCDEFS="$(sdl2-config --cflags)" \ + VIDEO_LDFLAGS="$(sdl2-config --libs)" \ + FONTPATH=$(finddir B_SYSTEM_FONTS_DIRECTORY) \ + $jobArgs } INSTALL() @@ -98,4 +116,6 @@ INSTALL() for bin in BIN/*; do cp -a "$bin" "$prefix/bin" done + + strip $prefix/bin/* }