FreeBSD Bugzilla – Attachment 213970 Details for
Bug 246072
[NEW PORT] games/shockolate: Cross platform System Shock
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
The new port
shockolate.shar (text/plain), 10.94 KB, created by
shamaz.mazum
on 2020-05-01 05:39:57 UTC
(
hide
)
Description:
The new port
Filename:
MIME Type:
Creator:
shamaz.mazum
Created:
2020-05-01 05:39:57 UTC
Size:
10.94 KB
patch
obsolete
># This is a shell archive. Save it in a file, remove anything before ># this line, and then unpack it by entering "sh file". Note, it may ># create directories; files and directories will be owned by you and ># have default permissions. ># ># This archive contains: ># ># shockolate ># shockolate/files ># shockolate/files/patch-src_MacSrc_OpenGL.cc ># shockolate/files/patch-src_Libraries_RES_Source_caseless.c ># shockolate/files/patch-src_GameSrc_setup.c ># shockolate/files/patch-src_MusicSrc_MusicDevice.c ># shockolate/pkg-descr ># shockolate/distinfo ># shockolate/Makefile ># shockolate/pkg-plist ># shockolate/pkg-message ># >echo c - shockolate >mkdir -p shockolate > /dev/null 2>&1 >echo c - shockolate/files >mkdir -p shockolate/files > /dev/null 2>&1 >echo x - shockolate/files/patch-src_MacSrc_OpenGL.cc >sed 's/^X//' >shockolate/files/patch-src_MacSrc_OpenGL.cc << '7a4284e97a8e59200e49e54c776e3cdb' >X--- src/MacSrc/OpenGL.cc.orig 2020-04-23 04:29:54 UTC >X+++ src/MacSrc/OpenGL.cc >X@@ -195,7 +195,7 @@ static GLuint loadShader(GLenum type, const char *file >X DEBUG("Loading shader %s", filename); >X >X char fb[256]; >X- sprintf(fb, "shaders/%s", filename); >X+ sprintf(fb, "%%DATADIR%%shaders/%s", filename); >X >X FILE* file = fopen(fb, "r"); >X if(file == nullptr) { >7a4284e97a8e59200e49e54c776e3cdb >echo x - shockolate/files/patch-src_Libraries_RES_Source_caseless.c >sed 's/^X//' >shockolate/files/patch-src_Libraries_RES_Source_caseless.c << '017ab5c3b0fb110f574106dfac76bf15' >X--- src/Libraries/RES/Source/caseless.c.orig 2020-04-23 04:29:54 UTC >X+++ src/Libraries/RES/Source/caseless.c >X@@ -20,6 +20,7 @@ along with this program. If not, see <http://www.gnu. >X // DG 2018: a case-insensitive fopen() wrapper, and functions used by it >X >X #include <assert.h> >X+#include <stdlib.h> >X #include <string.h> >X #include <stdio.h> >X #include <sys/stat.h> >X@@ -241,18 +242,35 @@ int caselesspath(const char *inpath, char *outpath, in >X >X FILE *fopen_caseless(const char *path, const char *mode) { >X FILE *ret = NULL; >X+ char fullpath[PATH_MAX]; >X+ char *home = getenv("HOME"); >X >X if (path == NULL || mode == NULL) >X return NULL; >X >X- ret = fopen(path, mode); >X+ if (strcmp (path, "CurrentGame.dat") == 0 || >X+ strncmp (path, "savgam", strlen ("savgam")) == 0) { >X+ if (home == NULL) >X+ return NULL; >X >X+ snprintf (fullpath, PATH_MAX, "%s/.sshock/", home); >X+ if (strstr (mode, "w") != NULL) { >X+ /* Ensure the local directory exists */ >X+ mkdir (fullpath, 0755); >X+ } >X+ >X+ strlcat (fullpath, path, PATH_MAX); >X+ } else { >X+ snprintf (fullpath, PATH_MAX, "%%DATADIR%%%s", path); >X+ } >X+ >X+ ret = fopen(fullpath, mode); >X #ifndef _WIN32 // not windows >X if (ret == NULL) { >X char fixedpath[PATH_MAX]; >X- size_t pathlen = strlen(path); >X+ size_t pathlen = strlen(fullpath); >X >X- if (pathlen < sizeof(fixedpath) && caselesspath(path, fixedpath, 0)) { >X+ if (pathlen < sizeof(fixedpath) && caselesspath(fullpath, fixedpath, 0)) { >X ret = fopen(fixedpath, mode); >X } >X } >017ab5c3b0fb110f574106dfac76bf15 >echo x - shockolate/files/patch-src_GameSrc_setup.c >sed 's/^X//' >shockolate/files/patch-src_GameSrc_setup.c << 'cea11e54905bfdc5dbcccd82a723cfb8' >X--- src/GameSrc/setup.c.orig 2020-04-23 04:29:54 UTC >X+++ src/GameSrc/setup.c >X@@ -25,6 +25,7 @@ along with this program. If not, see <http://www.gnu. >X >X #define __SETUP_SRC >X >X+#include <stdlib.h> >X #include <string.h> >X >X // TODO: extract this into a compatibility header >X@@ -36,6 +37,10 @@ along with this program. If not, see <http://www.gnu. >X #include <unistd.h> >X #endif >X >X+#ifndef PATH_MAX >X+#define PATH_MAX 4096 >X+#endif >X+ >X #include "archiveformat.h" >X #include "ShockDialogs.h" >X #include "setup.h" >X@@ -1305,8 +1310,21 @@ uchar intro_key_handler(uiEvent *ev, LGRegion *r, intp >X return (main_kb_callback(ev, r, user_data)); >X } >X >X+static int file_exists_in_homedir_p (const char *filename) >X+{ >X+ char *home = getenv ("HOME"); >X+ char path[PATH_MAX]; >X+ int res = 0; >X >X+ if (home != NULL) { >X+ snprintf (path, PATH_MAX, "%s/.sshock/%s", >X+ home, filename); >X+ res = access (path, F_OK) != -1; >X+ } >X >X+ return res; >X+} >X+ >X errtype load_savegame_names(void) >X { >X int i; >X@@ -1320,7 +1338,7 @@ errtype load_savegame_names(void) >X { >X Poke_SaveName(i); >X >X- if (access(save_game_name, F_OK) != -1) >X+ if (file_exists_in_homedir_p (save_game_name)) >X { >X file = ResOpenFile(save_game_name); >X if (ResInUse(OLD_SAVE_GAME_ID_BASE)) >cea11e54905bfdc5dbcccd82a723cfb8 >echo x - shockolate/files/patch-src_MusicSrc_MusicDevice.c >sed 's/^X//' >shockolate/files/patch-src_MusicSrc_MusicDevice.c << '79836a55a70311182bcc27d6f13780d6' >X--- src/MusicSrc/MusicDevice.c.orig 2020-04-23 04:29:54 UTC >X+++ src/MusicSrc/MusicDevice.c >X@@ -1023,9 +1023,10 @@ static int FluidMidiInit(MusicDevice *dev, const unsig >X fluid_settings_t *settings; >X fluid_synth_t *synth; >X int sfid; >X- char fileName[1024] = "res/"; >X+ char fileName[1024] = "%%MIDIDIR%%"; >X+ size_t dirlen = strlen (fileName); >X >X- FluidMidiGetOutputName(dev, outputIndex, &fileName[4], 1020); >X+ FluidMidiGetOutputName(dev, outputIndex, &fileName[dirlen], 1024 - dirlen); >X if (strlen(fileName) == 4) >X { >X WARN("Failed to locate SoundFont for outputIndex=%d", outputIndex); >X@@ -1184,19 +1185,20 @@ static unsigned int FluidMidiGetOutputCount(MusicDevic >X FindClose(hFind); >X } >X #else >X- DIR *dirp = opendir("res"); >X+ DIR *dirp = opendir("%%MIDIDIR%%"); >X struct dirent *dp = 0; >X- while ((dp = readdir(dirp))) >X- { >X- char *filename = dp->d_name; >X- char namelen = strlen(filename); >X- if (namelen < 4) continue; // ".sf2" >X- if (strcasecmp(".sf2", (char*)(filename + (namelen - 4)))) continue; >X- // found one >X- // INFO("Counting SoundFont file: %s", filename); >X- ++outputCount; >X+ if (dirp != NULL) { >X+ while ((dp = readdir(dirp))) { >X+ char *filename = dp->d_name; >X+ char namelen = strlen(filename); >X+ if (namelen < 4) continue; // ".sf2" >X+ if (strcasecmp(".sf2", (char*)(filename + (namelen - 4)))) continue; >X+ // found one >X+ // INFO("Counting SoundFont file: %s", filename); >X+ ++outputCount; >X+ } >X+ closedir(dirp); >X } >X- closedir(dirp); >X #endif >X >X // suppress compiler warnings >X@@ -1237,24 +1239,26 @@ static void FluidMidiGetOutputName(MusicDevice *dev, c >X unsigned int outputCount = 0; // subtract 1 to get index >X // count .sf2 files in res/ subdirectory until we find the one that the user >X // probably wants >X- DIR *dirp = opendir("res"); >X- struct dirent *dp = 0; >X- while ((outputCount <= outputIndex) && >X- (dp = readdir(dirp))) >X- { >X- char *filename = dp->d_name; >X- char namelen = strlen(filename); >X- if (namelen < 4) continue; // ".sf2" >X- if (strcasecmp(".sf2", (char*)(filename + (namelen - 4)))) continue; >X- // found one >X- // INFO("Counting SoundFont file: %s", filename); >X- ++outputCount; >X- if (outputCount - 1 != outputIndex) continue; >X- // found it >X- strncpy(buffer, filename, bufferSize - 1); >X- // INFO("Found SoundFont file for outputIndex=%d: %s", outputIndex, filename); >X+ DIR *dirp = opendir("%%MIDIDIR%%"); >X+ >X+ if (dirp != NULL) { >X+ struct dirent *dp = 0; >X+ while ((outputCount <= outputIndex) && >X+ (dp = readdir(dirp))) { >X+ char *filename = dp->d_name; >X+ char namelen = strlen(filename); >X+ if (namelen < 4) continue; // ".sf2" >X+ if (strcasecmp(".sf2", (char*)(filename + (namelen - 4)))) continue; >X+ // found one >X+ // INFO("Counting SoundFont file: %s", filename); >X+ ++outputCount; >X+ if (outputCount - 1 != outputIndex) continue; >X+ // found it >X+ strncpy(buffer, filename, bufferSize - 1); >X+ // INFO("Found SoundFont file for outputIndex=%d: %s", outputIndex, filename); >X+ } >X+ closedir(dirp); >X } >X- closedir(dirp); >X #endif >X // put NULL in last position in case we filled up everything else >X *(buffer + bufferSize - 1) = '\0'; >79836a55a70311182bcc27d6f13780d6 >echo x - shockolate/pkg-descr >sed 's/^X//' >shockolate/pkg-descr << '4573d52ec2b9665831ce991e03c621b5' >XShockolate is an opensource remake of System Shock, a 1994 FPS game in >Xcyberpunk setting. >X >XYou will need original System Shock data files to run the game. >4573d52ec2b9665831ce991e03c621b5 >echo x - shockolate/distinfo >sed 's/^X//' >shockolate/distinfo << '364bc0099d62474992cc72e948238a2f' >XTIMESTAMP = 1588277304 >XSHA256 (shamazmazum-systemshock-v0.8.4_GH0.tar.gz) = e256c33061c8416a0ddd65402330418cba4c667f9867f75fa850a5562fa6a2c2 >XSIZE (shamazmazum-systemshock-v0.8.4_GH0.tar.gz) = 12381384 >364bc0099d62474992cc72e948238a2f >echo x - shockolate/Makefile >sed 's/^X//' >shockolate/Makefile << '1a3d4576dfe0f77c7020b3e8e3ee92b0' >X# Created by: Vasily Postnicov <shamaz.mazum@gmail.com> >X# $FreeBSD$ >X >XPORTNAME= shockolate >XDISTVERSIONPREFIX=v >XDISTVERSION= 0.8.4 >XCATEGORIES= games >X >XMAINTAINER= shamaz.mazum@gmail.com >XCOMMENT= Open source and cross-platform remake of a cult game System Shock >X >XLICENSE= GPLv3 >XLICENSE_FILE= ${WRKSRC}/LICENSE >X >XLIB_DEPENDS= libfluidsynth.so:audio/fluidsynth \ >X libasound.so:audio/alsa-lib >X >XUSES= cmake gl sdl pkgconfig >XUSE_GL= gl glu >XUSE_SDL= sdl2 mixer2 >X >XUSE_GITHUB= yes >XGH_ACCOUNT= shamazmazum >XGH_PROJECT= systemshock >X >XCMAKE_ON= ENABLE_SDL2 ENABLE_SOUND ENABLE_FLUIDSYNTH >X >Xpost-patch: .SILENT >X ${REINPLACE_CMD} -e 's|%%DATADIR%%|${LOCALBASE}/share/shockolate/|' \ >X ${WRKSRC}/src/Libraries/RES/Source/caseless.c \ >X ${WRKSRC}/src/MacSrc/OpenGL.cc >X ${REINPLACE_CMD} -e 's|%%MIDIDIR%%|${LOCALBASE}/share/sounds/sf2/|' \ >X ${WRKSRC}/src/MusicSrc/MusicDevice.c >X >Xdo-install: >X ${INSTALL_PROGRAM} ${BUILD_WRKSRC}/systemshock ${STAGEDIR}${PREFIX}/bin >X (cd ${WRKSRC} && ${COPYTREE_SHARE} shaders ${STAGEDIR}${DATADIR}) >X ${MKDIR} ${STAGEDIR}${DATADIR}/res >X >X.include <bsd.port.mk> >1a3d4576dfe0f77c7020b3e8e3ee92b0 >echo x - shockolate/pkg-plist >sed 's/^X//' >shockolate/pkg-plist << '31cd809fcc61048522eabfe9848cb538' >Xbin/systemshock >X%%DATADIR%%/shaders/color.frag >X%%DATADIR%%/shaders/main.vert >X%%DATADIR%%/shaders/star.frag >X%%DATADIR%%/shaders/texture.frag >X@dir %%DATADIR%%/res >31cd809fcc61048522eabfe9848cb538 >echo x - shockolate/pkg-message >sed 's/^X//' >shockolate/pkg-message << '83518f55e29a89286306ef14b185f74b' >X[ >X{ type: install >X message: << EOM >XTo run the game, copy the game's datafiles (data and sound >Xdirectories) into /usr/local/shared/shockolate/res, then run >X >X$ systemshock >X >XIf you want to play MIDI soundtracks with fluidsynth, you need to >Xmanually install audio/fluid-soundfont port. >XEOM >X} >X] >83518f55e29a89286306ef14b185f74b >exit >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 246072
:
213970
|
215171