biome: 1.9.2 -> 1.9.3
[NixPkgs.git] / pkgs / tools / misc / ttmkfdir / default.nix
blob6edf9cc4ef986c472a211b336c4cdc6226a96cf7
1 { lib, stdenv, fetchurl, freetype, libtool, flex, bison, pkg-config }:
3 stdenv.mkDerivation {
4   pname = "ttf-mkfontdir";
5   version = "3.0.9-6";
7   src = fetchurl {
8     url = "http://mirror.fsf.org/trisquel/pool/main/t/ttmkfdir/ttmkfdir_3.0.9.orig.tar.gz";
9     sha256 = "0n6bmmndmp4c1myisvv7cby559gzgvwsw4rfw065a3f92m87jxiq";
10   };
12   # all the patches up from ttmkfdir-3.0.9/Makefile should be reviewed by someone
13   # who knows more about C/C++ ..
14   patches =
15     [ (fetchurl {
16         url = "http://mirror.fsf.org/trisquel/pool/main/t/ttmkfdir/ttmkfdir_3.0.9-6.diff.gz";
17         sha256 = "141kxaf2by8nf87hqyszaxi0n7nnmswr1nh2i5r5bsvxxmaj9633";
18       })
20       ./cstring.patch # also fixes some other compilation issues (freetype includes)
21     ];
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
28   postPatch = ''
29     substituteInPlace Makefile \
30       --replace "libtool " "${libtool}/bin/libtool --tag=CXX " \
31       --replace "freetype-config" "${stdenv.cc.targetPrefix}pkg-config freetype2"
32   '';
34   makeFlags = [ "DESTDIR=${placeholder "out"}" "BINDIR=/bin" "CXX=${stdenv.cc.targetPrefix}c++" ];
36   nativeBuildInputs = [ flex bison pkg-config ];
37   buildInputs = [ freetype ];
39   meta = {
40     description = "Create fonts.dir for TTF font directory";
41     platforms = lib.platforms.linux;
42     mainProgram = "ttmkfdir";
43   };