From 0e6c8cc9eaf3f901f5fe9f2914c47f05ed54ff138f37185b2dbd4fd97a6650e4 Mon Sep 17 00:00:00 2001 From: Dominique Leuenberger Date: Sun, 25 Mar 2012 17:01:45 +0000 Subject: [PATCH] Accepting request 110998 from home:jengelh:branches:games OBS-URL: https://build.opensuse.org/request/show/110998 OBS-URL: https://build.opensuse.org/package/show/games/blockout?expand=0&rev=1 --- .gitattributes | 23 +++ .gitignore | 1 + automake.diff | 86 ++++++++++++ bl24-src-linux-i586.tar.xz | 3 + bl2home.diff | 33 +++++ blockout.changes | 4 + blockout.spec | 46 ++++++ compilefixes.diff | 279 +++++++++++++++++++++++++++++++++++++ 8 files changed, 475 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 automake.diff create mode 100644 bl24-src-linux-i586.tar.xz create mode 100644 bl2home.diff create mode 100644 blockout.changes create mode 100644 blockout.spec create mode 100644 compilefixes.diff diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/automake.diff b/automake.diff new file mode 100644 index 0000000..aae146c --- /dev/null +++ b/automake.diff @@ -0,0 +1,86 @@ +From: Jan Engelhardt +Date: 2012-03-25 16:12:52.925160061 +0200 + +--- + BlockOut/Makefile.am | 14 ++++++++++++++ + ImageLib/src/Makefile.am | 12 ++++++++++++ + ImageLib/src/png/hpng.c | 2 +- + Makefile.am | 3 +++ + configure.ac | 14 ++++++++++++++ + 5 files changed, 44 insertions(+), 1 deletion(-) + +Index: bl24_lin_src/BlockOut/Makefile.am +=================================================================== +--- /dev/null ++++ bl24_lin_src/BlockOut/Makefile.am +@@ -0,0 +1,14 @@ ++# -*- Makefile -*- ++ ++AM_CPPFLAGS = -D_DEBUG -Dlinux -I../ImageLib/src -I. \ ++ ${libSDL_CFLAGS} ${libSDL_mixer_CFLAGS} ++ ++bin_PROGRAMS = blockout ++blockout_SOURCES = \ ++ BlockOut.cpp BotPlayer.cpp EditControl.cpp Game.cpp Http.cpp InitPolyCube.cpp Menu.cpp MenuGraphics.cpp MenuGrid.cpp PageChangeSetup.cpp PageChooseSetup.cpp PageControls.cpp PageCredits.cpp PageGSOptions.cpp PageHallOfFame.cpp PageHallOfFameOnLine.cpp PageHttp.cpp PageMainMenu.cpp PageOptions.cpp PageScoreDetails.cpp PageStartGame.cpp Pit.cpp PolyCube.cpp SetupManager.cpp SoundManager.cpp Sprites.cpp Utils.cpp BlockOut.h BotPlayer.h EditControl.h Game.h Http.h Menu.h MenuGrid.h MenuPage.h Pit.h PolyCube.h SetupManager.h SoundManager.h Sprites.h Types.h GLApp/GLApp.cpp GLApp/GLFont.cpp GLApp/GLMatrix.cpp GLApp/GLSprite.cpp GLApp/GLApp.h GLApp/GLFont.h GLApp/GLMatrix.h GLApp/GLSprite.h ++blockout_LDADD = \ ++ ../ImageLib/src/libimagelib.la \ ++ ${libGL_LIBS} ${libGLU_LIBS} ${libSDL_LIBS} ${libSDL_mixer_LIBS} ++ ++nobase_pkgdata_DATA = \ ++ images/allPieces.png images/background.png images/background2.png images/background3.png images/font.png images/gameover.png images/gameovera.png images/marble.png images/marbleg.png images/menuback.png images/menucredits.png images/menufont.png images/menufont2.png images/menupit.png images/online.png images/onlinea.png images/spark.png images/sparka.png images/sprites.png images/spritesa.png images/star_crystal_grid.png sounds/blub.wav sounds/empty.wav sounds/empty2.wav sounds/hit.wav sounds/level.wav sounds/level2.wav sounds/line.wav sounds/line2.wav sounds/music.mp3 sounds/tchh.wav sounds/welldone.wav sounds/welldone2.wav sounds/wozz.wav +Index: bl24_lin_src/ImageLib/src/Makefile.am +=================================================================== +--- /dev/null ++++ bl24_lin_src/ImageLib/src/Makefile.am +@@ -0,0 +1,12 @@ ++# -*- Makefile -*- ++ ++AM_CPPFLAGS = -I. ${libpng_CFLAGS} ++ ++noinst_LTLIBRARIES = libimagelib.la ++ ++libimagelib_la_SOURCES = \ ++ gif/gif.c gif/gif.h \ ++ jpg/H2v2.cpp jpg/idct.cpp jpg/jpegdecoder.cpp jpg/jpegdecodermain.cpp jpg/jpegdecoder.h jpg/main.h \ ++ png/hpng.c png/hpng.h \ ++ CImage.cpp CImage.h ++libimagelib_la_LIBADD = ${libpng_LIBS} +Index: bl24_lin_src/ImageLib/src/png/hpng.c +=================================================================== +--- bl24_lin_src.orig/ImageLib/src/png/hpng.c ++++ bl24_lin_src/ImageLib/src/png/hpng.c +@@ -1,6 +1,6 @@ + #include + #include +-#include "png/png.h" ++#include + #include "hpng.h" + + char PngErrorMessage[1024]; +Index: bl24_lin_src/Makefile.am +=================================================================== +--- /dev/null ++++ bl24_lin_src/Makefile.am +@@ -0,0 +1,3 @@ ++# -*- Makefile -*- ++ ++SUBDIRS = ImageLib/src BlockOut +Index: bl24_lin_src/configure.ac +=================================================================== +--- /dev/null ++++ bl24_lin_src/configure.ac +@@ -0,0 +1,14 @@ ++AC_INIT([blockout], [2.4]) ++AC_CONFIG_AUX_DIR([build-aux]) ++AM_INIT_AUTOMAKE([-Wall foreign subdir-objects tar-pax no-dist-gzip dist-xz]) ++LT_INIT ++AC_PROG_CXX ++PKG_CHECK_MODULES([libGL], [gl]) ++PKG_CHECK_MODULES([libGLU], [glu]) ++PKG_CHECK_MODULES([libSDL], [sdl >= 1.2.12]) ++PKG_CHECK_MODULES([libSDL_mixer], [SDL_mixer >= 1.2.8]) ++PKG_CHECK_MODULES([libpng], [libpng15], [:], [ ++ PKG_CHECK_MODULES([libpng], [libpng14]) ++]) ++AC_CONFIG_FILES([Makefile ImageLib/src/Makefile BlockOut/Makefile]) ++AC_OUTPUT diff --git a/bl24-src-linux-i586.tar.xz b/bl24-src-linux-i586.tar.xz new file mode 100644 index 0000000..a4d4a6c --- /dev/null +++ b/bl24-src-linux-i586.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1633a2f3d53c2ab44bcbaa731c21e84bc6e6e0a2aed80e5110e8a0b28fb24d77 +size 4874736 diff --git a/bl2home.diff b/bl2home.diff new file mode 100644 index 0000000..959692b --- /dev/null +++ b/bl2home.diff @@ -0,0 +1,33 @@ +From: Jan Engelhardt +Date: 2012-03-25 16:17:03.379573514 +0200 + +--- + BlockOut/Makefile.am | 1 + + BlockOut/Utils.cpp | 2 ++ + 2 files changed, 3 insertions(+) + +Index: bl24_lin_src/BlockOut/Makefile.am +=================================================================== +--- bl24_lin_src.orig/BlockOut/Makefile.am ++++ bl24_lin_src/BlockOut/Makefile.am +@@ -1,6 +1,7 @@ + # -*- Makefile -*- + + AM_CPPFLAGS = -D_DEBUG -Dlinux -I../ImageLib/src -I. \ ++ -DBL2_HOME=\"${pkgdatadir}\" \ + ${libSDL_CFLAGS} ${libSDL_mixer_CFLAGS} + + bin_PROGRAMS = blockout +Index: bl24_lin_src/BlockOut/Utils.cpp +=================================================================== +--- bl24_lin_src.orig/BlockOut/Utils.cpp ++++ bl24_lin_src/BlockOut/Utils.cpp +@@ -163,6 +163,8 @@ BOOL CheckEnv() { + } + + char *blockoutHome = getenv("BL2_HOME"); ++ if (blockoutHome == NULL) ++ blockoutHome = BL2_HOME; + if( blockoutHome==NULL ) { + printf("BL2_HOME environement variable if not defined !\n"); + printf("Please set the BL2_HOME to the BlockOut II installation directory (ex: BL2_HOME=/usr/local/bl2).\n"); diff --git a/blockout.changes b/blockout.changes new file mode 100644 index 0000000..83c1d05 --- /dev/null +++ b/blockout.changes @@ -0,0 +1,4 @@ +------------------------------------------------------------------- +Sun Mar 25 14:18:38 UTC 2012 - jengelh@medozas.de + +- Initial package for build.opensuse.org diff --git a/blockout.spec b/blockout.spec new file mode 100644 index 0000000..cb17854 --- /dev/null +++ b/blockout.spec @@ -0,0 +1,46 @@ +Name: blockout +Version: 2.4 +Release: 1 +Summary: A free clone of the original BlockOut DOS game +Group: Productivity/Networking/System +License: GPL v2 +Url: http://blockout.net/ + +Source: bl24-src-linux-i586.tar.xz +Patch1: automake.diff +Patch2: compilefixes.diff +Patch3: bl2home.diff +BuildRoot: %{_tmppath}/%{name}-%{version}-build +BuildRequires: autoconf automake libtool +BuildRequires: gcc-c++ pkgconfig(sdl) pkgconfig(SDL_mixer) xz +%if 0%{?suse_version} >= 1220 +BuildRequires: pkgconfig(libpng15) +%else +BuildRequires: pkgconfig(libpng14) +%endif + +%description +BlockOut II is a free adaptation of the original BlockOut DOS game +edited by California Dreams in 1989. BlockOut II has the same +features than the original game with few graphic improvements. The +game has been designed to reproduce the original game kinematics as +accurately as possible. + +%prep +%setup -qn bl24_lin_src +%patch -P 1 -P 2 -P 3 -p1 + +%build +autoreconf -fi +%configure +make %{?_smp_mflags} + +%install +make install DESTDIR="%buildroot"; + +%files +%defattr(-,root,root) +%_bindir/blockout +%_datadir/%name + +%changelog diff --git a/compilefixes.diff b/compilefixes.diff new file mode 100644 index 0000000..b616571 --- /dev/null +++ b/compilefixes.diff @@ -0,0 +1,279 @@ +From: Jan Engelhardt +Date: 2012-03-25 16:06:07.551725021 +0200 + +--- + BlockOut/EditControl.cpp | 2 +- + BlockOut/EditControl.h | 2 +- + BlockOut/GLApp/GLApp.h | 2 +- + BlockOut/GLApp/GLFont.cpp | 3 +-- + BlockOut/GLApp/GLSprite.cpp | 4 ++-- + BlockOut/GLApp/GLSprite.h | 2 +- + BlockOut/Menu.h | 4 ++-- + BlockOut/MenuGraphics.cpp | 4 ++-- + BlockOut/SetupManager.cpp | 2 +- + BlockOut/SetupManager.h | 2 +- + BlockOut/Types.h | 6 +++--- + BlockOut/Utils.cpp | 6 +++--- + ImageLib/src/jpg/jpegdecoder.cpp | 6 +++--- + ImageLib/src/png/hpng.c | 6 +----- + 14 files changed, 23 insertions(+), 28 deletions(-) + +Index: bl24_lin_src/BlockOut/EditControl.cpp +=================================================================== +--- bl24_lin_src.orig/BlockOut/EditControl.cpp ++++ bl24_lin_src/BlockOut/EditControl.cpp +@@ -30,7 +30,7 @@ void EditControl::SetDisplayLength(int l + + // ------------------------------------------------ + +-void EditControl::SetMode(char *text,BOOL edit,BYTE *keys) { ++void EditControl::SetMode(const char *text,BOOL edit,BYTE *keys) { + + if( strlen(text)>=255 ) { + strncpy(editText,text,255); +Index: bl24_lin_src/BlockOut/EditControl.h +=================================================================== +--- bl24_lin_src.orig/BlockOut/EditControl.h ++++ bl24_lin_src/BlockOut/EditControl.h +@@ -27,7 +27,7 @@ class EditControl { + void SetDisplayLength(int length); + + // Set edit control mode (keys can be NULL) +- void SetMode(char *text,BOOL edit,BYTE *keys); ++ void SetMode(const char *text,BOOL edit,BYTE *keys); + + // Get the mode + BOOL GetMode(); +Index: bl24_lin_src/BlockOut/GLApp/GLApp.h +=================================================================== +--- bl24_lin_src.orig/BlockOut/GLApp/GLApp.h ++++ bl24_lin_src/BlockOut/GLApp/GLApp.h +@@ -57,7 +57,7 @@ protected: + + // Internal variables for the state of the app + BOOL m_bWindowed; +- char* m_strWindowTitle; ++ const char *m_strWindowTitle; + int m_screenWidth; + int m_screenHeight; + +Index: bl24_lin_src/BlockOut/GLApp/GLFont.cpp +=================================================================== +--- bl24_lin_src.orig/BlockOut/GLApp/GLFont.cpp ++++ bl24_lin_src/BlockOut/GLApp/GLFont.cpp +@@ -6,8 +6,7 @@ + #include + #include + #include +- +-extern char *LID(char *fileName); ++#include "../Types.h" + + // ------------------------------------------- + +Index: bl24_lin_src/BlockOut/GLApp/GLSprite.cpp +=================================================================== +--- bl24_lin_src.orig/BlockOut/GLApp/GLSprite.cpp ++++ bl24_lin_src/BlockOut/GLApp/GLSprite.cpp +@@ -6,8 +6,8 @@ + #include + #include + #include ++#include "../Types.h" + +-extern char *LID(char *fileName); + + // ------------------------------------------- + +@@ -53,7 +53,7 @@ void Sprite2D::UpdateSprite(int x1,int y + + // ------------------------------------------- + +-int Sprite2D::RestoreDeviceObjects(char *diffName,char *alphaName,int scrWidth,int scrHeight) { ++int Sprite2D::RestoreDeviceObjects(const char *diffName, const char *alphaName,int scrWidth,int scrHeight) { + + GLint bpp; + GLenum format; +Index: bl24_lin_src/BlockOut/GLApp/GLSprite.h +=================================================================== +--- bl24_lin_src.orig/BlockOut/GLApp/GLSprite.h ++++ bl24_lin_src/BlockOut/GLApp/GLSprite.h +@@ -15,7 +15,7 @@ public: + + // Initialise the font + // return 1 when success, 0 otherwise +- int RestoreDeviceObjects(char *diffName,char *alphaName,int srcWidth,int scrHeight); ++ int RestoreDeviceObjects(const char *diffName, const char *alphaName,int srcWidth,int scrHeight); + + // Update sprite mapping and coordinates + void UpdateSprite(int x1,int y1,int x2,int y2); +Index: bl24_lin_src/BlockOut/Menu.h +=================================================================== +--- bl24_lin_src.orig/BlockOut/Menu.h ++++ bl24_lin_src/BlockOut/Menu.h +@@ -60,8 +60,8 @@ class Menu { + // Menu page + void ToPage(MenuPage *page); + void ToPage(MenuPage *page,int iParam,void *wParam); +- void RenderText(int x,int y,BOOL selected,char *text); +- void RenderTitle(char *title); ++ void RenderText(int x,int y,BOOL selected, const char *text); ++ void RenderTitle(const char *title); + + PageMainMenu mainMenuPage; + PageStartGame startGamePage; +Index: bl24_lin_src/BlockOut/MenuGraphics.cpp +=================================================================== +--- bl24_lin_src.orig/BlockOut/MenuGraphics.cpp ++++ bl24_lin_src/BlockOut/MenuGraphics.cpp +@@ -438,7 +438,7 @@ void Menu::RenderChar(int x,int y,int w, + + // --------------------------------------------------------------------- + +-void Menu::RenderTitle(char *title) { ++void Menu::RenderTitle(const char *title) { + + int lgth = strlen(title); + int nwFont = fround((float)wFont*1.1f); +@@ -454,7 +454,7 @@ void Menu::RenderTitle(char *title) { + + // --------------------------------------------------------------------- + +-void Menu::RenderText(int x,int y,BOOL selected,char *text) { ++void Menu::RenderText(int x,int y,BOOL selected, const char *text) { + + float startLine = 0.515f; + float startColumn = 0.15f; +Index: bl24_lin_src/BlockOut/SetupManager.cpp +=================================================================== +--- bl24_lin_src.orig/BlockOut/SetupManager.cpp ++++ bl24_lin_src/BlockOut/SetupManager.cpp +@@ -363,7 +363,7 @@ int SetupManager::GetTimeout() { + + // ------------------------------------------------ + +-char *SetupManager::GetName() { ++const char *SetupManager::GetName() { + + static char ret[32]; + strcpy(ret,""); +Index: bl24_lin_src/BlockOut/SetupManager.h +=================================================================== +--- bl24_lin_src.orig/BlockOut/SetupManager.h ++++ bl24_lin_src/BlockOut/SetupManager.h +@@ -49,7 +49,7 @@ class SetupManager { + float GetAnimationTime(); /* in seconds */ + + // Names +- char *GetName(); ++ const char *GetName(); + const char *GetBlockSetName(); + + // Sound +Index: bl24_lin_src/BlockOut/Types.h +=================================================================== +--- bl24_lin_src.orig/BlockOut/Types.h ++++ bl24_lin_src/BlockOut/Types.h +@@ -160,13 +160,13 @@ extern int fround(float x); + extern char *FormatTime(float seconds); + extern char *FormatDate(int time); + extern char *FormatDateShort(int time); +-extern int CreateTexture(int width,int height,char *imgName,GLuint *hmap); ++extern int CreateTexture(int width,int height, const char *imgName,GLuint *hmap); + extern char GetChar(BYTE *keys); + extern void ZeroMemory(void *buff,int size); + extern BOOL DirExists(char *dirname); + extern BOOL CheckEnv(); +-extern char *LID(char *fileName); +-extern char *LHD(char *fileName); ++extern char *LID(const char *fileName); ++extern char *LHD(const char *fileName); + + + #endif /* TYPESH */ +Index: bl24_lin_src/BlockOut/Utils.cpp +=================================================================== +--- bl24_lin_src.orig/BlockOut/Utils.cpp ++++ bl24_lin_src/BlockOut/Utils.cpp +@@ -191,7 +191,7 @@ BOOL CheckEnv() { + // Name: LID() + // Desc: Locate file in the installation directory + //----------------------------------------------------------------------------- +-char *LID(char *fileName) { ++char *LID(const char *fileName) { + + static char ret[512]; + sprintf(ret,"%s/%s",bl2Home,fileName); +@@ -203,7 +203,7 @@ char *LID(char *fileName) { + // Name: LHD() + // Desc: Locate file in the home directory + //----------------------------------------------------------------------------- +-char *LHD(char *fileName) { ++char *LHD(const char *fileName) { + + static char ret[512]; + sprintf(ret,"%s/%s",usrHome,fileName); +@@ -217,7 +217,7 @@ char *LHD(char *fileName) { + // Name: CreateTexture() + // Desc: Create a texture (no alpha) + //----------------------------------------------------------------------------- +-int CreateTexture(int width,int height,char *imgName,GLuint *hmap) { ++int CreateTexture(int width,int height, const char *imgName,GLuint *hmap) { + + *hmap = 0; + CImage img; +Index: bl24_lin_src/ImageLib/src/jpg/jpegdecoder.cpp +=================================================================== +--- bl24_lin_src.orig/ImageLib/src/jpg/jpegdecoder.cpp ++++ bl24_lin_src/ImageLib/src/jpg/jpegdecoder.cpp +@@ -106,7 +106,7 @@ void *jpeg_decoder::alloc(int n) + blocks[i] = q; + + // Round to qword boundry, to avoid misaligned accesses with MMX code +- return ((void *)(((uint)q + 7) & ~7)); ++ return ((void *)(((unsigned long)q + 7) & ~7)); + } + //------------------------------------------------------------------------------ + // Clear buffer to word values. +@@ -1884,7 +1884,7 @@ void jpeg_decoder::init_frame(void) + q = (uchar *)alloc(max_blocks_per_row * 64 * sizeof(BLOCK_TYPE) + 8); + + // Align to 8-byte boundry, for MMX code +- q = (uchar *)(((uint)q + 7) & ~7); ++ q = (uchar *)(((unsigned long)q + 7) & ~7); + + // The block_seg[] array's name dates back to the + // 16-bit assembler implementation. "seg" stood for "segment". +@@ -1894,7 +1894,7 @@ void jpeg_decoder::init_frame(void) + for (i = 0; i < max_blocks_per_row; i++) + block_max_zag_set[i] = 64; + +- Psample_buf = (uchar *)(((uint)alloc(max_blocks_per_row * 64 + 8) + 7) & ~7); ++ Psample_buf = (uchar *)(((unsigned long)alloc(max_blocks_per_row * 64 + 8) + 7) & ~7); + + total_lines_left = image_y_size; + +Index: bl24_lin_src/ImageLib/src/png/hpng.c +=================================================================== +--- bl24_lin_src.orig/ImageLib/src/png/hpng.c ++++ bl24_lin_src/ImageLib/src/png/hpng.c +@@ -45,10 +45,6 @@ int LoadPngImage(PNG_IMAGE *d) { + // ---------------- Error handling + + png_set_error_fn(png,NULL,my_png_error,NULL); +- if (setjmp(png->jmpbuf)) { +- png_destroy_read_struct(&png, &info, &endinfo); +- return 0; +- } + + // ----------------- Read the image + +@@ -154,7 +150,7 @@ char *WritePngImage(char *file_name,unsi + { + sprintf(PngErrorMessage,"png_create_info_struct() failed"); + fclose(fp); +- png_destroy_write_struct(&png_ptr, png_infopp_NULL); ++ png_destroy_write_struct(&png_ptr, NULL); + return PngErrorMessage; + } +