1 { lib, stdenv, fetchFromGitHub, fetchurl, cmake, pkg-config, SDL, SDL_image, SDL_mixer, SDL_net, SDL_ttf, libpng, librsvg, libxml2 }:
3 stdenv.mkDerivation rec {
7 src = fetchFromGitHub {
10 rev = "upstream/${version}";
11 sha256 = "13q02xpmps9qg8zrzzy2gzv4a6afgi28lxk4z242j780v0gphchp";
15 # patch from debian to support libpng16 instead of libpng12
17 url = "https://salsa.debian.org/tux4kids-pkg-team/t4kcommon/raw/f7073fa384f5a725139f54844e59b57338b69dc7/debian/patches/libpng16.patch";
18 sha256 = "1lcpkdy5gvxgljg1vkrxych74amq0gramb1snj2831dam48is054";
22 # Workaround build failure on -fno-common toolchains like upstream
23 # gcc-10. Otherwise build fails as:
24 # ld: CMakeFiles/t4k_common.dir/t4k_throttle.c.o:(.bss+0x0): multiple definition of
25 # `wrapped_lines'; CMakeFiles/t4k_common.dir/t4k_audio.c.o:(.bss+0x0): first defined here
26 # TODO: revisit https://github.com/tux4kids/t4kcommon/pull/10 when merged.
27 NIX_CFLAGS_COMPILE = "-fcommon";
29 nativeBuildInputs = [ cmake pkg-config ];
30 buildInputs = [ SDL SDL_image SDL_mixer SDL_net SDL_ttf libpng librsvg libxml2 ];
33 description = "A library of code shared between tuxmath and tuxtype";
34 homepage = "https://github.com/tux4kids/t4kcommon";
35 license = licenses.gpl3Plus;
36 maintainers = [ maintainers.aanderse ];
37 platforms = platforms.linux;