allegro5unstable: use stdenv

This replaces use of `builderDefsPackage`. Also change to download
tarball from GNA as it is the new upstream home. Minor other fixes.
This commit is contained in:
Robert Helgesson 2015-12-29 23:34:36 +01:00
parent f37279aebc
commit 9a47354a96
2 changed files with 27 additions and 59 deletions

View File

@ -1,61 +1,36 @@
{ stdenv, fetchurl, texinfo, libXext, xextproto, libX11, xproto
, libXpm, libXt, libXcursor, alsaLib, cmake, zlib, libpng, libvorbis
, libXxf86dga, libXxf86misc, xf86dgaproto, xf86miscproto
, xf86vidmodeproto, libXxf86vm, openal, mesa, kbproto, libjpeg, flac
, inputproto, libXi, fixesproto, libXfixes }:
x@{builderDefsPackage stdenv.mkDerivation rec {
, texinfo, libXext, xextproto, libX11, xproto, libXpm, libXt, libXcursor name = "allegro-${version}";
, alsaLib, cmake, zlib, libpng, libvorbis, libXxf86dga, libXxf86misc version = "5.1.11";
, xf86dgaproto, xf86miscproto, xf86vidmodeproto, libXxf86vm, openal, mesa
, kbproto, libjpeg, flac, inputproto, libXi, fixesproto, libXfixes
, ...}:
builderDefsPackage
(a :
let
helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++
[];
buildInputs = map (n: builtins.getAttr n x) src = fetchurl {
(builtins.attrNames (builtins.removeAttrs x helperArgNames)); url = "http://download.gna.org/allegro/allegro-unstable/${version}/${name}.tar.gz";
sourceInfo = rec {
baseName="allegro";
folderSuffix = "-unstable";
version = "5.1.11";
name="${baseName}-${version}";
project="alleg";
url="mirror://sourceforge/project/${project}/${baseName}${folderSuffix}/${version}/${name}.tar.gz";
hash="18fdppaqaf3g3rcqwhyvsmkzk3y14clz4l8cvmg4hvjgyf011f3i";
};
in
rec {
src = a.fetchurl {
url = sourceInfo.url;
sha256 = "0zz07gdyc6xflpvkknwgzsyyyh9qiwd69j42rm9cw1ciwcsic1vs"; sha256 = "0zz07gdyc6xflpvkknwgzsyyyh9qiwd69j42rm9cw1ciwcsic1vs";
}; };
inherit (sourceInfo) name version; buildInputs = [
inherit buildInputs; texinfo libXext xextproto libX11 xproto libXpm libXt libXcursor
alsaLib cmake zlib libpng libvorbis libXxf86dga libXxf86misc
/* doConfigure should be removed if not needed */ xf86dgaproto xf86miscproto xf86vidmodeproto libXxf86vm openal mesa
phaseNames = ["patchIncludes" "doCmake" "doMakeInstall"]; kbproto libjpeg flac inputproto libXi fixesproto libXfixes
patchIncludes = a.fullDepEntry ''
sed -e 's@/XInput2.h@/XI2.h@g' -i CMakeLists.txt src/*.c
'' ["minInit" "doUnpack"];
doCmake = a.fullDepEntry (''
export NIX_LDFLAGS="$NIX_LDFLAGS -lXext -lX11 -lXpm -lXcursor -lXxf86vm -lXi -lXfixes"
cmake -D CMAKE_INSTALL_PREFIX=$out -D CMAKE_SKIP_RPATH=ON .
'') ["minInit" "doUnpack" "addInputs"];
makeFlags = [
]; ];
meta = { patchPhase = ''
sed -e 's@/XInput2.h@/XI2.h@g' -i CMakeLists.txt "src/"*.c
'';
cmakeFlags = [ "-DCMAKE_SKIP_RPATH=ON" ];
meta = with stdenv.lib; {
description = "A game programming library"; description = "A game programming library";
license = a.lib.licenses.free; # giftware homepage = http://liballeg.org/;
maintainers = with a.lib.maintainers; license = licenses.zlib;
[ maintainers = [ maintainers.raskin ];
raskin platforms = platforms.linux;
];
platforms = with a.lib.platforms;
linux;
inherit version;
}; };
}) x }

View File

@ -1,7 +0,0 @@
attribute_name allegro5
url http://alleg.sourceforge.net/download.html
version_link '/allegro-unstable/.*[.]tar[.].*/download$'
SF_redirect
do_overwrite () {
do_overwrite_just_version
}