pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

ti99sim: Install ROMS, document patches, fix setup script



Module Name:	pkgsrc-wip
Committed By:	Jason W. Bacon <bacon%NetBSD.org@localhost>
Pushed By:	outpaddling
Date:		Tue Oct 8 09:34:59 2024 -0500
Changeset:	ee9cae4ebb83592af295a9315125409cddbb1673

Modified Files:
	ti99sim/Makefile
	ti99sim/PLIST
	ti99sim/distinfo
	ti99sim/patches/patch-Makefile.linux
	ti99sim/patches/patch-include_platform.hpp
	ti99sim/patches/patch-src_core_device-support.cpp
	ti99sim/patches/patch-src_core_stateobject.cpp
Added Files:
	ti99sim/COMMIT_MSG
	ti99sim/files/ti99sim-setup
Removed Files:
	ti99sim/files/Makefile.freebsd

Log Message:
ti99sim: Install ROMS, document patches, fix setup script

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=ee9cae4ebb83592af295a9315125409cddbb1673

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 ti99sim/COMMIT_MSG                                |   5 ++
 ti99sim/Makefile                                  |  10 ++-
 ti99sim/PLIST                                     |  13 +++
 ti99sim/distinfo                                  |   8 +-
 ti99sim/files/Makefile.freebsd                    | 103 ----------------------
 ti99sim/files/ti99sim-setup                       |  83 +++++++++++++++++
 ti99sim/patches/patch-Makefile.linux              |  41 +++------
 ti99sim/patches/patch-include_platform.hpp        |   2 +
 ti99sim/patches/patch-src_core_device-support.cpp |   2 +
 ti99sim/patches/patch-src_core_stateobject.cpp    |   2 +
 10 files changed, 132 insertions(+), 137 deletions(-)

diffs:
diff --git a/ti99sim/COMMIT_MSG b/ti99sim/COMMIT_MSG
new file mode 100644
index 0000000000..e34e3d9e73
--- /dev/null
+++ b/ti99sim/COMMIT_MSG
@@ -0,0 +1,5 @@
+emulators/ti99-sim: Add ti99sim-0.16.0
+
+Packaged by: J. Bacon
+
+Uptream changes
diff --git a/ti99sim/Makefile b/ti99sim/Makefile
index ebc69ef940..9fe3d21d5c 100644
--- a/ti99sim/Makefile
+++ b/ti99sim/Makefile
@@ -5,8 +5,8 @@
 #              Mon Oct  7 11:59:41 CDT 2024               #
 ###########################################################
 
-DISTNAME=	ti99sim-${PV}.src
-PKGNAME=	${DISTNAME}
+DISTNAME=	${PKGNAME}.src
+PKGNAME=	ti99sim-${PV}
 CATEGORIES=	emulators
 MASTER_SITES=	https://www.mrousseau.org/programs/ti99sim/archives/
 EXTRACT_SUFX=	.tar.xz
@@ -36,6 +36,12 @@ LDFLAGS+=	-L${PREFIX}/lib ${COMPILER_RPATH_FLAG}${PREFIX}/lib -lcrypto
 PV=		0.16.0
 DATADIR=	${PREFIX}/share/ti99sim
 
+post-patch:
+	${SED} -e 's|/usr/local|${PREFIX}|g' ${FILESDIR}/ti99sim-setup > ${WRKDIR}/ti99sim-setup
+
+post-install:
+	${INSTALL_SCRIPT} ${WRKDIR}/ti99sim-setup ${DESTDIR}${PREFIX}/bin
+
 .include "../../security/openssl/buildlink3.mk"
 .include "../../devel/SDL2/buildlink3.mk"
 .include "../../mk/bsd.pkg.mk"
diff --git a/ti99sim/PLIST b/ti99sim/PLIST
index 90ce5a48d4..09db2cee91 100644
--- a/ti99sim/PLIST
+++ b/ti99sim/PLIST
@@ -12,6 +12,7 @@ bin/mkspch
 bin/say
 bin/ti99sim-console
 bin/ti99sim-sdl
