diff --git a/index/alire-index-rxada.ads b/index/alire-index-rxada.ads index c3ae5891..9395681f 100644 --- a/index/alire-index-rxada.ads +++ b/index/alire-index-rxada.ads @@ -17,6 +17,7 @@ package Alire.Index.RxAda is Executable ("rx-examples-tests") and Executable ("rx-examples-threading") and + License (LGPL_3_0) and Maintainer ("alejandro@mosteo.com") and Website (Repo)); diff --git a/src/alire-index.ads b/src/alire-index.ads index fe49a48c..32e3bab6 100644 --- a/src/alire-index.ads +++ b/src/alire-index.ads @@ -3,10 +3,12 @@ private with Alire_Early_Elaboration; pragma Unreferenced (Alire_Early_Elaborati with Alire.Containers; with Alire.Compilers; with Alire.Dependencies.Vectors; +with Alire.Licensing; with Alire.Operating_Systems; with Alire.Origins; with Alire.Properties; with Alire.Properties.Labeled; +with Alire.Properties.Licenses; with Alire.Releases; with Alire.Requisites; with Alire.Requisites.Platform; @@ -88,8 +90,12 @@ package Alire.Index is function Maintainer is new Properties.Labeled.Generic_New_Label (Properties.Labeled.Maintainer); function Website is new Properties.Labeled.Generic_New_Label (Properties.Labeled.Website); + function License (L : Licensing.Licenses) return Properties.Property'Class is + (Properties.Licenses.Values.New_Property (L)); + use all type Alire.Dependencies.Vectors.Vector; use all type Compilers.Compilers; + use all type Licensing.Licenses; use all type Operating_Systems.Operating_Systems; use all type Properties.Property'Class; use all type Requisites.Requisite'Class; @@ -109,7 +115,7 @@ package Alire.Index is -- Specific shortcuts: function Compiler_Is_At_Least (V : Compilers.Compilers) return Requisites.Requisite'Class - renames Requisites.Platform.Compiler_Is_At_Least; + renames Requisites.Platform.Compiler_Is_At_Least; function System_is (V : Operating_Systems.Operating_Systems) return Requisites.Requisite'Class renames Requisites.Platform.System_Is; diff --git a/src/alire-licensing.ads b/src/alire-licensing.ads new file mode 100644 index 00000000..a60a7e60 --- /dev/null +++ b/src/alire-licensing.ads @@ -0,0 +1,41 @@ +package Alire.Licensing with Preelaborate is + + -- From https://github.com/github/choosealicense.com + + type Licenses is (AFL_3_0, + AGPL_3_0, + Apache_2_0, + Artistic_2_0, + BSD_2_Clause, + BSD_3_Clause_Clear, + BSD_3_Clause, + BSL_1_0, + CC0_1_0, + CC_BY_4_0, + CC_BY_SA_4_0, + ECL_2_0, + EPL_1_0, + EPL_2_0, + EUPL_1_1, + EUPL_1_2, + GPL_2_0, + GPL_3_0, + ISC, + LGPL_2_1, + LGPL_3_0, + LPPL_1_3c, + MIT, + MPL_2_0, + MS_PL, + MS_RL, + NCSA, + OFL_1_1, + OSL_3_0, + PostgreSQL, + Unlicense, + WTFPL, + Zlib, + Public_Domain, + Unknown); + +end Alire.Licensing; diff --git a/src/alire-properties-licenses.ads b/src/alire-properties-licenses.ads new file mode 100644 index 00000000..3f48d89b --- /dev/null +++ b/src/alire-properties-licenses.ads @@ -0,0 +1,15 @@ +with Alire.Licensing; + +package Alire.Properties.Licenses is + + function Image (L : Licensing.Licenses) return String; + + package Values is new Properties.Values (Alire.Licensing.Licenses, + Image); + +private + + function Image (L : Licensing.Licenses) return String is + ("License: " & L'Image); + +end Alire.Properties.Licenses;