nixpkgs/pkgs/development/libraries/libagar/libagar_test.nix
Jan Malakhovski 591ccfe5b9 treewide: noop: refer to src.name or similar where appropriate, part 3: more use cases
This continues where d8f7f6a5ce left off. Similarly
to that commit, this commit this also points `sourceRoot`s to `src.name` and similar
instead of keeping hardcoded names, and edits other derivation attrs do do the same,
where appropriate.

Also, similarly to d8f7f6a5ce some of expressions this
edits use `srcs` attribute with customly-named sources, so they have to be moved
into `let` blocks to keep evaluation efficient (the other, worse, way to do this
would to recurcively refer to `elemAt n finalAttrs.srcs` or, similarly, with `rec`).
2023-08-11 09:20:44 +00:00

33 lines
1.1 KiB
Nix

{ 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;
};
}