about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/libagar
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/libagar')
-rw-r--r--nixpkgs/pkgs/development/libraries/libagar/default.nix47
-rw-r--r--nixpkgs/pkgs/development/libraries/libagar/libagar_test.nix34
2 files changed, 81 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/libagar/default.nix b/nixpkgs/pkgs/development/libraries/libagar/default.nix
new file mode 100644
index 000000000000..bff80ab996db
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libagar/default.nix
@@ -0,0 +1,47 @@
+{ lib, stdenv, fetchurl, pkg-config, libtool, perl, bsdbuild, gettext, mandoc
+, libpng, libjpeg, libXinerama, freetype, SDL, libGLU, libGL
+, libsndfile, portaudio, libmysqlclient, fontconfig
+}:
+
+stdenv.mkDerivation (finalAttrs: {
+  pname = "libagar";
+  version = "1.5.0";
+
+  src = fetchurl {
+    url = "http://stable.hypertriton.com/agar/agar-${finalAttrs.version}.tar.gz";
+    sha256 = "001wcqk5z67qg0raw9zlwmv62drxiwqykvsbk10q2mrc6knjsd42";
+  };
+
+  preConfigure = ''
+    substituteInPlace configure.in \
+      --replace '_BSD_SOURCE' '_DEFAULT_SOURCE'
+    cat configure.in | ${bsdbuild}/bin/mkconfigure > configure
+  '';
+
+  configureFlags = [
+    "--with-libtool=${libtool}/bin/libtool"
+    "--enable-nls=yes"
+    "--with-gettext=${gettext}"
+    "--with-jpeg=${libjpeg.dev}"
+    "--with-gl=${libGL}"
+    "--with-mysql=${libmysqlclient}"
+    "--with-manpages=yes"
+  ];
+
+  outputs = [ "out" "devdoc" ];
+
+  nativeBuildInputs = [ pkg-config libtool gettext ];
+
+  buildInputs = [
+    bsdbuild perl libXinerama SDL libGL libmysqlclient mandoc
+    freetype.dev libpng libjpeg.dev fontconfig portaudio libsndfile
+  ];
+
+  meta = with lib; {
+    description = "Cross-platform GUI toolkit";
+    homepage = "http://libagar.org/index.html";
+    license = with licenses; bsd3;
+    maintainers = with maintainers; [ ramkromberg ];
+    platforms = with platforms; linux;
+  };
+})
diff --git a/nixpkgs/pkgs/development/libraries/libagar/libagar_test.nix b/nixpkgs/pkgs/development/libraries/libagar/libagar_test.nix
new file mode 100644
index 000000000000..e365479f90a5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libagar/libagar_test.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv, fetchurl, bsdbuild, libagar, perl, libjpeg, libpng, openssl }:
+
+stdenv.mkDerivation {
+  pname = "libagar-test";
+  inherit (libagar) version src;
+
+  sourceRoot = "agar-${libagar.version}/tests";
+
+  # Workaround build failure on -fno-common toolchains:
+  #   ld: textdlg.o:(.bss+0x0): multiple definition of `someString';
+  #     configsettings.o:(.bss+0x0): first defined here
+  # TODO: the workaround can be removed once nixpkgs updates to 1.6.0.
+  env.NIX_CFLAGS_COMPILE = "-fcommon";
+
+  preConfigure = ''
+    substituteInPlace configure.in \
+      --replace '_BSD_SOURCE' '_DEFAULT_SOURCE'
+    cat configure.in | ${bsdbuild}/bin/mkconfigure > configure
+  '';
+
+  configureFlags = [ "--with-agar=${libagar}" ];
+
+  buildInputs = [ perl bsdbuild libagar libjpeg libpng openssl ];
+
+  meta = with lib; {
+    broken = (stdenv.isLinux && stdenv.isAarch64);
+    description = "Tests for libagar";
+    mainProgram = "agartest";
+    homepage = "http://libagar.org/index.html";
+    license = with licenses; bsd3;
+    maintainers = with maintainers; [ ramkromberg ];
+    platforms = with platforms; linux;
+  };
+}