diff --git a/pkgs/games/exult/64bits.patch b/pkgs/games/exult/64bits.patch deleted file mode 100644 index 49c67cd2f05e..000000000000 --- a/pkgs/games/exult/64bits.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff -ru exult-1.2-orig/usecode/useval.cc exult-1.2/usecode/useval.cc ---- exult-1.2-orig/usecode/useval.cc 2004-05-23 07:07:11.000000000 +0200 -+++ exult-1.2/usecode/useval.cc 2008-06-25 17:27:15.000000000 +0200 -@@ -464,7 +464,7 @@ - if (buflen < 5) - return -1; - *ptr++ = type; -- Write4(ptr, (int)value.ptr); -+ Write4(ptr, 0); - break; - case string_type: - { -@@ -525,7 +525,7 @@ - case pointer_type: - if (buflen < 5) - return false; -- value.ptr = (Game_object*)Read4(ptr); //DON'T dereference this pointer! -+ value.ptr = 0; //DON'T dereference this pointer! - // Maybe add a new type "serialized_pointer" to prevent "accidents"? - return true; - case string_type: diff --git a/pkgs/games/exult/arch.patch b/pkgs/games/exult/arch.patch new file mode 100644 index 000000000000..70de34184a24 --- /dev/null +++ b/pkgs/games/exult/arch.patch @@ -0,0 +1,123 @@ +diff -aur exult-1.4.9rc1.orig/desktop/exult.desktop exult-1.4.9rc1/desktop/exult.desktop +--- exult-1.4.9rc1.orig/desktop/exult.desktop 2008-07-11 05:41:06.000000000 +0600 ++++ exult-1.4.9rc1/desktop/exult.desktop 2012-05-19 13:15:30.616084585 +0600 +@@ -1,9 +1,8 @@ + [Desktop Entry] +-Encoding=UTF-8 + Name=Exult + Comment=Exult Ultima 7 Engine + Exec=exult +-Icon=exult.png ++Icon=exult + Terminal=false + Type=Application +-Categories=Application;Game;RolePlaying; ++Categories=Game;RolePlaying; +diff -aur exult-1.4.9rc1.orig/files/databuf.h exult-1.4.9rc1/files/databuf.h +--- exult-1.4.9rc1.orig/files/databuf.h 2010-03-10 09:07:05.000000000 +0500 ++++ exult-1.4.9rc1/files/databuf.h 2012-05-19 12:50:16.856076030 +0600 +@@ -18,6 +18,7 @@ + #define DATA_H + + #include ++#include + #include + #include + #include +diff -aur exult-1.4.9rc1.orig/files/U7obj.h exult-1.4.9rc1/files/U7obj.h +--- exult-1.4.9rc1.orig/files/U7obj.h 2010-02-25 07:52:07.000000000 +0500 ++++ exult-1.4.9rc1/files/U7obj.h 2012-05-19 12:50:35.916076137 +0600 +@@ -26,6 +26,7 @@ + #include + #include + #include ++#include + #include "common_types.h" + #include "utils.h" + +diff -aur exult-1.4.9rc1.orig/imagewin/manip.h exult-1.4.9rc1/imagewin/manip.h +--- exult-1.4.9rc1.orig/imagewin/manip.h 2010-08-29 20:26:00.000000000 +0600 ++++ exult-1.4.9rc1/imagewin/manip.h 2012-05-19 13:02:45.159413596 +0600 +@@ -319,7 +319,7 @@ + static uintD copy(uintS src) + { + unsigned int r, g, b; +- split_source(src,r,g,b); ++ ManipBaseSrc::split_source(src,r,g,b); + return ManipBaseDest::rgb(r,g,b); + } + static void copy(uintD& dest, uintS src) +diff -aur exult-1.4.9rc1.orig/istring.h exult-1.4.9rc1/istring.h +--- exult-1.4.9rc1.orig/istring.h 2005-06-07 15:55:39.000000000 +0600 ++++ exult-1.4.9rc1/istring.h 2012-05-19 13:01:14.886079750 +0600 +@@ -162,19 +162,19 @@ + + _Myt& operator+=(const _Myt& _Right) + { // append _Right +- append(_Right); ++ this->append(_Right); + return (*this); + } + + _Myt& operator+=(const _Elem *_Ptr) + { // append [_Ptr, ) +- append(_Ptr); ++ this->append(_Ptr); + return (*this); + } + + _Myt& operator+=(_Elem _Ch) + { // append 1 * _Ch +- append(static_cast(1), _Ch); ++ this->append(static_cast(1), _Ch); + return (*this); + } + +diff -aur exult-1.4.9rc1.orig/shapes/pngio.cc exult-1.4.9rc1/shapes/pngio.cc +--- exult-1.4.9rc1.orig/shapes/pngio.cc 2010-02-15 18:48:11.000000000 -0200 ++++ exult-1.4.9rc1/shapes/pngio.cc 2013-09-22 20:56:37.809763588 -0300 +@@ -26,6 +26,7 @@ + #ifdef HAVE_CONFIG_H + # include + #endif ++#include + + #ifdef HAVE_PNG_H + +@@ -79,7 +80,7 @@ + } + // Allocate info. structure. + png_infop info = png_create_info_struct(png); +- if (setjmp(png->jmpbuf)) // Handle errors. ++ if (setjmp(png_jmpbuf(png))) // Handle errors. + { + png_destroy_read_struct(&png, &info, 0); + fclose(fp); +@@ -208,7 +209,7 @@ + } + // Allocate info. structure. + png_infop info = png_create_info_struct(png); +- if (setjmp(png->jmpbuf)) // Handle errors. ++ if (setjmp(png_jmpbuf(png))) // Handle errors. + { + png_destroy_write_struct(&png, &info); + fclose(fp); +@@ -306,7 +307,7 @@ + } + // Allocate info. structure. + png_infop info = png_create_info_struct(png); +- if (setjmp(png->jmpbuf)) // Handle errors. ++ if (setjmp(png_jmpbuf(png))) // Handle errors. + { + png_destroy_read_struct(&png, &info, 0); + fclose(fp); +@@ -395,7 +396,7 @@ + } + // Allocate info. structure. + png_infop info = png_create_info_struct(png); +- if (setjmp(png->jmpbuf)) // Handle errors. ++ if (setjmp(png_jmpbuf(png))) // Handle errors. + { + png_destroy_write_struct(&png, &info); + fclose(fp); + diff --git a/pkgs/games/exult/default.nix b/pkgs/games/exult/default.nix index e784cc109f53..a79b6f8d5d8d 100644 --- a/pkgs/games/exult/default.nix +++ b/pkgs/games/exult/default.nix @@ -1,56 +1,45 @@ -{stdenv, fetchurl, SDL, SDL_mixer, zlib, libpng, unzip}: +{ stdenv, fetchurl, pkgconfig, SDL, libogg, libvorbis, zlib, unzip }: let # Digital recordings of the music on an original Roland MT-32. So # we don't need actual MIDI playback capability. - musicFiles = - [ (fetchurl { - url = mirror://sourceforge/exult/U7MusicOGG_1of2.zip; - md5 = "7746d1a9164fd67509107797496553bf"; - }) - (fetchurl { - url = mirror://sourceforge/exult/U7MusicOGG_2of2.zip; - md5 = "cdae5956d7c52f35e90317913a660123"; - }) - ]; + audio = fetchurl { + url = mirror://sourceforge/exult/exult_audio.zip; + sha256 = "0s5wvgy9qja06v38g0qwzpaw76ff96vzd6gb1i3lb9k4hvx0xqbj"; + }; in -stdenv.mkDerivation { - name = "exult-1.2"; - +stdenv.mkDerivation rec { + name = "exult-1.4.9rc1"; + src = fetchurl { - url = mirror://sourceforge/exult/exult-1.2.tar.gz; - md5 = "0fc88dee74a91724d25373ba0a8670ba"; + url = "mirror://sourceforge/exult/${name}.tar.gz"; + sha256 = "0a03a2l3ji6h48n106d4w55l8v6lni1axniafnvvv5c5n3nz5bgd"; }; - # Patches for building on x86_64 and gcc 4.x. - patches = [ - (fetchurl { - url = "http://www.rocklinux.net/sources/package/stf/exult/exult-gcc4.patch"; - sha256 = "1jlikxcpsi3yfchan3jbyi66fcyr18m7kfmsa946lwh3kzckszm7"; - }) + configureFlags = "--disable-tools"; - # From http://sources.gentoo.org/viewcvs.py/*checkout*/gentoo-x86/games-engines/exult/files/exult-1.2-64bits.patch?rev=1.1 - ./64bits.patch - ]; + patches = + [ # Arch Linux patch set. + ./arch.patch + ]; - buildInputs = [SDL SDL_mixer zlib libpng unzip]; - - NIX_CFLAGS_COMPILE = "-I${SDL_mixer}/include/SDL"; + buildInputs = [ pkgconfig SDL libogg libvorbis zlib unzip ]; + + enableParallelBuilding = true; postInstall = '' mkdir -p $out/share/exult/music - for i in $musicFiles; do - unzip -o -d $out/share/exult/music $i - done - ''; - + unzip -o -d $out/share/exult ${audio} + chmod 644 $out/share/exult/*.flx + ''; # */ + meta = { homepage = http://exult.sourceforge.net/; description = "A reimplementation of the Ultima VII game engine"; - maintainers = [stdenv.lib.maintainers.eelco]; + maintainers = [ stdenv.lib.maintainers.eelco ]; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 57ad4ff7398f..0e07e136bf5d 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10184,10 +10184,7 @@ let egoboo = callPackage ../games/egoboo { }; - exult = callPackage ../games/exult { - stdenv = overrideGCC stdenv gcc42; - libpng = libpng12; - }; + exult = callPackage ../games/exult { }; flightgear = callPackage ../games/flightgear { };