1 { lib, stdenv, fetchurl, freetype, libtool, flex, bison, pkg-config }:
4 pname = "ttf-mkfontdir";
8 url = "http://mirror.fsf.org/trisquel/pool/main/t/ttmkfdir/ttmkfdir_3.0.9.orig.tar.gz";
9 sha256 = "0n6bmmndmp4c1myisvv7cby559gzgvwsw4rfw065a3f92m87jxiq";
12 # all the patches up from ttmkfdir-3.0.9/Makefile should be reviewed by someone
13 # who knows more about C/C++ ..
16 url = "http://mirror.fsf.org/trisquel/pool/main/t/ttmkfdir/ttmkfdir_3.0.9-6.diff.gz";
17 sha256 = "141kxaf2by8nf87hqyszaxi0n7nnmswr1nh2i5r5bsvxxmaj9633";
20 ./cstring.patch # also fixes some other compilation issues (freetype includes)
23 # cross-compilation fixes:
24 # - fix libtool, the reason it does not work in nativeBuildInputs is complicated
25 # see https://github.com/NixOS/nixpkgs/pull/192878 for more info
26 # - freetype-config doesn't properly support cross-compilation, but is just a thin
27 # wrapper around pkg-config anyways
29 substituteInPlace Makefile \
30 --replace "libtool " "${libtool}/bin/libtool --tag=CXX " \
31 --replace "freetype-config" "${stdenv.cc.targetPrefix}pkg-config freetype2"
34 makeFlags = [ "DESTDIR=${placeholder "out"}" "BINDIR=/bin" "CXX=${stdenv.cc.targetPrefix}c++" ];
36 nativeBuildInputs = [ flex bison pkg-config ];
37 buildInputs = [ freetype ];
40 description = "Create fonts.dir for TTF font directory";
41 platforms = lib.platforms.linux;
42 mainProgram = "ttmkfdir";