1{ lib, stdenv, fetchurl, bsdbuild, libagar, perl, libjpeg, libpng, openssl }:
2
3let srcs = import ./srcs.nix { inherit fetchurl; }; in
4stdenv.mkDerivation {
5 pname = "libagar-test";
6 inherit (srcs) version src;
7
8 sourceRoot = "agar-1.5.0/tests";
9
10 # Workaround build failure on -fno-common toolchains:
11 # ld: textdlg.o:(.bss+0x0): multiple definition of `someString';
12 # configsettings.o:(.bss+0x0): first defined here
13 # TODO: the workaround can be removed once nixpkgs updates to 1.6.0.
14 env.NIX_CFLAGS_COMPILE = "-fcommon";
15
16 preConfigure = ''
17 substituteInPlace configure.in \
18 --replace '_BSD_SOURCE' '_DEFAULT_SOURCE'
19 cat configure.in | ${bsdbuild}/bin/mkconfigure > configure
20 '';
21
22 configureFlags = [ "--with-agar=${libagar}" ];
23
24 buildInputs = [ perl bsdbuild libagar libjpeg libpng openssl ];
25
26 meta = with lib; {
27 broken = (stdenv.isLinux && stdenv.isAarch64);
28 description = "Tests for libagar";
29 homepage = "http://libagar.org/index.html";
30 license = with licenses; bsd3;
31 maintainers = with maintainers; [ ramkromberg ];
32 platforms = with platforms; linux;
33 };
34}