From 90903ea1474a65b8efb29719d412c427aadbb3b8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Persson?= <Bjorn@Rombobjörn.se>
Date: Sat, 2 May 2015 21:24:38 +0200
Subject: [PATCH 1/2] Patched to build with GCC 5.

---
 matreshka-0.6.0-GCC5.patch | 117 +++++++++++++++++++++++++++++++++++++++++++++
 matreshka.spec             |   7 ++-
 2 files changed, 123 insertions(+), 1 deletion(-)
 create mode 100644 matreshka-0.6.0-GCC5.patch

diff --git a/matreshka-0.6.0-GCC5.patch b/matreshka-0.6.0-GCC5.patch
new file mode 100644
index 0000000..ca5dea1
--- /dev/null
+++ b/matreshka-0.6.0-GCC5.patch
@@ -0,0 +1,117 @@
+--- source/league/league-environment_variables.adb	2011-02-26 13:11:48.788640000 +0100
++++ source/league/league-environment_variables.adb	2015-05-02 17:44:59.589254146 +0200
+@@ -61,8 +61,7 @@
+       use type Universal_String_Maps.Map;
+ 
+    begin
+-      return
+-        Universal_String_Maps.Map (Left) = Universal_String_Maps.Map (Right);
++      return Left.Data = Right.Data;
+    end "=";
+ 
+    -----------
+@@ -71,7 +70,7 @@
+ 
+    procedure Clear (Self : in out Environment_Variable_Set'Class) is
+    begin
+-      Universal_String_Maps.Map (Self).Clear;
++      Self.Data.Clear;
+    end Clear;
+ 
+    --------------
+@@ -83,7 +82,7 @@
+      Name : League.Strings.Universal_String) return Boolean
+    is
+       Key      : constant Key_Type := To_Key (Name);
+-      Position : constant Universal_String_Maps.Cursor := Self.Find (Key);
++      Position : constant Universal_String_Maps.Cursor := Self.Data.Find (Key);
+ 
+    begin
+       return Universal_String_Maps.Has_Element (Position);
+@@ -108,14 +107,14 @@
+      Value : League.Strings.Universal_String)
+    is
+       Key      : constant Key_Type := To_Key (Name);
+-      Position : constant Universal_String_Maps.Cursor := Self.Find (Key);
++      Position : constant Universal_String_Maps.Cursor := Self.Data.Find (Key);
+ 
+    begin
+       if Universal_String_Maps.Has_Element (Position) then
+-         Self.Replace_Element (Position, Value);
++         Self.Data.Replace_Element (Position, Value);
+ 
+       else
+-         Self.Insert (Key, Value);
++         Self.Data.Insert (Key, Value);
+       end if;
+    end Insert;
+ 
+@@ -128,11 +127,11 @@
+      Name  : League.Strings.Universal_String)
+    is
+       Key      : constant Key_Type := To_Key (Name);
+-      Position : Universal_String_Maps.Cursor := Self.Find (Key);
++      Position : Universal_String_Maps.Cursor := Self.Data.Find (Key);
+ 
+    begin
+       if Universal_String_Maps.Has_Element (Position) then
+-         Self.Delete (Position);
++         Self.Data.Delete (Position);
+       end if;
+    end Remove;
+ 
+@@ -155,7 +154,7 @@
+          return League.Strings.Universal_String
+    is
+       Key      : constant Key_Type                     := To_Key (Name);
+-      Position : constant Universal_String_Maps.Cursor := Self.Find (Key);
++      Position : constant Universal_String_Maps.Cursor := Self.Data.Find (Key);
+ 
+    begin
+       if Universal_String_Maps.Has_Element (Position) then
+--- source/league/league-environment_variables.ads	2012-08-13 09:41:05.105439000 +0200
++++ source/league/league-environment_variables.ads	2015-05-02 17:44:59.589254146 +0200
+@@ -93,7 +93,8 @@
+            "=",
+            League.Strings."=");
+ 
+-   type Environment_Variable_Set is
+-     new Universal_String_Maps.Map with null record;
++   type Environment_Variable_Set is tagged record
++      Data : Universal_String_Maps.Map;
++   end record;
+ 
+ end League.Environment_Variables;
+--- source/xml/sax/xml/xml-sax-simple_readers.ads	2012-10-08 17:25:42.487161000 +0200
++++ source/xml/sax/xml/xml-sax-simple_readers.ads	2015-05-02 16:45:24.480791034 +0200
+@@ -303,7 +303,7 @@
+    type Simple_Shared_Locator is tagged;
+    type Simple_Shared_Locator_Access is access all Simple_Shared_Locator'Class;
+ 
+-   type SAX_Simple_Reader is new Ada.Finalization.Limited_Controlled
++   type SAX_Simple_Reader is limited new Ada.Finalization.Limited_Controlled
+      and XML.SAX.Readers.SAX_Reader with
+    record
+       --  Handlers
+--- source/xml/sax/xml-sax-input_sources-streams-sockets.ads	2011-07-22 22:16:17.999942000 +0200
++++ source/xml/sax/xml-sax-input_sources-streams-sockets.ads	2015-05-02 16:54:10.442710474 +0200
+@@ -63,7 +63,7 @@
+ 
+ private
+ 
+-   type Socket_Input_Source is new Stream_Input_Source with record
++   type Socket_Input_Source is limited new Stream_Input_Source with record
+       Socket : GNAT.Sockets.Socket_Type;
+    end record;
+ 
+--- testsuite/xml/sax_events_writers.ads	2013-10-28 12:46:59.843622000 +0100
++++ testsuite/xml/sax_events_writers.ads	2015-05-02 18:26:33.838316036 +0200
+@@ -190,7 +190,7 @@
+ private
+ 
+    type SAX_Events_Writer is
+-     new Ada.Finalization.Limited_Controlled
++     limited new Ada.Finalization.Limited_Controlled
+        and XML.SAX.Content_Handlers.SAX_Content_Handler
+        and XML.SAX.DTD_Handlers.SAX_DTD_Handler
+        and XML.SAX.Entity_Resolvers.SAX_Entity_Resolver
diff --git a/matreshka.spec b/matreshka.spec
index 5c5787e..8597ac2 100644
--- a/matreshka.spec
+++ b/matreshka.spec
@@ -1,12 +1,13 @@
 %define _gprdir %_GNAT_project_dir
 Name:       matreshka
 Version:    0.6.0