+bin/ti99sim-setup
 share/ti99sim/bin/catalog
 share/ti99sim/bin/convert-ctg
 share/ti99sim/bin/decode
@@ -25,6 +26,18 @@ share/ti99sim/bin/mkspch
 share/ti99sim/bin/say
 share/ti99sim/bin/ti99sim-console
 share/ti99sim/bin/ti99sim-sdl
+share/ti99sim/roms/cf7+.dat
+share/ti99sim/roms/cf7a+.bin
+share/ti99sim/roms/gram-kracker.dat
+share/ti99sim/roms/mini-memory.dat
+share/ti99sim/roms/spchrom.dat
+share/ti99sim/roms/ti-994.dat
+share/ti99sim/roms/ti-994a-qi.dat
+share/ti99sim/roms/ti-994a-v22.dat
+share/ti99sim/roms/ti-994a.dat
+share/ti99sim/roms/ti-disk.dat
+share/ti99sim/roms/ti-pcard.dat
+share/ti99sim/roms/tiworkshop379.dat
 @pkgdir share/ti99sim/disks
 @pkgdir share/ti99sim/console
 @pkgdir share/ti99sim/cartridges
diff --git a/ti99sim/distinfo b/ti99sim/distinfo
index 1078511fba..78c7d59fd2 100644
--- a/ti99sim/distinfo
+++ b/ti99sim/distinfo
@@ -3,13 +3,13 @@ $NetBSD$
 BLAKE2s (ti99sim-0.16.0.src.tar.xz) = b6cd23be4a8e281f926a82726409d466651ae03f69fb9a431d1ce44a2d93b09c
 SHA512 (ti99sim-0.16.0.src.tar.xz) = 5636b1ecbaf7da10ecaea2d59aac0d84f03934065c02d3441576e4675a6d818ca21e3af80caddfa9fef640f6e0bef093a09082ec0d453df87b67431d7f5c0fec
 Size (ti99sim-0.16.0.src.tar.xz) = 193760 bytes
-SHA1 (patch-Makefile.linux) = c45906a6dda3ede7328390e15bbacaaa0f5cde56
+SHA1 (patch-Makefile.linux) = 5e97cd887fdd8762a7caa95ec789295a40c4f3dd
 SHA1 (patch-include_common.hpp) = 6a0e63c88eb988b8c8f52ca3bfa435179c206ed4
-SHA1 (patch-include_platform.hpp) = 2b01ea7439d915095a36ea01921c2266fd77094b
+SHA1 (patch-include_platform.hpp) = 351c26f2c5d3697009ed41398a00981743fea317
 SHA1 (patch-rules.mak) = 2c370ccccc7f775d48c453aedb09bab37532ec35
 SHA1 (patch-src_Makefile) = 973ef9f28c277d4be8f67b8e7d55f3e314acc797
 SHA1 (patch-src_console_Makefile) = 79e5b9c710d005facfa7641f2ec129e9f72241b1
-SHA1 (patch-src_core_device-support.cpp) = c685db3bd50d8ee1d320971a3b759e06459c15be
-SHA1 (patch-src_core_stateobject.cpp) = 9ee81d2897741d5d881dd35a83fd622a360ff9ce
+SHA1 (patch-src_core_device-support.cpp) = 77042bb0d1fb5e348a98a6694bc3ee57f1ee7943
+SHA1 (patch-src_core_stateobject.cpp) = 4abda2c067e115d341976c0a92bd7cdff7b0c56b
 SHA1 (patch-src_sdl_Makefile) = 2cb0bda9c81110f6ee03739ceb5160cb872f34f1
 SHA1 (patch-src_util_Makefile) = e2f64a450229b737f6f70cdf67f43ff8dfeefe07
