3
0
Fork 0
forked from mirrors/nixpkgs

fix ttmkfdir compilation (freetype headers, .o files)

svn path=/nixpkgs/trunk/; revision=15341
This commit is contained in:
Marc Weber 2009-04-27 22:38:54 +00:00
parent 3ae548a124
commit 5703b08f47
4 changed files with 117 additions and 2 deletions

View file

@ -9,4 +9,82 @@ index 5f0d78a..b94cbe5 100644
+#include <cstring>
#include "directory.h"
diff --git a/Makefile b/Makefile
index e65b64c..52af5ed 100644
--- a/Makefile
+++ b/Makefile
@@ -41,8 +41,9 @@ all: ttmkfdir
.cpp.o:
libtool --mode=compile $(CXX) $(CXXFLAGS) -o $@ -c $^
+# ulgy hack for libtool to find .o files !!
ttmkfdir: ttmkfdir.o directory.o commandline.o ttf.o encoding.o parser.o builtin.o
- libtool --mode=link $(CXX) -o $@ $^ $(LDFLAGS)
+ libtool --mode=link $(CXX) -o $@ ./.libs/ttmkfdir.o ./.libs/directory.o ./.libs/commandline.o ./.libs/ttf.o ./.libs/encoding.o ./.libs/parser.o ./.libs/builtin.o $(LDFLAGS)
parser.cpp: encoding.l
flex -i -8 -o$@ $<
diff --git a/encoding.cpp b/encoding.cpp
index 9035d35..b4e9733 100644
--- a/encoding.cpp
+++ b/encoding.cpp
@@ -2,7 +2,9 @@
#include <cstdio>
#include <cstdlib>
#include <cstring>
-#include "freetype/freetype.h"
+#include <ft2build.h>
+#include FT_FREETYPE_H
+#include <freetype/ftsnames.h>
#include "ttmkfdir.h"
#include "encoding.h"
diff --git a/encoding.h b/encoding.h
index fc618bc..e01518f 100644
--- a/encoding.h
+++ b/encoding.h
@@ -6,7 +6,8 @@
#include <map>
#include <string>
-#include "freetype/freetype.h"
+#include <ft2build.h>
+#include FT_FREETYPE_H
#include "util.h"
diff --git a/ttf.cpp b/ttf.cpp
index 1dda774..97b37f3 100644
--- a/ttf.cpp
+++ b/ttf.cpp
@@ -239,7 +239,7 @@ Face::FontFamilyName (void) const
for (i = 0; i < n; i++) {
if ((fterror = FT_Get_Sfnt_Name (face, i, &NamePtr)) != FT_Err_Ok) {
std::cout << "Warning: Can't SFNT name : " << FileName << "(" << fterror << ")" << std::endl;
- return;
+ return 0;
};
platform = NamePtr.platform_id;
encoding = NamePtr.encoding_id;
diff --git a/ttf.h b/ttf.h
index 4261ef8..c4a0f1f 100644
--- a/ttf.h
+++ b/ttf.h
@@ -3,13 +3,14 @@
#define TTF_H__
#include <string>
+#include <ft2build.h>
+#include FT_FREETYPE_H
#include "freetype/freetype.h"
#include "freetype/tttables.h"
#include "freetype/ftsnames.h"
#include "freetype/ttnameid.h"
#include "freetype/fterrors.h"
-#include "freetype/ftmodule.h"
-
+#include "freetype/ftmodapi.h"
#include "util.h"
#include "encoding.h"

View file

@ -9,7 +9,9 @@ debBuild ({
url = http://ftp.de.debian.org/debian/pool/main/t/ttmkfdir/ttmkfdir_3.0.9-5.1.diff.gz;
sha256 = "1500kwvhxfq85zg7nwnn9dlvjxyg2ni7as17gdfm67pl9a45q3w4";
};
patches = [ ./cstring.patch ];
patches = [
/* also fixes some other compilation issues (freetype includes) */
./cstring.patch ];
name = "ttf-mkfontdir-3.0.9-5.1";
buildInputs = [fontconfig freetype libunwind libtool
flex bison];

View file

@ -0,0 +1,29 @@
args: with args;
stdenv.mkDerivation {
name = "ttf-mkfontdir-3.0.9-5.1";
src = fetchurl {
url = http://ftp.de.debian.org/debian/pool/main/t/ttmkfdir/ttmkfdir_3.0.9.orig.tar.gz;
sha256 = "0n6bmmndmp4c1myisvv7cby559gzgvwsw4rfw065a3f92m87jxiq";
};
# all the patches up from ttmkfdir-3.0.9/Makefile should be reviewed by someone
# who knows more about C/C++ ..
patches = [
(fetchurl {
url = http://ftp.de.debian.org/debian/pool/main/t/ttmkfdir/ttmkfdir_3.0.9-5.1.diff.gz;
sha256 = "1500kwvhxfq85zg7nwnn9dlvjxyg2ni7as17gdfm67pl9a45q3w4";
})
./cstring.patch /* also fixes some other compilation issues (freetype includes) */ ];
preInstall = ''
ensureDir $out; makeFlags="DESTDIR=$out BINDIR=/bin"
'';
buildInputs = [freetype fontconfig libunwind libtool flex bison];
meta = {
description = "Create fonts.dir for TTF font directory.";
};
}

View file

@ -1379,10 +1379,16 @@ let
wxGTK = wxGTK28;
};
ttmkfdir = import ../tools/misc/ttmkfdir {
/* don't have time to fix the builderDefs based expression
ttmkfdirX = import ../tools/misc/ttmkfdir {
inherit debPackage freetype fontconfig libunwind libtool bison;
flex = flex2534;
};
*/
ttmkfdir = import ../tools/misc/ttmkfdir/normal-builder.nix {
inherit stdenv fetchurl freetype fontconfig libunwind libtool bison;
flex = flex2534;
};
units = import ../tools/misc/units {
inherit fetchurl stdenv;