Merge pull request #28597 from orivej/rocksndiamonds
rocksndiamonds: init at 4.0.0.2
This commit is contained in:
commit
445465e2fc
8 changed files with 178 additions and 4 deletions
|
@ -1,4 +1,6 @@
|
|||
{ stdenv, lib, fetchurl, SDL2, libogg, libvorbis, smpeg, flac, enableNativeMidi ? false, fluidsynth ? null }:
|
||||
{ stdenv, lib, fetchurl, autoreconfHook, pkgconfig, which
|
||||
, SDL2, libogg, libvorbis, smpeg2, flac, libmodplug
|
||||
, enableNativeMidi ? false, fluidsynth ? null }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "SDL2_mixer-${version}";
|
||||
|
@ -9,9 +11,14 @@ stdenv.mkDerivation rec {
|
|||
sha256 = "0pv9jzjpcjlbiaybvwrb4avmv46qk7iqxlnqrd2dfj82c4mgc92s";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = [ SDL2 libogg libvorbis fluidsynth smpeg flac ];
|
||||
nativeBuildInputs = [ autoreconfHook pkgconfig which ];
|
||||
|
||||
configureFlags = [ "--disable-music-ogg-shared" ] ++ lib.optional enableNativeMidi "--enable-music-native-midi-gpl";
|
||||
propagatedBuildInputs = [ SDL2 libogg libvorbis fluidsynth smpeg2 flac libmodplug ];
|
||||
|
||||
patches = [ ./libmodplug.patch ];
|
||||
|
||||
configureFlags = [ "--disable-music-ogg-shared" ]
|
||||
++ lib.optional enableNativeMidi "--enable-music-native-midi-gpl";
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
description = "SDL multi-channel audio mixer library";
|
||||
|
|
13
pkgs/development/libraries/SDL2_mixer/libmodplug.patch
Normal file
13
pkgs/development/libraries/SDL2_mixer/libmodplug.patch
Normal file
|
@ -0,0 +1,13 @@
|
|||
diff --git a/configure.in b/configure.in
|
||||
index d511646..77dc3fe 100644
|
||||
--- a/configure.in
|
||||
+++ b/configure.in
|
||||
@@ -258,7 +258,7 @@ if test x$enable_music_mod = xyes -a x$enable_music_mod_modplug = xyes; then
|
||||
have_libmodplug_lib=yes
|
||||
], [dnl
|
||||
AC_CHECK_HEADER([libmodplug/modplug.h], [have_libmodplug_hdr=yes])
|
||||
- AC_CHECK_LIB([modplug], [have_libmodplug_lib=yes])
|
||||
+ AC_CHECK_LIB([modplug], [ModPlug_Load], [have_libmodplug_lib=yes])
|
||||
])
|
||||
|
||||
if test x$have_libmodplug_hdr = xyes -a x$have_libmodplug_lib = xyes; then
|
43
pkgs/development/libraries/smpeg2/default.nix
Normal file
43
pkgs/development/libraries/smpeg2/default.nix
Normal file
|
@ -0,0 +1,43 @@
|
|||
{ stdenv, fetchsvn, autoconf, automake, libtool, m4, pkgconfig, makeWrapper, SDL2 }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "smpeg2-svn${version}";
|
||||
version = "412";
|
||||
|
||||
src = fetchsvn {
|
||||
url = svn://svn.icculus.org/smpeg/trunk;
|
||||
rev = version;
|
||||
sha256 = "1irf2d8f150j8cx8lbb0pz1rijap536crsz0mw871xrh6wd2fd96";
|
||||
};
|
||||
|
||||
patches = [
|
||||
./gcc6.patch
|
||||
./sdl2.patch
|
||||
];
|
||||
|
||||
nativeBuildInputs = [ autoconf automake pkgconfig makeWrapper ];
|
||||
|
||||
buildInputs = [ SDL2 ];
|
||||
|
||||
preConfigure = ''
|
||||
sh autogen.sh
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
sed -e 's,#include "\(SDL.*.h\)",#include <SDL2/\1>,' -i $out/include/smpeg2/*.h
|
||||
|
||||
wrapProgram $out/bin/smpeg2-config \
|
||||
--prefix PATH ":" "${pkgconfig}/bin" \
|
||||
--prefix PKG_CONFIG_PATH ":" "${SDL2.dev}/lib/pkgconfig"
|
||||
'';
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
homepage = http://icculus.org/smpeg/;
|
||||
description = "SDL2 MPEG Player Library";
|
||||
license = licenses.lgpl2;
|
||||
platforms = platforms.linux;
|
||||
maintainers = with maintainers; [ orivej ];
|
||||
};
|
||||
}
|
33
pkgs/development/libraries/smpeg2/gcc6.patch
Normal file
33
pkgs/development/libraries/smpeg2/gcc6.patch
Normal file
|
@ -0,0 +1,33 @@
|
|||
--- a/audio/hufftable.cpp
|
||||
+++ b/audio/hufftable.cpp
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
+#include <climits>
|
||||
#include "MPEGaudio.h"
|
||||
|
||||
static const unsigned int
|
||||
@@ -550,11 +551,11 @@ htd33[ 31][2]={{ 16, 1},{ 8, 1},{ 4,
|
||||
|
||||
const HUFFMANCODETABLE MPEGaudio::ht[HTN]=
|
||||
{
|
||||
- { 0, 0-1, 0-1, 0, 0, htd33},
|
||||
+ { 0, UINT_MAX, UINT_MAX, 0, 0, htd33},
|
||||
{ 1, 2-1, 2-1, 0, 7,htd01},
|
||||
{ 2, 3-1, 3-1, 0, 17,htd02},
|
||||
{ 3, 3-1, 3-1, 0, 17,htd03},
|
||||
- { 4, 0-1, 0-1, 0, 0, htd33},
|
||||
+ { 4, UINT_MAX, UINT_MAX, 0, 0, htd33},
|
||||
{ 5, 4-1, 4-1, 0, 31,htd05},
|
||||
{ 6, 4-1, 4-1, 0, 31,htd06},
|
||||
{ 7, 6-1, 6-1, 0, 71,htd07},
|
||||
@@ -564,7 +565,7 @@ const HUFFMANCODETABLE MPEGaudio::ht[HTN
|
||||
{11, 8-1, 8-1, 0,127,htd11},
|
||||
{12, 8-1, 8-1, 0,127,htd12},
|
||||
{13,16-1,16-1, 0,511,htd13},
|
||||
- {14, 0-1, 0-1, 0, 0, htd33},
|
||||
+ {14, UINT_MAX, UINT_MAX, 0, 0, htd33},
|
||||
{15,16-1,16-1, 0,511,htd15},
|
||||
{16,16-1,16-1, 1,511,htd16},
|
||||
{17,16-1,16-1, 2,511,htd16},
|
22
pkgs/development/libraries/smpeg2/sdl2.patch
Normal file
22
pkgs/development/libraries/smpeg2/sdl2.patch
Normal file
|
@ -0,0 +1,22 @@
|
|||
diff --git a/smpeg2-config.in b/smpeg2-config.in
|
||||
index 5cce954..0e61939 100644
|
||||
--- a/smpeg2-config.in
|
||||
+++ b/smpeg2-config.in
|
||||
@@ -42,7 +42,7 @@ while test $# -gt 0; do
|
||||
if test @includedir@ != /usr/include ; then
|
||||
includes=-I@includedir@
|
||||
fi
|
||||
- echo $includes -I@includedir@/smpeg2 `@SDL_CONFIG@ --cflags`
|
||||
+ echo $includes -I@includedir@/smpeg2 `@SDL2_CONFIG@ --cflags`
|
||||
;;
|
||||
--libs)
|
||||
if [ "`uname`" = "SunOS" ]; then
|
||||
@@ -50,7 +50,7 @@ while test $# -gt 0; do
|
||||
else
|
||||
libdirs="-L@libdir@ @SMPEG_RLD_FLAGS@"
|
||||
fi
|
||||
- echo $libdirs -lsmpeg2 `@SDL_CONFIG@ --libs`
|
||||
+ echo $libdirs -lsmpeg2 `@SDL2_CONFIG@ --libs`
|
||||
;;
|
||||
*)
|
||||
echo "${usage}" 1>&2
|
|
@ -1,4 +1,4 @@
|
|||
{ stdenv, pkgs, buildPythonPackage, fetchFromGitHub
|
||||
{ stdenv, pkgs, buildPythonPackage, fetchFromGitHub, isPy27
|
||||
, cython, SDL2, SDL2_image, SDL2_ttf, SDL2_mixer, libjpeg, libpng }:
|
||||
|
||||
buildPythonPackage rec {
|
||||
|
@ -18,6 +18,9 @@ buildPythonPackage rec {
|
|||
cython libjpeg libpng
|
||||
];
|
||||
|
||||
|
||||
doCheck = isPy27; # python3 tests are non-functional
|
||||
|
||||
postInstall = ''
|
||||
( cd "$out"/include/python*/ ;
|
||||
ln -s pygame-sdl2 pygame_sdl2 || true ; )
|
||||
|
|
49
pkgs/games/rocksndiamonds/default.nix
Normal file
49
pkgs/games/rocksndiamonds/default.nix
Normal file
|
@ -0,0 +1,49 @@
|
|||
{ stdenv, fetchurl, makeDesktopItem, SDL2, SDL2_image, SDL2_mixer, SDL2_net }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "${project}-${version}";
|
||||
project = "rocksndiamonds";
|
||||
version = "4.0.0.2";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://www.artsoft.org/RELEASES/unix/${project}/${name}.tar.gz";
|
||||
sha256 = "0dzn6vlayvnkjm64zwva337rn07lc21kq93m2h8zz8j3wpl11pb4";
|
||||
};
|
||||
|
||||
desktopItem = makeDesktopItem {
|
||||
name = "rocksndiamonds";
|
||||
exec = "rocksndiamonds";
|
||||
icon = "rocksndiamonds";
|
||||
comment = meta.description;
|
||||
desktopName = "Rocks'n'Diamonds";
|
||||
genericName = "Tile-based puzzle";
|
||||
categories = "Game;LogicGame;";
|
||||
};
|
||||
|
||||
buildInputs = [ SDL2 SDL2_image SDL2_mixer SDL2_net ];
|
||||
|
||||
preBuild = ''
|
||||
dataDir="$out/share/rocksndiamonds"
|
||||
makeFlags+="RO_GAME_DIR=$dataDir"
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
appDir=$out/share/applications
|
||||
iconDir=$out/share/icons/hicolor/32x32/apps
|
||||
mkdir -p $out/bin $appDir $iconDir $dataDir
|
||||
cp rocksndiamonds $out/bin/
|
||||
ln -s ${desktopItem}/share/applications/* $appDir/
|
||||
ln -s $dataDir/graphics/gfx_classic/RocksIcon32x32.png $iconDir/rocksndiamonds.png
|
||||
cp -r docs graphics levels music sounds $dataDir
|
||||
'';
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
description = "Scrolling tile-based arcade style puzzle game";
|
||||
homepage = https://www.artsoft.org/rocksndiamonds/;
|
||||
license = licenses.gpl2;
|
||||
platforms = platforms.linux;
|
||||
maintainers = with maintainers; [ orivej ];
|
||||
};
|
||||
}
|
|
@ -10299,6 +10299,8 @@ with pkgs;
|
|||
|
||||
smpeg = callPackage ../development/libraries/smpeg { };
|
||||
|
||||
smpeg2 = callPackage ../development/libraries/smpeg2 { };
|
||||
|
||||
snack = callPackage ../development/libraries/snack {
|
||||
# optional
|
||||
};
|
||||
|
@ -17511,6 +17513,8 @@ with pkgs;
|
|||
|
||||
robotfindskitten = callPackage ../games/robotfindskitten { };
|
||||
|
||||
rocksndiamonds = callPackage ../games/rocksndiamonds { };
|
||||
|
||||
saga = callPackage ../applications/gis/saga { };
|
||||
|
||||
samplv1 = callPackage ../applications/audio/samplv1 { };
|
||||
|
|
Loading…
Reference in a new issue