lol

Adding two NES emulators. Because of them, I made allegro build the allegrogl library. I also added the HawkNL library.


svn path=/nixpkgs/trunk/; revision=26517

+188 -1
+1 -1
pkgs/development/libraries/allegro/default.nix
··· 1 1 x@{builderDefsPackage 2 2 , texinfo, libXext, xextproto, libX11, xproto, libXpm, libXt, libXcursor 3 3 , alsaLib, cmake, zlib, libpng, libvorbis, libXxf86dga, libXxf86misc 4 - , xf86dgaproto, xf86miscproto, xf86vidmodeproto, libXxf86vm, openal 4 + , xf86dgaproto, xf86miscproto, xf86vidmodeproto, libXxf86vm, openal, mesa 5 5 , ...}: 6 6 builderDefsPackage 7 7 (a :
+28
pkgs/development/libraries/hawknl/default.nix
··· 1 + {stdenv, fetchurl, unzip}: 2 + 3 + stdenv.mkDerivation { 4 + name = "hawknl-1.34"; 5 + src = fetchurl { 6 + url = http://hawksoft.com/download/files/HawkNL168src.zip; 7 + sha256 = "11shn2fbxj3w0j77w0234pqyj1368x686kkgv09q5yqhi1cdp028"; 8 + }; 9 + 10 + buildInputs = [ unzip ]; 11 + 12 + makefile = "makefile.linux"; 13 + 14 + patchPhase = '' 15 + sed -i s/soname,NL/soname,libNL/ src/makefile.linux 16 + ''; 17 + 18 + preInstall = '' 19 + sed -i s,/usr/local,$out, src/makefile.linux 20 + ensureDir $out/lib $out/include 21 + ''; 22 + 23 + meta = { 24 + homepage = http://hawksoft.com/hawknl/; 25 + description = "Free, open source, game oriented network API"; 26 + license = "LGPLv2+"; 27 + }; 28 + }
+28
pkgs/misc/emulators/darcnes/default.nix
··· 1 + {stdenv, fetchurl, libX11, libXt, libXext, libXaw }: 2 + 3 + assert stdenv.system == "i686-linux"; 4 + 5 + stdenv.mkDerivation { 6 + name = "darnes-9b0401"; 7 + src = fetchurl { 8 + url = http://www.dridus.com/~nyef/darcnes/download/dn9b0401.tgz; 9 + sha256 = "05a7mh51rg7ydb414m3p5mm05p4nz2bgvspqzwm3bhbj7zz543k3"; 10 + }; 11 + 12 + buildInputs = [ libX11 libXt libXext libXaw ]; 13 + 14 + installPhase = '' 15 + ensureDir $out/bin 16 + cp darcnes $out/bin 17 + ''; 18 + 19 + patches = [ ./label.patch ]; 20 + 21 + meta = { 22 + homepage = http://www.dridus.com/~nyef/darcnes/; 23 + description = "Multi-System emulator, specially for NES"; 24 + /* Prohibited commercial use, credit required. */ 25 + license = "free"; 26 + }; 27 + 28 + }
+13
pkgs/misc/emulators/darcnes/label.patch
··· 1 + http://gentoo-overlays.zugaina.org/funtoo/portage/games-emulation/darcnes/files/darcnes-0401-exec-stack.patch 2 + 3 + diff -Naur old/video_x.c new/video_x.c 4 + --- old/video_x.c 2004-09-04 01:26:41.102187277 +0200 5 + +++ new/video_x.c 2004-09-04 01:27:51.586427427 +0200 6 + @@ -366,6 +366,7 @@ 7 + } 8 + 9 + default: 10 + + break; 11 + } 12 + } 13 +
+84
pkgs/misc/emulators/fakenes/build.patch
··· 1 + diff --git a/build/openal.cbd b/build/openal.cbd 2 + index d18e62d..74af061 100644 3 + --- a/build/openal.cbd 4 + +++ b/build/openal.cbd 5 + @@ -23,7 +23,7 @@ CFLAGS += ' -DUSE_OPENAL' 6 + # -- 7 + 8 + do ifplat unix 9 + - LDFLAGS += ' `openal-config --libs`' 10 + + LDFLAGS += ' -lopenal' 11 + else 12 + LDFLAGS += ' -lOpenAL32' 13 + done 14 + diff --git a/build/alleggl.cbd b/build/alleggl.cbd 15 + index e2708ff..e826371 100644 16 + --- a/build/alleggl.cbd 17 + +++ b/build/alleggl.cbd 18 + @@ -22,7 +22,7 @@ CFLAGS += ' -DUSE_ALLEGROGL' 19 + 20 + # -- 21 + 22 + -LIBAGL = agl 23 + +LIBAGL = alleggl 24 + 25 + ifopt debug LIBAGL = 'agld' 26 + 27 + diff --git a/src/apu.cpp b/src/apu.cpp 28 + index af59f1c..893a798 100644 29 + --- a/src/apu.cpp 30 + +++ b/src/apu.cpp 31 + @@ -1930,7 +1930,7 @@ static void amplify(real& sample) 32 + gain -= releaseRate; 33 + } 34 + 35 + - real output = (1.0 / max(gain, EPSILON)); 36 + + real output = (1.0 / MAX(gain, EPSILON)); 37 + output = fixf(output, apu_agc_gain_floor, apu_agc_gain_ceiling); 38 + sample *= output; 39 + } 40 + diff --git a/src/audio.cpp b/src/audio.cpp 41 + index b9650dc..c21c05e 100644 42 + --- a/src/audio.cpp 43 + +++ b/src/audio.cpp 44 + @@ -7,6 +7,7 @@ 45 + You must read and accept the license prior to use. */ 46 + 47 + #include <allegro.h> 48 + +#include <cstdio> 49 + #include <cstdlib> 50 + #include <cstring> 51 + #include <vector> 52 + @@ -234,7 +235,7 @@ void audio_update(void) 53 + const unsigned queuedFrames = (audioQueue.size() / audio_channels); 54 + if(queuedFrames > 0) { 55 + // Determine how many frames we want to make room for. 56 + - const unsigned framesToAdd = min(queuedFrames, audio_buffer_size_frames); 57 + + const unsigned framesToAdd = MIN(queuedFrames, audio_buffer_size_frames); 58 + // Make room for the frames in the buffer. 59 + const unsigned framesToMove = (audioBufferedFrames - framesToAdd); 60 + if(framesToMove > 0) { 61 + @@ -258,7 +259,7 @@ void audio_update(void) 62 + // Determine how many frames are available in the buffer. 63 + const unsigned bufferableFrames = (audio_buffer_size_frames - audioBufferedFrames); 64 + // Determine the number of frames to copy to the buffer. 65 + - const unsigned framesToCopy = min(queuedFrames, bufferableFrames); 66 + + const unsigned framesToCopy = MIN(queuedFrames, bufferableFrames); 67 + 68 + // Copy frames to the buffer. 69 + for(unsigned frame = 0; frame < framesToCopy; frame++) { 70 + diff --git a/src/include/common.h b/src/include/common.h 71 + index be28795..e2d21d1 100644 72 + --- a/src/include/common.h 73 + +++ b/src/include/common.h 74 + @@ -41,8 +41,10 @@ extern "C" { 75 + #define true TRUE 76 + #define false FALSE 77 + 78 + +/* 79 + #define min(x,y) MIN((x),(y)) 80 + #define max(x,y) MAX((x),(y)) 81 + +*/ 82 + 83 + #define true_or_false(x) ((x) ? true : false) 84 +
+28
pkgs/misc/emulators/fakenes/default.nix
··· 1 + {stdenv, fetchurl, allegro, openal, mesa, zlib, hawknl, freeglut, libX11, 2 + libXxf86vm, libXcursor, libXpm }: 3 + 4 + stdenv.mkDerivation { 5 + name = "fakenes-0.5.9b3"; 6 + src = fetchurl { 7 + url = mirror://sourceforge/fakenes/fakenes-0.5.9-beta3.tar.gz; 8 + sha256 = "026h67s4pzc1vma59pmzk02iy379255qbai2q74wln9bxqcpniy4"; 9 + }; 10 + 11 + buildInputs = [ allegro openal mesa zlib hawknl freeglut libX11 12 + libXxf86vm libXcursor libXpm ]; 13 + 14 + installPhase = '' 15 + ensureDir $out/bin 16 + cp fakenes $out/bin 17 + ''; 18 + 19 + NIX_LDFLAGS = "-lX11 -lXxf86vm -lXcursor -lXpm"; 20 + 21 + patches = [ ./build.patch ]; 22 + 23 + meta = { 24 + homepage = http://fakenes.sourceforge.net/; 25 + license = "GPLv2+"; 26 + description = "Portable Open Source NES Emulator"; 27 + }; 28 + }
+6
pkgs/top-level/all-packages.nix
··· 3278 3278 # TODO : Add MIT Kerberos and let admin choose. 3279 3279 kerberos = heimdal; 3280 3280 3281 + hawknl = callPackage ../development/libraries/hawknl { }; 3282 + 3281 3283 heimdal = callPackage ../development/libraries/kerberos/heimdal.nix { }; 3282 3284 3283 3285 herqqSvn = callPackage ../development/libraries/herqq/svn.nix { }; ··· 7474 7476 7475 7477 cupsBjnp = callPackage ../misc/cups/drivers/cups-bjnp { }; 7476 7478 7479 + darcnes = callPackage ../misc/emulators/darcnes { }; 7480 + 7477 7481 dblatex = callPackage ../misc/tex/dblatex { }; 7478 7482 7479 7483 dosbox = callPackage ../misc/emulators/dosbox { }; ··· 7483 7487 ekiga = newScope (pkgs.gtkLibs // pkgs.gnome) ../applications/networking/ekiga { }; 7484 7488 7485 7489 electricsheep = callPackage ../misc/screensavers/electricsheep { }; 7490 + 7491 + fakenes = callPackage ../misc/emulators/fakenes { }; 7486 7492 7487 7493 foldingathome = callPackage ../misc/foldingathome { }; 7488 7494