diff --git a/deps/semver b/deps/semver index 2937c650..ebf71f00 160000 --- a/deps/semver +++ b/deps/semver @@ -1 +1 @@ -Subproject commit 2937c650511ad3c87af64be963eca7eba7aebb68 +Subproject commit ebf71f00daba91489238f79819078a37e36be188 diff --git a/index/alire-index-semantic_versioning.ads b/index/alire-index-semantic_versioning.ads index 5c49a1e4..7178b58f 100644 --- a/index/alire-index-semantic_versioning.ads +++ b/index/alire-index-semantic_versioning.ads @@ -4,6 +4,11 @@ package Alire.Index.Semantic_Versioning is Repo : constant URL := "https://github.com/alire-project/semantic_versioning.git"; + V_0_3 : constant Release := Project.Register + (V ("0.3"), + Git (Repo, "ebf71f00daba91489238f79819078a37e36be188")); + + V_0_2 : constant Release := Project.Register (V ("0.2"), Git (Repo, "2937c650511ad3c87af64be963eca7eba7aebb68")); diff --git a/index/alire-projects.ads b/index/alire-projects.ads index 6cadadac..3a2fba53 100644 --- a/index/alire-projects.ads +++ b/index/alire-projects.ads @@ -32,6 +32,7 @@ package Alire.Projects with Preelaborate is Globe_3D, GLUT, + GNAT, GtkAda, ------- @@ -132,6 +133,8 @@ package Alire.Projects with Preelaborate is "GL Object Based Engine for 3D in Ada", when GLUT => "OpenGL Utility Toolkit", + when GNAT => + "GNU Ada compiler (platform package)", when GtkAda => "Ada binding for the GTK+ GUI", diff --git a/index/native/alire-index-gnat.ads b/index/native/alire-index-gnat.ads new file mode 100644 index 00000000..6b13eb78 --- /dev/null +++ b/index/native/alire-index-gnat.ads @@ -0,0 +1,19 @@ +package Alire.Index.GNAT is + + function Project is new Catalogued_Project (Projects.GNAT); + + -- If minor versions proved important they could be segregated with platform-specific knowledge + + V_8 : constant Release := + Project.Register + (V ("8"), + Native ((Debian | Ubuntu => Packaged_As ("gnat-8"), + others => Unavailable))); + + V_7 : constant Release := + Project.Register + (V ("7"), + Native ((Debian | Ubuntu => Packaged_As ("gnat-7"), + others => Unavailable))); + +end Alire.Index.GNAT; diff --git a/index/native/alire-index-gtkada.ads b/index/native/alire-index-gtkada.ads index b5cd207d..cdb375a1 100644 --- a/index/native/alire-index-gtkada.ads +++ b/index/native/alire-index-gtkada.ads @@ -1,3 +1,5 @@ +with Alire.Index.GNAT; + package Alire.Index.GtkAda is function Project is new Catalogued_Project (Projects.GtkAda); @@ -8,8 +10,8 @@ package Alire.Index.GtkAda is Native ((Debian | Ubuntu => Packaged_As ("libgtkada16.1.0-dev"), others => Unavailable)), - Available_When => Compiler_Is_Native - -- Unfortunately packaged libs can't be used with non-platform compilers due to .ali clashes + Dependencies => + GNAT.Project >= GNAT.V_7 ); end Alire.Index.GtkAda; diff --git a/index/native/alire-index-native_template.ads b/index/native/alire-index-native_template.ads index cd5c2455..39fe838c 100644 --- a/index/native/alire-index-native_template.ads +++ b/index/native/alire-index-native_template.ads @@ -1,8 +1,9 @@ package Alire.Index.Native_Template is +-- function Project is new Catalogued_Project (Projects.Name); + -- V : constant Release := --- Register (Projects.Name --- V (""), +-- Project.Register (V (""), -- Native ((Debian | Ubuntu => Packaged_As (""), -- others => Unavailable))); diff --git a/index/native/alire-index-ncursesada.ads b/index/native/alire-index-ncursesada.ads index 895d2f68..69a3f51e 100644 --- a/index/native/alire-index-ncursesada.ads +++ b/index/native/alire-index-ncursesada.ads @@ -1,3 +1,5 @@ +with Alire.Index.GNAT; + package Alire.Index.NcursesAda is function Project is new Catalogued_Project (Projects.NcursesAda); @@ -8,8 +10,8 @@ package Alire.Index.NcursesAda is Native ((Debian | Ubuntu => Packaged_As ("libncursesada5-dev"), others => Unavailable)), - Available_When => Compiler_Is_Native - -- Unfortunately packaged libs can't be used with non-platform compilers due to .ali clashes + Dependencies => + GNAT.Project >= GNAT.V_7 ); V_3 : constant Release := @@ -18,6 +20,8 @@ package Alire.Index.NcursesAda is Native ((Debian | Ubuntu => Packaged_As ("libncursesada3-dev"), others => Unavailable)), - Available_When => Compiler_Is_Native); + Dependencies => + GNAT.Project >= GNAT.V_7 + ); end Alire.Index.NcursesAda; diff --git a/src/alire-index.ads b/src/alire-index.ads index 402d5d40..55e0acbd 100644 --- a/src/alire-index.ads +++ b/src/alire-index.ads @@ -143,6 +143,7 @@ package Alire.Index is renames Semver.Relaxed; use Versions.Expressions; + use Versions.Expressions_With_Versioned; function Unavailable return Release_Dependencies; -- A never available release @@ -252,7 +253,7 @@ package Alire.Index is package Plat_Reqs renames Requisites.Platform; function Compiler is new Requisites.Platform.Compilers.Factory; - function Compiler_Is_Native return Release_Requisites renames Plat_Reqs.Compiler_Is_Native; +-- function Compiler_Is_Native return Release_Requisites renames Plat_Reqs.Compiler_Is_Native; use all type Requisites.Platform.Compilers.Comparable; function Distribution is new Requisites.Platform.Distributions.Factory; diff --git a/src/alire-platforms.ads b/src/alire-platforms.ads index 3cc621bb..383a9499 100644 --- a/src/alire-platforms.ads +++ b/src/alire-platforms.ads @@ -4,36 +4,37 @@ package Alire.Platforms with Preelaborate is type Compilers is (GNAT_Unknown, GNAT_FSF_7_2, + GNAT_FSF_7_3, GNAT_GPL_2017); type Operating_Systems is (GNU_Linux, Windows, - Unsupported); + OS_Unknown); type Distributions is (Debian, Ubuntu, - Unsupported); + Distro_Unknown); type Versions is (Debian_Buster, Ubuntu_Xenial, Ubuntu_Yakkety, Ubunty_Zesty, Ubuntu_Artful, - Unsupported); + Distro_Version_Unsupported); -- Known flavors of OSs -- It turns out that Debian uses no numbers for its non-stable releases, so we'll prefer the codename -- Not really used very much for now type Word_Sizes is (Bits_32, Bits_64, - Unsupported); + Bits_Unknown); type Package_Managers is (Apt, - Unsupported); + Packager_Unknown); function Package_Manager (D : Distributions) return Package_Managers is (case D is when Debian | Ubuntu => Apt, - when others => Unsupported); + when others => Packager_Unknown); end Alire.Platforms; diff --git a/src/alire-requisites-platform.ads b/src/alire-requisites-platform.ads index 66e6c4f9..5fba051e 100644 --- a/src/alire-requisites-platform.ads +++ b/src/alire-requisites-platform.ads @@ -25,8 +25,8 @@ package Alire.Requisites.Platform with Preelaborate is use all type Compilers.Comparable; function Compiler is new Compilers.Factory; - function Compiler_Is_Native return Tree is - (Compiler < GNAT_GPL_2017 and Compiler /= GNAT_Unknown); +-- function Compiler_Is_Native return Tree is +-- (Compiler < GNAT_GPL_2017 and Compiler /= GNAT_Unknown); package Distributions is new Comparables (Ps.Distributions, Ps."<", Ps.Distributions'Image, diff --git a/src/alire-versions.ads b/src/alire-versions.ads index 078f9a05..60ba08dd 100644 --- a/src/alire-versions.ads +++ b/src/alire-versions.ads @@ -14,6 +14,8 @@ package Alire.Versions with Preelaborate is function Version (V : Versioned) return Semantic_Versioning.Version is abstract; + function Version_Classwide (V : Versioned'Class) return Semantic_Versioning.Version is (V.Version); + function This_Version (V : Versioned'Class) return Conditional.Dependencies; function Within_Major (V : Versioned'Class) return Conditional.Dependencies; function Within_Minor (V : Versioned'Class) return Conditional.Dependencies; @@ -31,6 +33,9 @@ package Alire.Versions with Preelaborate is Conditional.Dependencies, New_Dependency_Classwide); + package Expressions_With_Versioned is new Expressions.Against (Versioned'Class, + Version_Classwide); + private use Semantic_Versioning;