Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 12 Nov 2017 12:35:22 +0000 (UTC)
From:      Rene Ladan <rene@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r454035 - in head/x11-fonts/alfont: . files
Message-ID:  <201711121235.vACCZMLF008850@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rene
Date: Sun Nov 12 12:35:22 2017
New Revision: 454035
URL: https://svnweb.freebsd.org/changeset/ports/454035

Log:
  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

Added:
  head/x11-fonts/alfont/files/
  head/x11-fonts/alfont/files/patch-src_alfont.c   (contents, props changed)
Modified:
  head/x11-fonts/alfont/Makefile

Modified: head/x11-fonts/alfont/Makefile
==============================================================================
--- head/x11-fonts/alfont/Makefile	Sun Nov 12 12:33:11 2017	(r454034)
+++ head/x11-fonts/alfont/Makefile	Sun Nov 12 12:35:22 2017	(r454035)
@@ -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|; \

Added: head/x11-fonts/alfont/files/patch-src_alfont.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/x11-fonts/alfont/files/patch-src_alfont.c	Sun Nov 12 12:35:22 2017	(r454035)
@@ -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);
+   }
+ }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201711121235.vACCZMLF008850>