diff options
author | Ronny Schmatzler <schmatzler@hirnschwund.net> | 2015-03-12 22:42:30 +0700 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2015-03-12 22:42:30 +0700 |
commit | 2dd53fd37b7826fe1ff63924206bbb09209ed343 (patch) | |
tree | 27345f7cf7991050b97c3eaa13a8061fa975c3f9 /system | |
parent | 6d204a3c370236ba083168d7f3e0b9c60c1283fc (diff) |
system/ttmkfdir: Added (fonts.dir creator).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system')
-rw-r--r-- | system/ttmkfdir/README | 8 | ||||
-rw-r--r-- | system/ttmkfdir/patches/ttmkfdir-3.0.9-bug434301.patch | 11 | ||||
-rw-r--r-- | system/ttmkfdir/patches/ttmkfdir-3.0.9-cpp.patch | 11 | ||||
-rw-r--r-- | system/ttmkfdir/patches/ttmkfdir-3.0.9-encoding-dir.patch | 20 | ||||
-rw-r--r-- | system/ttmkfdir/patches/ttmkfdir-3.0.9-fix-crash.patch | 79 | ||||
-rw-r--r-- | system/ttmkfdir/patches/ttmkfdir-3.0.9-fix-freetype217.patch | 44 | ||||
-rw-r--r-- | system/ttmkfdir/patches/ttmkfdir-3.0.9-font-scale.patch | 107 | ||||
-rw-r--r-- | system/ttmkfdir/patches/ttmkfdir-3.0.9-namespace.patch | 56 | ||||
-rw-r--r-- | system/ttmkfdir/patches/ttmkfdir-3.0.9-segfaults.patch | 20 | ||||
-rw-r--r-- | system/ttmkfdir/patches/ttmkfdir-3.0.9-warnings.patch | 75 | ||||
-rw-r--r-- | system/ttmkfdir/patches/ttmkfdir-3.0.9-zlib.patch | 80 | ||||
-rw-r--r-- | system/ttmkfdir/slack-desc | 19 | ||||
-rw-r--r-- | system/ttmkfdir/ttmkfdir.SlackBuild | 92 | ||||
-rw-r--r-- | system/ttmkfdir/ttmkfdir.info | 10 |
14 files changed, 632 insertions, 0 deletions
diff --git a/system/ttmkfdir/README b/system/ttmkfdir/README new file mode 100644 index 000000000000..dc602841b667 --- /dev/null +++ b/system/ttmkfdir/README @@ -0,0 +1,8 @@ +This program creates 'font.dir' files for TrueType fonts. These files +are required if you want to use TrueType fonts with X. + +There is no website, since the tool has been abandoned. +RedHat still seems to be making patches from time to time. + +It has been superseded by mkfontscale and mkfontdir, +but Cinelerra only works with this one. diff --git a/system/ttmkfdir/patches/ttmkfdir-3.0.9-bug434301.patch b/system/ttmkfdir/patches/ttmkfdir-3.0.9-bug434301.patch new file mode 100644 index 000000000000..0a77dbbbc51a --- /dev/null +++ b/system/ttmkfdir/patches/ttmkfdir-3.0.9-bug434301.patch @@ -0,0 +1,11 @@ +--- ttmkfdir-3.0.9/directory.cpp.bak 2008-02-27 10:18:52.000000000 +0800 ++++ ttmkfdir-3.0.9/directory.cpp 2008-02-27 10:20:24.000000000 +0800 +@@ -3,6 +3,8 @@ + #include <stdio.h> + #include <sys/stat.h> + #include <unistd.h> ++#include <string.h> ++#include <stdlib.h> + + #include "directory.h" + diff --git a/system/ttmkfdir/patches/ttmkfdir-3.0.9-cpp.patch b/system/ttmkfdir/patches/ttmkfdir-3.0.9-cpp.patch new file mode 100644 index 000000000000..58839eda9673 --- /dev/null +++ b/system/ttmkfdir/patches/ttmkfdir-3.0.9-cpp.patch @@ -0,0 +1,11 @@ +--- ttmkfdir-3.0.9/ttf.cpp.sopwith Thu Aug 7 12:49:08 2003 ++++ ttmkfdir-3.0.9/ttf.cpp Thu Aug 7 12:50:01 2003 +@@ -239,7 +239,7 @@ + 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 NULL; + }; + platform = NamePtr.platform_id; + encoding = NamePtr.encoding_id; diff --git a/system/ttmkfdir/patches/ttmkfdir-3.0.9-encoding-dir.patch b/system/ttmkfdir/patches/ttmkfdir-3.0.9-encoding-dir.patch new file mode 100644 index 000000000000..b07329620a4b --- /dev/null +++ b/system/ttmkfdir/patches/ttmkfdir-3.0.9-encoding-dir.patch @@ -0,0 +1,20 @@ +--- ttmkfdir-3.0.9/ttmkfdir.cpp.Origin 2006-06-15 17:58:43.000000000 +0800 ++++ ttmkfdir-3.0.9/ttmkfdir.cpp 2006-06-15 17:59:07.000000000 +0800 +@@ -16,7 +16,7 @@ + + cerr << "This Program is (C) Joerg Pommnitz, 2000" << endl; + cerr << "Usage: " << program << " [OPTION]" << endl; +- cerr << "-e, --encoding\t\tname of the encoding directory file, default is \"/usr/X11R6/lib/X11/fonts/encodings/encodings.dir\"" << endl; ++ cerr << "-e, --encoding\t\tname of the encoding directory file, default is \"/usr/share/X11/fonts/encodings/encodings.dir\"" << endl; + cerr << "-o, --output\t\tname of the destination file, default is \"fonts.scale\"" << endl; + cerr << "-d, --font-dir\t\tname of the TrueType font directory, default is \".\"" << endl; + cerr << "-f, --default-foundry\tname of the default font foundry, default is \"misc\"" << endl; +@@ -32,7 +32,7 @@ + void + ParseCommandline (int argc, char *argv[]) + { +- cmdline::instance()->AddOption (new Commandline::Option ("encoding", 'e', "/usr/X11R6/lib/X11/fonts/encodings/encodings.dir")); ++ cmdline::instance()->AddOption (new Commandline::Option ("encoding", 'e', "/usr/share/X11/fonts/encodings/encodings.dir")); + cmdline::instance()->AddOption (new Commandline::Option ("output", 'o', "fonts.scale")); + cmdline::instance()->AddOption (new Commandline::Option ("font-dir", 'd', ".")); + cmdline::instance()->AddOption (new Commandline::Option ("default-foundry", 'f', "misc")); diff --git a/system/ttmkfdir/patches/ttmkfdir-3.0.9-fix-crash.patch b/system/ttmkfdir/patches/ttmkfdir-3.0.9-fix-crash.patch new file mode 100644 index 000000000000..4a17ccfdc74b --- /dev/null +++ b/system/ttmkfdir/patches/ttmkfdir-3.0.9-fix-crash.patch @@ -0,0 +1,79 @@ +--- ttmkfdir-3.0.9.orig/encoding.l 2003-01-08 14:25:25.000000000 +0900 ++++ ttmkfdir-3.0.9/encoding.l 2005-08-03 19:24:22.000000000 +0900 +@@ -21,6 +21,19 @@ + + static Encoding *cur_enc; + static NumericMapping *cur_map; ++static int is_created_map = 0; ++ ++static void ++create_mapping(void) ++{ ++ cur_map = new NumericMapping (cur_enc->size, ++ TT_PLATFORM_MICROSOFT, ++ TT_MS_ID_UNICODE_CS); ++ ++ cur_enc->enc_size = 0; ++ cur_enc->start_code = 0xffff; ++ is_created_map = 1; ++} + + %} + +@@ -67,12 +80,6 @@ + } + + <INSIDE_ENC_BLOCK>STARTMAPPING{WHITESPACES}unicode { +- cur_map = new NumericMapping (cur_enc->size, +- TT_PLATFORM_MICROSOFT, +- TT_MS_ID_UNICODE_CS); +- +- cur_enc->enc_size = 0; +- cur_enc->start_code = 0xffff; + BEGIN(INSIDE_MAP_BLOCK); + } + +@@ -107,6 +114,12 @@ + i2 = i1; + } + ++ /* avoid a crash issue */ ++ if (cur_enc->size < i2) ++ cur_enc->size = i2; ++ if (!is_created_map) ++ create_mapping(); ++ + /* now mark all the unassigned codes */ + for (long i = i1; i <= i2; i++) { + (*cur_map)[i] = -1; +@@ -114,10 +127,14 @@ + } + + <INSIDE_MAP_BLOCK>{NUMBER}({WHITESPACES}{NUMBER}){0,2} { +- int numbers[3], i = 0, start_range, end_range, target, res; ++ unsigned int start_range; ++ int numbers[3], i = 0, end_range, target, res; + char *startptr; + char *endptr = yytext; + ++ if (!is_created_map) ++ create_mapping(); ++ + for (i = 0;;i++) { + startptr = endptr; + res = std::strtol (startptr, &endptr, 0); +@@ -150,9 +167,14 @@ + + + <INSIDE_MAP_BLOCK>ENDMAPPING { ++ /* it may not happens but to be safe */ ++ if (!is_created_map) ++ create_mapping(); ++ + cur_enc->AddMapping (cur_map); + dest.insert (std::make_pair(cur_map->cmapkey(), cur_enc));; + BEGIN(INSIDE_ENC_BLOCK); ++ is_created_map = 0; + } + + <INSIDE_UNKNOWN_MAP>ENDMAPPING { diff --git a/system/ttmkfdir/patches/ttmkfdir-3.0.9-fix-freetype217.patch b/system/ttmkfdir/patches/ttmkfdir-3.0.9-fix-freetype217.patch new file mode 100644 index 000000000000..a5ded9fbe492 --- /dev/null +++ b/system/ttmkfdir/patches/ttmkfdir-3.0.9-fix-freetype217.patch @@ -0,0 +1,44 @@ +--- ttmkfdir-3.0.9/encoding.cpp.orig 2002-12-09 17:52:48.000000000 +0900 ++++ ttmkfdir-3.0.9/encoding.cpp 2004-01-31 18:16:46.617118976 +0900 +@@ -4,7 +4,6 @@ + #include <cstring> + #include <unistd.h> + #include <zlib.h> +-#include "freetype/freetype.h" + + #include "ttmkfdir.h" + #include "encoding.h" +--- ttmkfdir-3.0.9/encoding.h.orig 2002-12-09 17:52:48.000000000 +0900 ++++ ttmkfdir-3.0.9/encoding.h 2004-01-31 18:19:18.600014064 +0900 +@@ -6,7 +6,8 @@ + #include <map> + #include <string> + +-#include "freetype/freetype.h" ++#include <ft2build.h> ++#include FT_FREETYPE_H + + #include "util.h" + +--- ttmkfdir-3.0.9/ttf.h.orig 2003-01-08 14:25:25.000000000 +0900 ++++ ttmkfdir-3.0.9/ttf.h 2004-01-31 18:32:53.333155800 +0900 +@@ -3,12 +3,13 @@ + #define TTF_H__ + + #include <string> +-#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 <ft2build.h> ++#include FT_FREETYPE_H ++#include FT_SFNT_NAMES_H ++#include FT_TRUETYPE_TABLES_H ++#include FT_TRUETYPE_IDS_H ++#include FT_ERRORS_H ++#include FT_MODULE_H + + #include "util.h" + #include "encoding.h" diff --git a/system/ttmkfdir/patches/ttmkfdir-3.0.9-font-scale.patch b/system/ttmkfdir/patches/ttmkfdir-3.0.9-font-scale.patch new file mode 100644 index 000000000000..e44e5dcbd3e1 --- /dev/null +++ b/system/ttmkfdir/patches/ttmkfdir-3.0.9-font-scale.patch @@ -0,0 +1,107 @@ +diff -ruN -x '*o' -x '*~' -x ttmkfdir -x parser.cpp ttmkfdir-3.0.9.orig/ttf.cpp ttmkfdir-3.0.9/ttf.cpp +--- ttmkfdir-3.0.9.orig/ttf.cpp 2006-11-29 15:46:55.000000000 +0900 ++++ ttmkfdir-3.0.9/ttf.cpp 2006-11-29 17:21:40.000000000 +0900 +@@ -70,7 +70,6 @@ + Face::Face (const std::string &filename) + { + FT_Error fterror; +- string header_enc("-"); + int face_id, face_count; + + string::size_type pos = filename.rfind("/"); +@@ -98,29 +97,13 @@ + if ((post = (TT_Postscript *) FT_Get_Sfnt_Table(face, ft_sfnt_post)) == 0){ + std::cout << "Warning: Can't get POST table : " << FileName << "(" << FT_Err_Post_Table_Missing << ")" << std::endl; + return; +- } ++ } + + if ((os2 = (TT_OS2 *) FT_Get_Sfnt_Table(face, ft_sfnt_os2)) == 0) { + std::cout << "Warning: Can't get OS2 table : " << FileName << "(" << FT_Err_Table_Missing << ")" << std::endl; + return; + } + +- for (int j = 0; j < 32; j++) { +- switch (os2->ulCodePageRange1 & (1 << j)) { +- case TT_CODEPAGE_RANGE_932: /* Japanese */ +- header_enc = "ji"; +- break; +- case TT_CODEPAGE_RANGE_936: /* Simplified Chinese */ +- header_enc = "gb"; +- break; +- case TT_CODEPAGE_RANGE_949: /* Korean Wansung */ +- header_enc = "ks"; +- break; +- case TT_CODEPAGE_RANGE_950: /* Traditional Chinese */ +- header_enc = "big"; +- break; +- } +- } + /* + * Iterate over all cmap entries. + */ +@@ -148,25 +131,50 @@ + */ + typedef Encodings_t::const_iterator MI; + std::pair<MI, MI> bounds = Encodings::instance()->equal_range (key); ++ bool need_non_cjk_encoding = true; + + /* + * then look whether each of these encodings is present in this cmap. + */ +- for (Encodings_t::const_iterator i = bounds.first; i != bounds.second; i++) { +- if (MappingPresent (cmapidx, +- i->second->mappings[key], +- i->second->enc_size, +- i->second->start_code, +- (header_enc.compare("-")?((i->second->names[0].find(header_enc) != string::npos)?1:0):1) +- )) { +- /* +- * if the mapping is present, add all xlfd names for this mapping to the +- * list of available font names. +- */ +- for (unsigned int k = 0; k < i->second->names.size (); k++) { +- add_entries (i->second->names[k],face_id); ++ for (int j = 0; j < 32; j++) { ++ string header_enc("-"); ++ ++ switch (os2->ulCodePageRange1 & (1 << j)) { ++ case TT_CODEPAGE_RANGE_932: /* Japanese */ ++ header_enc = "ji"; ++ break; ++ case TT_CODEPAGE_RANGE_936: /* Simplified Chinese */ ++ header_enc = "gb"; ++ break; ++ case TT_CODEPAGE_RANGE_949: /* Korean Wansung */ ++ header_enc = "ks"; ++ break; ++ case TT_CODEPAGE_RANGE_950: /* Traditional Chinese */ ++ header_enc = "big"; ++ break; ++ default: ++ if (need_non_cjk_encoding) ++ need_non_cjk_encoding = false; ++ else ++ continue; ++ break; ++ } ++ for (Encodings_t::const_iterator i = bounds.first; i != bounds.second; i++) { ++ if (MappingPresent (cmapidx, ++ i->second->mappings[key], ++ i->second->enc_size, ++ i->second->start_code, ++ (header_enc.compare("-")?((i->second->names[0].find(header_enc) != string::npos)?1:0):1) ++ )) { ++ /* ++ * if the mapping is present, add all xlfd names for this mapping to the ++ * list of available font names. ++ */ ++ for (unsigned int k = 0; k < i->second->names.size (); k++) { ++ add_entries (i->second->names[k],face_id); ++ } + } +- } ++ } + } + } + diff --git a/system/ttmkfdir/patches/ttmkfdir-3.0.9-namespace.patch b/system/ttmkfdir/patches/ttmkfdir-3.0.9-namespace.patch new file mode 100644 index 000000000000..34220c20e88b --- /dev/null +++ b/system/ttmkfdir/patches/ttmkfdir-3.0.9-namespace.patch @@ -0,0 +1,56 @@ +*** ttmkfdir-3.0.9/ttf.h.ORIG 2004-03-10 13:40:47.149814008 -0700 +--- ttmkfdir-3.0.9/ttf.h 2004-03-10 13:40:50.571293864 -0700 +*************** namespace ttf { +*** 50,56 **** + TT_Postscript *post; + std::string FileName; + }; +! }; + + #endif /* TTF_H__ */ + +--- 50,56 ---- + TT_Postscript *post; + std::string FileName; + }; +! } + + #endif /* TTF_H__ */ + +*** ttmkfdir-3.0.9/util.h.ORIG 2004-03-10 13:40:19.872960720 -0700 +--- ttmkfdir-3.0.9/util.h 2004-03-10 13:40:34.059803992 -0700 +*************** namespace util { +*** 17,22 **** + Singleton (void) {}; + ~Singleton (void) {}; + }; +! }; + + #endif // TTMKFDIRUTIL_H__ +--- 17,22 ---- + Singleton (void) {}; + ~Singleton (void) {}; + }; +! } + + #endif // TTMKFDIRUTIL_H__ +*** ttmkfdir-3.0.9/builtin.cpp.ORIG 2004-03-10 13:41:47.089701760 -0700 +--- ttmkfdir-3.0.9/builtin.cpp 2004-03-10 13:41:51.327057584 -0700 +*************** namespace { +*** 600,606 **** + 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x00ff + }; + +! }; + + Encoding::BuiltinEncoding_t Encoding::builtin_encodings[] = { + {256,191,32,{TT_PLATFORM_MICROSOFT,TT_MS_ID_UNICODE_CS,iso8859_1},{"iso8859-1",}}, +--- 600,606 ---- + 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x00ff + }; + +! } + + Encoding::BuiltinEncoding_t Encoding::builtin_encodings[] = { + {256,191,32,{TT_PLATFORM_MICROSOFT,TT_MS_ID_UNICODE_CS,iso8859_1},{"iso8859-1",}}, + diff --git a/system/ttmkfdir/patches/ttmkfdir-3.0.9-segfaults.patch b/system/ttmkfdir/patches/ttmkfdir-3.0.9-segfaults.patch new file mode 100644 index 000000000000..17a8dec55060 --- /dev/null +++ b/system/ttmkfdir/patches/ttmkfdir-3.0.9-segfaults.patch @@ -0,0 +1,20 @@ +--- ttmkfdir-3.0.9/directory.cpp.back 2005-10-08 14:25:37.839328408 +0800 ++++ ttmkfdir-3.0.9/directory.cpp 2005-10-08 14:26:00.021956136 +0800 +@@ -1,5 +1,6 @@ + #include <cctype> + #include <dirent.h> ++#include <stdio.h> + #include <sys/stat.h> + #include <unistd.h> + +@@ -13,6 +14,10 @@ + directory::scan (const std::string &dir) + { + DIR *ttfdir = opendir(dir.c_str ()); ++ if (!ttfdir) { ++ printf("%s is not exist!\n", dir.c_str ()); ++ exit(-1); ++ } + + this->clear (); + dirpath = dir; diff --git a/system/ttmkfdir/patches/ttmkfdir-3.0.9-warnings.patch b/system/ttmkfdir/patches/ttmkfdir-3.0.9-warnings.patch new file mode 100644 index 000000000000..26334bb432e8 --- /dev/null +++ b/system/ttmkfdir/patches/ttmkfdir-3.0.9-warnings.patch @@ -0,0 +1,75 @@ +--- ttmkfdir-3.0.9/encoding.l~ 2005-08-03 19:33:07.000000000 +0900 ++++ ttmkfdir-3.0.9/encoding.l 2005-08-03 21:52:15.000000000 +0900 +@@ -115,7 +115,7 @@ + } + + /* avoid a crash issue */ +- if (cur_enc->size < i2) ++ if ((int) (cur_enc->size) < i2) + cur_enc->size = i2; + if (!is_created_map) + create_mapping(); +@@ -127,8 +127,8 @@ + } + + <INSIDE_MAP_BLOCK>{NUMBER}({WHITESPACES}{NUMBER}){0,2} { +- unsigned int start_range; +- int numbers[3], i = 0, end_range, target, res; ++ unsigned int start_range = 0, i = 0, end_range = 0; ++ int numbers[3], target = 0, res; + char *startptr; + char *endptr = yytext; + +--- ttmkfdir-3.0.9/commandline.cpp~ 2002-12-09 17:29:11.000000000 +0900 ++++ ttmkfdir-3.0.9/commandline.cpp 2005-08-03 21:12:40.000000000 +0900 +@@ -1,6 +1,8 @@ + #include <cstdlib> + ++#ifndef _GNU_SOURCE + #define _GNU_SOURCE ++#endif + #include <getopt.h> + + #include "commandline.h" +--- ttmkfdir-3.0.9/ttmkfdir.cpp~ 2003-01-20 08:33:11.000000000 +0900 ++++ ttmkfdir-3.0.9/ttmkfdir.cpp 2005-08-03 21:08:43.000000000 +0900 +@@ -76,7 +76,7 @@ + return 1; + } + +- fprintf (output, "%d\n", fontdir.size ()); ++ fprintf (output, "%d\n", (int)(fontdir.size ())); + + for (vector<string>::const_iterator i = fontdir.begin (); i != fontdir.end (); i++) { + fprintf (output, "%s\n", i->c_str ()); +--- ttmkfdir-3.0.9/ttf.cpp~ 2005-08-03 19:33:07.000000000 +0900 ++++ ttmkfdir-3.0.9/ttf.cpp 2005-08-03 21:31:48.000000000 +0900 +@@ -533,7 +533,7 @@ + const char * + Face::Weight (void) const + { +- const char *result; ++ const char *result = NULL; + + if (cmdline::instance()->option ("panose") && ((result = PanoseWeight ()) != 0)) { + return result; +@@ -614,7 +614,7 @@ + const char * + Face::Width (void) const + { +- const char *result; ++ const char *result = NULL; + + if (cmdline::instance()->option ("panose") && ((result = PanoseWidth ()) != 0)) { + return result; +--- ttmkfdir-3.0.9/encoding.cpp~ 2005-08-03 19:33:07.000000000 +0900 ++++ ttmkfdir-3.0.9/encoding.cpp 2005-08-03 21:31:44.000000000 +0900 +@@ -121,7 +121,7 @@ + + NumericMapping *m = new NumericMapping (size, b->mapdata.platform, b->mapdata.encoding); + +- for (int i = 0; i < size; i++) ++ for (unsigned int i = 0; i < size; i++) + (*m)[i] = b->mapdata.mappingtable[i]; + + AddMapping (m); diff --git a/system/ttmkfdir/patches/ttmkfdir-3.0.9-zlib.patch b/system/ttmkfdir/patches/ttmkfdir-3.0.9-zlib.patch new file mode 100644 index 000000000000..548a49e3c669 --- /dev/null +++ b/system/ttmkfdir/patches/ttmkfdir-3.0.9-zlib.patch @@ -0,0 +1,80 @@ +--- ttmkfdir-3.0.9/encoding.cpp 2002-12-09 03:52:48.000000000 -0500 ++++ ttmkfdir-3.0.9/encoding.cpp 2003-09-12 12:32:29.000000000 -0400 +@@ -2,6 +2,8 @@ + #include <cstdio> + #include <cstdlib> + #include <cstring> ++#include <unistd.h> ++#include <zlib.h> + #include "freetype/freetype.h" + + #include "ttmkfdir.h" +@@ -32,9 +34,16 @@ + NextFile (FILE *f, char *name) + { + char file_name [1024]; +- char command[1024]; ++ char line_buf [1024]; ++ char tmp_file_name[] = "/tmp/ttmkfdir_XXXXXX"; ++ char inbuf[300000]; ++ FILE *od; ++ gzFile fd; ++ int rvalue, tmpfd; + +- if (fscanf (f, "%*s %[^\n]\n", file_name) == 1) { ++ if (fgets (line_buf, sizeof(line_buf), f) != NULL) { ++ ++ sscanf (line_buf, "%*s %[^\n]\n", file_name); + + if (file_name[0] == '/') { + name[0] = 0; +@@ -44,9 +53,25 @@ + + strcat (name, file_name); + +- sprintf (command, "exec %s < %s", (toupper(name[strlen (name) - 1]) == 'Z') +- ? "gzip -d" : "cat", name); +- return popen (command, "r"); ++ bzero(inbuf, sizeof(inbuf)); ++ ++ fd = gzopen (name,"rb"); ++ rvalue = gzread (fd, inbuf, sizeof(inbuf)); ++ ++ tmpfd = mkstemp (tmp_file_name); ++ if (tmpfd == -1) { ++ return 0; ++ } ++ ++ od = fdopen (tmpfd,"w"); ++ fputs (inbuf, od); ++ fflush (od); ++ fclose (od); ++ ++ od = fopen (tmp_file_name,"r"); ++ unlink (tmp_file_name); ++ return od; ++ + } + + return 0; +@@ -75,7 +100,7 @@ + yyrestart (input); + yylex (name, *this); + +- pclose (input); ++ fclose (input); + } + + fclose (f); +diff -uNr ttmkfdir-3.0.9.orig/Makefile ttmkfdir-3.0.9/Makefile +--- ttmkfdir-3.0.9.orig/Makefile 2003-08-21 17:43:13.000000000 +1000 ++++ ttmkfdir-3.0.9/Makefile 2003-08-21 17:40:16.000000000 +1000 +@@ -28,7 +28,7 @@ + DEBUG=-ggdb + CXX=g++ + CXXFLAGS=-Wall -pedantic $(FREETYPE_INCL) $(DEBUG) $(OPTFLAGS) +-LDFLAGS=$(FREETYPE_LIB) $(DEBUG) ++LDFLAGS=$(FREETYPE_LIB) $(DEBUG) -lz + + DESTDIR= + PREFIX=/usr diff --git a/system/ttmkfdir/slack-desc b/system/ttmkfdir/slack-desc new file mode 100644 index 000000000000..c8e5248127cc --- /dev/null +++ b/system/ttmkfdir/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. +# Line up the first '|' above the ':' following the base package name, and +# the '|' on the right side marks the last column you can put a character in. +# You must make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +ttmkfdir: ttmkfdir (Tool for creating fonts.dir for TrueType fonts) +ttmkfdir: +ttmkfdir: This program creates 'font.dir' files for TrueType fonts. These files +ttmkfdir: are required if you want to use TrueType fonts with X. +ttmkfdir: +ttmkfdir: +ttmkfdir: +ttmkfdir: +ttmkfdir: +ttmkfdir: +ttmkfdir: diff --git a/system/ttmkfdir/ttmkfdir.SlackBuild b/system/ttmkfdir/ttmkfdir.SlackBuild new file mode 100644 index 000000000000..b5d3d3071b58 --- /dev/null +++ b/system/ttmkfdir/ttmkfdir.SlackBuild @@ -0,0 +1,92 @@ +#!/bin/sh + +# Slackware build script for ttmkfdir + +# Copyright (c) 2015 Roberto Metere. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +PRGNAM=ttmkfdir +VERSION=${VERSION:-3.0.9} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) export ARCH=i486 ;; + arm*) export ARCH=arm ;; + *) export ARCH=$( uname -m ) ;; + esac +fi + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +# Set compiling FLAGS +if [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mtune=i686"; SLKLDFLAGS=""; LIBDIRSUFFIX=""; CHOST="i486" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686"; SLKLDFLAGS=""; LIBDIRSUFFIX=""; CHOST="i686" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC"; SLKLDFLAGS="-L/usr/lib64"; LIBDIRSUFFIX="64"; CHOST="x86_64" +fi + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION +tar -xvzf $CWD/$PRGNAM-$VERSION.tar.gz +cd $PRGNAM-$VERSION +chown -R root:root . +find -L . \ + \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ + -o -perm 511 \) -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + +#apply all patches +patch -p1 < $CWD/patches/ttmkfdir-3.0.9-cpp.patch +patch -p1 < $CWD/patches/ttmkfdir-3.0.9-zlib.patch +patch -p1 < $CWD/patches/ttmkfdir-3.0.9-fix-freetype217.patch +patch -p1 < $CWD/patches/ttmkfdir-3.0.9-namespace.patch +patch -p1 < $CWD/patches/ttmkfdir-3.0.9-fix-crash.patch +patch -p1 < $CWD/patches/ttmkfdir-3.0.9-warnings.patch +patch -p1 < $CWD/patches/ttmkfdir-3.0.9-segfaults.patch +patch -p1 < $CWD/patches/ttmkfdir-3.0.9-encoding-dir.patch +patch -p1 < $CWD/patches/ttmkfdir-3.0.9-font-scale.patch +patch -p1 < $CWD/patches/ttmkfdir-3.0.9-bug434301.patch + +#compile +make +make install DESTDIR=$PKG + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp README $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} diff --git a/system/ttmkfdir/ttmkfdir.info b/system/ttmkfdir/ttmkfdir.info new file mode 100644 index 000000000000..962e7ec15a8a --- /dev/null +++ b/system/ttmkfdir/ttmkfdir.info @@ -0,0 +1,10 @@ +PRGNAM="ttmkfdir" +VERSION="3.0.9" +HOMEPAGE="http://freecode.com/projects/ttmkfdir" +DOWNLOAD="http://schmatzler.de/my_slackbuilds/ttmkfdir/ttmkfdir-3.0.9.tar.gz" +MD5SUM="c22b8b7f8401fd924200c8e0e04a78f9" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="" +MAINTAINER="Ronny Schmatzler" +EMAIL="schmatzler@hirnschwund.net" |