[Pkg-erlang-commits] r1828 - in wings3d/trunk/debian: . patches

sgolovan at alioth.debian.org sgolovan at alioth.debian.org
Sat Sep 3 11:18:22 UTC 2016


Author: sgolovan
Date: 2016-09-03 11:18:22 +0000 (Sat, 03 Sep 2016)
New Revision: 1828

Added:
   wings3d/trunk/debian/patches/r19.diff
Modified:
   wings3d/trunk/debian/changelog
   wings3d/trunk/debian/control
   wings3d/trunk/debian/patches/series
Log:
[wings3d]
  * Added a patch by upstream which fixes FTBFS with Erlang 19 due to
    deprecated module usage and redefining predefined macro name.


Modified: wings3d/trunk/debian/changelog
===================================================================
--- wings3d/trunk/debian/changelog	2016-09-03 10:03:29 UTC (rev 1827)
+++ wings3d/trunk/debian/changelog	2016-09-03 11:18:22 UTC (rev 1828)
@@ -1,8 +1,9 @@
-wings3d (1.5.4-2) UNRELEASED; urgency=medium
+wings3d (1.5.4-2) unstable; urgency=medium
 
-  * NOT RELEASED YET
+  * Added a patch by upstream which fixes FTBFS with Erlang 19 due to
+    deprecated module usage and redefining predefined macro name.
 
- -- Sergei Golovan <sgolovan at debian.org>  Tue, 17 Nov 2015 13:30:30 +0300
+ -- Sergei Golovan <sgolovan at debian.org>  Sat, 03 Sep 2016 14:17:18 +0300
 
 wings3d (1.5.4-1) unstable; urgency=medium
 

Modified: wings3d/trunk/debian/control
===================================================================
--- wings3d/trunk/debian/control	2016-09-03 10:03:29 UTC (rev 1827)
+++ wings3d/trunk/debian/control	2016-09-03 11:18:22 UTC (rev 1828)
@@ -4,7 +4,7 @@
 Section: graphics
 Priority: optional
 Build-Depends: debhelper (>= 8.0.0), grep-dctrl,
- erlang-dev (>= 1:15.b), erlang-esdl-dev (>= 1.2), erlang-cl,
+ erlang-dev (>= 1:18.0), erlang-esdl-dev (>= 1.2), erlang-cl,
  libgl1-mesa-dev | libgl-dev, libglu1-mesa-dev | libglu-dev, libjpeg-dev
 Standards-Version: 3.9.6
 Homepage: http://www.wings3d.com

