@@ -0,0 +1,42 @@
1+{ stdenv, fetchurl, pkgconfig, libtool, perl, bsdbuild, gettext, mandoc
2+, libpng, libjpeg, xlibsWrapper, libXinerama, freetype, SDL, mesa
3+, libsndfile, portaudio, mysql, fontconfig
4+}:
5+
6+let srcs = import ./srcs.nix { inherit fetchurl; }; in
7+stdenv.mkDerivation rec {
8+ name = "libagar-${version}";
9+ inherit (srcs) version src;
10+
11+ preConfigure = ''
12+ substituteInPlace configure.in \
13+ --replace '_BSD_SOURCE' '_DEFAULT_SOURCE'
14+ cat configure.in | ${bsdbuild}/bin/mkconfigure > configure
15+ '';
16+
17+ configureFlags = [
18+ "--with-libtool=${libtool}/bin/libtool"
19+ "--enable-nls=yes"
20+ "--with-gettext=${gettext}"
21+ "--with-jpeg=${libjpeg.dev}"
22+ "--with-gl=${mesa}"
23+ "--with-mysql=yes"
24+ "--with-manpages=yes"
25+ ];
26+
27+ outputs = [ "out" "devdoc" ];
28+
29+ nativeBuildInputs = [ pkgconfig libtool gettext ];
30+ buildInputs = [
31+ bsdbuild perl xlibsWrapper libXinerama SDL mesa mysql.client mandoc
32+ freetype.dev libpng libjpeg.dev fontconfig portaudio libsndfile
33+ ];
34+
35+ meta = with stdenv.lib; {
36+ description = "Cross-platform GUI toolkit";
37+ homepage = http://libagar.org/index.html;
38+ license = with licenses; bsd3;
39+ maintainers = with maintainers; [ ramkromberg ];
40+ platforms = with platforms; linux;
41+ };
42+}