about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/libagar/libagar_test.nix
blob: c54a7957f436a5560be9d672c2d1e196193b524e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
{ 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";
    homepage = "http://libagar.org/index.html";
    license = with licenses; bsd3;
    maintainers = with maintainers; [ ramkromberg ];
    platforms = with platforms; linux;
  };
}