summary refs log tree commit diff
path: root/pkgs/tools/misc/ttmkfdir
diff options
context:
space:
mode:
authorMarc Weber <marco-oweber@gmx.de>2009-04-27 22:38:54 +0000
committerMarc Weber <marco-oweber@gmx.de>2009-04-27 22:38:54 +0000
commit5703b08f47197b2885932696386c7690425f5404 (patch)
tree9a9e7eec00db0b4fd4171e2e8946c94c4878db82 /pkgs/tools/misc/ttmkfdir
parent3ae548a124ec7d67c1c7be3650626dded663df91 (diff)
downloadnixpkgs-5703b08f47197b2885932696386c7690425f5404.tar
nixpkgs-5703b08f47197b2885932696386c7690425f5404.tar.gz
nixpkgs-5703b08f47197b2885932696386c7690425f5404.tar.bz2
nixpkgs-5703b08f47197b2885932696386c7690425f5404.tar.lz
nixpkgs-5703b08f47197b2885932696386c7690425f5404.tar.xz
nixpkgs-5703b08f47197b2885932696386c7690425f5404.tar.zst
nixpkgs-5703b08f47197b2885932696386c7690425f5404.zip
fix ttmkfdir compilation (freetype headers, .o files)
svn path=/nixpkgs/trunk/; revision=15341
Diffstat (limited to 'pkgs/tools/misc/ttmkfdir')
-rw-r--r--pkgs/tools/misc/ttmkfdir/cstring.patch78
-rw-r--r--pkgs/tools/misc/ttmkfdir/default.nix4
-rw-r--r--pkgs/tools/misc/ttmkfdir/normal-builder.nix29
3 files changed, 110 insertions, 1 deletions
diff --git a/pkgs/tools/misc/ttmkfdir/cstring.patch b/pkgs/tools/misc/ttmkfdir/cstring.patch
index 84f2621eaaa..6b65b44e851 100644
--- a/pkgs/tools/misc/ttmkfdir/cstring.patch
+++ b/pkgs/tools/misc/ttmkfdir/cstring.patch
@@ -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"
  
diff --git a/pkgs/tools/misc/ttmkfdir/default.nix b/pkgs/tools/misc/ttmkfdir/default.nix
index 6f90ca8eb0d..52b344e69bf 100644
--- a/pkgs/tools/misc/ttmkfdir/default.nix
+++ b/pkgs/tools/misc/ttmkfdir/default.nix
@@ -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];
diff --git a/pkgs/tools/misc/ttmkfdir/normal-builder.nix b/pkgs/tools/misc/ttmkfdir/normal-builder.nix
new file mode 100644
index 00000000000..122ea47e33b
--- /dev/null
+++ b/pkgs/tools/misc/ttmkfdir/normal-builder.nix
@@ -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.";
+  };
+}