diff --git a/ti99sim/files/Makefile.freebsd b/ti99sim/files/Makefile.freebsd
deleted file mode 100644
index e95835edd1..0000000000
--- a/ti99sim/files/Makefile.freebsd
+++ /dev/null
@@ -1,103 +0,0 @@
-# TI-99/sim Makefile for Linux
-
-XLIBS += -lstdc++fs
-
-ifndef DATA_DIR
-DATA_DIR  := /usr/local/share/ti99sim
-endif
-
-ifndef BIN_DIR
-BIN_DIR   := $(DATA_DIR)/bin
-endif
-
-ifndef SYS_BIN
-SYS_BIN   := /usr/local/bin
-endif
-
-ifneq ($(BIN_DIR),$(DATA_DIR)/bin)
-	TI_DATA_DIR := TI_DATA_DIR=$(DATA_DIR)
-endif
-
-INSTALL   := /usr/bin/install
-
-ITARGETS  = \
-	bin/catalog \
-	bin/convert-ctg \
-	bin/decode \
-	bin/disk \
-	bin/dumpcpu \
-	bin/dumpgrom \
-	bin/dumpspch \
-	bin/list \
-	bin/mkcart \
-	bin/mkspch \
-	bin/say \
-	bin/ti99sim-console \
-	bin/ti99sim-sdl
-
-SRC_DIRS = \
-	src/core \
-	src/console \
-	src/sdl \
-	src/util
-
-install: ti99sim
-	@$(INSTALL) -d $(DATA_DIR)
-	@$(INSTALL) -d $(DATA_DIR)/cartridges
-	@$(INSTALL) -d $(DATA_DIR)/console
-	@$(INSTALL) -d $(DATA_DIR)/disks
-	@$(INSTALL) -d $(BIN_DIR)
-	@for target in $(ITARGETS); do \
-	   $(INSTALL) -s $$target $(BIN_DIR); \
-	 done
-	@if [ $(BIN_DIR) != $(SYS_BIN) ]; then \
-	   for target in $(notdir $(ITARGETS)); do \
-	     ln -f -s $(BIN_DIR)/$$target $(SYS_BIN)/$$target; \
-	   done \
-	fi
-
-uninstall:
-	@for target in $(notdir $(ITARGETS)); do \
-	   rm -f $(BIN_DIR)/$$target; \
-	   rm -f $(SYS_BIN)/$$target; \
-	done
-	@rm -Rd $(DATA_DIR)
-
-clean:
-	@if [ -x src ]; then \
-	   rm -f {.,include,doc}/*~; \
-	   for dir in $(SRC_DIRS); do \
-	     $(MAKE) -sC $$dir clean; \
-	   done \
-	 fi
-	@if [ -x bin ]; then \
-	   rmdir --ignore-fail-on-non-empty bin; \
-	 fi
-
-dep:
-	@if [ -x src ]; then \
-	  for dir in $(SRC_DIRS); do \
-	    $(MAKE) -C $$dir dep; \
-	  done \
-	fi
-
-ti99sim:
-	@if [ -x src ]; then \
-	  if ! [ -r /usr/include/endian.h ]; then \
-	    if [ -r /usr/include/machine/endian.h ]; then \
-	      rm -f include/endian.h; \
-	      ln -s /usr/include/machine/endian.h include/endian.h; \
-	    fi \
-	  fi; \
-	  for dir in $(SRC_DIRS); do \
-	    $(MAKE) -sC $$dir $(TI_DATA_DIR); \
-	  done \
-	fi
-
-test: ti99sim
-	@if [ -x test ]; then \
-	  $(MAKE) -sC test; \
-	  for test in test/bin/test-*; do \
-	    $$test; \
-	  done \
-	fi
diff --git a/ti99sim/files/ti99sim-setup b/ti99sim/files/ti99sim-setup
new file mode 100755
index 0000000000..9d59625fe7
--- /dev/null
+++ b/ti99sim/files/ti99sim-setup
@@ -0,0 +1,83 @@
+#!/bin/sh
+
+root=/usr/local/share/ti99sim
+
+tmpdir=$(mktemp -d)
+cd $tmpdir
+
+for fetch in fetch wget curl notfound; do
+    if which $fetch; then
+	break
+    fi
+done
+if [ $fetch = notfound ]; then
+    exit 1
+elif [ $fetch = curl ]; then
+    fetch='curl -O'
+fi
+
+$fetch http://ftp.whtech.com/System%20ROMs/MAME/pre_0.174/ti99_complete.zip
+$fetch http://ftp.whtech.com/System%20ROMs/MAME/ti99_gkracker.zip
+$fetch http://ftp.whtech.com/emulators/mess/mess_modules.zip
+
+unzip -oq ti99_complete ti99_4a.zip
+unzip -oq ti99_complete ti99_4qi.zip
+unzip -oq ti99_complete ti99_fdc.zip
+unzip -oq ti99_complete ti99_pcode.zip
+unzip -oq ti99_complete ti99_speech.zip
+
+cp $root/roms/cf7a+.bin .
+
+unzip -oq ti99_4a.zip '*.bin'
+unzip -oq ti99_4qi.zip '*.bin'
+unzip -oq ti99_fdc.zip '*.bin'
+unzip -oq ti99_pcode.zip '*.bin'
+unzip -oq ti99_speech.zip '*.bin'
+unzip -oq ti99_gkracker.zip '*.bin'
+
+convert-ctg $root/roms/cf7+.dat
+convert-ctg $root/roms/gram-kracker.dat
+convert-ctg $root/roms/ti-994a.dat
+convert-ctg $root/roms/ti-994a-qi.dat
+convert-ctg $root/roms/ti-disk.dat
+convert-ctg $root/roms/ti-pcard.dat
+
+mkdir -p ~/.ti99sim
+
+if [ -d /home/pi/RetroPie ]; then
+	if [ ! -d ~/.ti99sim/console ]; then
+		mkdir -p /home/pi/RetroPie/BIOS/ti99
+		ln -s /home/pi/RetroPie/BIOS/ti99 ~/.ti99sim/console
+	fi
+	if [ ! -d ~/.ti99sim/cartridges ]; then
+		mkdir -p /home/pi/RetroPie/roms/ti99
+		ln -s /home/pi/RetroPie/roms/ti99 ~/.ti99sim/cartridges
+	fi
+fi
+
+mkdir -p ~/.ti99sim/console
+mkdir -p ~/.ti99sim/cartridges
+mkdir -p ~/.ti99sim/disks
+
+if [ ! -f ~/.ti99sim/disks/image.cf7 ]; then
+	tmpdisk=$(mktemp -uq)
+	disk --create=sssd $tmpdisk > /dev/null
+	disk --output=cf7+ --filename=image.cf7#32 $tmpdisk > /dev/null
+	rm $tmpdisk
+	yes -n | mv -i image.cf7 ~/.ti99sim/disks
+fi
+
+yes -n | mv -i *ctg ~/.ti99sim/console
+yes -n | mv -i spchrom.bin ~/.ti99sim/console
+
+unzip -oq mess_modules -d roms
+yes -n | mv -i roms/minimem*.bin .
+
+convert-ctg $root/roms/mini-memory.dat
+mkcart roms
+
+yes -n | mv -i *ctg ~/.ti99sim/cartridges
+
+cd -
+
+rm -Rf $tmpdir
diff --git a/ti99sim/patches/patch-Makefile.linux b/ti99sim/patches/patch-Makefile.linux
index c940fe6f0a..9c272c0464 100644
--- a/ti99sim/patches/patch-Makefile.linux
+++ b/ti99sim/patches/patch-Makefile.linux
@@ -1,41 +1,26 @@
 $NetBSD$
 
-# Symlinks are problematic with destdir
+# Install ROMs, symlinks are problematic with destdir
 
 --- Makefile.linux.orig	2020-05-25 20:52:22.000000000 +0000
 +++ Makefile.linux
-@@ -1,7 +1,5 @@
- # TI-99/sim Makefile for Linux
- 
--XLIBS += -lstdc++fs
--
- ifndef DATA_DIR
- DATA_DIR  := /opt/ti99sim
- endif
-@@ -42,17 +40,18 @@ SRC_DIRS = \
- 	src/util
- 
- install: ti99sim
--	@$(INSTALL) -d $(DATA_DIR)
--	@$(INSTALL) -d $(DATA_DIR)/cartridges
--	@$(INSTALL) -d $(DATA_DIR)/console
--	@$(INSTALL) -d $(DATA_DIR)/disks
--	@$(INSTALL) -d $(BIN_DIR)
--	@for target in $(ITARGETS); do \
-+	$(INSTALL) -d $(DATA_DIR)
-+	$(INSTALL) -d $(DATA_DIR)/cartridges
-+	$(INSTALL) -d $(DATA_DIR)/console
-+	$(INSTALL) -d $(DATA_DIR)/disks
-+	$(INSTALL) -d $(BIN_DIR)
-+	$(INSTALL) -d $(SYS_BIN)
-+	for target in $(ITARGETS); do \
+@@ -46,15 +46,18 @@ install: ti99sim
+ 	@$(INSTALL) -d $(DATA_DIR)/cartridges
+ 	@$(INSTALL) -d $(DATA_DIR)/console
+ 	@$(INSTALL) -d $(DATA_DIR)/disks
++	@$(INSTALL) -d $(DATA_DIR)/roms
+ 	@$(INSTALL) -d $(BIN_DIR)
++	@$(INSTALL) -d $(SYS_BIN)
+ 	@for target in $(ITARGETS); do \
  	   $(INSTALL) -s $$target $(BIN_DIR); \
  	 done
--	@if [ $(BIN_DIR) != $(SYS_BIN) ]; then \
-+	if [ $(BIN_DIR) != $(SYS_BIN) ]; then \
+ 	@if [ $(BIN_DIR) != $(SYS_BIN) ]; then \
  	   for target in $(notdir $(ITARGETS)); do \
 -	     ln -f -s $(BIN_DIR)/$$target $(SYS_BIN)/$$target; \
 +	     cp $(BIN_DIR)/$$target $(SYS_BIN)/$$target; \
  	   done \
  	fi
++	$(INSTALL) roms/* $(DATA_DIR)/roms
  
+ uninstall:
+ 	@for target in $(notdir $(ITARGETS)); do \
diff --git a/ti99sim/patches/patch-include_platform.hpp b/ti99sim/patches/patch-include_platform.hpp
index 245e663fcd..8682481a4c 100644
--- a/ti99sim/patches/patch-include_platform.hpp
+++ b/ti99sim/patches/patch-include_platform.hpp
@@ -1,5 +1,7 @@
 $NetBSD$
 
+# Document misleading code
+
 --- include/platform.hpp.orig	2024-10-06 12:13:54 UTC
 +++ include/platform.hpp
 @@ -35,6 +35,10 @@
diff --git a/ti99sim/patches/patch-src_core_device-support.cpp b/ti99sim/patches/patch-src_core_device-support.cpp
index c488de643d..71c05e870d 100644
--- a/ti99sim/patches/patch-src_core_device-support.cpp
+++ b/ti99sim/patches/patch-src_core_device-support.cpp
@@ -1,5 +1,7 @@
 $NetBSD$
 
+# Fix build
+
 --- src/core/device-support.cpp.orig	2024-10-04 12:23:39 UTC
 +++ src/core/device-support.cpp
 @@ -27,6 +27,7 @@
diff --git a/ti99sim/patches/patch-src_core_stateobject.cpp b/ti99sim/patches/patch-src_core_stateobject.cpp
index 5ade234e72..da8c55051e 100644
--- a/ti99sim/patches/patch-src_core_stateobject.cpp
+++ b/ti99sim/patches/patch-src_core_stateobject.cpp
@@ -1,5 +1,7 @@
 $NetBSD$
 
+# Fix build
+
 --- src/core/stateobject.cpp.orig	2024-10-03 22:18:01 UTC
 +++ src/core/stateobject.cpp
 @@ -31,6 +31,7 @@


Home | Main Index | Thread Index | Old Index