From c6330010d1bc3e46c795d75b719969691cf184e8 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Fri, 6 Dec 2024 17:25:11 +0100 Subject: [PATCH] update to 4.10.2.2614 source renamed from Squeak to squeak-vm [release 4.10.2.2614-1mamba;Fri Dec 06 2024] --- README.md | 2 + squeak-vm-4.10.2.2614-alsa-fixes.patch | 157 +++++ squeak-vm-4.10.2.2614-dprintf.patch | 12 + squeak-vm-4.10.2.2614-fix-cmake.patch | 33 + squeak-vm-4.10.2.2614-format-security.patch | 13 + squeak-vm-4.10.2.2614-gcc-14.patch | 673 ++++++++++++++++++++ squeak-vm-4.10.2.2614-squeak-init-fix.patch | 57 ++ squeak-vm.spec | 99 +++ 8 files changed, 1046 insertions(+) create mode 100644 squeak-vm-4.10.2.2614-alsa-fixes.patch create mode 100644 squeak-vm-4.10.2.2614-dprintf.patch create mode 100644 squeak-vm-4.10.2.2614-fix-cmake.patch create mode 100644 squeak-vm-4.10.2.2614-format-security.patch create mode 100644 squeak-vm-4.10.2.2614-gcc-14.patch create mode 100644 squeak-vm-4.10.2.2614-squeak-init-fix.patch create mode 100644 squeak-vm.spec diff --git a/README.md b/README.md index 489baa0..5b9470c 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,4 @@ # squeak-vm +Squeak is a full-featured implementation of the Smalltalk programming language and environment based on (and largely compatible with) the original Smalltalk-80 system. Squeak has very powerful 2- and 3-D graphics, sound, video, MIDI, animation and other multimedia capabilities -- and one of the most impressive development environments ever created. It also includes a customisable framework for creating dynamic HTTP servers and interactively extensible Web sites. The entire Squeak system is open source software, distributed freely with a liberal license. + diff --git a/squeak-vm-4.10.2.2614-alsa-fixes.patch b/squeak-vm-4.10.2.2614-alsa-fixes.patch new file mode 100644 index 0000000..00e0ad7 --- /dev/null +++ b/squeak-vm-4.10.2.2614-alsa-fixes.patch @@ -0,0 +1,157 @@ +--- trunk/platforms/unix/vm-sound-ALSA/sqUnixSoundALSA.c 2013/03/26 01:49:32 2711 ++++ trunk/platforms/unix/vm-sound-ALSA/sqUnixSoundALSA.c 2013/04/04 05:05:14 2712 +@@ -2,7 +2,7 @@ + * + * Author: Ian.Piumarta@squeakland.org + * +- * Last edited: 2010-04-01 13:48:37 by piumarta on emilia-2.local ++ * Last edited: 2013-04-04 13:59:35 by piumarta on linux32 + * + * Copyright (C) 2006 by Ian Piumarta + * All rights reserved. +@@ -65,8 +65,10 @@ + /* output */ + + ++#if 0 + #define SQ_SND_PLAY_START_THRESHOLD 7/8 + #define SQ_SND_PLAY_AVAIL_MIN 4/8 ++#endif + + static snd_pcm_t *output_handle= 0; + static snd_async_handler_t *output_handler= 0; +@@ -99,8 +101,8 @@ + int err; + snd_pcm_hw_params_t *hwparams; + snd_pcm_sw_params_t *swparams; ++ snd_pcm_uframes_t period_size; + unsigned int uval; +- int dir; + + if (output_handle) sound_Stop(); + +@@ -114,18 +116,25 @@ + snd_pcm_hw_params_set_format(output_handle, hwparams, SND_PCM_FORMAT_S16_LE); + snd_pcm_hw_params_set_channels(output_handle, hwparams, output_channels); + uval= samplesPerSec; +- snd_pcm_hw_params_set_rate_near(output_handle, hwparams, &uval, &dir); ++ snd_pcm_hw_params_set_rate_near(output_handle, hwparams, &uval, 0); + output_buffer_period_size= frameCount; +- snd_pcm_hw_params_set_period_size_near(output_handle, hwparams, &output_buffer_period_size, &dir); ++ snd_pcm_hw_params_set_period_size_near(output_handle, hwparams, &output_buffer_period_size, 0); + snd(pcm_hw_params(output_handle, hwparams), "sound_Start: snd_pcm_hw_params"); + + snd_pcm_sw_params_alloca(&swparams); + snd(pcm_sw_params_current(output_handle, swparams), "sound_Start: snd_pcm_sw_params_current"); ++#if 0 + snd(pcm_sw_params_set_start_threshold(output_handle, swparams, frameCount * SQ_SND_PLAY_START_THRESHOLD), "sound_Start: snd_pcm_sw_params_set_start_threshold"); + snd(pcm_sw_params_set_avail_min(output_handle, swparams, frameCount * SQ_SND_PLAY_AVAIL_MIN), "sound_Start: snd_pcm_sw_parama_set_avail_min"); ++#endif + snd(pcm_sw_params_set_xfer_align(output_handle, swparams, 1), "sound_Start: snd_pcm_sw_params_set_xfer_align"); + snd(pcm_sw_params(output_handle, swparams), "sound_Start: snd_pcm_sw_params"); ++ ++ snd(pcm_hw_params_get_period_size(hwparams, &period_size, 0), "sound_Start: pcm_hw_params_get_period_size"); + snd(pcm_hw_params_get_buffer_size(hwparams, &output_buffer_size), "sound_Start: pcm_hw_params_get_buffer_size"); ++ snd(pcm_sw_params_set_avail_min(output_handle, swparams, period_size), "sound_Start: snd_pcm_sw_parama_set_avail_min"); ++ snd(pcm_sw_params_set_start_threshold(output_handle, swparams, output_buffer_size), "sound_Start: snd_pcm_sw_params_set_start_threshold"); ++ + output_buffer_frames_available= 1; + max_delay_frames= output_buffer_period_size * 2; /* set initial delay frames */ + +@@ -200,6 +209,7 @@ + + static sqInt sound_PlaySamplesFromAtLength(sqInt frameCount, void *srcBufPtr, sqInt startIndex) + { ++#if 0 + if (output_handle) + { + void *samples= srcBufPtr + startIndex * output_channels * 2; +@@ -222,6 +232,41 @@ + return count; + } + success(false); ++#else ++ if (!output_handle) ++ success(false); ++ else { ++ void *samples= srcBufPtr + startIndex * output_channels * 2; ++ int count= snd_pcm_writei(output_handle, samples, frameCount); ++ ++ if (count < frameCount / 2) ++ output_buffer_frames_available= 0; ++ ++ if (count >= 0) ++ return count; ++ ++ switch (count) { ++ case -EPIPE: { /* under-run */ ++ int err= snd_pcm_prepare(output_handle); ++ if (err < 0) fprintf(stderr, "sound_PlaySamples: can't recover from underrun, snd_pcm_prepare failed: %s", snd_strerror(err)); ++ break; ++ } ++ case -ESTRPIPE: { /* stream suspended */ ++ int err; ++ int timeout= 5; /* half a second */ ++ while (-EAGAIN == (err= snd_pcm_resume(output_handle)) && timeout--) ++ usleep(100000); /* wait 1/10 of a second for suspend flag to be released */ ++ if (-EAGAIN == err) break; /* return to interpreter and try to recover next time around */ ++ if (err < 0) err= snd_pcm_prepare(output_handle); ++ if (err < 0) fprintf(stderr, "sound_PlaySamples: can't recover from suspend, snd_pcm_prepare failed: %s", snd_strerror(err)); ++ break; ++ } ++ default: ++ fprintf(stderr, "snd_pcm_writei returned %i\n", count); ++ break; ++ } ++ } ++#endif + return 0; + } + +@@ -231,8 +276,10 @@ + /* input */ + + ++#if 0 + #define SQ_SND_REC_START_THRESHOLD 4/8 + #define SQ_SND_REC_AVAIL_MIN 4/8 ++#endif + + static snd_pcm_t *input_handle= 0; + static snd_async_handler_t *input_handler= 0; +@@ -262,7 +309,8 @@ + snd_pcm_hw_params_t *hwparams; + snd_pcm_sw_params_t *swparams; + snd_pcm_uframes_t frames; +- int dir; ++ snd_pcm_uframes_t period_size; ++ snd_pcm_uframes_t buffer_size; + + if (input_handle) sound_StopRecording(); + +@@ -276,15 +324,23 @@ + snd_pcm_hw_params_set_format(input_handle, hwparams, SND_PCM_FORMAT_S16_LE); + snd_pcm_hw_params_set_channels(input_handle, hwparams, input_channels); + input_rate= desiredSamplesPerSec; +- snd_pcm_hw_params_set_rate_near(input_handle, hwparams, &input_rate, &dir); ++ snd_pcm_hw_params_set_rate_near(input_handle, hwparams, &input_rate, 0); + frames= 4096; +- snd_pcm_hw_params_set_period_size_near(input_handle, hwparams, &frames, &dir); ++ snd_pcm_hw_params_set_period_size_near(input_handle, hwparams, &frames, 0); + snd(pcm_hw_params(input_handle, hwparams), "sound_StartRecording: snd_pcm_hw_params"); + ++ snd(pcm_hw_params_get_period_size(hwparams, &period_size, 0), "sound_Start: pcm_hw_params_get_period_size"); ++ snd(pcm_hw_params_get_buffer_size(hwparams, &buffer_size), "sound_Start: pcm_hw_params_get_buffer_size"); ++ + snd_pcm_sw_params_alloca(&swparams); + snd(pcm_sw_params_current(input_handle, swparams), "sound_StartRecording: snd_pcm_sw_params_current"); ++#if 0 + snd(pcm_sw_params_set_start_threshold(input_handle, swparams, frames * SQ_SND_REC_START_THRESHOLD), "sound_StartRecording: snd_pcm_sw_params_set_start_threshold"); + snd(pcm_sw_params_set_avail_min(input_handle, swparams, frames * SQ_SND_REC_AVAIL_MIN), "sound_StartRecording: snd_pcm_sw_parama_set_avail_min"); ++#else ++ snd(pcm_sw_params_set_start_threshold(input_handle, swparams, buffer_size), "sound_StartRecording: snd_pcm_sw_params_set_start_threshold"); ++ snd(pcm_sw_params_set_avail_min(input_handle, swparams, period_size), "sound_StartRecording: snd_pcm_sw_parama_set_avail_min"); ++#endif + snd(pcm_sw_params_set_xfer_align(input_handle, swparams, 1), "sound_StartRecording: snd_pcm_sw_params_set_xfer_align"); + snd(pcm_sw_params(input_handle, swparams), "sound_StartRecording: snd_pcm_sw_params"); + diff --git a/squeak-vm-4.10.2.2614-dprintf.patch b/squeak-vm-4.10.2.2614-dprintf.patch new file mode 100644 index 0000000..1cfeaab --- /dev/null +++ b/squeak-vm-4.10.2.2614-dprintf.patch @@ -0,0 +1,12 @@ +diff -up Squeak-4.10.2.2614-src-no-mp3/unix/vm-display-fbdev/sqUnixFBDevFramebuffer.c.orig Squeak-4.10.2.2614-src-no-mp3/unix/vm-display-fbdev/sqUnixFBDevFramebuffer.c +--- Squeak-4.10.2.2614-src-no-mp3/unix/vm-display-fbdev/sqUnixFBDevFramebuffer.c.orig 2009-08-19 13:36:33.000000000 +0200 ++++ Squeak-4.10.2.2614-src-no-mp3/unix/vm-display-fbdev/sqUnixFBDevFramebuffer.c 2012-11-22 16:01:49.753763504 +0100 +@@ -508,7 +508,7 @@ static void fb_initVisual(_self) + self->size= fb_height(self) * self->fix.line_length; + self->pitch= self->fix.line_length / self->var.bits_per_pixel * 8; + +- debugf("%s: %dx%dx%d+%x+%x (%dx%d) %s, rgb %d+%d %d+%d %d+%d pitch %d(%d)\n", self->fbName, ++ debugf("%s: %dx%dx%d+%x+%x (%dx%d) %s, rgb %d+%d %d+%d %d+%d pitch %d(%ld)\n", self->fbName, + self->var.xres, self->var.yres, self->var.bits_per_pixel, self->var.xoffset, self->var.yoffset, + self->var.xres_virtual, self->var.yres_virtual, + visualName(self), diff --git a/squeak-vm-4.10.2.2614-fix-cmake.patch b/squeak-vm-4.10.2.2614-fix-cmake.patch new file mode 100644 index 0000000..98758a0 --- /dev/null +++ b/squeak-vm-4.10.2.2614-fix-cmake.patch @@ -0,0 +1,33 @@ +diff -up Squeak-4.10.2.2614-src-no-mp3/unix/CMakeLists.txt.orig Squeak-4.10.2.2614-src-no-mp3/unix/CMakeLists.txt +--- Squeak-4.10.2.2614-src-no-mp3/unix/CMakeLists.txt.orig 2012-09-17 03:03:14.000000000 +0200 ++++ Squeak-4.10.2.2614-src-no-mp3/unix/CMakeLists.txt 2012-11-22 18:21:16.413017772 +0100 +@@ -23,10 +23,14 @@ SET (prefix ${CMAKE_INSTALL_PREFIX}) + + SET (version ${VM_VERSION}) + ++if(NOT DEFINED LIB_SUFFIX AND CMAKE_SYSTEM_PROCESSOR MATCHES "64$") ++ set(LIB_SUFFIX 64) ++endif() ++ + SET (bindir bin) +-SET (imgdir lib/squeak) +-SET (plgdir lib/squeak/${version}${versionsuffix}) +-SET (mandir man/man1) ++SET (imgdir lib${LIB_SUFFIX}/squeak) ++SET (plgdir lib${LIB_SUFFIX}/squeak/${version}${versionsuffix}) ++SET (mandir share/man/man1) + SET (docdir share/doc/squeak-${version}) + + GET_CMAKE_PROPERTY (vars VARIABLES) +@@ -135,9 +139,9 @@ SET (ioUtcWithOffset sqUnixUtcWithOffset + CONFIG_DEFINE (ioUtcWithOffset) + + SET (CMAKE_SKIP_BUILD_RPATH TRUE) +-SET (CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) ++SET (CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) + SET (CMAKE_INSTALL_RPATH "") +-SET (CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) ++SET (CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE) + + INCLUDE (${unix}/vm/config.cmake) + diff --git a/squeak-vm-4.10.2.2614-format-security.patch b/squeak-vm-4.10.2.2614-format-security.patch new file mode 100644 index 0000000..ab51ed6 --- /dev/null +++ b/squeak-vm-4.10.2.2614-format-security.patch @@ -0,0 +1,13 @@ +diff --git a/Cross/plugins/Squeak3D/b3dMain.c b/Cross/plugins/Squeak3D/b3dMain.c +index 2716d4a..b920906 100644 +--- a/Cross/plugins/Squeak3D/b3dMain.c ++++ b/Cross/plugins/Squeak3D/b3dMain.c +@@ -63,7 +63,7 @@ int maxEdges = 0; + /*************************************************************/ + + void b3dAbort(char *msg){ +- printf(msg); ++ printf("%s", msg); + exit(-1); + } + diff --git a/squeak-vm-4.10.2.2614-gcc-14.patch b/squeak-vm-4.10.2.2614-gcc-14.patch new file mode 100644 index 0000000..c9a3f93 --- /dev/null +++ b/squeak-vm-4.10.2.2614-gcc-14.patch @@ -0,0 +1,673 @@ +diff --git a/Cross/vm/sqVirtualMachine.c b/Cross/vm/sqVirtualMachine.c +index 59b6a6e..d367251 100644 +--- a/Cross/vm/sqVirtualMachine.c ++++ b/Cross/vm/sqVirtualMachine.c +@@ -4,6 +4,7 @@ + #include + #include + #include ++#include + + #include "sqVirtualMachine.h" + +diff --git a/unix/plugins/AsynchFilePlugin/sqUnixAsynchFile.c b/unix/plugins/AsynchFilePlugin/sqUnixAsynchFile.c +index 788287f..b916c86 100644 +--- a/unix/plugins/AsynchFilePlugin/sqUnixAsynchFile.c ++++ b/unix/plugins/AsynchFilePlugin/sqUnixAsynchFile.c +@@ -142,7 +142,7 @@ INLINE static FilePtr newFileRec(int fd, int sema) + return fp; + } + +-INLINE static allocateBuffer(struct FileBuf *buf, int size) ++INLINE static int allocateBuffer(struct FileBuf *buf, int size) + { + if (buf->capacity >= size) + return 1; +diff --git a/unix/plugins/CameraPlugin/sqCamera-linux.c b/unix/plugins/CameraPlugin/sqCamera-linux.c +index 218322f..c5a6815 100644 +--- a/unix/plugins/CameraPlugin/sqCamera-linux.c ++++ b/unix/plugins/CameraPlugin/sqCamera-linux.c +@@ -181,7 +181,7 @@ libCon(void) + vd_dup = dup; + vd_ioctl = ioctl; + vd_read = read; +- vd_mmap = mmap; ++ vd_mmap = (void * (*)(void *, size_t, int, int, int, int64_t))mmap; + vd_munmap = munmap; + + /* Use libv4l2: use if available... */ +diff --git a/unix/plugins/HostWindowPlugin/sqUnixHostWindowPlugin.c b/unix/plugins/HostWindowPlugin/sqUnixHostWindowPlugin.c +index c963f53..4788120 100644 +--- a/unix/plugins/HostWindowPlugin/sqUnixHostWindowPlugin.c ++++ b/unix/plugins/HostWindowPlugin/sqUnixHostWindowPlugin.c +@@ -78,7 +78,7 @@ sqInt ioShowDisplayOnWindow( + return 0; + else + return dpy->hostWindowShowDisplay( +- dispBitsIndex, width, height, depth, affectedL, affectedR, affectedT, affectedB, windowIndex); ++ (unsigned int *)dispBitsIndex, width, height, depth, affectedL, affectedR, affectedT, affectedB, windowIndex); + } + + +diff --git a/unix/plugins/MIDIPlugin/sqUnixMIDIALSA.inc b/unix/plugins/MIDIPlugin/sqUnixMIDIALSA.inc +index cc4bbad..1d451da 100644 +--- a/unix/plugins/MIDIPlugin/sqUnixMIDIALSA.inc ++++ b/unix/plugins/MIDIPlugin/sqUnixMIDIALSA.inc +@@ -333,7 +333,7 @@ int sqMIDIParameter(int whichParameter, int modify, int newValue) + { + snd_seq_queue_tempo_t *tempo= 0; + snd_seq_queue_tempo_alloca(&tempo); +- snd_seq_get_queue_tempo(seq, queue, &tempo); ++ snd_seq_get_queue_tempo(seq, queue, (snd_seq_queue_tempo_t *)&tempo); + return snd_seq_queue_tempo_get_tempo(tempo) / 1000.0; + } + break; +diff --git a/unix/plugins/SerialPlugin/sqUnixSerial.c b/unix/plugins/SerialPlugin/sqUnixSerial.c +index 2e61099..f3bc6b1 100644 +--- a/unix/plugins/SerialPlugin/sqUnixSerial.c ++++ b/unix/plugins/SerialPlugin/sqUnixSerial.c +@@ -157,21 +157,6 @@ void make_portname_from_portnum(char *serialPortName, const int portNum) + /*** Public Functions ***/ + + /* return value ignored */ +-int serialPortClose(int portNum) +-{ +- char serialPortName[PORT_NAME_SIZE]; +- +- if (portNum < 0 || portNum >= MAX_SERIAL_PORTS) +- { +- success(false); +- return 0; +- } +- +- make_portname_from_portnum(serialPortName, portNum); +- +- return serialPortCloseByName(serialPortName); +-} +- + int serialPortCloseByName(const char *portName) + { + serial_port_type * sp= find_stored_serialport(portName); +@@ -205,16 +190,19 @@ int serialPortCloseByName(const char *portName) + return 0; + } + +-/* Open the given serial port using the given port number. +- * "/dev/ttySxx" port name are assumed. */ +-int serialPortOpen(int portNum, int dataRate, int stopBitsType, int parityType, int dataBits, +- int inFlowCtrl, int outFlowCtrl, int xOnChar, int xOffChar) +-{ ++int serialPortClose(int portNum) ++{ + char serialPortName[PORT_NAME_SIZE]; ++ ++ if (portNum < 0 || portNum >= MAX_SERIAL_PORTS) ++ { ++ success(false); ++ return 0; ++ } ++ + make_portname_from_portnum(serialPortName, portNum); +- +- return serialPortOpenByName(serialPortName, dataRate, stopBitsType, parityType, dataBits, +- inFlowCtrl, outFlowCtrl, xOnChar, xOffChar); ++ ++ return serialPortCloseByName(serialPortName); + } + + /* If anything goes wrong during opening make sure the file descriptor +@@ -356,6 +344,18 @@ int serialPortOpenByName(char *portName, int dataRate, int stopBitsType, int par + return 0; + } + ++/* Open the given serial port using the given port number. ++ * "/dev/ttySxx" port name are assumed. */ ++int serialPortOpen(int portNum, int dataRate, int stopBitsType, int parityType, int dataBits, ++ int inFlowCtrl, int outFlowCtrl, int xOnChar, int xOffChar) ++{ ++ char serialPortName[PORT_NAME_SIZE]; ++ make_portname_from_portnum(serialPortName, portNum); ++ ++ return serialPortOpenByName(serialPortName, dataRate, stopBitsType, parityType, dataBits, ++ inFlowCtrl, outFlowCtrl, xOnChar, xOffChar); ++} ++ + /* Read up to count bytes from the given serial port into the given + byte array. Read only up to the number of bytes in the port's + input buffer; if fewer bytes than count have been received, do not +diff --git a/unix/plugins/WeDoPlugin/WeDoLinux.c b/unix/plugins/WeDoPlugin/WeDoLinux.c +index 973c2d3..1dc4de1 100644 +--- a/unix/plugins/WeDoPlugin/WeDoLinux.c ++++ b/unix/plugins/WeDoPlugin/WeDoLinux.c +@@ -38,6 +38,7 @@ + #include + #include + #include ++#include + + + #define true 1 +diff --git a/unix/src/plugins/ClipboardExtendedPlugin/ClipboardExtendedPlugin.c b/unix/src/plugins/ClipboardExtendedPlugin/ClipboardExtendedPlugin.c +index 4c71420..7f54955 100644 +--- a/unix/src/plugins/ClipboardExtendedPlugin/ClipboardExtendedPlugin.c ++++ b/unix/src/plugins/ClipboardExtendedPlugin/ClipboardExtendedPlugin.c +@@ -75,6 +75,8 @@ static sqInt halt(void) { + ; + } + ++extern void sqPasteboardPutItemFlavordatalengthformatTypeformatLength(sqInt, char*, int, char*, int); ++ + EXPORT(sqInt) ioAddClipboardData(void) { + sqInt clipboardAddress; + sqInt formatLength; +@@ -102,6 +104,8 @@ EXPORT(sqInt) ioAddClipboardData(void) { + return null; + } + ++extern void sqPasteboardClear(sqInt); ++ + EXPORT(sqInt) ioClearClipboard(void) { + sqInt clipboardAddress; + sqInt clipboard; +@@ -119,6 +123,8 @@ EXPORT(sqInt) ioClearClipboard(void) { + return null; + } + ++sqInt sqCreateClipboard(void); ++ + EXPORT(sqInt) ioCreateClipboard(void) { + sqInt clipboardAddress; + +@@ -130,6 +136,10 @@ EXPORT(sqInt) ioCreateClipboard(void) { + return null; + } + ++extern int sqPasteboardGetItemCount(sqInt); ++extern int sqPasteboardCopyItemFlavorsitemNumber (sqInt, int); ++extern int sqPasteboardCopyItemFlavorDataformatformatLength (sqInt, char*, int); ++ + EXPORT(sqInt) ioGetClipboardFormat(void) { + sqInt clipboardAddress; + sqInt itemCount; +diff --git a/unix/src/plugins/DBusPlugin/DBusPlugin.c b/unix/src/plugins/DBusPlugin/DBusPlugin.c +index b3b8027..11bc22e 100644 +--- a/unix/src/plugins/DBusPlugin/DBusPlugin.c ++++ b/unix/src/plugins/DBusPlugin/DBusPlugin.c +@@ -474,7 +474,7 @@ static sqInt halt(void) { + } + + static sqInt handleflag(int fd, int flag) { +- aioHandle(fd, handleReadForFDwithDataandFlag , flag); ++ aioHandle(fd, (void (*)(int, void *, int)) handleReadForFDwithDataandFlag , flag); + } + + +@@ -1796,8 +1796,8 @@ static dbus_bool_t sqDBusPluginAddWatchwithData(DBusWatch*watch, void*data) { + fd = dbus_watch_get_fd(watch); + ((sqDBusData*)data)->watch = watch; + if (flag & DBUS_WATCH_READABLE) { +- aioEnable(fd, data, NULL); +- aioHandle(fd, handleReadForFDwithDataandFlag , 1<<0 | 1<<1 | 1<<3); ++ aioEnable(fd, data, 0); ++ aioHandle(fd, (void (*)(int, void *, int)) handleReadForFDwithDataandFlag , 1<<0 | 1<<1 | 1<<3); + } + return 1; + } +@@ -1830,7 +1830,7 @@ static void sqDBusPluginToggleWatchwithData(DBusWatch*watch, void*data) { + fd = dbus_watch_get_fd(watch); + if (enable) { + ((sqDBusData*)data)->watch = watch; +- aioEnable(fd, data, NULL); ++ aioEnable(fd, data, 0); + } else { + aioDisable(fd); + } +diff --git a/unix/src/plugins/FileCopyPlugin/FileCopyPlugin.c b/unix/src/plugins/FileCopyPlugin/FileCopyPlugin.c +index e2f1b5a..16a3066 100644 +--- a/unix/src/plugins/FileCopyPlugin/FileCopyPlugin.c ++++ b/unix/src/plugins/FileCopyPlugin/FileCopyPlugin.c +@@ -18,6 +18,7 @@ + #include "sqConfig.h" + /* Platform specific definitions */ + #include "sqPlatformSpecific.h" ++#include "FileCopyPlugin.h" + + #define true 1 + #define false 0 +diff --git a/unix/src/plugins/HostWindowPlugin/HostWindowPlugin.c b/unix/src/plugins/HostWindowPlugin/HostWindowPlugin.c +index ea5c0d7..54bb88b 100644 +--- a/unix/src/plugins/HostWindowPlugin/HostWindowPlugin.c ++++ b/unix/src/plugins/HostWindowPlugin/HostWindowPlugin.c +@@ -312,7 +312,7 @@ EXPORT(sqInt) primitiveShowHostWindowRect(void) { + if (interpreterProxy->failed()) { + return null; + } +- ok = ioShowDisplayOnWindow(dispBits, w, h, d, left, right, top, ++ ok = ioShowDisplayOnWindow((unsigned char *)dispBits, w, h, d, left, right, top, + bottom, windowIndex); + if (!(ok)) { + interpreterProxy->primitiveFail(); +diff --git a/unix/src/plugins/MIDIPlugin/MIDIPlugin.c b/unix/src/plugins/MIDIPlugin/MIDIPlugin.c +index a3fae58..8ec2eaa 100644 +--- a/unix/src/plugins/MIDIPlugin/MIDIPlugin.c ++++ b/unix/src/plugins/MIDIPlugin/MIDIPlugin.c +@@ -161,7 +161,7 @@ EXPORT(sqInt) primitiveMIDIGetPortName(void) { + if (interpreterProxy->failed()) { + return null; + } +- sz = sqMIDIGetPortName(portNum, &portName, 255); ++ sz = sqMIDIGetPortName(portNum, (int)&portName, 255); + nameObj = interpreterProxy->instantiateClassindexableSize(interpreterProxy->classString(), sz); + if (interpreterProxy->failed()) { + return null; +diff --git a/unix/src/plugins/RomePlugin/RomePlugin.c b/unix/src/plugins/RomePlugin/RomePlugin.c +index aed0e19..f9ff990 100644 +--- a/unix/src/plugins/RomePlugin/RomePlugin.c ++++ b/unix/src/plugins/RomePlugin/RomePlugin.c +@@ -49,6 +49,7 @@ + + + #include "sqMemoryAccess.h" ++#include "sq.h" + + + /*** Constants ***/ +diff --git a/unix/src/plugins/Squeak3D/Squeak3D.c b/unix/src/plugins/Squeak3D/Squeak3D.c +index 3732e62..2127bb3 100644 +--- a/unix/src/plugins/Squeak3D/Squeak3D.c ++++ b/unix/src/plugins/Squeak3D/Squeak3D.c +@@ -1657,8 +1657,8 @@ static sqInt halt(void) { + } + + EXPORT(sqInt) initialiseModule(void) { +- loadBBFn = interpreterProxy->ioLoadFunctionFrom("loadBitBltFrom", bbPluginName); +- copyBitsFn = interpreterProxy->ioLoadFunctionFrom("copyBitsFromtoat", bbPluginName); ++ loadBBFn = (sqInt) interpreterProxy->ioLoadFunctionFrom("loadBitBltFrom", bbPluginName); ++ copyBitsFn = (sqInt) interpreterProxy->ioLoadFunctionFrom("copyBitsFromtoat", bbPluginName); + return (loadBBFn != 0) && (copyBitsFn != 0); + } + +diff --git a/unix/src/plugins/SqueakFFIPrims/SqueakFFIPrims.c b/unix/src/plugins/SqueakFFIPrims/SqueakFFIPrims.c +index 24601e4..07e4714 100644 +--- a/unix/src/plugins/SqueakFFIPrims/SqueakFFIPrims.c ++++ b/unix/src/plugins/SqueakFFIPrims/SqueakFFIPrims.c +@@ -1215,6 +1215,8 @@ static sqInt halt(void) { + ; + } + ++extern void initSurfacePluginFunctionPointers(); ++ + EXPORT(sqInt) initialiseModule(void) { + initSurfacePluginFunctionPointers(); + } +diff --git a/unix/src/plugins/XDisplayControlPlugin/XDisplayControlPlugin.c b/unix/src/plugins/XDisplayControlPlugin/XDisplayControlPlugin.c +index 1a53f09..ed3a446 100644 +--- a/unix/src/plugins/XDisplayControlPlugin/XDisplayControlPlugin.c ++++ b/unix/src/plugins/XDisplayControlPlugin/XDisplayControlPlugin.c +@@ -132,6 +132,10 @@ EXPORT(sqInt) primitiveCanConnectToDisplay(void) { + } + } + ++extern void forgetXDisplay(void); ++extern void synchronizeXDisplay(void); ++extern void openXDisplay(void); ++extern int disconnectXDisplay(void); + + /* Call an internal function which will disconnect the X display session. The actual + Squeak window on the X server is not effected, but this instance of Squeak will +diff --git a/unix/src/vm/interp.c b/unix/src/vm/interp.c +index 85f416d..c179a34 100644 +--- a/unix/src/vm/interp.c ++++ b/unix/src/vm/interp.c +@@ -15665,6 +15665,9 @@ sqInt primitiveAtPut(void) { + } + + ++extern sqInt ioSetCursorARGB(sqInt, sqInt, sqInt, sqInt, sqInt); ++ ++ + /* Set the cursor to the given shape. The Mac only supports 16x16 pixel cursors. Cursor offsets are handled by Smalltalk. */ + + sqInt primitiveBeCursor(void) { +diff --git a/unix/src/vm/intplugins/AsynchFilePlugin/AsynchFilePlugin.c b/unix/src/vm/intplugins/AsynchFilePlugin/AsynchFilePlugin.c +index f0b72e7..f53d7f3 100644 +--- a/unix/src/vm/intplugins/AsynchFilePlugin/AsynchFilePlugin.c ++++ b/unix/src/vm/intplugins/AsynchFilePlugin/AsynchFilePlugin.c +@@ -162,7 +162,7 @@ EXPORT(sqInt) primitiveAsyncFileOpen(void) { + fOop = interpreterProxy->instantiateClassindexableSize(interpreterProxy->classByteArray(), sizeof(AsyncFile)); + f = asyncFileValueOf(fOop); + if (!(interpreterProxy->failed())) { +- asyncFileOpen(f, fileName, fileNameSize, writeFlag, semaIndex); ++ asyncFileOpen(f, (int) fileName, fileNameSize, writeFlag, semaIndex); + } + if (interpreterProxy->failed()) { + return null; +@@ -209,7 +209,7 @@ EXPORT(sqInt) primitiveAsyncFileReadResult(void) { + interpreterProxy->success((startIndex >= 1) && (((startIndex + count) - 1) <= bufferSize)); + bufferPtr = (((pointerForOop(buffer)) + (BASE_HEADER_SIZE)) + startIndex) - 1; + if (!(interpreterProxy->failed())) { +- r = asyncFileReadResult(f, bufferPtr, count); ++ r = asyncFileReadResult(f, (int) bufferPtr, count); + } + _return_value = interpreterProxy->integerObjectOf(r); + if (interpreterProxy->failed()) { +@@ -301,7 +301,7 @@ EXPORT(sqInt) primitiveAsyncFileWriteStart(void) { + interpreterProxy->success((startIndex >= 1) && (((startIndex + count) - 1) <= bufferSize)); + bufferPtr = (((pointerForOop(buffer)) + (BASE_HEADER_SIZE)) + startIndex) - 1; + if (!(interpreterProxy->failed())) { +- asyncFileWriteStart(f, fPosition, bufferPtr, count); ++ asyncFileWriteStart(f, fPosition, (int) bufferPtr, count); + } + if (interpreterProxy->failed()) { + return null; +diff --git a/unix/src/vm/intplugins/CroquetPlugin/CroquetPlugin.c b/unix/src/vm/intplugins/CroquetPlugin/CroquetPlugin.c +index ae84066..c27ac3c 100644 +--- a/unix/src/vm/intplugins/CroquetPlugin/CroquetPlugin.c ++++ b/unix/src/vm/intplugins/CroquetPlugin/CroquetPlugin.c +@@ -512,6 +512,8 @@ EXPORT(sqInt) primitiveTransposeMatrix(void) { + + /* Primitive. Answer whether an AABB intersects with a given triangle */ + ++extern sqInt triBoxOverlap(float*, float*, float*, float*, float*); ++ + EXPORT(sqInt) primitiveTriBoxIntersects(void) { + float*maxCorner; + float*minCorner; +diff --git a/unix/src/vm/intplugins/FilePlugin/FilePlugin.c b/unix/src/vm/intplugins/FilePlugin/FilePlugin.c +index 0495a0f..baf618c 100644 +--- a/unix/src/vm/intplugins/FilePlugin/FilePlugin.c ++++ b/unix/src/vm/intplugins/FilePlugin/FilePlugin.c +@@ -734,7 +734,7 @@ EXPORT(sqInt) primitiveFileStdioHandles(void) { + return interpreterProxy->primitiveFail(); + } + } +- validMask = sqFileStdioHandlesInto((&fileRecords)); ++ validMask = sqFileStdioHandlesInto((SQFile*)(&fileRecords)); + if (validMask == 0) { + return interpreterProxy->primitiveFail(); + } +diff --git a/unix/src/vm/intplugins/MiscPrimitivePlugin/MiscPrimitivePlugin.c b/unix/src/vm/intplugins/MiscPrimitivePlugin/MiscPrimitivePlugin.c +index 501077a..53767a4 100644 +--- a/unix/src/vm/intplugins/MiscPrimitivePlugin/MiscPrimitivePlugin.c ++++ b/unix/src/vm/intplugins/MiscPrimitivePlugin/MiscPrimitivePlugin.c +@@ -101,6 +101,10 @@ static sqInt halt(void) { + } + + ++sqInt _isBytes(sqInt oop) { ++ return ((oop & 1) == 0) && (((((usqInt) (longAt(oop))) >> 8) & 15) >= 8); ++} ++ + /* Return 1, 2 or 3, if string1 is <, =, or > string2, with the collating order of characters given by the order array. */ + + EXPORT(sqInt) primitiveCompareString(void) { +@@ -115,17 +119,17 @@ EXPORT(sqInt) primitiveCompareString(void) { + sqInt len2; + + rcvr = stackValue(3); +- if (!(isBytes(stackValue(2)))) { ++ if (!(_isBytes(stackValue(2)))) { + return primitiveFail(); + } + string1 = arrayValueOf(stackValue(2)); + string1 -= 1; +- if (!(isBytes(stackValue(1)))) { ++ if (!(_isBytes(stackValue(1)))) { + return primitiveFail(); + } + string2 = arrayValueOf(stackValue(1)); + string2 -= 1; +- if (!(isBytes(stackValue(0)))) { ++ if (!(_isBytes(stackValue(0)))) { + return primitiveFail(); + } + order = arrayValueOf(stackValue(0)); +@@ -225,7 +229,7 @@ EXPORT(sqInt) primitiveCompressToByteArray(void) { + rcvr = stackValue(2); + bm = arrayValueOf(stackValue(1)); + bm -= 1; +- if (!(isBytes(stackValue(0)))) { ++ if (!(_isBytes(stackValue(0)))) { + return primitiveFail(); + } + ba = arrayValueOf(stackValue(0)); +@@ -393,7 +397,7 @@ EXPORT(sqInt) primitiveConvert8BitSigned(void) { + sqInt s; + + rcvr = stackValue(2); +- if (!(isBytes(stackValue(1)))) { ++ if (!(_isBytes(stackValue(1)))) { + return primitiveFail(); + } + aByteArray = arrayValueOf(stackValue(1)); +@@ -453,7 +457,7 @@ EXPORT(sqInt) primitiveDecompressFromByteArray(void) { + rcvr = stackValue(3); + bm = arrayValueOf(stackValue(2)); + bm -= 1; +- if (!(isBytes(stackValue(1)))) { ++ if (!(_isBytes(stackValue(1)))) { + return primitiveFail(); + } + ba = arrayValueOf(stackValue(1)); +@@ -556,12 +560,12 @@ EXPORT(sqInt) primitiveFindFirstInString(void) { + sqInt stringSize; + + rcvr = stackValue(3); +- if (!(isBytes(stackValue(2)))) { ++ if (!(_isBytes(stackValue(2)))) { + return primitiveFail(); + } + aString = arrayValueOf(stackValue(2)); + aString -= 1; +- if (!(isBytes(stackValue(1)))) { ++ if (!(_isBytes(stackValue(1)))) { + return primitiveFail(); + } + inclusionMap = arrayValueOf(stackValue(1)); +@@ -614,18 +618,18 @@ EXPORT(sqInt) primitiveFindSubstring(void) { + sqInt startIndex; + + rcvr = stackValue(4); +- if (!(isBytes(stackValue(3)))) { ++ if (!(_isBytes(stackValue(3)))) { + return primitiveFail(); + } + key = arrayValueOf(stackValue(3)); + key -= 1; +- if (!(isBytes(stackValue(2)))) { ++ if (!(_isBytes(stackValue(2)))) { + return primitiveFail(); + } + body = arrayValueOf(stackValue(2)); + body -= 1; + start = stackIntegerValue(1); +- if (!(isBytes(stackValue(0)))) { ++ if (!(_isBytes(stackValue(0)))) { + return primitiveFail(); + } + matchTable = arrayValueOf(stackValue(0)); +@@ -673,7 +677,7 @@ EXPORT(sqInt) primitiveIndexOfAsciiInString(void) { + + rcvr = stackValue(3); + anInteger = stackIntegerValue(2); +- if (!(isBytes(stackValue(1)))) { ++ if (!(_isBytes(stackValue(1)))) { + return primitiveFail(); + } + aString = arrayValueOf(stackValue(1)); +@@ -719,7 +723,7 @@ EXPORT(sqInt) primitiveStringHash(void) { + sqInt pos; + + rcvr = stackValue(2); +- if (!(isBytes(stackValue(1)))) { ++ if (!(_isBytes(stackValue(1)))) { + return primitiveFail(); + } + aByteArray = arrayValueOf(stackValue(1)); +@@ -758,14 +762,14 @@ EXPORT(sqInt) primitiveTranslateStringWithTable(void) { + sqInt i; + + rcvr = stackValue(4); +- if (!(isBytes(stackValue(3)))) { ++ if (!(_isBytes(stackValue(3)))) { + return primitiveFail(); + } + aString = arrayValueOf(stackValue(3)); + aString -= 1; + start = stackIntegerValue(2); + stop = stackIntegerValue(1); +- if (!(isBytes(stackValue(0)))) { ++ if (!(_isBytes(stackValue(0)))) { + return primitiveFail(); + } + table = arrayValueOf(stackValue(0)); +diff --git a/unix/src/vm/intplugins/RePlugin/RePlugin.c b/unix/src/vm/intplugins/RePlugin/RePlugin.c +index 97a99c9..4f09246 100644 +--- a/unix/src/vm/intplugins/RePlugin/RePlugin.c ++++ b/unix/src/vm/intplugins/RePlugin/RePlugin.c +@@ -252,7 +252,7 @@ EXPORT(sqInt) primPCREExec(void) { + /* begin rcvrExtraPtr */ + extraObj = interpreterProxy->fetchPointerofObject(3, rcvr); + if (extraObj == (interpreterProxy->nilObject())) { +- extraPtr = NULL; ++ extraPtr = 0; + goto l1; + } + extraPtr = ((int) (interpreterProxy->arrayValueOf(extraObj))); +@@ -317,7 +317,7 @@ EXPORT(sqInt) primPCREExecfromto(void) { + /* begin rcvrExtraPtr */ + extraObj = interpreterProxy->fetchPointerofObject(3, rcvr); + if (extraObj == (interpreterProxy->nilObject())) { +- extraPtr = NULL; ++ extraPtr = 0; + goto l1; + } + extraPtr = ((int) (interpreterProxy->arrayValueOf(extraObj))); +diff --git a/unix/src/vm/intplugins/SerialPlugin/SerialPlugin.c b/unix/src/vm/intplugins/SerialPlugin/SerialPlugin.c +index a40a64d..ecc29f5 100644 +--- a/unix/src/vm/intplugins/SerialPlugin/SerialPlugin.c ++++ b/unix/src/vm/intplugins/SerialPlugin/SerialPlugin.c +@@ -100,6 +100,9 @@ EXPORT(sqInt) primitiveSerialPortClose(void) { + return null; + } + ++extern sqInt serialPortCloseByName(const char*); ++extern sqInt serialPortOpenByName(char*, int, int, int, int, int, int, int, int); ++ + EXPORT(sqInt) primitiveSerialPortCloseByName(void) { + char * cString; + char *deviceName; +diff --git a/unix/src/vm/intplugins/SlangTestSupportPlugin/SlangTestSupportPlugin.c b/unix/src/vm/intplugins/SlangTestSupportPlugin/SlangTestSupportPlugin.c +index 72f9def..46280d9 100644 +--- a/unix/src/vm/intplugins/SlangTestSupportPlugin/SlangTestSupportPlugin.c ++++ b/unix/src/vm/intplugins/SlangTestSupportPlugin/SlangTestSupportPlugin.c +@@ -147,7 +147,7 @@ static sqInt inlineByMethod(void) { + sqInt bar; + sqInt foo; + +- foo = "foo"; ++ foo = (sqInt) "foo"; + bar = methodThatShouldNotBeInlinedByMethod(); + } + +@@ -159,24 +159,24 @@ static sqInt inlineByPragma(void) { + sqInt bar; + sqInt foo; + +- foo = "foo"; ++ foo = (sqInt) "foo"; + bar = methodThatShouldNotBeInlinedByPragma(); + } + + static sqInt methodThatShouldBeInlinedByMethod(void) { +- return "foo"; ++ return (sqInt) "foo"; + } + + static sqInt methodThatShouldBeInlinedByPragma(void) { +- return "foo"; ++ return (sqInt) "foo"; + } + + static sqInt methodThatShouldNotBeInlinedByMethod(void) { +- return "bar"; ++ return (sqInt) "bar"; + } + + static sqInt methodThatShouldNotBeInlinedByPragma(void) { +- return "bar"; ++ return (sqInt) "bar"; + } + + +diff --git a/unix/vm-sound-pulse/sqUnixSoundPulseAudio.c b/unix/vm-sound-pulse/sqUnixSoundPulseAudio.c +index 18d0f7f..8b0f35d 100644 +--- a/unix/vm-sound-pulse/sqUnixSoundPulseAudio.c ++++ b/unix/vm-sound-pulse/sqUnixSoundPulseAudio.c +@@ -995,10 +995,10 @@ DBGMSG("sound_StopRecording()"); + +- if (!audioIn.open) return; ++ if (!audioIn.open) return 0; + audioIn.open = false; + +- if (NULL == audioIn.pa_conn) return; ++ if (NULL == audioIn.pa_conn) return 0; + + ioThreadStall(&audioIn); + +diff --git a/unix/vm/SqSound.h b/unix/vm/SqSound.h +index bddbf24..973db1b 100644 +--- a/unix/vm/SqSound.h ++++ b/unix/vm/SqSound.h +@@ -47,7 +47,7 @@ static struct SqSound sound_##NAME##_itf= { \ + sound_RecordSamplesIntoAtLength, \ + sound_Volume, \ + sound_SetVolume, \ +- sound_SetRecordLevel, \ ++ (void (*)(sqInt))sound_SetRecordLevel, \ + sound_GetSwitch, \ + sound_SetSwitch, \ + sound_SetDevice \ +diff --git a/unix/vm/aio.c b/unix/vm/aio.c +index 57e054e..f133c8e 100644 +--- a/unix/vm/aio.c ++++ b/unix/vm/aio.c +@@ -31,6 +31,7 @@ + */ + + #include "sqaio.h" ++#include "sq.h" + + #ifdef HAVE_CONFIG_H + +diff --git a/unix/vm/sqUnixMain.c b/unix/vm/sqUnixMain.c +index 98ea3bc..76391f7 100644 +--- a/unix/vm/sqUnixMain.c ++++ b/unix/vm/sqUnixMain.c +@@ -34,6 +34,7 @@ + #include "sqMemoryAccess.h" + #include "sqaio.h" + #include "sqUnixCharConv.h" ++#include "sqUnixGlobals.h" + #include "debug.h" + + #ifdef ioMSecs +@@ -42,6 +43,7 @@ + + #include + #include ++#include + #include + #include + #include +@@ -511,6 +513,8 @@ sqInt ioRelinquishProcessorForMicroseconds(sqInt us) + + sqInt ioBeep(void) { return dpy->ioBeep(); } + ++extern sqInt printCallStack(void); ++ + #if defined(IMAGE_DUMP) + + static void emergencyDump(int quit) diff --git a/squeak-vm-4.10.2.2614-squeak-init-fix.patch b/squeak-vm-4.10.2.2614-squeak-init-fix.patch new file mode 100644 index 0000000..079be88 --- /dev/null +++ b/squeak-vm-4.10.2.2614-squeak-init-fix.patch @@ -0,0 +1,57 @@ +diff -up Squeak-4.10.2.2614-src-no-mp3/unix/cmake/squeak.in.orig Squeak-4.10.2.2614-src-no-mp3/unix/cmake/squeak.in +--- Squeak-4.10.2.2614-src-no-mp3/unix/cmake/squeak.in.orig 2012-11-23 11:01:10.000000000 +0100 ++++ Squeak-4.10.2.2614-src-no-mp3/unix/cmake/squeak.in 2012-11-23 11:03:38.940563799 +0100 +@@ -78,19 +78,27 @@ elif test -x "${bindir}/${ck}"; then ck= + elif test -x "`which ${ck}`"; then ck="`which ${ck}`" + fi + +-if test -z "${image}"; then image="${SQUEAK_IMAGE}"; fi +-if test -z "${image}"; then image="squeak"; fi +-if test -f "${image}.image"; then image="${image}.image"; fi ++for f in "$SQUEAKHOME" . "$HOME" ++do ++ cd "$f" 2> /dev/null || continue ++ if test -z "${image}"; then image="${SQUEAK_IMAGE}"; fi ++ if test -z "${image}"; then image="squeak"; fi ++ if test -f "${image}.image"; then image="${image}.image"; fi ++ test -f "$image" && break ++ cd "$OLDPWD" ++done + +-if test "${info}"; then +- if test ! -x "${ck}"; then ++if test ! -x "${ck}"; then + echo "cannot find executable file: ${ck}" >&2 + exit 1 +- fi +- if test ! -f "${image}"; then +- echo "cannot find image file: ${image}" >&2 ++fi ++if test ! -f "${image}"; then ++ MSG="cannot find image file: ${image}, did you run 'inisqueak -m'?" ++ echo "$MSG" >&2 ++ xmessage "$MSG" 2>/dev/null + exit 1 +- fi ++fi ++if test "${info}"; then + exec "${ck}" "${image}" + fi + +@@ -115,7 +120,6 @@ if test -z "${vms}"; then + fi + + for avm in ${vms}; do +- echo CHECKING ${avm} + if test -x "${plgdir}/${avm}"; then # bin/squeak -> lib/squeak/x.y-z/squeakvm + vm="${plgdir}/${avm}" + plugins="${plgdir}" +@@ -124,7 +128,7 @@ for avm in ${vms}; do + vm="${bindir}/${avm}" + plugins="${bindir}/%n" + break; +- elif test -x "`which ${avm}`"; then ++ elif test -x "`which ${avm} 2>/dev/null`"; then + vm="`which ${avm}`" + plugins="" + break; diff --git a/squeak-vm.spec b/squeak-vm.spec new file mode 100644 index 0000000..dbe3309 --- /dev/null +++ b/squeak-vm.spec @@ -0,0 +1,99 @@ +%define vmver %(echo %version | cut -d. -f1-3) +%define rev %(echo %version | cut -d. -f4) +Name: squeak-vm +Version: 4.10.2.2614 +Release: 1mamba +Summary: A full-featured implementation of the Smalltalk programming language and environment +Group: Applications/Development +Vendor: openmamba +Distribution: openmamba +Packager: Silvan Calarco +URL: http://www.squeakvm.org +Source: http://www.squeakvm.org/unix/release/Squeak-%{version}-src.tar.gz +Patch0: squeak-vm-4.10.2.2614-fix-cmake.patch +Patch1: squeak-vm-4.10.2.2614-format-security.patch +Patch2: squeak-vm-4.10.2.2614-gcc-14.patch +Patch3: squeak-vm-4.10.2.2614-squeak-init-fix.patch +Patch4: squeak-vm-4.10.2.2614-dprintf.patch +Patch5: squeak-vm-4.10.2.2614-alsa-fixes.patch +License: MIT, Apache License 2.0 +## AUTOBUILDREQ-BEGIN +BuildRequires: glibc-devel +BuildRequires: libICE-devel +BuildRequires: libSM-devel +BuildRequires: libX11-devel +BuildRequires: libXext-devel +BuildRequires: libXrender-devel +BuildRequires: libalsa-devel +BuildRequires: libaudio-devel +BuildRequires: libcairo-devel +BuildRequires: libdbus-devel +BuildRequires: libffi-devel +BuildRequires: libfreetype-devel +BuildRequires: libglib-devel +BuildRequires: libglu-devel +BuildRequires: libglvnd-devel +BuildRequires: libharfbuzz-devel +BuildRequires: libnsl-devel +BuildRequires: libpango-devel +BuildRequires: libpulseaudio-devel +BuildRequires: libuuid-devel +## AUTOBUILDREQ-END +Obsoletes: Squeak < 4.10.2-2mamba + +%description +Squeak is a full-featured implementation of the Smalltalk programming language and environment based on (and largely compatible with) the original Smalltalk-80 system. Squeak has very powerful 2- and 3-D graphics, sound, video, MIDI, animation and other multimedia capabilities -- and one of the most impressive development environments ever created. It also includes a customisable framework for creating dynamic HTTP servers and interactively extensible Web sites. The entire Squeak system is open source software, distributed freely with a liberal license. + +%debug_package + +%prep +%setup -q -n Squeak-%{version}-src +%patch 0 -p1 -b .fix-cmake +%patch 1 -p1 -b .format-security +%patch 2 -p1 -b .gcc-14 +%patch 3 -p1 -b .squeak-init-fix +%patch 4 -p1 -b .dprintf +%patch 5 -p2 -b .alsa-fixes + +# Fix libdir +sed -i 's|libdir="${prefix}/lib/squeak"|libdir="%{_libdir}/squeak"|' unix/cmake/squeak.in + +%build +./unix/cmake/configure \ + --prefix=%{_prefix} \ + --without-Mpeg3Plugin \ + --with-x \ + --enable-mpg-mmx + +%make + +%install +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" +%makeinstall + +%clean +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" + +%files +%defattr(-,root,root) +%{_bindir}/squeak +%{_bindir}/squeak.sh +%dir %{_libdir}/squeak +%dir %{_libdir}/squeak/%{vmver}-%{rev} +%{_libdir}/squeak/%{vmver}-%{rev}/ckformat +%{_libdir}/squeak/%{vmver}-%{rev}/so.* +%{_libdir}/squeak/%{vmver}-%{rev}/squeakvm +%{_mandir}/man1/squeak.1* +%doc unix/doc/LICENSE + +%changelog +* Fri Dec 06 2024 Silvan Calarco 4.10.2.2614-1mamba +- update to 4.10.2.2614 +- source renamed from Squeak to squeak-vm + +* Wed Nov 21 2012 Ercole 'ercolinux' Carpanetto 4.10.2-1mamba +- update to 4.10.2 +- fixed the specfile + +* Sun May 06 2012 Ercole 'ercolinux' Carpanetto 4.4.7-1mamba +- package created by autospec