Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Dec 2013 03:30:22 +0000 (UTC)
From:      Dmitry Marakasov <amdmi3@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r337318 - in head/graphics/wings: . files
Message-ID:  <201312240330.rBO3UMAK084619@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: amdmi3
Date: Tue Dec 24 03:30:22 2013
New Revision: 337318
URL: http://svnweb.freebsd.org/changeset/ports/337318

Log:
  - Fix build with newer erlang
  
  Submitted by:	olgeni

Added:
  head/graphics/wings/files/patch-src_wings____font.erl   (contents, props changed)
  head/graphics/wings/files/patch-src_wings__text.erl   (contents, props changed)
Modified:
  head/graphics/wings/Makefile

Modified: head/graphics/wings/Makefile
==============================================================================
--- head/graphics/wings/Makefile	Tue Dec 24 03:20:14 2013	(r337317)
+++ head/graphics/wings/Makefile	Tue Dec 24 03:30:22 2013	(r337318)
@@ -3,7 +3,7 @@
 
 PORTNAME=	wings
 PORTVERSION=	1.4.1
-PORTREVISION=	3
+PORTREVISION=	4
 CATEGORIES=	graphics
 MASTER_SITES=	SF
 DIST_SUBDIR=	erlang
@@ -39,6 +39,7 @@ DESKTOP_ENTRIES="Wings" \
 post-patch:
 	@${REINPLACE_CMD} -e 's|$$(GCC)|${CC} -I${LOCALBASE}/include -L${LOCALBASE}/lib|g' \
 		${WRKSRC}/plugins_src/accel/Makefile
+	@${FIND} ${WRKSRC} -name "*.orig" -delete
 
 do-install:
 	${MKDIR} ${STAGEDIR}${PREFIX}/lib/erlang/lib/${DISTNAME}

