diff options
author | rene <rene@FreeBSD.org> | 2017-11-12 20:35:22 +0800 |
---|---|---|
committer | rene <rene@FreeBSD.org> | 2017-11-12 20:35:22 +0800 |
commit | f0f3f04ed0661406498e45b354dc84ab933de07f (patch) | |
tree | 90655bbfa0012c220117d97af9e602b48e390caa /x11-fonts | |
parent | ed942ca0cb1089d0177a5f934740ff7dbcc8de1b (diff) | |
download | freebsd-ports-gnome-f0f3f04ed0661406498e45b354dc84ab933de07f.tar.gz freebsd-ports-gnome-f0f3f04ed0661406498e45b354dc84ab933de07f.tar.zst freebsd-ports-gnome-f0f3f04ed0661406498e45b354dc84ab933de07f.zip |
x11-fonts/alfont: fix build and undeprecate, also clean up fetching.
Somehow I failed to see this patch earlier when the port originally expired.
PR: 213600
Submitted by: timon at timon.net.nz
Approved by: maintainer timeout (nemysis@, 1 year)
MFH: 2017Q4
Diffstat (limited to 'x11-fonts')
-rw-r--r-- | x11-fonts/alfont/Makefile | 15 | ||||
-rw-r--r-- | x11-fonts/alfont/files/patch-src_alfont.c | 120 |
2 files changed, 123 insertions, 12 deletions
diff --git a/x11-fonts/alfont/Makefile b/x11-fonts/alfont/Makefile index 44db01efe4b5..d40696fc2a8c 100644 --- a/x11-fonts/alfont/Makefile +++ b/x11-fonts/alfont/Makefile @@ -5,13 +5,10 @@ PORTNAME= alfont PORTVERSION= 209 PORTREVISION= 3 CATEGORIES= x11-fonts -MASTER_SITES= http://opensnc.sourceforge.net/alfont/mirror/ \ - SF/nemysisfreebsdp/${CATEGORIES}/${PORTNAME}/:nemysis -# http://opensnc.sourceforge.net/alfont/:opensnc -DISTFILES= AlFont${DISTVERSION}.rar \ - alfont.c:nemysis +MASTER_SITES= http://opensnc.sourceforge.net/alfont/mirror/ +DISTNAME= AlFont${DISTVERSION} +EXTRACT_SUFX= .rar DIST_SUBDIR= ${PORTNAME} -EXTRACT_ONLY= AlFont${DISTVERSION}.rar MAINTAINER= nemysis@FreeBSD.org COMMENT= Wrapper around the freetype2 library @@ -21,10 +18,6 @@ LICENSE_NAME= The FreeType Project LICENSE (FTL) LICENSE_FILE= ${WRKSRC}/docs/FTL.txt LICENSE_PERMS= auto-accept -BROKEN= unfetchable -DEPRECATED= Broken for more than 6 months -EXPIRATION_DATE= 2017-08-23 - EXTRACT_DEPENDS= unrar:archivers/unrar LIB_DEPENDS= liballeg.so.4:devel/allegro \ libfreetype.so:print/freetype2 @@ -62,8 +55,6 @@ do-extract: ${_DISTDIR}/AlFont${DISTVERSION}.rar post-patch: - @${CP} -af ${_DISTDIR}/alfont.c ${WRKSRC}/src - @${REINPLACE_CMD} -e \ 's|#define ALFONT_WINDOWS|//#define ALFONT_WINDOWS|; \ s|//#define ALFONT_LINUX|#define ALFONT_LINUX|; \ diff --git a/x11-fonts/alfont/files/patch-src_alfont.c b/x11-fonts/alfont/files/patch-src_alfont.c new file mode 100644 index 000000000000..1e5df79a26a6 --- /dev/null +++ b/x11-fonts/alfont/files/patch-src_alfont.c @@ -0,0 +1,120 @@ +--- src/alfont.c.orig 2016-10-18 20:04:21 UTC ++++ src/alfont.c +@@ -1,3 +1,28 @@ ++/* ++ * Modified Alfont 2.0.9 ++ * ++ * The original AllegroFont v2.0.9 has a few problems. ++ * This modification solves them. ++ * ++ * Modification by: Alexandre Martins (thanks to http://allegro.cc forums) ++ * Modification date: 2010-10-30 ++ * ++ * Modification by: Rusmir Dusko ++ * (thanks to http://allegro.cc forums and Hans de Goede [alfont] Fix undefined reference to _msize) ++ * Modification date: 2014-03-10 ++ * ++ * Original Alfont website: http://chernsha.sitesled.com/ ++ * AllegroFont (c) 2001, 2002 Javier Gonzalez ++ * Enhanced by Chernsha since 2004 year ++ */ ++ ++//#define malloc_usable_size malloc_size ++ ++#ifdef __GNUC__ ++#define _msize malloc_usable_size ++#include <malloc_np.h> ++#endif ++ + /* AllegroFont - a wrapper for FreeType 2 */ + /* to render TTF and other font formats with Allegro */ + +@@ -336,7 +361,7 @@ int alfont_set_font_size(ALFONT_FONT *f, + break; + + /* compare real height with asked height */ +- real_height = abs(f->face->size->metrics.ascender >> 6) + abs(f->face->size->metrics.descender >> 6); ++ real_height = labs(f->face->size->metrics.ascender >> 6) + labs(f->face->size->metrics.descender >> 6); + if (real_height == h) { + /* we found the wanted height */ + break; +@@ -468,7 +493,7 @@ ALFONT_FONT *alfont_load_font(const char + alfont_set_char_extra_spacing(font, 0); + + //Initial Font attribute +- font->language=""; /* Initial Language */ ++ font->language=NULL; /* Initial Language */ + font->type=0; /* Initial Code Convert */ + font->outline_top=0; /* Initial Font top outline width */ + font->outline_bottom=0; /* Initial Font bottom outline width */ +@@ -515,7 +540,7 @@ ALFONT_FONT *alfont_load_font_from_mem(c + memcpy((void *)font->data, (void *)data, data_len); + + /* load the font */ +- error = FT_New_Memory_Face(ft_library, font->data, font->data_size, 0, &font->face); ++ error = FT_New_Memory_Face(ft_library, (unsigned char*)font->data, font->data_size, 0, &font->face); + + if (error) { + free(font->data); +@@ -548,7 +573,7 @@ ALFONT_FONT *alfont_load_font_from_mem(c + alfont_set_char_extra_spacing(font, 0); + + //Initial Font attribute +- font->language=""; /* Initial Language */ ++ font->language=NULL; /* Initial Language */ + font->type=0; /* Initial Code Convert */ + font->outline_top=0; /* Initial Font top outline width */ + font->outline_bottom=0; /* Initial Font bottom outline width */ +@@ -3761,15 +3786,15 @@ int alfont_ugetx(ALFONT_FONT *f, char ** + //advances the *s pointer to the next character + + if (f->type==1) { +- ugetxc((char**)s); ++ ugetxc((const char**)s); + #ifdef ALFONT_LINUX +- ugetxc((char**)s); ++ ugetxc((const char**)s); + #endif + } + else if(f->type==2) { +- ugetxc(&lpszWS); ++ ugetxc((const char**)&lpszWS); + #ifdef ALFONT_LINUX +- ugetxc(&lpszWS); ++ ugetxc((const char**)&lpszWS); + #endif + #ifdef ALFONT_DOS + if ((c_pt = iconv_open(f->language, "UTF-16LE")) == (iconv_t)-1) { +@@ -3814,9 +3839,9 @@ int alfont_ugetx(ALFONT_FONT *f, char ** + #ifdef ALFONT_LINUX + set_uformat(U_UTF8); + #endif +- ugetxc((char**)s); ++ ugetxc((const char**)s); + #ifdef ALFONT_LINUX +- ugetxc((char**)s); ++ ugetxc((const char**)s); + #endif + } + +@@ -4083,9 +4108,9 @@ int alfont_ugetxc(ALFONT_FONT *f, const + #endif + } + else if(f->type==2) { +- ugetxc(&lpszWS); ++ ugetxc((const char**)&lpszWS); + #ifdef ALFONT_LINUX +- ugetxc(&lpszWS); ++ ugetxc((const char**)&lpszWS); + #endif + #ifdef ALFONT_DOS + if ((c_pt = iconv_open(f->language, "UTF-16LE")) == (iconv_t)-1) { +@@ -4828,7 +4853,7 @@ void alfont_set_language(ALFONT_FONT *f, + } + else + { +- f->language=(char *)malloc(strlen(language)*sizeof(char)); ++ f->language=(char *)malloc((strlen(language)+1)*sizeof(char)); + strcpy(f->language,language); + } + } |