diff options
author | John Marino <marino@FreeBSD.org> | 2014-03-15 20:21:49 +0000 |
---|---|---|
committer | John Marino <marino@FreeBSD.org> | 2014-03-15 20:21:49 +0000 |
commit | 9723bb167e1a7b5e1c42f5c08a3246920959aa9b (patch) | |
tree | b6e0b2b3c04aee98b295a34d9736e1af7cd881b6 /devel/matreshka | |
parent | d84e12f791571d5b4db236056e68ba68ee07a930 (diff) | |
download | ports-9723bb167e1a7b5e1c42f5c08a3246920959aa9b.tar.gz ports-9723bb167e1a7b5e1c42f5c08a3246920959aa9b.zip |
devel/matreshka: Add FireBird SQL Support
After reporting the build issue of the Firebird SQL driver to the author,
a fix was introduced a couple of days later. I finally have time to
apply that repository fix. While here, fix it so the license can be
installed.
Notes
Notes:
svn path=/head/; revision=348377
Diffstat (limited to 'devel/matreshka')
-rw-r--r-- | devel/matreshka/Makefile | 12 | ||||
-rw-r--r-- | devel/matreshka/files/patch-changeset_4465.diff | 203 |
2 files changed, 206 insertions, 9 deletions
diff --git a/devel/matreshka/Makefile b/devel/matreshka/Makefile index 2209c785b82b..3bba637d1bcf 100644 --- a/devel/matreshka/Makefile +++ b/devel/matreshka/Makefile @@ -3,7 +3,7 @@ PORTNAME= matreshka PORTVERSION= 0.6.0 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= devel MASTER_SITES= http://forge.ada-ru.org/matreshka/downloads/ @@ -21,11 +21,6 @@ NO_MTREE= yes OPTIONS_DEFINE= SQLITE3 FIREBIRD PGSQL MYSQL ORACLE AMF OPTIONS_DEFAULT=SQLITE3 FIREBIRD PGSQL MYSQL -#FIREBIRD option requires Ada-2012; disable until new compiler arrives -#Excluding option breaks X_CONFIGURE_ENABLE, so manually set that too -OPTIONS_EXCLUDE=FIREBIRD -CONFIGURE_ARGS+= --disable-firebird - AMF_DESC= Build Ada Modeling Framework SQLITE3_CONFIGURE_ENABLE= sqlite3 @@ -36,7 +31,6 @@ ORACLE_CONFIGURE_ENABLE= oracle AMF_CONFIGURE_ENABLE= amf MAKE_JOBS_UNSAFE= yes -NO_LICENSES_INSTALL= yes MAKE_ENV+= SMP_MFLAGS=-j${MAKE_JOBS_NUMBER} @@ -60,11 +54,11 @@ USE_SQLITE= yes .endif pre-configure: - cd ${WRKSRC} && ${SETENV} ${CONFIGURE_ENV} ${GMAKE} config + cd ${WRKSRC} && ${SETENV} ${CONFIGURE_ENV} ${MAKE_CMD} config post-install: @cd ${STAGEDIR}${PREFIX}; ${FIND} * \( -type f -or -type l \) | \ - ${SORT} > ${TMPPLIST} + ${SORT} >> ${TMPPLIST} @cd ${STAGEDIR}${PREFIX}; ${FIND} * -type d | ${AWK} '/\//' | ${SORT} -r | \ ${SED} -e '/lib\/gnat$$/d' -e 's/^/@dirrm /g' >> ${TMPPLIST} @echo "@unexec rmdir %D/lib/gnat 2>/dev/null || true" >> ${TMPPLIST} diff --git a/devel/matreshka/files/patch-changeset_4465.diff b/devel/matreshka/files/patch-changeset_4465.diff new file mode 100644 index 000000000000..e25ffdafa7bd --- /dev/null +++ b/devel/matreshka/files/patch-changeset_4465.diff @@ -0,0 +1,203 @@ +Restore FireBird SQL Support +http://forge.ada-ru.org/matreshka/changeset/4465 + +=================================================================== +--- source/sql/firebird/matreshka-internals-sql_drivers-firebird-databases.adb.orig ++++ source/sql/firebird/matreshka-internals-sql_drivers-firebird-databases.adb +@@ -213,20 +213,25 @@ + + overriding function Open + (Self : not null access Firebird_Database; +- Options : League.Strings.Universal_String) return Boolean ++ Options : SQL.Options.SQL_Options) return Boolean + is + use type Isc_Result_Code; + use League.Strings; + + Result : Isc_Result_Code := 0; ++ ++ Database_Name : constant League.Strings.Universal_String ++ := League.Strings.To_Universal_String ("database"); ++ Password_Name : constant League.Strings.Universal_String ++ := League.Strings.To_Universal_String ("password"); ++ User_Name : constant League.Strings.Universal_String ++ := League.Strings.To_Universal_String ("user"); + + function Get_User return League.Strings.Universal_String; + function Get_Password return League.Strings.Universal_String; + function Get_Database return Isc_String; + procedure Create_Codec; + +- Pwd_Separator : constant Natural := Options.Index ('/'); +- DB_Separator : constant Natural := Options.Index ('@'); + Charset : constant League.Strings.Universal_String := + League.Strings.To_Universal_String ("UTF8"); + +@@ -304,22 +309,9 @@ + Empty : constant Isc_String (1 .. 0) := (others => Interfaces.C.nul); + + begin +- if DB_Separator /= 0 then +- declare +- V_Item : constant Ada.Streams.Stream_Element_Array := +- ASCII_Codec.Encode +- (Options.Slice (DB_Separator + 1, Options.Length)). +- To_Stream_Element_Array; +- +- S_Item : String (1 .. V_Item'Length); +- +- for S_Item'Address use V_Item'Address; +- pragma Import (Ada, S_Item); +- +- begin +- return Interfaces.C.To_C (S_Item); +- end; +- ++ if Options.Is_Set (Database_Name) then ++ return Interfaces.C.To_C ++ (Options.Get (Database_Name).To_UTF_8_String); + else + return Empty; + end if; +@@ -331,14 +323,8 @@ + + function Get_Password return League.Strings.Universal_String is + begin +- if Pwd_Separator /= 0 then +- if DB_Separator /= 0 then +- return Options.Slice (Pwd_Separator + 1, DB_Separator - 1); +- +- else +- return Options.Slice (Pwd_Separator + 1, Options.Length); +- end if; +- ++ if Options.Is_Set (Password_Name) then ++ return Options.Get (Password_Name); + else + return League.Strings.Empty_Universal_String; + end if; +@@ -350,14 +336,10 @@ + + function Get_User return League.Strings.Universal_String is + begin +- if Pwd_Separator /= 0 then +- return Options.Slice (1, Pwd_Separator - 1); +- +- elsif DB_Separator /= 0 then +- return Options.Slice (1, DB_Separator - 1); +- ++ if Options.Is_Set (User_Name) then ++ return Options.Get (User_Name); + else +- return Options; ++ return League.Strings.Empty_Universal_String; + end if; + end Get_User; + +--- source/sql/firebird/matreshka-internals-sql_drivers-firebird-databases.ads.orig ++++ source/sql/firebird/matreshka-internals-sql_drivers-firebird-databases.ads +@@ -106,7 +106,7 @@ + + overriding function Open + (Self : not null access Firebird_Database; +- Options : League.Strings.Universal_String) return Boolean; ++ Options : SQL.Options.SQL_Options) return Boolean; + + procedure Check_Result + (Self : not null access Firebird_Database; +--- source/sql/firebird/matreshka-internals-sql_drivers-firebird-queries.adb.orig ++++ source/sql/firebird/matreshka-internals-sql_drivers-firebird-queries.adb +@@ -169,6 +169,7 @@ + end if; + end case; + ++ Self.Is_Valid := False; + return True; + + exception +@@ -294,6 +295,7 @@ + Self.Sql_Params.Codec := Codec; + Self.Sql_Record.Utf := Utf; + Self.Sql_Params.Utf := Utf; ++ Self.Is_Valid := False; + + SQL_Drivers.Initialize (Self, Database_Access (Database)); + end Initialize; +@@ -327,6 +329,16 @@ + begin + return Self.State = Active; + end Is_Active; ++ ++ -------------- ++ -- Is_Valid -- ++ -------------- ++ ++ overriding function Is_Valid ++ (Self : not null access Firebird_Query) return Boolean is ++ begin ++ return Self.Is_Valid; ++ end Is_Valid; + + ---------- + -- Next -- +@@ -349,6 +361,7 @@ + + if Result > 0 then + if Result = 100 then ++ Self.Is_Valid := False; + return False; + + else +@@ -358,11 +371,13 @@ + + begin + if Check_For_Error (Self.Status'Access, EC) then ++ Self.Is_Valid := False; + return False; + + else + Self.Error := Get_Error (Self.Status'Access); + Self.Finish; ++ Self.Is_Valid := False; + + return False; + end if; +@@ -370,6 +385,7 @@ + end if; + + else ++ Self.Is_Valid := True; + return True; + end if; + end Next; +--- source/sql/firebird/matreshka-internals-sql_drivers-firebird-queries.ads.orig ++++ source/sql/firebird/matreshka-internals-sql_drivers-firebird-queries.ads +@@ -81,6 +81,7 @@ + Cursor_Name : Isc_String (1 .. 10); + Status : aliased Isc_Results := (others => 0); + Error : League.Strings.Universal_String; ++ Is_Valid : Boolean := False; + end record; + + overriding procedure Bind_Value +@@ -110,6 +111,9 @@ + overriding function Next + (Self : not null access Firebird_Query) return Boolean; + ++ overriding function Is_Valid ++ (Self : not null access Firebird_Query) return Boolean; ++ + overriding function Prepare + (Self : not null access Firebird_Query; + Query : League.Strings.Universal_String) return Boolean; +--- source/sql/matreshka-internals-sql_drivers.ads.orig ++++ source/sql/matreshka-internals-sql_drivers.ads +@@ -154,7 +154,7 @@ + (Self : not null access Abstract_Query'Class) return Boolean; + -- Returns True when query object is valid. + +- function Is_Valid ++ not overriding function Is_Valid + (Self : not null access Abstract_Query) return Boolean is abstract; + -- Returns True if the query is currently positioned on a valid record; + -- otherwise returns false. |