1 { lib, stdenv, fetchFromGitHub, SDL, autoconf, automake, libtool, gtk2, m4, pkg-config, libGLU, libGL, makeWrapper }:
3 stdenv.mkDerivation rec {
7 src = fetchFromGitHub {
10 rev = "release_${builtins.replaceStrings ["."] ["_"] version}";
11 sha256 = "sha256-nq/i7cFGpJXIuTwN/ScLMX7FN8NMdgdsRM9xOD3uycs=";
21 enableParallelBuilding = true;
23 nativeBuildInputs = [ autoconf automake libtool m4 pkg-config makeWrapper ];
25 buildInputs = [ SDL gtk2 libGLU libGL ];
27 outputs = [ "out" "dev" ];
30 touch NEWS AUTHORS ChangeLog
35 sed -i -e 's,"SDL.h",<SDL/SDL.h>,' \
36 -e 's,"SDL_mutex.h",<SDL/SDL_mutex.h>,' \
37 -e 's,"SDL_audio.h",<SDL/SDL_audio.h>,' \
38 -e 's,"SDL_thread.h",<SDL/SDL_thread.h>,' \
39 -e 's,"SDL_types.h",<SDL/SDL_types.h>,' \
40 $dev/include/smpeg/*.h
42 moveToOutput bin/smpeg-config "$dev"
44 wrapProgram $dev/bin/smpeg-config \
45 --prefix PATH ":" "${pkg-config}/bin" \
46 --prefix PKG_CONFIG_PATH ":" "${lib.getDev SDL}/lib/pkgconfig"
49 NIX_LDFLAGS = "-lX11";
52 homepage = "http://icculus.org/smpeg/";
53 description = "MPEG decoding library";
54 license = lib.licenses.gpl2Plus;
55 platforms = lib.platforms.unix;