--- Makefile 2016-10-18 23:09:17.183620000 +0300 +++ Makefile 2016-10-18 22:57:42.729886000 +0300 @@ -5,11 +5,9 @@ PORTNAME= alfont PORTVERSION= 209 PORTREVISION= 2 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/ +DISTFILES= AlFont${DISTVERSION}.rar + DIST_SUBDIR= ${PORTNAME} EXTRACT_ONLY= AlFont${DISTVERSION}.rar @@ -21,8 +19,6 @@ LICENSE_NAME= The FreeType Project LICEN LICENSE_FILE= ${WRKSRC}/docs/FTL.txt LICENSE_PERMS= auto-accept -BROKEN= unfetchable - EXTRACT_DEPENDS= unrar:archivers/unrar LIB_DEPENDS= liballeg.so.4:devel/allegro \ libfreetype.so:print/freetype2 @@ -60,8 +56,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|; \ --- /dev/null 2016-10-18 23:11:00.000000000 +0300 +++ files/patch-src_alfont.c 2016-10-18 23:06:01.989664000 +0300 @@ -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 ++#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); + } + }