Added: wings3d/trunk/debian/patches/r19.diff
===================================================================
--- wings3d/trunk/debian/patches/r19.diff	                        (rev 0)
+++ wings3d/trunk/debian/patches/r19.diff	2016-09-03 11:18:22 UTC (rev 1828)
@@ -0,0 +1,160 @@
+From: Dan Gudmundsson <dgud at users.sourceforge.net>
+Date: Wed, 6 Apr 2016 18:28:01 +0200
+Subject: Patch from upstream fixes building Wings3D with Erlang R19
+ by replacing deprecated calls, fixing a macro and non-matching function
+ clause.
+
+--- a/e3d/e3d_qbvh.erl
++++ b/e3d/e3d_qbvh.erl
+@@ -40,6 +40,7 @@
+ 
+ -define(F32, 32/float-native).
+ -define(I32, 32/signed-native).
++-define(U32, 32/unsigned-native).
+ -define(QNODE_SZ, ((24+4)*4)).
+ -define(QTRI_SZ,  ((12*3+4)*4)).
+ 
+@@ -118,8 +119,8 @@
+ convert_to_image(_, <<>>, Acc) -> Acc.
+ 
+ convert_children(4, _W, Qns, Acc) ->  {Qns, Acc};
+-convert_children(J, W, <<16#ffffffff:?I32, Qns/binary>>, Acc) ->  %% EMPTY
+-    convert_children(J+1, W, Qns, <<Acc/binary, 16#ffffffff:?I32>>);
++convert_children(J, W, <<16#ffffffff:?U32, Qns/binary>>, Acc) ->  %% EMPTY
++    convert_children(J+1, W, Qns, <<Acc/binary, 16#ffffffff:?U32>>);
+ convert_children(J, W, <<C0:?I32, Qns/binary>>, Acc) when C0 < 0 -> %% IS_LEAF
+     Count = first_quad(C0) * 10,
+     X = (Count rem W) div 10, %% "div 10" in order to not waste bits
+--- a/e3d/e3d_util.erl
++++ b/e3d/e3d_util.erl
+@@ -53,7 +53,7 @@
+     New = {sublist(Key, Max-1)++sublist(Orig, Max+1, 999999),Orig},
+     remove_chars(T, Max, [New|Acc]);
+ remove_chars([{Key,Orig}|T], Max, Acc) ->
+-    C = trunc($a+random:uniform(26)),
++    C = trunc($a+rand:uniform(26)),
+     remove_chars(T, Max, [{[C|Key],Orig}|Acc]);
+ remove_chars([], Max, Acc) ->
+     L0 = [{sublist(Key, Max),Key} || {Key,_} <- Acc],
+--- a/intl_tools/tools.erl
++++ b/intl_tools/tools.erl
+@@ -261,7 +261,7 @@
+ %%%
+ 
+ -define(STRINGS, wings_lang_transform_strings).
+--define(FUNCTION_NAME, wings_lang_transform_function_name).
++-define(FUNCTION, wings_lang_transform_function_name).
+ -define(ERRORS, wings_lang_transform_errors).
+ -define(FILENAME, wings_lang_transform_filename).
+ 
+@@ -286,12 +286,12 @@
+     put(?FILENAME, Filename),
+     Form;
+ transform({function,L,Name,Arity,Cs}) ->
+-    put(?FUNCTION_NAME, Name),
++    put(?FUNCTION, Name),
+     {function,L,Name,Arity,transform(Cs)};
+ transform({call,L,{remote,_,{atom,_,wings_lang},{atom,_,str}}=Rem,
+ 	   [{tuple,_,[{atom,_,M}=Mod,Key]},
+ 	    {string,_,S}=Str]}) ->
+-    FunName = get(?FUNCTION_NAME),
++    FunName = get(?FUNCTION),
+     K = literal_key(Key),
+     add_string({{M,FunName,K},{S,L}}),
+     {call,L,Rem,[{tuple,L,[Mod,{atom,L,FunName},Key]},Str]};
+--- a/plugins_src/autouv/auv_mapping.erl
++++ b/plugins_src/autouv/auv_mapping.erl
+@@ -1030,9 +1030,6 @@
+     wings_pb:start(?__(1,"optimizing")),
+     wings_pb:update(0.01, ?__(2,"initializing")),
+ 
+-    {_,R1,R2} = os:timestamp(),
+-    random:seed(R2, R1, 128731),
+-
+     %% {FaceToStretchMean, FaceToStretchWorst,FaceToVerts,VertToFaces,VertToUvs}
+     {F2S2,_F2S8,Uvs,State,Scale} = stretch_setup(Fs,We0,OVs),
+ 
+@@ -1103,8 +1100,8 @@
+     {V2S, F2S2, Uvs}.
+ 
+ random_line() ->
+-    X   = random:uniform()-0.5,
+-    Y   = random:uniform()-0.5,
++    X   = rand:uniform()-0.5,
++    Y   = rand:uniform()-0.5,
+     Len = math:sqrt(X*X+Y*Y),
+     {X/Len,Y/Len}.
+ 
+--- a/src/wings_deform.erl
++++ b/src/wings_deform.erl
+@@ -128,14 +128,14 @@
+     wings_drag:setup(Tvs, [{percent,{-20.0,20.0}}], St).
+ 
+ crumple(normal, Vs0, #we{id=Id}=We, Acc) ->
+-    {Sa,Sb,Sc} = os:timestamp(),
++    ExpSeed = rand:export_seed_s(rand:seed_s(exs64)),
+     Vs = gb_sets:to_list(Vs0),
+     VsPos0 = wings_util:add_vpos(Vs, We),
+     VsPos = [{V,Pos,wings_vertex:normal(V, We)} || {V,Pos} <- VsPos0],
+     Fun = fun([Dx], A) ->
+-		  random:seed(Sa, Sb, Sc),
++		  rand:seed(ExpSeed),
+ 		  foldl(fun({V,Pos0,N}, VsAcc) ->
+-				{R1,_,_} = rnd(Dx/10),
++				R1 = rand:normal()*Dx/10,
+ 				Pos = e3d_vec:add_prod(Pos0, N, R1),
+ 				[{V,Pos}|VsAcc]
+ 			end, A, VsPos)
+@@ -143,11 +143,11 @@
+     [{Id,{Vs,Fun}}|Acc];
+ crumple(Dir, Vs0, #we{id=Id}=We, Acc) ->
+     {Xmask,Ymask,Zmask} = crumple_mask(Dir),
+-    {Sa,Sb,Sc} = os:timestamp(),
++    ExpSeed = rand:export_seed_s(rand:seed_s(exs64)),
+     Vs = gb_sets:to_list(Vs0),
+     VsPos = wings_util:add_vpos(Vs, We),
+     Fun = fun([Dx], A) ->
+-		  random:seed(Sa, Sb, Sc),
++		  rand:seed(ExpSeed),
+ 		  foldl(fun({V,{X0,Y0,Z0}}, VsAcc) ->
+ 				{R1,R2,R3} = rnd(Dx/4),
+ 				X = X0 + R1*Xmask,
+@@ -164,20 +164,7 @@
+ crumple_mask(random) -> {1,1,1}.
+ 
+ rnd(Sc) when is_float(Sc) ->
+-    %% Use Box-Muller's method for generation of normally-distributed
+-    %% random numbers.
+-    X1 = random:uniform(),
+-    X2 = random:uniform(),
+-    A1 = 2*?PI*X2,
+-    R1 = math:sqrt(-2.0*math:log(X1)),
+-    Y1 = R1*math:cos(A1),
+-    Y2 = R1*math:sin(A1),
+-    
+-    X3 = random:uniform(),
+-    X4 = random:uniform(),
+-    Y3 = math:sqrt(-2.0*math:log(X3))*math:cos(2*?PI*X4),
+-    
+-    {Sc*(Y1-0.5),Sc*(Y2-0.5),Sc*(Y3-0.5)}.
++    {Sc*rand:normal(),Sc*rand:normal(),Sc*rand:normal()}.
+ 
+ %%
+ %% The Inflate deformer.
+--- a/src/wings_sel_cmd.erl
++++ b/src/wings_sel_cmd.erl
+@@ -884,12 +884,12 @@
+ random(Percent, #st{selmode=Mode, sel=[]}=St) ->
+     P = Percent / 100,
+     wings_pref:set_value(random_select, Percent),
+-    {save_state, wings_sel:make(fun(_, _) -> random:uniform() < P end, Mode, St)};
++    {save_state, wings_sel:make(fun(_, _) -> rand:uniform() < P end, Mode, St)};
+ random(Percent, St) ->
+     P = Percent / 100,
+     NewSel = wings_sel:fold(fun(Sel0, #we{id=Id}, Acc) ->
+             Sel1 = gb_sets:to_list(Sel0),
+-            Sel2 = [Elem || Elem <- Sel1, random:uniform() < P ],
++            Sel2 = [Elem || Elem <- Sel1, rand:uniform() < P ],
+             case Sel2 of
+               [] -> Acc;
+               _ -> [{Id,gb_sets:from_list(Sel2)}|Acc]

Modified: wings3d/trunk/debian/patches/series
===================================================================
--- wings3d/trunk/debian/patches/series	2016-09-03 10:03:29 UTC (rev 1827)
+++ wings3d/trunk/debian/patches/series	2016-09-03 11:18:22 UTC (rev 1828)
@@ -5,3 +5,4 @@
 wx.diff
 stl.diff
 e3d_hrl.diff
+r19.diff




More information about the Pkg-erlang-commits mailing list