-Release:    8%{?dist}
+Release:    9%{?dist}
 Summary:    Set of Ada libraries to help to develop information systems
 Group:      System Environment/Libraries
 License:    BSD
 URL:        http://forge.ada-ru.org/matreshka
 Source0:    http://forge.ada-ru.org/matreshka/downloads/%{name}-%{version}.tar.gz
+Patch1:     matreshka-0.6.0-GCC5.patch
 BuildRequires:   gcc-gnat
 BuildRequires:   fedora-gnat-project-common  >= 3 
 BuildRequires:   chrpath
@@ -330,6 +331,7 @@ Requires:   fedora-gnat-project-common  >= 2
 
 %prep
 %setup -q 
+%patch1
 
 %build
 make config  %{?_smp_mflags} GPRBUILD_FLAGS="%Gnatmake_optflags"
@@ -424,6 +426,9 @@ chrpath --delete %{buildroot}%{_libdir}/lib*
 %files amf-mofext-devel -f .objs/amf_mofext-devel.files
 
 %changelog
+* Sat May 02 2015 Björn Persson <bjorn@rombobjörn.se> - 0.6.0-9
+- Patched to build with GCC 5.
+
 * Wed Apr 29 2015 Peter Robinson <pbrobinson@fedoraproject.org> 0.6.0-8
 - rebuild (gcc / gnat 5)
 
-- 
2.1.0