Added: head/graphics/wings/files/patch-src_wings____font.erl
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/graphics/wings/files/patch-src_wings____font.erl	Tue Dec 24 03:30:22 2013	(r337318)
@@ -0,0 +1,76 @@
+
+$FreeBSD$
+
+--- src/wings__font.erl.orig
++++ src/wings__font.erl
+@@ -11,45 +11,50 @@
+ %%     $Id$
+ %%
+ 
+--module(wings__font, [Key,Desc,Width,Height,GlyphTab,Bitmaps]).
+--export([key/0,desc/0,width/0,height/0,draw/1,char/1,char_width/1,
+-	bold_char/1,bold_char_width/1]).
++-module(wings__font).
++-export([new/6,key/1,desc/1,width/1,height/1,draw/2,char/2,char_width/2,
++	bold_char/2,bold_char_width/2]).
+ 
+-draw([C|T]) ->
+-    char(C),
+-    draw(T);
+-draw([]) -> ok.
++-record(font, {key, desc, width, height, glyph_tab, bitmaps}).
+ 
+-key() -> Key.
+-desc() -> Desc.
++new(Key, Desc, Width, Height, GlyphTab, Bitmaps) ->
++    #font{key = Key, desc = Desc, width = Width, height = Height, glyph_tab = GlyphTab, bitmaps = Bitmaps}.
+ 
+-char_width(C) ->
+-    element(1, glyph_info(C)).
+-width() ->
++draw(Font, [C|T]) ->
++    char(Font, C),
++    draw(Font, T);
++draw(_Font, []) -> ok.
++
++key(#font{key = Key}) -> Key.
++desc(#font{desc = Desc}) -> Desc.
++
++char_width(Font, C) ->
++    element(1, glyph_info(Font, C)).
++width(#font{width = Width}) ->
+     insert_glyph(char_width, Width),
+     Width.
+-height() ->
++height(#font{height = Height}) ->
+     insert_glyph(char_height, Height),
+     Height.
+ 
+-bold_char(C) ->
+-    Glyph = glyph_info(C),
++bold_char(Font, C) ->
++    Glyph = glyph_info(Font, C),
+     draw_glyph(Glyph),
+     Cw = glyph_width(Glyph),
+     gl:bitmap(1, 1, 0, 0, -Cw+1, 0, <<0>>),
+     draw_glyph(Glyph).
+ 
+-bold_char_width(C) ->
+-    Glyph = glyph_info(C),
++bold_char_width(Font, C) ->
++    Glyph = glyph_info(Font, C),
+     glyph_width(Glyph)+1.
+ 
+-char(C) ->
+-    draw_glyph(glyph_info(C)).
++char(Font, C) ->
++    draw_glyph(glyph_info(Font, C)).
+ 
+ draw_glyph({W,H,Xorig,Yorig,Xmove,B}) ->
+     gl:bitmap(W, H, Xorig, Yorig, Xmove, 0, B).
+ 
+-glyph_info(C) ->
++glyph_info(#font{glyph_tab = GlyphTab, width = Width, height = Height, bitmaps = Bitmaps}, C) ->
+     BitMap = case ets:lookup(GlyphTab, C) of
+ 	[] when is_integer(C), C > 0 ->
+ 	    %% Undefined character. Return a filled box.

Added: head/graphics/wings/files/patch-src_wings__text.erl
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/graphics/wings/files/patch-src_wings__text.erl	Tue Dec 24 03:30:22 2013	(r337318)
@@ -0,0 +1,73 @@
+
+$FreeBSD$
+
+--- src/wings_text.erl.orig
++++ src/wings_text.erl
+@@ -65,7 +65,7 @@
+ 
+ bold_string_width([C|S], W) ->
+     BCW = case wings_font_table:bold_char_width(C) of
+-        undefined -> (current_font()):bold_char_width(C);
++        undefined -> wings__font:bold_char_width(current_font(), C);
+         Other -> Other
+     end,
+     bold_string_width(S, BCW+W);
+@@ -74,19 +74,19 @@
+ 
+ char_width(C) ->
+     case wings_font_table:char_width(C) of
+-        undefined -> (current_font()):char_width(C);
++        undefined -> wings__font:char_width(current_font(), C);
+         Other -> Other
+     end.
+ 
+ width() ->
+     case wings_font_table:char(char_width) of
+-        undefined -> (current_font()):width();
++        undefined -> wings__font:width(current_font());
+         Other -> Other
+     end.
+ 
+ height() ->
+     case wings_font_table:char(char_height) of
+-        undefined -> (current_font()):height();
++        undefined -> wings__font:height(current_font());
+         Other -> Other
+     end.
+ 
+@@ -111,13 +111,13 @@
+ char(C) when is_atom(C) -> special(C);
+ char(C) ->
+     case wings_font_table:char(C) of
+-        undefined -> (current_font()):char(C);
++        undefined -> wings__font:char(current_font(), C);
+         Other -> Other
+     end.
+ 
+ bold([C|S]) ->
+     case wings_font_table:bold_char(C) of
+-        undefined -> (current_font()):bold_char(C);
++        undefined -> wings__font:bold_char(current_font(), C);
+         Other -> Other
+     end,
+     bold(S);
+@@ -195,7 +195,7 @@
+     CharWidth = wings_text:width([$\s])*2,
+     Line = [$\s,$\s|Line0],
+     string_to_text_box(Tb#tb{text=Text,lw=LW+CharWidth,line=Line});
+-    
++
+ string_to_text_box(#tb{text=[{Style,String}=Stylized|Text],lw=Lw, max=Max, line=Line0,res=Res}=Tb0) ->
+     Sw = width([Stylized]),
+     NLW = Lw + Sw,
+@@ -504,8 +504,8 @@
+     {ok,Bin} = file:read_file(FontDir),
+     Font = binary_to_term(Bin),
+     Mod = load_font_1(Font),
+-    Key = Mod:key(),
+-    Desc = Mod:desc(),
++    Key = wings__font:key(Mod),
++    Desc = wings__font:desc(Mod),
+     ets:insert(wings_fonts, {Key,Mod,Desc}).
+ 
+ load_font_1({wings_font,?wings_version,Font}) ->



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