Removed all source code files
This commit is contained in:
committed by
Alejandro R Mosteo
parent
f3cf5858dd
commit
4d69109e18
@@ -1,31 +0,0 @@
|
||||
with "aaa";
|
||||
with "semantic_versioning";
|
||||
with "simple_logging";
|
||||
|
||||
project Alire is
|
||||
|
||||
for Source_Dirs use ("index", "index/**", "src");
|
||||
for Object_Dir use "obj";
|
||||
|
||||
package Pretty_Printer is
|
||||
for Switches ("ada") use ("--no-separate-is");
|
||||
end Pretty_Printer;
|
||||
|
||||
package Builder is
|
||||
for Switches ("ada") use ("-s", "-m", "-j0", "-g");
|
||||
end Builder;
|
||||
|
||||
package Compiler is
|
||||
for Switches ("ada") use ("-gnatwa", "-gnatVa", "-g", "-O2", "-gnat12",
|
||||
"-gnato", "-fstack-check", "-gnata", "-fPIC");
|
||||
end Compiler;
|
||||
|
||||
package Binder is
|
||||
for Switches ("ada") use ("-Es");
|
||||
end Binder;
|
||||
|
||||
package Ide is
|
||||
for Vcs_Kind use "Git";
|
||||
end Ide;
|
||||
|
||||
end Alire;
|
||||
@@ -1,10 +0,0 @@
|
||||
aggregate project Alire_Env is
|
||||
|
||||
for Project_Path use (
|
||||
"deps/aaa",
|
||||
"deps/semver",
|
||||
"deps/simple_logging");
|
||||
|
||||
for Project_Files use ("alire.gpr");
|
||||
|
||||
end Alire_Env;
|
||||
@@ -1,18 +0,0 @@
|
||||
package Alire.Index.AAA is
|
||||
|
||||
function Project is new Catalogued_Project
|
||||
("Alex's Ada Assortment (of miscellaneous utilities)");
|
||||
|
||||
Repo : constant URL := "https://github.com/mosteo/aaa.git";
|
||||
|
||||
Base : constant Release :=
|
||||
Project.Unreleased
|
||||
(Properties =>
|
||||
Author ("alejandro@mosteo.com") and
|
||||
License (LGPL_3_0));
|
||||
|
||||
package V_1_0_0 is new Project_Release
|
||||
(Base
|
||||
.Replacing (Git (Repo, "3b263b6cb858c1ca0043674d21ae3e618c4026e2")));
|
||||
|
||||
end Alire.Index.AAA;
|
||||
@@ -1,33 +0,0 @@
|
||||
with Alire.Index.Liblua;
|
||||
|
||||
package Alire.Index.Ada_Lua is
|
||||
|
||||
function Project is new Catalogued_Project ("An Ada binding for Lua");
|
||||
|
||||
Prj_Repo : constant URL := "https://github.com/alire-project/ada-lua.git";
|
||||
Prj_Maintainer : constant String := "AdaCore";
|
||||
Prj_Website : constant URL := "https://github.com/AdaCore/ada-lua";
|
||||
|
||||
V_0_0_0 : constant Release :=
|
||||
Project.Register
|
||||
(V ("0.0.0-5.3"),
|
||||
Git (Prj_Repo, "ba2fcbf9f8d54d3f6362f20523deb4371371f658"),
|
||||
|
||||
Dependencies =>
|
||||
Liblua.V_5_3.Within_Major,
|
||||
|
||||
Properties =>
|
||||
Project_File ("lua.gpr") and
|
||||
|
||||
Executable ("main") and
|
||||
|
||||
Maintainer (Prj_Maintainer) and
|
||||
Website (Prj_Website) and
|
||||
License (GPL_3_0),
|
||||
|
||||
Private_Properties =>
|
||||
Project_File ("examples/example1/example1.gpr") and
|
||||
Project_File ("examples/example2/example2.gpr")
|
||||
);
|
||||
|
||||
end Alire.Index.Ada_Lua;
|
||||
@@ -1,55 +0,0 @@
|
||||
with Alire.Index.NcursesAda;
|
||||
|
||||
package Alire.Index.Adacurses is
|
||||
|
||||
function Project is
|
||||
new Catalogued_Project ("Wrapper on different packagings of NcursesAda");
|
||||
|
||||
Repo : constant String := "https://github.com/alire-project/adacurses-wrapper.git";
|
||||
-- This is the wrapper around native packages
|
||||
|
||||
Repo_Src : constant String := "https://github.com/alire-project/adacurses.git";
|
||||
-- This is the actual source
|
||||
|
||||
Comments : constant Conditional.Properties :=
|
||||
Comment ("AdaCurses is the project name used by upstream, thus adacurses.gpr") and
|
||||
Comment ("However, some distros (e.g., Debian family) use ncursesada.gpr") and
|
||||
Comment ("This package wraps these differences so clients can always safely use adacurses");
|
||||
|
||||
Base : constant Release := Project.Unreleased
|
||||
(Properties =>
|
||||
Comments and
|
||||
Author ("Thomas E. Dickey") and
|
||||
Website ("http://invisible-island.net/ncurses/ncurses-Ada95.html"));
|
||||
|
||||
-- package V_6_1 is new Project_Release
|
||||
-- (Base
|
||||
-- .Replacing
|
||||
-- (Git (Repo_Src, "fa61672dbb457fcd1dcc38da6f1d0681aaf0cd39"))
|
||||
-- .Extending
|
||||
-- (Private_Properties =>
|
||||
-- Action_Run (Post_Fetch, "./configure") and
|
||||
-- Action_Run (Post_Fetch, "make"),
|
||||
--
|
||||
-- Available =>
|
||||
-- Operating_System = GNU_Linux));
|
||||
|
||||
package V_6 is new Project_Release
|
||||
(Base
|
||||
.Replacing
|
||||
(Git (Repo, "4ccb20409becb50c0b5fd29effb676b650608326"))
|
||||
.Extending
|
||||
(Case_Distribution_Is
|
||||
((Debian | Ubuntu => NcursesAda.V_6.Within_Major,
|
||||
others => Unavailable))));
|
||||
|
||||
package V_5 is new Project_Release
|
||||
(Base
|
||||
.Replacing
|
||||
(Git (Repo, "4ccb20409becb50c0b5fd29effb676b650608326"))
|
||||
.Extending
|
||||
(Case_Distribution_Is
|
||||
((Debian | Ubuntu => NcursesAda.V_5.Within_Major,
|
||||
others => Unavailable))));
|
||||
|
||||
end Alire.Index.Adacurses;
|
||||
@@ -1,70 +0,0 @@
|
||||
with Alire.Index.AUnit;
|
||||
with Alire.Index.Simple_Components;
|
||||
|
||||
package Alire.Index.AdaYaml is
|
||||
|
||||
function Project is
|
||||
new Catalogued_Project ("Experimental YAML 1.3 implementation in Ada");
|
||||
|
||||
Prj_Repo : constant URL := "https://github.com/yaml/AdaYaml.git";
|
||||
Prj_Author : constant String := "Felix Krause";
|
||||
Prj_Website : constant URL := "https://ada.yaml.io/";
|
||||
|
||||
Base : constant Release :=
|
||||
Project.Unreleased
|
||||
(Dependencies =>
|
||||
AUnit.Project >= AUnit.V_2017,
|
||||
|
||||
Properties =>
|
||||
Project_File ("yaml.gpr") and
|
||||
Project_File ("yaml-utils.gpr") and
|
||||
|
||||
GPR_Scenario ("Mode", "debug" or "release") and
|
||||
|
||||
Author (Prj_Author) and
|
||||
Website (Prj_Website) and
|
||||
License (MIT),
|
||||
|
||||
Private_Properties =>
|
||||
Project_File ("yaml-tests.gpr"));
|
||||
|
||||
package V_0_3 is new Project_Release
|
||||
(Base
|
||||
.Replacing (Git (Prj_Repo, "2017a7c2523499c03b8d7fe06546a5a8bae6476d"))
|
||||
.Extending (Properties =>
|
||||
Project_File ("yaml-annotation_processor.gpr"),
|
||||
Private_Properties =>
|
||||
Executable ("yaml-dumping_tests-harness") and
|
||||
Executable ("yaml-loading_tests-harness") and
|
||||
Executable ("yaml-transformation_tests-harness")));
|
||||
|
||||
package V_0_2 is new Project_Release
|
||||
(Base
|
||||
.Replacing (Git (Prj_Repo, "0264b03fd92eeedfe3e2713ed1da3f0d255c1727"))
|
||||
.Extending (Private_Properties =>
|
||||
Executable ("yaml-lexer-harness") and
|
||||
Executable ("yaml-parser-harness")));
|
||||
|
||||
------------
|
||||
-- Server --
|
||||
------------
|
||||
|
||||
package Server is
|
||||
|
||||
function Project is new Catalogued_Project
|
||||
("Experimental YAML 1.3 implementation in Ada (server component)");
|
||||
|
||||
V_0_3 : constant Release :=
|
||||
Project.Register
|
||||
(AdaYaml.V_0_3.Release
|
||||
.Extending
|
||||
(Properties =>
|
||||
Project_File ("yaml-server.gpr") and
|
||||
Executable ("yaml-server"),
|
||||
|
||||
Dependencies =>
|
||||
Simple_Components.Connections.V_4_27.Within_Major));
|
||||
|
||||
end Server;
|
||||
|
||||
end Alire.Index.AdaYaml;
|
||||
@@ -1,27 +0,0 @@
|
||||
with Alire.Index.Libgsl;
|
||||
|
||||
package Alire.Index.Agpl is
|
||||
|
||||
function Project is new Catalogued_Project
|
||||
("Ada General Purpose Library with a robotics flavor");
|
||||
|
||||
Repo : constant URL := "https://github.com/mosteo/agpl.git";
|
||||
|
||||
Base : constant Release :=
|
||||
Project.Unreleased
|
||||
(Dependencies =>
|
||||
Libgsl.Project.Current,
|
||||
Properties =>
|
||||
GPR_Scenario ("Agpl_Include_Concorde", "True" or "False") and
|
||||
GPR_Scenario ("Agpl_Include_Db", "True" or "False") and
|
||||
GPR_Scenario ("Agpl_Include_Boost", "True" or "False") and
|
||||
GPR_Scenario ("Agpl_Include_PngIO", "True" or "False") and
|
||||
|
||||
Author ("alejandro@mosteo.com") and
|
||||
License (LGPL_3_0));
|
||||
|
||||
package V_1_0_0 is new Project_Release
|
||||
(Base
|
||||
.Replacing (Git (Repo, "00ac879f8d049171206699da39ac01f126b196e0")));
|
||||
|
||||
end Alire.Index.Agpl;
|
||||
@@ -1,22 +0,0 @@
|
||||
with Alire.Index.XML_EZ_Out;
|
||||
|
||||
package Alire.Index.AJUnitGen is
|
||||
|
||||
function Project is new Catalogued_Project
|
||||
("Generator of JUnit-compatible XML reports");
|
||||
|
||||
Repo : constant URL := "https://github.com/mosteo/ajunitgen.git";
|
||||
|
||||
Base : constant Release :=
|
||||
Project.Unreleased
|
||||
(Properties =>
|
||||
Author ("Alejandro R. Mosteo") and
|
||||
License (LGPL_3_0),
|
||||
Dependencies =>
|
||||
XML_EZ_Out.V_1_6.Within_Major);
|
||||
|
||||
package V_1_0_0 is new Project_Release
|
||||
(Base
|
||||
.Replacing (Git (Repo, "d2d110f92b8175ace6668dfdb639ea10ece5a822")));
|
||||
|
||||
end Alire.Index.AJUnitGen;
|
||||
@@ -1,176 +0,0 @@
|
||||
with Alire.Index.AAA;
|
||||
with Alire.Index.Semantic_Versioning;
|
||||
with Alire.Index.Simple_Logging;
|
||||
|
||||
package Alire.Index.Alire is
|
||||
|
||||
function Project is
|
||||
new Catalogued_Project ("Alire project catalog and support files");
|
||||
|
||||
Repo : constant URL := "https://github.com/alire-project/alire.git";
|
||||
|
||||
Base : constant Release :=
|
||||
Project.Unreleased
|
||||
(V ("0.0"),
|
||||
No_Origin,
|
||||
Properties =>
|
||||
Author ("Alejandro R. Mosteo") and
|
||||
License (GPL_3_0));
|
||||
|
||||
package V_0_6 is new Project_Release
|
||||
(Base
|
||||
.Replacing (Origin =>
|
||||
Git (Repo, "f418890a85f421b20ad00f1f52259c122f883aca"))
|
||||
.Extending (Dependencies =>
|
||||
AAA.V_1_0_0.Within_Major and
|
||||
Semantic_Versioning.V_0_3_2.Within_Minor and
|
||||
Simple_Logging.V_1_0.Within_Major));
|
||||
|
||||
package V_0_5 is new Project_Release
|
||||
(Base
|
||||
.Replacing (Origin =>
|
||||
Git (Repo, "ff4f75f938a22173b8296efb21e112eb63865882"))
|
||||
.Extending (Dependencies =>
|
||||
Semantic_Versioning.V_0_3_2.Within_Minor and
|
||||
Simple_Logging.V_1_0.Within_Major));
|
||||
|
||||
-- Old-style early releases
|
||||
|
||||
V_0_4 : constant Release :=
|
||||
Project.Register
|
||||
(Base
|
||||
.Upgrading
|
||||
(V ("0.4"),
|
||||
Git (Repo, "219cdcbc5f26efca331400582026c6377ef0f794"))
|
||||
.Extending
|
||||
(Dependencies =>
|
||||
Semantic_Versioning.V_0_3_1.Within_Minor and
|
||||
Simple_Logging.V_1_0.Within_Major));
|
||||
|
||||
V_0_2 : constant Release :=
|
||||
Project.Register
|
||||
(Base
|
||||
.Upgrading
|
||||
(V ("0.2"),
|
||||
Git (Repo, "5ba81ba33dfeb184b2e644ef2996200b5fdd6ae4"))
|
||||
.Extending
|
||||
(Dependencies =>
|
||||
Semantic_Versioning.V_0_3.Within_Minor and
|
||||
Simple_Logging.V_1_0.Within_Major));
|
||||
|
||||
V_0_1_2 : constant Release :=
|
||||
Project.Register
|
||||
(Base
|
||||
.Upgrading
|
||||
(V ("0.1.2"),
|
||||
Git (Repo, "e2dee2e147ae9e4d666567b53b108cbe61bc06e8"))
|
||||
.Extending
|
||||
(Dependencies =>
|
||||
Semantic_Versioning.V_0_1_2.Within_Minor and
|
||||
Simple_Logging.V_1_0.Within_Major));
|
||||
|
||||
function Example_Project return Catalog_Entry renames Project;
|
||||
function Elite_Dangerous return Catalog_Entry renames Project;
|
||||
function Half_Life return Catalog_Entry renames Project;
|
||||
function Star_Citizen return Catalog_Entry renames Project;
|
||||
function Windows_3000 return Catalog_Entry renames Project;
|
||||
|
||||
Syntax_Example : constant Release :=
|
||||
Example_Project.Unreleased
|
||||
(V ("0.0.1"),
|
||||
Origins.New_Filesystem ("/alire"),
|
||||
Notes => "Mock release with examples of complex conditions",
|
||||
Dependencies =>
|
||||
Half_Life >= "3.0" and -- unconditional
|
||||
On_Condition -- conditional
|
||||
(Operating_System = GNU_Linux,
|
||||
When_True => Elite_Dangerous >= "2.0" and Star_Citizen >= V ("3.0"), -- Wish...
|
||||
When_False => Windows_3000 > V ("1.0")) and
|
||||
(Star_Citizen >= "4.0" or Half_Life >= "3.0"),
|
||||
-- Chained preferences, takes first available
|
||||
|
||||
Private_Properties => -- These are only interesting to alr, not users
|
||||
GPR_External ("Profile", "False"),
|
||||
-- Sample extra params for build
|
||||
|
||||
Properties =>
|
||||
GPR_Scenario ("Build", "Debug" or "Release") and
|
||||
GPR_Free_Scenario ("Path_To_Something") and
|
||||
-- Known scenario variables
|
||||
|
||||
Project_File ("scenarios/catastrophical.gpr") and
|
||||
-- Way to specify a project file not named like the project
|
||||
-- Path separators are always "/" and internally converted to native ones
|
||||
|
||||
On_Condition
|
||||
(Operating_System = Windows,
|
||||
Project_File ("project_win.gpr")) and
|
||||
On_Condition
|
||||
(Operating_System = GNU_Linux,
|
||||
On_Condition (Distribution = Ubuntu, -- Nested conditions
|
||||
Project_File ("project_ubuntu.gpr"))) and
|
||||
-- Conditional project file
|
||||
|
||||
On_Condition
|
||||
(Operating_System = GNU_Linux,
|
||||
Comment ("Long life the penguin")) and
|
||||
-- Conditions on operating system
|
||||
|
||||
Case_Operating_System_Is
|
||||
((GNU_Linux => Comment ("Longerer life to the penguin"),
|
||||
OSX => Comment ("Oh shiny!"),
|
||||
others => Comment ("Pick your poison"))) and
|
||||
-- Also as Case-like statements
|
||||
|
||||
On_Condition
|
||||
(Compiler = GNAT_Unknown, -- /= also works
|
||||
Comment ("Never saw that compiler") and Comment ("But I would like to")) and
|
||||
-- Conditions on compiler version
|
||||
|
||||
On_Condition
|
||||
(Distro_Release = Ubuntu_Bionic,
|
||||
When_True => Comment ("Living on the edge"),
|
||||
When_False => Comment ("I am a rock")) and
|
||||
-- Conditions on distribution release
|
||||
|
||||
Comment ("Tell me about your mother") and
|
||||
Website ("http://www.www.www"),
|
||||
-- Unconditional properties
|
||||
|
||||
Available_When => -- Impossible mix
|
||||
(Operating_System = Windows and Operating_System /= GNU_Linux) or
|
||||
(Compiler = GNAT_Unknown and Compiler /= GNAT_Unknown));
|
||||
|
||||
-- package Experimental is
|
||||
--
|
||||
-- function Project is new Catalogued_Project ("Experimental packages");
|
||||
--
|
||||
-- Base : constant Release := Project.Unreleased;
|
||||
--
|
||||
-- package V1 is new Project_Release (Base);
|
||||
-- package V2 is new Project_Release (Base);
|
||||
-- package V3 is new Project_Release (Base);
|
||||
--
|
||||
-- package Greedy_Breaker is
|
||||
--
|
||||
-- function Project is new Catalogued_Project
|
||||
-- ("Dependency too complex for the greedy solver");
|
||||
--
|
||||
-- R1 : constant Release := Project.Register
|
||||
-- (V ("1"),
|
||||
-- No_Origin,
|
||||
-- Dependencies =>
|
||||
-- (V2.This_Version -- This causes V2 to be chosen greedily
|
||||
-- or V3.This_Version) -- This will never be attempted
|
||||
-- and V3.This_Version); -- And thus this will never be met
|
||||
--
|
||||
-- R2 : constant Release := Project.Register
|
||||
-- (V ("2"),
|
||||
-- No_Origin,
|
||||
-- Dependencies =>
|
||||
-- (V1.This_Version or V2.This_Version or V3.This_Version));
|
||||
-- end Greedy_Breaker;
|
||||
--
|
||||
-- end Experimental;
|
||||
|
||||
end Alire.Index.Alire;
|
||||
@@ -1,70 +0,0 @@
|
||||
with Alire.Index.AJUnitGen;
|
||||
with Alire.Index.Alire;
|
||||
with Alire.Index.XML_EZ_Out;
|
||||
|
||||
package Alire.Index.Alr is
|
||||
|
||||
function Project is
|
||||
new Catalogued_Project ("Command-line tool from the Alire project");
|
||||
|
||||
Repo : constant URL := "https://github.com/alire-project/alr.git";
|
||||
|
||||
Base : constant Release :=
|
||||
Project.Unreleased
|
||||
(Dependencies =>
|
||||
No_Dependencies,
|
||||
-- Transitive dependencies via Alire can be omitted, because there is
|
||||
-- no way that Alr can be deployed before Alire
|
||||
|
||||
Properties =>
|
||||
Author ("Alejandro R. Mosteo") and
|
||||
License (GPL_3_0));
|
||||
|
||||
package V_0_6 is new Project_Release
|
||||
(Base
|
||||
.Replacing
|
||||
(Origin => Git (Repo, "7686e42addf0a341a72383572555c75ad0516a4e"))
|
||||
.Extending
|
||||
(Dependencies =>
|
||||
Alire .V_0_6 .Within_Minor and
|
||||
AJUnitGen .V_1_0_0 .Within_Major));
|
||||
|
||||
package V_0_5 is new Project_Release
|
||||
(Base
|
||||
.Replacing
|
||||
(Origin => Git (Repo, "d26955fbfd8ef8b301791ab554113af1c6d46365"))
|
||||
.Extending
|
||||
(Dependencies =>
|
||||
Alire .V_0_5 .Within_Minor and
|
||||
AJUnitGen.V_1_0_0.Within_Major
|
||||
));
|
||||
|
||||
package V_0_4 is new Project_Release
|
||||
(Base
|
||||
.Replacing (Git (Repo, "721d111225cf30b9c298ff23587664510f4c4ea1"))
|
||||
.Extending
|
||||
(Dependencies =>
|
||||
Alire.V_0_4.Within_Minor and
|
||||
XML_EZ_Out.V_1_6.Within_Minor));
|
||||
|
||||
V_0_2 : constant Release :=
|
||||
Project.Register
|
||||
(Base
|
||||
.Upgrading
|
||||
(V ("0.2"),
|
||||
Git (Repo, "481a22aceb07242cabaefedbb41b2d6fe7a8bd1e"))
|
||||
.Extending
|
||||
(Dependencies =>
|
||||
Alire.V_0_2.Within_Minor));
|
||||
|
||||
V_0_1_2 : constant Release :=
|
||||
Project.Register
|
||||
(Base
|
||||
.Upgrading
|
||||
(V ("0.1.2"),
|
||||
Git (Repo, "4002536beea8aee12b455077df4dd144b409bde4"))
|
||||
.Extending
|
||||
(Dependencies =>
|
||||
Alire.V_0_1_2.Within_Minor));
|
||||
|
||||
end Alire.Index.Alr;
|
||||
@@ -1,25 +0,0 @@
|
||||
package Alire.Index.APQ is
|
||||
|
||||
function Project is
|
||||
new Catalogued_Project ("APQ Ada95 Database Library (core)");
|
||||
|
||||
Repo : constant URL := "https://github.com/alire-project/apq.git";
|
||||
|
||||
V_3_2_0 : constant Release :=
|
||||
Project.Register
|
||||
(V ("3.2.0"),
|
||||
Git (Repo, "3b5b4b99f528f853e02abf239da7db3d8c9962b4"),
|
||||
Properties =>
|
||||
Project_File ("apq.gpr") and
|
||||
|
||||
GPR_Scenario ("OS", "Windows_NT" or "GNU/Linux" or "Darwin") and
|
||||
GPR_Scenario ("DEBUG", "true" or "false") and
|
||||
|
||||
License (GMGPL_2_0) and
|
||||
License (GMGPL_3_0),
|
||||
|
||||
Private_Properties =>
|
||||
Project_File ("samples/apq-samples.gpr")
|
||||
);
|
||||
|
||||
end Alire.Index.APQ;
|
||||
@@ -1,66 +0,0 @@
|
||||
with Alire.Index.Make;
|
||||
|
||||
package Alire.Index.ASIS is
|
||||
|
||||
function Project is
|
||||
new Catalogued_Project
|
||||
("Ada Semantic Interface Specification or ASIS (library part)");
|
||||
|
||||
Src_2018 : constant URL :=
|
||||
"http://mirrors.cdn.adacore.com/art/5b0819e0c7a447df26c27ab8";
|
||||
Src_2017 : constant URL :=
|
||||
"http://mirrors.cdn.adacore.com/art/591c45e2c7a447af2deecffb";
|
||||
|
||||
Common_Dependencies : constant Release_Dependencies :=
|
||||
Make.Project.Current;
|
||||
|
||||
Common_Properties : constant Release_Properties :=
|
||||
Maintainer ("AdaCore") and
|
||||
Website ("https://www.adacore.com/download/more") and
|
||||
License (GPL_3_0);
|
||||
|
||||
V_2018 : constant Release :=
|
||||
Project.Register
|
||||
(V ("2018"),
|
||||
Source_Archive
|
||||
(Src_2018,
|
||||
"asis-gpl-2018-20180524-src.tar.gz"),
|
||||
|
||||
Dependencies =>
|
||||
Common_Dependencies,
|
||||
|
||||
Properties =>
|
||||
Project_File ("asis-gpl-2018-src/asis.gpr") and
|
||||
Common_Properties,
|
||||
|
||||
Private_Properties =>
|
||||
Action_Run
|
||||
(Post_Fetch, "make setup-snames -C asis-gpl-2018-src"),
|
||||
|
||||
Available_When =>
|
||||
Compiler = GNAT_Community_2018
|
||||
);
|
||||
|
||||
V_2017 : constant Release :=
|
||||
Project.Register
|
||||
(V ("2017"),
|
||||
Source_Archive
|
||||
(Src_2017,
|
||||
"asis-gpl-2017-src.tar.gz"),
|
||||
|
||||
Dependencies =>
|
||||
Common_Dependencies,
|
||||
|
||||
Properties =>
|
||||
Project_File ("asis-gpl-2017-src/asis.gpr") and
|
||||
Common_Properties,
|
||||
|
||||
Private_Properties =>
|
||||
Action_Run
|
||||
(Post_Fetch, "make setup-snames -C asis-gpl-2017-src"),
|
||||
|
||||
Available_When =>
|
||||
Compiler = GNAT_Community_2018
|
||||
);
|
||||
|
||||
end Alire.Index.ASIS;
|
||||
@@ -1,48 +0,0 @@
|
||||
package Alire.Index.AUnit is
|
||||
|
||||
function Project is
|
||||
new Catalogued_Project ("Ada unit test framework");
|
||||
|
||||
Prj_Repo : constant URL := "https://github.com/alire-project/libaunit.git";
|
||||
|
||||
Common_Properties : constant Release_Properties :=
|
||||
Maintainer ("AdaCore") and
|
||||
Website ("https://www.adacore.com/download/more") and
|
||||
License (GPL_3_0);
|
||||
|
||||
V_2017 : constant Release :=
|
||||
Project.Register
|
||||
(V ("2017"),
|
||||
Git (Prj_Repo, "b66a41ceb35bfc81b9345655c5f46317a57de3b4"),
|
||||
Properties =>
|
||||
GPR_Scenario ("RUNTIME",
|
||||
"full" or "zfp" or "ravenscar" or "ravenscar-cert" or "cert") and
|
||||
|
||||
Project_File ("aunit.gpr") and
|
||||
|
||||
Executable ("aunit_harness") and
|
||||
Executable ("run-ppc-elf") and
|
||||
Executable ("test_liskov") and
|
||||
Executable ("test_calculator") and
|
||||
Executable ("test_math") and
|
||||
|
||||
Common_Properties,
|
||||
|
||||
Private_Properties =>
|
||||
Project_File ("test/aunit_tests.gpr") and
|
||||
|
||||
Project_File ("examples/calculator/harness.gpr") and
|
||||
Project_File ("examples/calculator/tested_lib/testlib.gpr") and
|
||||
Project_File ("examples/failures/harness.gpr") and
|
||||
Project_File ("examples/failures/tested_lib/testlib.gpr") and
|
||||
Project_File ("examples/liskov/harness.gpr") and
|
||||
Project_File ("examples/liskov/tested_lib/testlib.gpr") and
|
||||
Project_File ("examples/simple_test/harness.gpr") and
|
||||
Project_File ("examples/simple_test/tested_lib/testlib.gpr") and
|
||||
Project_File ("examples/test_caller/harness/harness.gpr") and
|
||||
Project_File ("examples/test_caller/tested_lib/testlib.gpr") and
|
||||
Project_File ("examples/test_fixture/harness.gpr") and
|
||||
Project_File ("examples/test_fixture/tested_lib/testlib.gpr")
|
||||
);
|
||||
|
||||
end Alire.Index.AUnit;
|
||||
@@ -1,18 +0,0 @@
|
||||
package Alire.Index.C_Strings is
|
||||
|
||||
function Project is new Catalogued_Project
|
||||
("Convenience subprograms to interact with C strings");
|
||||
|
||||
Repo : constant URL := "https://github.com/mosteo/cstrings.git";
|
||||
|
||||
Base : constant Release :=
|
||||
Project.Unreleased
|
||||
(Properties =>
|
||||
Author ("alejandro@mosteo.com") and
|
||||
License (LGPL_3_0));
|
||||
|
||||
package V_1_0_0 is new Project_Release
|
||||
(Base
|
||||
.Replacing (Git (Repo, "2bd507ca150d2c58e13ae98443614a3c85330cb5")));
|
||||
|
||||
end Alire.Index.C_Strings;
|
||||
@@ -1,23 +0,0 @@
|
||||
package Alire.Index.Deepend is
|
||||
|
||||
function Project is new Catalogued_Project
|
||||
("A suite of dynamic storage pools with subpool capabilities");
|
||||
|
||||
Repo : constant URL := "https://github.com/alire-project/deepend.git";
|
||||
|
||||
Base : constant Release :=
|
||||
Project.Unreleased
|
||||
(Properties =>
|
||||
Author ("Brad Moore") and
|
||||
Website ("https://sourceforge.net/projects/deepend/") and
|
||||
License (GPL_2_0));
|
||||
|
||||
package V_3_9 is new Project_Release
|
||||
(Base
|
||||
.Replacing
|
||||
(Git (Repo, "4491dcf36a9264110f9cd3876cdcd476f1fbf09d"))
|
||||
.Extending
|
||||
(Properties =>
|
||||
GPR_Scenario ("Ada_Mode", "95" or "2005" or "2012")));
|
||||
|
||||
end Alire.Index.Deepend;
|
||||
@@ -1,22 +0,0 @@
|
||||
with Alire.Index.C_Strings;
|
||||
|
||||
package Alire.Index.DL_Ada is
|
||||
|
||||
function Project is new Catalogued_Project ("Partial binding to libdl");
|
||||
|
||||
Repo : constant URL := "https://github.com/mosteo/dl-ada.git";
|
||||
|
||||
Base : constant Release :=
|
||||
Project.Unreleased
|
||||
(Dependencies =>
|
||||
C_Strings.V_1_0_0.Within_Major,
|
||||
Properties =>
|
||||
Project_File ("dl.gpr") and
|
||||
Author ("alejandro@mosteo.com") and
|
||||
License (LGPL_3_0));
|
||||
|
||||
package V_1_0_0 is new Project_Release
|
||||
(Base
|
||||
.Replacing (Git (Repo, "6e86754884e58908777070798645475fd47a4d0a")));
|
||||
|
||||
end Alire.Index.DL_Ada;
|
||||
@@ -1,28 +0,0 @@
|
||||
with Alire.Index.GtkAda;
|
||||
|
||||
package Alire.Index.Eagle_Lander is
|
||||
|
||||
function Project is
|
||||
new Catalogued_Project ("Apollo 11 lunar lander simulator (Ada/Gtk/Cairo)");
|
||||
|
||||
Prj_Repo : constant URL := "https://github.com/alire-project/eagle-lander.git";
|
||||
Prj_Author : constant String := "Fabien Chouteau";
|
||||
Prj_Website : constant URL := "https://blog.adacore.com/make-with-ada-the-eagle-has-landed";
|
||||
|
||||
V_1_0 : constant Release :=
|
||||
Project.Register
|
||||
(V ("1.0"),
|
||||
Git (Prj_Repo, "5a3bcc61eff4d60d2b741add7841410ce539d0b8"),
|
||||
|
||||
Dependencies =>
|
||||
GtkAda.V_17.Within_Major,
|
||||
|
||||
Properties =>
|
||||
Project_File ("lunar_lander.gpr") and
|
||||
|
||||
Author (Prj_Author) and
|
||||
Website (Prj_Website) and
|
||||
License (GPL_3_0)
|
||||
);
|
||||
|
||||
end Alire.Index.Eagle_Lander;
|
||||
@@ -1,50 +0,0 @@
|
||||
with Alire.Index.GLUT;
|
||||
|
||||
package Alire.Index.Globe_3D is
|
||||
|
||||
function Project is
|
||||
new Catalogued_Project ("GL Object Based Engine for 3D in Ada");
|
||||
|
||||
Prj_Repo : constant URL := "https://github.com/svn2github/GLOBE_3D.git";
|
||||
Prj_Author : constant String := "Gautier de Montmollin";
|
||||
Prj_Website : constant URL := "https://globe3d.sourceforge.io/";
|
||||
|
||||
V_20180111 : constant Release :=
|
||||
Project.Register
|
||||
(V ("20180111"),
|
||||
Git (Prj_Repo, "93f7185130e2fb0db7f1f7e67eaf1b6ca561d651"),
|
||||
|
||||
Dependencies =>
|
||||
GLUT.V_2_8_1.Within_Major,
|
||||
|
||||
Properties =>
|
||||
Project_File ("globe_3d.gpr") and
|
||||
|
||||
GPR_Scenario ("OS_Kind", "linux" or "macosx" or "win32") and
|
||||
|
||||
Executable ("globe_3d_demo") and
|
||||
Executable ("launch_armada") and
|
||||
Executable ("launch_multi_window") and
|
||||
Executable ("launch_sprite_demo") and
|
||||
Executable ("mini") and
|
||||
|
||||
Author (Prj_Author) and
|
||||
Website (Prj_Website) and
|
||||
License (Unknown),
|
||||
|
||||
Private_Properties =>
|
||||
Project_File ("demo/culler/armada/armada.gpr") and
|
||||
Project_File ("demo/globe_3d_demos.gpr") and
|
||||
Project_File ("demo/multi_window/multi_window.gpr") and
|
||||
Project_File ("demo/sprite/sprite_demo.gpr") and
|
||||
|
||||
On_Condition
|
||||
(Operating_System = GNU_Linux,
|
||||
GPR_External ("OS_Kind", "linux")),
|
||||
|
||||
Available_When =>
|
||||
Operating_System = GNU_Linux
|
||||
-- It's available in more platforms, but still untested and with unknown dependencies
|
||||
);
|
||||
|
||||
end Alire.Index.Globe_3D;
|
||||
@@ -1,90 +0,0 @@
|
||||
with Ada.Directories;
|
||||
|
||||
package Alire.Index.GNATCOLL is
|
||||
|
||||
function Project is new Catalogued_Project
|
||||
("GNAT Components Collection - Core packages");
|
||||
|
||||
Repo_AdaCore : constant URL := "https://github.com/AdaCore/gnatcoll-core.git";
|
||||
-- Upstream
|
||||
|
||||
Repo_Alire : constant URL := "https://github.com/alire-project/gnatcoll-core.git";
|
||||
-- For slim picks
|
||||
|
||||
Base : constant Release := Project.Unreleased
|
||||
(Properties =>
|
||||
Author ("AdaCore")
|
||||
and Maintainer ("alejandro@mosteo.com")
|
||||
and License (GPL_3_0)
|
||||
and GPR_Scenario ("GNATCOLL_ATOMICS",
|
||||
"intrinsic" or "mutex")
|
||||
and GPR_Scenario ("GNATCOLL_OS",
|
||||
"windows" or "unix" or "osx")
|
||||
and GPR_Scenario ("BUILD",
|
||||
"DEBUG" or "PROD")
|
||||
and GPR_Scenario ("LIBRARY_TYPE",
|
||||
"relocatable" or "static" or "static-pic"),
|
||||
Private_Properties =>
|
||||
GPR_External ("BUILD", "PROD") and
|
||||
GPR_External ("LIBRARY_TYPE", "static-pic") and
|
||||
Case_Operating_System_Is
|
||||
((GNU_Linux => GPR_External ("GNATCOLL_OS", "unix"),
|
||||
OSX => GPR_External ("GNATCOLL_OS", "osx"),
|
||||
Windows => GPR_External ("GNATCOLL_OS", "windows"),
|
||||
OS_Unknown => GPR_External ("GNATCOLL_OS", "ERROR"))));
|
||||
|
||||
package Regular is
|
||||
|
||||
package V_2018 is new Project_Release
|
||||
(Base
|
||||
.Renaming (GNATCOLL.Project)
|
||||
.Replacing (Source_Archive
|
||||
("http://mirrors.cdn.adacore.com/art/5b0819dfc7a447df26c27a99",
|
||||
"gnatcoll-core-gpl-2018-20180524-src.tar.gz"))
|
||||
.Extending
|
||||
(Properties => Project_File (Ada.Directories.Compose
|
||||
("gnatcoll-core-gpl-2018-src", "gnatcoll.gpr")),
|
||||
Available => Compiler >= GNAT_Community_2018));
|
||||
|
||||
end Regular;
|
||||
|
||||
package Slim is
|
||||
|
||||
function Project is new Catalogued_Project
|
||||
("GNAT Components Collection - Slim version (no dependencies)");
|
||||
|
||||
package V_20180425 is new Project_Release
|
||||
(Base
|
||||
.Renaming (GNATCOLL.Project)
|
||||
.Replacing (Git (Repo_Alire,
|
||||
"81bc37d7548fe40024eb0f647df65ec42f65443b")));
|
||||
|
||||
end Slim;
|
||||
|
||||
package Strings is
|
||||
|
||||
function Project is new Catalogued_Project
|
||||
("GNAT Components Collection - Strings only");
|
||||
|
||||
package V_20180425 is new Project_Release
|
||||
(Base
|
||||
.Renaming (GNATCOLL.Project)
|
||||
.Replacing (Git (Repo_Alire,
|
||||
"7823e31add7133b9fbc6e037d9986a823e840dc0")));
|
||||
|
||||
end Strings;
|
||||
|
||||
-- package Test is
|
||||
--
|
||||
-- function Project is new Catalogued_Project
|
||||
-- ("GNAT Components Collection - Testing renames");
|
||||
--
|
||||
-- package V_99999999 is new Project_Release
|
||||
-- (Base
|
||||
-- .Extending
|
||||
-- (Dependencies =>
|
||||
-- Slim.Project.Current));
|
||||
--
|
||||
-- end Test;
|
||||
|
||||
end Alire.Index.GNATCOLL;
|
||||
@@ -1,18 +0,0 @@
|
||||
package Alire.Index.Hangman is
|
||||
|
||||
function Project is
|
||||
new Catalogued_Project ("Hangman game for the console");
|
||||
|
||||
Prj_Repo : constant URL := "https://github.com/alire-project/Hangman.git";
|
||||
Prj_Author : constant String := "Jon Hollan, Mark Hoffman, & Brandon Ball";
|
||||
|
||||
V_1_0 : constant Release :=
|
||||
Project.Register
|
||||
(V ("1.0"),
|
||||
Git (Prj_Repo, "a57904920b81d72621aba434bf72e0175a12624d"),
|
||||
|
||||
Properties =>
|
||||
Executable ("hangmain") and
|
||||
Author (Prj_Author)
|
||||
);
|
||||
end Alire.Index.Hangman;
|
||||
@@ -1,22 +0,0 @@
|
||||
with Alire.Index.Libhello;
|
||||
|
||||
package Alire.Index.Hello is
|
||||
|
||||
function Project is
|
||||
new Catalogued_Project ("""Hello, world!"" demonstration project");
|
||||
|
||||
Repo : constant URL := "https://github.com/alire-project/hello.git";
|
||||
|
||||
V_1_0_0 : constant Release :=
|
||||
Project.Register
|
||||
(V ("1.0.0"),
|
||||
Git (Repo, "8cac0afddc505794ae3e5634745ce0830129d241"),
|
||||
Dependencies => Libhello.V_1_0.Within_Major);
|
||||
|
||||
V_1_0_1 : constant Release :=
|
||||
Project.Register
|
||||
(V_1_0_0.Upgrading
|
||||
(V ("1.0.1"),
|
||||
Git (Repo, "65725c20778875eef12b61a01b437120932965f3")));
|
||||
|
||||
end Alire.Index.Hello;
|
||||
@@ -1,21 +0,0 @@
|
||||
package Alire.Index.Hungarian is
|
||||
|
||||
function Project is new Catalogued_Project
|
||||
("Ada wrapper for the fast Stachniss' Hungarian solver");
|
||||
|
||||
Repo : constant URL := "https://github.com/mosteo/hungarian.git";
|
||||
|
||||
Base : constant Release :=
|
||||
Project.Unreleased
|
||||
(Properties =>
|
||||
GPR_Scenario ("Build_Type", "Debug" or "Release" or
|
||||
"No_Options" or "Profile") and
|
||||
|
||||
Author ("alejandro@mosteo.com") and
|
||||
License (LGPL_3_0));
|
||||
|
||||
package V_1_0_0 is new Project_Release
|
||||
(Base
|
||||
.Replacing (Git (Repo, "2494b4501837979a92a1de90e05c95ed7b23ce93")));
|
||||
|
||||
end Alire.Index.Hungarian;
|
||||
@@ -1,18 +0,0 @@
|
||||
package Alire.Index.Ini_Files is
|
||||
|
||||
function Project is new Catalogued_Project
|
||||
("A standalone, portable Ada package for configuration files");
|
||||
|
||||
Base : constant Release := Project.Unreleased
|
||||
(Version => V ("08"),
|
||||
Properties => Project_File ("ini_files_gnat.gpr")
|
||||
and Author ("Gautier de Montmollin & Rolf Ebert")
|
||||
and Website ("https://sourceforge.net/p/ini-files/")
|
||||
and License (MIT));
|
||||
|
||||
package V_8 is new Project_Release
|
||||
(Base
|
||||
.Renaming (Project)
|
||||
.Replacing (SVN ("https://svn.code.sf.net/p/ini-files/code/", "28")));
|
||||
|
||||
end Alire.Index.Ini_Files;
|
||||
@@ -1,50 +0,0 @@
|
||||
with Alire.Index.AUnit;
|
||||
|
||||
package Alire.Index.Libadacrypt is
|
||||
|
||||
function Project is
|
||||
new Catalogued_Project ("A crypto library for Ada with a nice API");
|
||||
|
||||
Prj_Repo : constant URL := "https://github.com/alire-project/Ada-Crypto-Library.git";
|
||||
Prj_Author : constant String := "Christian Forler";
|
||||
|
||||
V_0_8_7 : constant Release :=
|
||||
Project.Register
|
||||
(V ("0.8.7"),
|
||||
Git (Prj_Repo, "33d15283abbc6d8a51d717de2bd822e026710c0d"),
|
||||
|
||||
Dependencies =>
|
||||
AUnit.V_2017.Within_Major,
|
||||
|
||||
Properties =>
|
||||
Project_File ("libadacrypt.gpr") and
|
||||
|
||||
GPR_Scenario ("system", "unix" or "windows") and
|
||||
GPR_Scenario ("mode", "debug" or "release") and
|
||||
|
||||
Executable ("test-asymmetric_ciphers") and
|
||||
Executable ("test-big_number") and
|
||||
Executable ("test-kdf") and
|
||||
Executable ("test-symmetric_ciphers") and
|
||||
Executable ("test-tests") and
|
||||
|
||||
Author (Prj_Author) and
|
||||
License (GMGPL_2_0) and
|
||||
License (GMGPL_3_0),
|
||||
|
||||
Private_Properties =>
|
||||
Project_File ("acltest.gpr") and
|
||||
|
||||
On_Condition
|
||||
(Operating_System = GNU_Linux,
|
||||
GPR_External ("system", "unix")) and
|
||||
On_Condition
|
||||
(Operating_System = Windows,
|
||||
GPR_External ("system", "windows")),
|
||||
|
||||
Available_When =>
|
||||
Compiler > GNAT_FSF_7_3_Or_Newer
|
||||
-- It fails self-tests; might be a spureous warning
|
||||
);
|
||||
|
||||
end Alire.Index.Libadacrypt;
|
||||
@@ -1,14 +0,0 @@
|
||||
package Alire.Index.Libhello is
|
||||
|
||||
function Project is
|
||||
new Catalogued_Project
|
||||
("""Hello, world!"" demonstration project support library");
|
||||
|
||||
Repo : constant URL := "https://github.com/alire-project/libhello.git";
|
||||
|
||||
V_1_0 : constant Release :=
|
||||
Project.Register
|
||||
(V ("1.0"),
|
||||
Git (Repo, "ce78e7706c9d3f97605df48d8befca5407f8d328"));
|
||||
|
||||
end Alire.Index.Libhello;
|
||||
@@ -1,18 +0,0 @@
|
||||
package Alire.Index.Mandelbrot_ASCII is
|
||||
|
||||
function Project is new Catalogued_Project
|
||||
("Mandelbrot renderer using Unicode glyphs");
|
||||
|
||||
Repo : constant URL := "https://github.com/mosteo/mandelbrot_ascii.git";
|
||||
|
||||
Base : constant Release :=
|
||||
Project.Unreleased
|
||||
(Properties =>
|
||||
Author ("David Given") and
|
||||
Maintainer ("Alejandro R. Mosteo") and
|
||||
License (Unknown));
|
||||
|
||||
package V_1 is new Project_Release
|
||||
(Base.Replacing (Git (Repo, "53efca17cdcc2d42c3a87e4344fa782fbeac906e")));
|
||||
|
||||
end Alire.Index.Mandelbrot_ASCII;
|
||||
@@ -1,63 +0,0 @@
|
||||
package Alire.Index.Mathpaqs is
|
||||
|
||||
function Project is
|
||||
new Catalogued_Project
|
||||
("A collection of mathematical, 100% portable, packages");
|
||||
|
||||
Prj_Repo : constant URL := "https://github.com/svn2github/Mathpaqs.git";
|
||||
Prj_Author : constant String := "Gautier de Montmollin";
|
||||
Prj_Website : constant URL := "https://mathpacks.sourceforge.io/";
|
||||
|
||||
Base : constant Release :=
|
||||
Project.Unreleased
|
||||
(Properties =>
|
||||
GPR_Scenario ("Build_Mode", "Debug" or "Style_Checks" or "Fast") and
|
||||
|
||||
Author (Prj_Author) and
|
||||
Website (Prj_Website) and
|
||||
License (Unknown)
|
||||
);
|
||||
|
||||
|
||||
package V_20180327 is new Project_Release
|
||||
(Base
|
||||
.Replacing
|
||||
(Origin => Git (Prj_Repo, "0f406899a339b654b247a4017557b0943c431486"))
|
||||
.Extending
|
||||
(Properties =>
|
||||
Executable ("test_discrete_random_simulation")));
|
||||
|
||||
package V_20180114 is new Project_Release
|
||||
(Base
|
||||
.Replacing
|
||||
(Origin => Git (Prj_Repo, "c17a6725c4b559ea55b64f0cf3c3660e558777ea"))
|
||||
.Extending
|
||||
(Properties =>
|
||||
Executable ("arenstorf") and
|
||||
Executable ("arithmetic_compression") and
|
||||
Executable ("biomorph") and
|
||||
Executable ("champ_vt") and
|
||||
Executable ("cr_demo") and
|
||||
Executable ("fractal") and
|
||||
Executable ("gnat_int") and
|
||||
Executable ("ppm2func") and
|
||||
Executable ("show_floats_limits") and
|
||||
Executable ("test_beta") and
|
||||
Executable ("test_cholesky") and
|
||||
Executable ("test_copulas") and
|
||||
Executable ("test_ert") and
|
||||
Executable ("test_estimators") and
|
||||
Executable ("test_formulas") and
|
||||
Executable ("test_gamma") and
|
||||
Executable ("test_generic_real_linear_equations") and
|
||||
Executable ("test_normal") and
|
||||
Executable ("test_pareto") and
|
||||
Executable ("test_poisson") and
|
||||
Executable ("test_qr") and
|
||||
Executable ("test_random_performance") and
|
||||
Executable ("test_rsa") and
|
||||
Executable ("test_samples") and
|
||||
Executable ("test_sparse") and
|
||||
Executable ("test_u_rand")));
|
||||
|
||||
end Alire.Index.Mathpaqs;
|
||||
@@ -1,50 +0,0 @@
|
||||
package Alire.Index.Matreshka is
|
||||
|
||||
-- The build process of this package is a bit special.
|
||||
-- As other big projects, it includes a configuration step.
|
||||
-- In this case is an Ada tool that we can build in advance and use.
|
||||
|
||||
-- There is no easy way in current Alire to individually select components
|
||||
-- to build, which furthermore have differing dependencies. For now,
|
||||
-- only components without dependencies are built then.
|
||||
|
||||
-- package No_DB is
|
||||
--
|
||||
-- function Project is new Catalogued_Project
|
||||
-- ("Ada framework to develop information systems (databases missing)");
|
||||
--
|
||||
-- Repo : constant URL := "https://github.com/reznikmm/matreshka.git";
|
||||
--
|
||||
-- Install_To : constant String := "alrinst";
|
||||
--
|
||||
-- Base : constant Release := Project.Unreleased
|
||||
-- (Properties =>
|
||||
-- Project_File (Install_To & "/lib/gnat/matreshka/league.gpr") and
|
||||
--
|
||||
-- Maintainer ("Vadim Godunko") and
|
||||
-- Maintainer ("Maxim Reznik") and
|
||||
-- Website ("http://forge.ada-ru.org/matreshka") and
|
||||
-- License (BSD_3_Clause) and
|
||||
-- Comment ("NOTE: ONLY COMPONENTS WITHOUT DEPENDENCIES IN THIS PACKAGE"),
|
||||
--
|
||||
-- Private_Properties =>
|
||||
-- Action_Run (Post_Fetch, "make config") and
|
||||
-- Action_Run (Post_Fetch,
|
||||
-- "./configure --prefix=" & Install_To &
|
||||
-- " --enable-amf" &
|
||||
-- " --disable-sqlite3 --disable-postgresql --disable-firebird --disable-oracle --disable-mysql") and
|
||||
-- Action_Run (Post_Fetch, "make") and
|
||||
-- Action_Run (Post_Fetch, "make install"),
|
||||
--
|
||||
-- Available_When =>
|
||||
-- Operating_System /= Windows);
|
||||
--
|
||||
-- package V_0_7 is new Project_Release
|
||||
-- (Base
|
||||
-- .Replacing
|
||||
-- (Git (Repo, "9ce672ea383179392bdad3967fa37537db72fa20")));
|
||||
--
|
||||
-- end No_DB;
|
||||
|
||||
|
||||
end Alire.Index.Matreshka;
|
||||
@@ -1,53 +0,0 @@
|
||||
with Alire.Index.Libglfw3;
|
||||
with Alire.Index.LibX11;
|
||||
|
||||
package Alire.Index.OpenGLAda is
|
||||
|
||||
function Project is
|
||||
new Catalogued_Project ("Thick Ada binding for OpenGL and GLFW");
|
||||
|
||||
Prj_Repo : constant URL := "https://github.com/flyx/OpenGLAda.git";
|
||||
Prj_Author : constant String := "Felix Krause <contact@flyx.org>";
|
||||
Prj_Website : constant URL := "http://flyx.github.io/OpenGLAda/";
|
||||
|
||||
V_0_6 : constant Release :=
|
||||
Project.Register
|
||||
(V ("0.6"),
|
||||
Git (Prj_Repo, "54a7a50cebab2cba0262c7f59b927e9ddf6e4649"),
|
||||
|
||||
Dependencies =>
|
||||
On_Condition
|
||||
(Operating_System = GNU_Linux,
|
||||
Libglfw3.V_3.Within_Major And
|
||||
LibX11.V_2.Within_Major),
|
||||
|
||||
Properties =>
|
||||
Project_File ("opengl.gpr") and
|
||||
Project_File ("opengl-glfw.gpr") and
|
||||
Project_File ("opengl-soil.gpr") and
|
||||
Project_File ("opengl-test.gpr") and
|
||||
|
||||
GPR_Scenario ("GLFW_Version", "2" or "3") and
|
||||
GPR_Scenario ("Mode", "debug" or "release") and
|
||||
GPR_Scenario ("Auto_Exceptions", "enabled" or "disabled") and
|
||||
|
||||
Executable ("gl_test-opengl3") and
|
||||
Executable ("gl_test-context") and
|
||||
Executable ("gl_test-vbos") and
|
||||
Executable ("gl_test-shaders") and
|
||||
Executable ("gl_test-framebuffers") and
|
||||
Executable ("gl_test-immediate") and
|
||||
|
||||
Author (Prj_Author) and
|
||||
Website (Prj_Website) and
|
||||
License (MIT),
|
||||
|
||||
Private_Properties =>
|
||||
On_Condition
|
||||
(Operating_System = GNU_Linux, GPR_External ("Windowing_System", "x11")),
|
||||
|
||||
Available_When =>
|
||||
Operating_System = GNU_Linux
|
||||
);
|
||||
|
||||
end Alire.Index.OpenGLAda;
|
||||
@@ -1,29 +0,0 @@
|
||||
package Alire.Index.PDF_Out is
|
||||
|
||||
function Project is new Catalogued_Project
|
||||
("Standalone, portable package for producing dynamically PDF documents");
|
||||
|
||||
Repo : constant URL := "https://github.com/svn2github/pdf_out.git";
|
||||
|
||||
Base : constant Release :=
|
||||
Project.Unreleased
|
||||
(Properties =>
|
||||
Author ("Gautier de Montmollin") and
|
||||
Website ("https://sourceforge.net/projects/apdf") and
|
||||
License (MIT));
|
||||
|
||||
package V_1_0_0_RC4 is new Project_Release
|
||||
(Base
|
||||
.Replacing (Git (Repo, "9f2d3adbc453e03fce88646d80d2ed9c9a58b32b"))
|
||||
.Extending
|
||||
(Properties =>
|
||||
Project_File ("pdf_out_gnat.gpr") and
|
||||
|
||||
GPR_Scenario ("Build_Mode", "Debug" or "Fast" or "Check_95") and
|
||||
|
||||
Executable ("img2pdf") and
|
||||
Executable ("page_test") and
|
||||
Executable ("pdf_out_demo") and
|
||||
Executable ("validation_test")));
|
||||
|
||||
end Alire.Index.PDF_Out;
|
||||
@@ -1,28 +0,0 @@
|
||||
with Alire.Index.Zlib_Ada;
|
||||
|
||||
package Alire.Index.PNG_IO is
|
||||
|
||||
function Project is new Catalogued_Project
|
||||
("Ada95 coder/decoder for Portable Network Graphics");
|
||||
|
||||
Repo : constant URL := "https://github.com/alire-project/png_io.git";
|
||||
|
||||
Base : constant Release :=
|
||||
Project.Unreleased
|
||||
(Properties =>
|
||||
Executable ("png_chunks") and
|
||||
Executable ("png_compare") and
|
||||
Executable ("png_dump") and
|
||||
Executable ("png_properties") and
|
||||
Executable ("png_test") and
|
||||
|
||||
Author ("Steve Sangwine") and
|
||||
Website ("http://png-io.sourceforge.net/") and
|
||||
License (GPL_3_0));
|
||||
|
||||
package V_4_6_0 is new Project_Release
|
||||
(Base
|
||||
.Replacing (Git (Repo, "bb31fe1c1566e13339dec26ae359564364c00999"))
|
||||
.Extending (Dependencies => Zlib_Ada.V_1_3_0.Within_Major));
|
||||
|
||||
end Alire.Index.PNG_IO;
|
||||
@@ -1,33 +0,0 @@
|
||||
package Alire.Index.PragmARC is
|
||||
|
||||
function Project is
|
||||
new Catalogued_Project ("PragmAda Reusable Components (PragmARCs)");
|
||||
|
||||
Repo : constant URL := "https://github.com/alire-project/PragmARC.git";
|
||||
Auth : constant String := "Jeffrey R. Carter";
|
||||
Web1 : constant String := "https://github.com/jrcarter/PragmARC";
|
||||
Web2 : constant String := "https://pragmada.x10hosting.com/";
|
||||
|
||||
V_2011 : constant Release := -- Pure Ada95 version
|
||||
Project.Register
|
||||
(V ("2011.1995.0"),
|
||||
Git (Repo, "34b0e12b5f9aea63408c94cc48ba7a16687c8d76"),
|
||||
Notes => "Ada 95 version",
|
||||
Properties =>
|
||||
Executable ("compile_all") and
|
||||
License (GMGPL_2_0) and
|
||||
Author (Auth) and
|
||||
Website (Web1) and
|
||||
Website (Web2)
|
||||
);
|
||||
|
||||
V_2017 : constant Release := -- Experimental '07 version
|
||||
Project.Register
|
||||
(V_2011
|
||||
.Upgrading
|
||||
(V ("2017.2007.0"),
|
||||
Git (Repo, "db6c1730fe825f8303c60b48f82db08bd408588d"))
|
||||
.Replacing
|
||||
(Notes => "ISO/IEC 8652:2007 version"));
|
||||
|
||||
end Alire.Index.PragmARC;
|
||||
@@ -1,19 +0,0 @@
|
||||
package Alire.Index.RSFile is
|
||||
|
||||
function Project is new Catalogued_Project
|
||||
("Pick a file with probability proportional to its size");
|
||||
|
||||
Repo : constant URL := "https://github.com/mosteo/rsfile.git";
|
||||
|
||||
Base : constant Release :=
|
||||
Project.Unreleased
|
||||
(Properties =>
|
||||
Author ("alejandro@mosteo.com") and
|
||||
License (GPL_3_0));
|
||||
|
||||
package V_1_0_0 is new Project_Release
|
||||
(Base
|
||||
.Replacing (Git (Repo, "d1a368be007c9e4dd92cdaa9d031324121b9f4c7"))
|
||||
.Extending (Properties => Executable ("rsfile")));
|
||||
|
||||
end Alire.Index.RSFile;
|
||||
@@ -1,21 +0,0 @@
|
||||
package Alire.Index.RxAda is
|
||||
|
||||
function Project is
|
||||
new Catalogued_Project ("RxAda port of the Rx framework");
|
||||
|
||||
Repo : constant URL := "https://bitbucket.org/amosteo/rxada";
|
||||
|
||||
V_0_1_0 : constant Release :=
|
||||
Project.Register
|
||||
(V ("0.1.0"),
|
||||
Hg (Repo, "361d4e2ab20a7dcca007e31bf7094d57b13fee6b"),
|
||||
Properties =>
|
||||
Executable ("rx-examples-basic") and
|
||||
Executable ("rx-examples-minimal") and
|
||||
Executable ("rx-examples-tests") and
|
||||
Executable ("rx-examples-threading") and
|
||||
|
||||
Author ("Alejandro R. Mosteo") and
|
||||
License (LGPL_3_0));
|
||||
|
||||
end Alire.Index.RxAda;
|
||||
@@ -1,59 +0,0 @@
|
||||
with Alire.Index.LibSDL2;
|
||||
|
||||
package Alire.Index.SDLAda is
|
||||
|
||||
function Project is
|
||||
new Catalogued_Project ("Ada 2012 bindings to SDL 2");
|
||||
|
||||
Prj_Repo : constant URL := "https://github.com/alire-project/sdlada.git";
|
||||
Prj_Author : constant String := "Luke A. Guest";
|
||||
|
||||
V_2_3_1 : constant Release :=
|
||||
Project.Register
|
||||
(V ("2.3.1"),
|
||||
Git (Prj_Repo, "570232193facb90a58f67aadac93df9dfae8bcd4"),
|
||||
|
||||
Dependencies =>
|
||||
LibSDL2.V_2.Within_Major and
|
||||
LibSDL2.Image.V_2.Within_Major and
|
||||
LibSDL2.TTF.V_2.Within_Major,
|
||||
|
||||
Properties =>
|
||||
Project_File ("build/gnat/sdlada.gpr") and
|
||||
|
||||
GPR_Scenario ("SDL_MODE", "debug" or "release") and
|
||||
GPR_Scenario ("SDL_PLATFORM", "linux" or "bsd" or "windows" or "macosx" or "ios" or "android") and
|
||||
|
||||
Author (Prj_Author) and
|
||||
License (Zlib),
|
||||
|
||||
Private_Properties =>
|
||||
Project_File ("build/gnat/tests.gpr") and
|
||||
-- Project_File ("build/gnat/tests_image.gpr") and
|
||||
Project_File ("build/gnat/test_maths_build.gpr") and
|
||||
-- Project_File ("build/gnat/tools.gpr") and
|
||||
-- Project_File ("build/gnat/unit_tests.gpr") and
|
||||
|
||||
Executable ("clipboard") and
|
||||
Executable ("error") and
|
||||
Executable ("libraries") and
|
||||
Executable ("load_surface") and
|
||||
Executable ("platform") and
|
||||
Executable ("rwops") and
|
||||
Executable ("stream") and
|
||||
Executable ("stream2") and
|
||||
Executable ("surface") and
|
||||
Executable ("test") and
|
||||
Executable ("version") and
|
||||
|
||||
GPR_External ("SDL_MODE", "release") and
|
||||
|
||||
On_Condition
|
||||
(Operating_System = GNU_Linux,
|
||||
GPR_External ("SDL_PLATFORM", "linux")),
|
||||
|
||||
Available_When =>
|
||||
Operating_System = GNU_Linux
|
||||
);
|
||||
|
||||
end Alire.Index.SDLAda;
|
||||
@@ -1,32 +0,0 @@
|
||||
package Alire.Index.Semantic_Versioning is
|
||||
|
||||
function Project is
|
||||
new Catalogued_Project ("Semantic Versioning in Ada");
|
||||
|
||||
Repo : constant URL := "https://github.com/alire-project/semantic_versioning.git";
|
||||
|
||||
Base : constant Release := Project.Unreleased;
|
||||
|
||||
package V_0_3_2 is new Project_Release
|
||||
(Base.Replacing (Git (Repo, "dc462f11adb34bbb3d9163e44c287add5b3421c6")));
|
||||
|
||||
-- Old style releases
|
||||
|
||||
V_0_3_1 : constant Release := Project.Register
|
||||
(V ("0.3.1"),
|
||||
Git (Repo, "71653babaab97d835ecd22edb562b9b529dd8948"));
|
||||
|
||||
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"));
|
||||
|
||||
V_0_1_2 : constant Release := Project.Register
|
||||
(V ("0.1.2"),
|
||||
Git (Repo, "09774d80fac62ea3a09d46b22d4807da530387e2"));
|
||||
|
||||
end Alire.Index.Semantic_Versioning;
|
||||
@@ -1,334 +0,0 @@
|
||||
with Alire.Index.LibGNUTLS;
|
||||
with Alire.Index.UnixODBC;
|
||||
|
||||
package Alire.Index.Simple_Components is
|
||||
|
||||
-- Simple Components by Dmitry A. Kazakov
|
||||
|
||||
Repo : constant URL := "https://github.com/alire-project/dak_simple_components.git";
|
||||
DAK_Author : constant String := "Dmitry A. Kazakov";
|
||||
DAK_Website : constant String := "http://www.dmitry-kazakov.de/ada/components.htm";
|
||||
|
||||
function Project is
|
||||
new Catalogued_Project ("Simple Components (root project)");
|
||||
-- This is a special project because it contains no code.
|
||||
|
||||
-- NOTE: since all extensions reside in the same commit/folder, there's no need for interdependencies
|
||||
|
||||
Base_V_4_27 : constant Release :=
|
||||
Project.Unreleased
|
||||
(V ("4.27"),
|
||||
Git (Repo, "7cafd2da4a92cfe2b1a45374de6d35fc904b2788"),
|
||||
|
||||
Properties =>
|
||||
GPR_Scenario ("Legacy", "Ada95" or "Ada2005" or "Ada2012") and
|
||||
GPR_Scenario ("Development", "Debug" or "Release") and
|
||||
|
||||
License (GMGPL_2_0) and
|
||||
Author (DAK_Author) and
|
||||
Website (DAK_Website));
|
||||
|
||||
-----------------
|
||||
-- Connections --
|
||||
-----------------
|
||||
|
||||
package Connections is
|
||||
|
||||
function Project is new Catalogued_Project
|
||||
("Simple Components (clients/servers)");
|
||||
|
||||
V_4_27 : constant Release :=
|
||||
Project.Register
|
||||
(Base_V_4_27
|
||||
-- .Replacing (Git (Repo, "008935d5a89396cc0c39afb39f04bf6a89a92058"))
|
||||
.Extending
|
||||
(
|
||||
-- Dependencies =>
|
||||
-- Components_V_4_27.Within_Major and
|
||||
-- Sqlite_V_4_27.Within_Major,
|
||||
|
||||
Properties =>
|
||||
-- Main projects
|
||||
Project_File ("components-connections_server.gpr") and
|
||||
Project_File ("components-connections_server-elv_max_cube.gpr") and
|
||||
Project_File ("components-connections_server-http_server.gpr") and
|
||||
Project_File ("components-connections_server-http_server-sqlite_browser.gpr") and
|
||||
Project_File ("components-connections_server-modbus.gpr") and
|
||||
Project_File ("components-connections_server-mqtt.gpr") and
|
||||
Project_File ("components-connections_server-smtp.gpr"),
|
||||
|
||||
Private_Properties =>
|
||||
Executable ("test_data_server") and
|
||||
Executable ("test_echo_client") and
|
||||
Executable ("test_echo_client_async") and
|
||||
Executable ("test_echo_server") and
|
||||
Executable ("test_elv_max_cube_client") and
|
||||
Executable ("test_http_client") and
|
||||
Executable ("test_http_continuous_server") and
|
||||
Executable ("test_http_server") and
|
||||
Executable ("test_infinity_server") and
|
||||
Executable ("test_modbus_client") and
|
||||
Executable ("test_mqtt_client") and
|
||||
Executable ("test_mqtt_server") and
|
||||
Executable ("test_mqtt_webserver") and
|
||||
Executable ("test_websocket_duplex_server") and
|
||||
Executable ("test_websocket_server") and
|
||||
|
||||
Project_File ("test_components/components-connections_server-elv_max_cube-test_elv_max_cube_client.gpr") and
|
||||
Project_File ("test_components/components-connections_server-http_server-test_http_server.gpr") and
|
||||
Project_File ("test_components/components-connections_server-modbus-test_modbus_client.gpr") and
|
||||
Project_File ("test_components/components-connections_server-mqtt-test_mqtt.gpr") and
|
||||
Project_File ("test_components/components-connections_server-test_data_server.gpr") and
|
||||
Project_File ("test_components/components-connections_server-test_echo_client_async.gpr") and
|
||||
Project_File ("test_components/components-connections_server-test_echo_client.gpr") and
|
||||
Project_File ("test_components/components-connections_server-test_echo_server.gpr") and
|
||||
Project_File ("test_components/components-connections_server-test_websockets_mqtt.gpr") and
|
||||
|
||||
-- Those fail for some reason on missing libdl
|
||||
On_Condition (Compiler > GNAT_FSF_7_3_Or_Newer,
|
||||
Executable ("test_http_sqlite_browser") and
|
||||
Project_File ("test_components/components-test_sqlite_browser.gpr"))
|
||||
));
|
||||
|
||||
---------
|
||||
-- NTP --
|
||||
---------
|
||||
|
||||
package NTP is
|
||||
|
||||
function Project is new Catalogued_Project
|
||||
("Simple Components (Network Time Protocol)");
|
||||
|
||||
V_4_27 : constant Release :=
|
||||
Project.Register
|
||||
(Base_V_4_27
|
||||
-- .Replacing (Origin => Git (Repo, "34fb305d6ef360cde5e272b51409097a5de72017"))
|
||||
.Extending
|
||||
(
|
||||
-- Dependencies =>
|
||||
-- Components_V_4_27.Within_Major,
|
||||
|
||||
Properties =>
|
||||
Project_File ("components-ntp.gpr"),
|
||||
|
||||
Private_Properties =>
|
||||
Executable ("test_ntp") and
|
||||
Project_File ("test_components/components-ntp-test_ntp.gpr")));
|
||||
|
||||
end NTP;
|
||||
|
||||
------------
|
||||
-- Secure --
|
||||
------------
|
||||
|
||||
package Secure is
|
||||
|
||||
function Project is new Catalogued_Project
|
||||
("Simple Components (clients/servers over TLS)");
|
||||
|
||||
V_4_27 : constant Release :=
|
||||
Project.Register
|
||||
(Base_V_4_27
|
||||
-- .Replacing (Origin => Git (Repo, "ca72cf4150ae14ba6d40c3d2dd92c7846cb4cb5d"))
|
||||
.Extending
|
||||
(Dependencies =>
|
||||
-- Connections_V_4_27.Within_Major and
|
||||
LibGNUTLS.V_3_5_8.Within_Major,
|
||||
|
||||
Properties =>
|
||||
Project_File ("components-connections_server-secure.gpr") and
|
||||
Project_File ("components-gnutls.gpr"),
|
||||
|
||||
Private_Properties =>
|
||||
Executable ("test_https_client") and
|
||||
Executable ("test_https_server") and
|
||||
Executable ("test_smtp_client") and
|
||||
|
||||
Project_File ("test_components/components-connections_server-http_server-test_https_server.gpr") and
|
||||
Project_File ("test_components/components-connections_server-smtp-test_smtp.gpr")));
|
||||
|
||||
end Secure;
|
||||
|
||||
end Connections;
|
||||
|
||||
----------
|
||||
-- Core --
|
||||
----------
|
||||
|
||||
package Core is
|
||||
|
||||
function Project is new Catalogued_Project
|
||||
("Simple Components (core components)");
|
||||
|
||||
Components_V_4_27 : constant Release :=
|
||||
Project.Register
|
||||
(Base_V_4_27
|
||||
-- .Replacing (Origin => Git (Repo, "542f02c9be86693f759fcb784a8462bc4b25f1f2"))
|
||||
.Extending
|
||||
(
|
||||
-- Dependencies =>
|
||||
-- Strings_Edit_V_4_27.Within_Major and
|
||||
-- Tables_V_4_27.Within_Major,
|
||||
Properties =>
|
||||
Project_File ("components.gpr") and
|
||||
|
||||
GPR_Scenario ("Atomic_Access", "Pragma-atomic" or "GCC-built-ins" or "GCC-long-offsets") and
|
||||
GPR_Scenario ("Tasking", "Multiple" or "Single") and
|
||||
GPR_Scenario ("Traced_objects", "Off" or "On") and
|
||||
|
||||
Comment ("Tasking=Single seems to be broken at persistent-single_file-text_io.adb"),
|
||||
|
||||
Private_Properties =>
|
||||
Executable ("test_approximations") and
|
||||
Executable ("test_association") and
|
||||
Executable ("test_blackboard") and
|
||||
Executable ("test_blackboard_performance") and
|
||||
Executable ("test_blocking_files") and
|
||||
Executable ("test_block_streams") and
|
||||
Executable ("test_b_trees") and
|
||||
Executable ("test_cubic_spline") and
|
||||
Executable ("test_dining_philosophers") and
|
||||
Executable ("test_fifo") and
|
||||
Executable ("test_generic_indefinite_sets") and
|
||||
Executable ("test_generic_maps") and
|
||||
Executable ("test_generic_sets") and
|
||||
Executable ("test_graphs") and
|
||||
Executable ("test_handles") and
|
||||
Executable ("test_ieee_754") and
|
||||
Executable ("test_linked_lists") and
|
||||
Executable ("test_linked_lists_scheduler_test") and
|
||||
Executable ("test_parser_stream_io") and
|
||||
Executable ("test_persistent_memory_pool") and
|
||||
Executable ("test_persistent_storage") and
|
||||
Executable ("test_sequencer") and
|
||||
Executable ("test_single_file_persistence") and
|
||||
Executable ("test_stack") and
|
||||
Executable ("test_storage_streams") and
|
||||
Executable ("test_string_streams") and
|
||||
Executable ("test_synchronization_events") and
|
||||
Executable ("test_transactional_blocking_files") and
|
||||
Executable ("test_utf8_tables") and
|
||||
|
||||
Project_File ("test_components/components-tests.gpr")));
|
||||
|
||||
end Core;
|
||||
|
||||
----------
|
||||
-- ODBC --
|
||||
----------
|
||||
|
||||
package ODBC is
|
||||
|
||||
function Project is new Catalogued_Project
|
||||
("Simple Components (ODBC bindings)");
|
||||
|
||||
ODBC_V_4_27 : constant Release :=
|
||||
Project.Register
|
||||
(Base_V_4_27
|
||||
-- .Replacing (Origin => Git (Repo, "47337f8a5dd69404087129d5cca79885d6e8cd3f"))
|
||||
.Extending
|
||||
(Dependencies =>
|
||||
-- Components_V_4_27.Within_Major and
|
||||
UnixODBC.V_2_3.Within_Major,
|
||||
|
||||
Properties =>
|
||||
Project_File ("components-odbc.gpr"),
|
||||
|
||||
Private_Properties =>
|
||||
Executable ("test_odbc_bindings") and
|
||||
|
||||
Project_File ("test_components/components-odbc-odbc_bindings_tests.gpr") and
|
||||
|
||||
On_Condition
|
||||
(Operating_System = GNU_Linux,
|
||||
GPR_External ("odbc", "unixODBC")) and
|
||||
On_Condition
|
||||
(Operating_System = Windows,
|
||||
GPR_External ("odbc", "ODBC32")) and
|
||||
On_Condition
|
||||
(Word_Size = Bits_32,
|
||||
GPR_External ("arch", "i686")) and
|
||||
On_Condition
|
||||
(Word_Size = Bits_64,
|
||||
GPR_External ("arch", "x86_64"))));
|
||||
|
||||
end ODBC;
|
||||
|
||||
------------
|
||||
-- Sqlite --
|
||||
------------
|
||||
|
||||
package Sqlite is
|
||||
|
||||
function Project is new Catalogued_Project
|
||||
("Simple Components (SQLite)");
|
||||
|
||||
Sqlite_V_4_27 : constant Release :=
|
||||
Project.Register
|
||||
(Base_V_4_27
|
||||
-- .Replacing (Origin => Git (Repo, "6fda0f3f7494815c87b329f7411b9a49ff97b9ba"))
|
||||
.Extending
|
||||
(
|
||||
-- Dependencies =>
|
||||
-- Components_V_4_27.Within_Major,
|
||||
|
||||
Properties =>
|
||||
Project_File ("components-sqlite.gpr"),
|
||||
|
||||
Private_Properties =>
|
||||
-- Those fail for some reason on missing libdl
|
||||
On_Condition (Compiler > GNAT_FSF_7_3_Or_Newer,
|
||||
Executable ("test_sqlite_benchmark") and
|
||||
Executable ("test_sqlite_persistence") and
|
||||
|
||||
Project_File ("test_components/components-sqlite-benchmark_tests.gpr") and
|
||||
Project_File ("test_components/components-sqlite-sqlite_persistence_tests.gpr"))
|
||||
));
|
||||
|
||||
end Sqlite;
|
||||
|
||||
------------------
|
||||
-- Strings_Edit --
|
||||
------------------
|
||||
|
||||
package Strings_Edit is
|
||||
|
||||
function Project is new Catalogued_Project
|
||||
("Simple Components (strings)");
|
||||
|
||||
V_4_27 : constant Release :=
|
||||
Project.Register
|
||||
(Base_V_4_27
|
||||
.Extending
|
||||
(Properties =>
|
||||
Project_File ("strings_edit.gpr"),
|
||||
|
||||
Private_Properties =>
|
||||
Executable ("test_base64") and
|
||||
Executable ("test_strings_edit") and
|
||||
Executable ("test_string_streams") and
|
||||
|
||||
Project_File ("test_strings_edit/strings_edit-test.gpr")));
|
||||
|
||||
end Strings_Edit;
|
||||
|
||||
package Tables is
|
||||
|
||||
function Project is new Catalogued_Project
|
||||
("Simple Components (tables)");
|
||||
|
||||
V_4_27 : constant Release :=
|
||||
Project.Register
|
||||
(Base_V_4_27
|
||||
-- .Replacing (Origin => Git (Repo, "19205e4981d72242daf72da7d59c5faf2b4c91fd"))
|
||||
.Extending
|
||||
(Properties =>
|
||||
Project_File ("tables.gpr"),
|
||||
|
||||
Private_Properties =>
|
||||
Executable ("test_tables") and
|
||||
Project_File ("test_tables/tables-test.gpr")));
|
||||
|
||||
end Tables;
|
||||
|
||||
end Alire.Index.Simple_Components;
|
||||
@@ -1,12 +0,0 @@
|
||||
package Alire.Index.Simple_Logging is
|
||||
|
||||
function Project is new Catalogued_Project ("Simple logging to console");
|
||||
|
||||
Repo : constant URL := "https://github.com/alire-project/simple_logging.git";
|
||||
|
||||
V_1_0 : constant Release :=
|
||||
Project.Register
|
||||
(V ("1.0"),
|
||||
Git (Repo, "d98242b8bd1c7f964cebc454e9b1206ffdbb0ca9"));
|
||||
|
||||
end Alire.Index.Simple_Logging;
|
||||
@@ -1,18 +0,0 @@
|
||||
package Alire.Index.Smart_Pointers is
|
||||
|
||||
function Project is new Catalogued_Project
|
||||
("Christoph Karl Walter Grein's Smart Pointers ");
|
||||
|
||||
Repo : constant URL := "https://github.com/alire-project/smart_pointers.git";
|
||||
|
||||
Base : constant Release :=
|
||||
Project.Unreleased
|
||||
(Properties =>
|
||||
Author ("Christoph Karl Walter Grein") and
|
||||
Website ("http://www.christ-usch-grein.homepage.t-online.de/Ada/Smart_Pointers.html") and
|
||||
License (Unknown));
|
||||
|
||||
package V_20180216 is new Project_Release
|
||||
(Base.Replacing (Git (Repo, "01f2674634dc23da1a572363d8660af274642771")));
|
||||
|
||||
end Alire.Index.Smart_Pointers;
|
||||
@@ -1,46 +0,0 @@
|
||||
with Alire.Index.Adacurses;
|
||||
with Alire.Index.GtkAda;
|
||||
|
||||
package Alire.Index.Steamsky is
|
||||
|
||||
function Project is
|
||||
new Catalogued_Project ("Roguelike in sky with steampunk theme");
|
||||
|
||||
Prj_Repo : constant URL := "https://github.com/thindil/steamsky.git";
|
||||
|
||||
Prj_Author : constant String := "Bartek Jasicki";
|
||||
Prj_Website : constant URL := "https://thindil.github.io/steamsky/";
|
||||
|
||||
V_2_1_Dev : constant Release :=
|
||||
Project.Register
|
||||
(V ("2.1-dev"),
|
||||
Git (Prj_Repo, "faee42a72506f2522d3db9c714d0b0a001c0032d"),
|
||||
|
||||
Notes => "GtkAda version",
|
||||
|
||||
Dependencies =>
|
||||
GtkAda.V_17.Within_Major,
|
||||
|
||||
Properties =>
|
||||
Author (Prj_Author) and
|
||||
Website (Prj_Website) and
|
||||
License (GPL_3_0)
|
||||
);
|
||||
|
||||
V_2_0_2 : constant Release :=
|
||||
Project.Register
|
||||
(V ("2.0.2"),
|
||||
Git (Prj_Repo, "8b4dd319c3199f4b770e39de13f9ef3d9020266f"),
|
||||
|
||||
Notes => "Console (ncurses) version",
|
||||
|
||||
Dependencies =>
|
||||
Adacurses.V_6.Within_Major,
|
||||
|
||||
Properties =>
|
||||
Author (Prj_Author) and
|
||||
Website (Prj_Website) and
|
||||
License (GPL_3_0)
|
||||
);
|
||||
|
||||
end Alire.Index.Steamsky;
|
||||
@@ -1,23 +0,0 @@
|
||||
package Alire.Index.Template is
|
||||
|
||||
-- function Project is new Catalogued_Project
|
||||
-- ("description");
|
||||
--
|
||||
-- Repo : constant URL := "";
|
||||
--
|
||||
-- Base : constant Release :=
|
||||
-- Project.Unreleased
|
||||
-- (Properties =>
|
||||
-- Author ("") and
|
||||
-- Maintainer ("") and
|
||||
-- Website ("") and
|
||||
-- License (Unknown));
|
||||
--
|
||||
-- package V_0_0_0 is new Project_Release
|
||||
-- (Base
|
||||
-- .Replacing (Git (Repo, "commit"))
|
||||
-- .Extending
|
||||
-- (Properties =>
|
||||
-- Comment ("")));
|
||||
|
||||
end Alire.Index.Template;
|
||||
@@ -1,34 +0,0 @@
|
||||
with Alire.Index.XMLAda;
|
||||
|
||||
package Alire.Index.Templates_Parser is
|
||||
|
||||
function Project is new Catalogued_Project
|
||||
("Templates Parser: File generation from templates in Ada");
|
||||
|
||||
Repo : constant URL := "https://github.com/AdaCore/templates-parser.git";
|
||||
|
||||
Base : constant Release := Project.Unreleased
|
||||
(Dependencies =>
|
||||
XMLAda.V_18_2.Within_Major,
|
||||
|
||||
Properties =>
|
||||
GPR_Scenario ("PRJ_BUILD", "Debug" or "Release") and
|
||||
GPR_Scenario ("TP_TASKING", "No_Tasking " or "Standard_Tasking") and
|
||||
GPR_Scenario ("TP_XMLADA", "Installed " or "Disabled") and
|
||||
GPR_Scenario ("LIBRARY_TYPE", "static" or "relocatable") and
|
||||
|
||||
Maintainer ("AdaCore") and
|
||||
Website ("https://github.com/AdaCore/templates-parser") and
|
||||
License (GPL_3_0),
|
||||
|
||||
Private_Properties =>
|
||||
GPR_External ("TP_XMLADA", "Installed") and
|
||||
Action_Run (Post_Fetch, "cp config/tp_xmlada_installed.gpr tp_xmlada.gpr")
|
||||
);
|
||||
|
||||
package V_18_2 is new Project_Release
|
||||
(Base
|
||||
.Replacing
|
||||
(Git (Repo, "cfb146506fa2fa276e935244021d44e0d834c342")));
|
||||
|
||||
end Alire.Index.Templates_Parser;
|
||||
@@ -1,38 +0,0 @@
|
||||
with Alire.Index.Make;
|
||||
|
||||
package Alire.Index.Whitakers_Words is
|
||||
|
||||
function Project is
|
||||
new Catalogued_Project ("William Whitaker's WORDS, a Latin dictionary");
|
||||
|
||||
Prj_Repo : constant URL := "https://github.com/mk270/whitakers-words.git";
|
||||
Prj_Author : constant String := "William A. Whitaker";
|
||||
Prj_Maintainer : constant String := "Martin Keegan";
|
||||
Prj_Website : constant URL := "http://mk270.github.io/whitakers-words/";
|
||||
|
||||
V_2017_09_10 : constant Release :=
|
||||
Project.Register
|
||||
(V ("2017.09.10"),
|
||||
Git (Prj_Repo, "27be95b8a06d7b22c0600c824cf929ab43efcf25"),
|
||||
Dependencies =>
|
||||
Make.Project.Current,
|
||||
|
||||
Properties =>
|
||||
Project_File ("words.gpr") and
|
||||
|
||||
Executable ("words") and
|
||||
|
||||
Author (Prj_Author) and
|
||||
Maintainer (Prj_Maintainer) and
|
||||
Website (Prj_Website) and
|
||||
License (Public_Domain),
|
||||
|
||||
Private_Properties =>
|
||||
Action_Run (Post_Compile, "make"),
|
||||
|
||||
Available_When =>
|
||||
Compiler > GNAT_FSF_7_3_Or_Newer
|
||||
-- bug with SAL library failing binding
|
||||
);
|
||||
|
||||
end Alire.Index.Whitakers_Words;
|
||||
@@ -1,22 +0,0 @@
|
||||
package Alire.Index.XML_EZ_Out is
|
||||
|
||||
function Project is new Catalogued_Project
|
||||
("Creation of XML-formatted output from Ada programs");
|
||||
|
||||
Repo : constant URL := "https://github.com/alire-project/xmlezout.git";
|
||||
|
||||
Base_Properties : constant Release_Properties :=
|
||||
Author ("Marc A. Criley") and
|
||||
Website ("http://www.mckae.com/xmlEz.html") and
|
||||
License (Unknown);
|
||||
|
||||
V_1_6 : constant Release :=
|
||||
Project.Register
|
||||
(V ("1.6"),
|
||||
Git (Repo, "48bf688f0eb672b597ed5a4f54cd6c535be452f2"),
|
||||
Properties =>
|
||||
Base_Properties and
|
||||
Executable ("tmeztf")
|
||||
);
|
||||
|
||||
end Alire.Index.XML_EZ_Out;
|
||||
@@ -1,36 +0,0 @@
|
||||
package Alire.Index.XMLAda is
|
||||
|
||||
function Project is new Catalogued_Project ("The XML/Ada toolkit");
|
||||
|
||||
Repo : constant URL := "https://github.com/AdaCore/xmlada.git";
|
||||
|
||||
Base : constant Release := Project.Unreleased
|
||||
(Properties =>
|
||||
GPR_Scenario ("LIBRARY_TYPE", "relocatable" or "static" or "static-pic") and
|
||||
GPR_Scenario ("BUILD", "distrib" or "Debug" or "Production" or "profile" or "coverage" or "nochecks") and
|
||||
|
||||
Project_File ("distrib/xmlada.gpr") and
|
||||
|
||||
Maintainer ("AdaCore") and
|
||||
Website ("https://github.com/AdaCore/xmlada") and
|
||||
License (GPL_3_0),
|
||||
|
||||
Private_Properties =>
|
||||
Project_File ("dom/xmlada_dom.gpr") and
|
||||
Project_File ("input_sources/xmlada_input.gpr") and
|
||||
Project_File ("sax/xmlada_sax.gpr") and
|
||||
Project_File ("schema/xmlada_schema.gpr") and
|
||||
Project_File ("unicode/xmlada_unicode.gpr") and
|
||||
|
||||
Action_Run (Post_Fetch, "sh configure") and
|
||||
Action_Run (Post_Fetch, "rm -f xmlada.gpr"), -- Else it conflicts
|
||||
|
||||
Available_When =>
|
||||
Operating_System /= Windows);
|
||||
|
||||
package V_18_2 is new Project_Release
|
||||
(Base
|
||||
.Replacing
|
||||
(Git (Repo, "5c3c4a1621a970849601a9df36423d8974c13dec")));
|
||||
|
||||
end Alire.Index.XMLAda;
|
||||
@@ -1,24 +0,0 @@
|
||||
with Alire.Index.GNATCOLL;
|
||||
|
||||
package Alire.Index.XStrings is
|
||||
|
||||
function Project is new Catalogued_Project
|
||||
("Renaming of gnatcoll.strings without further dependencies");
|
||||
|
||||
Repo : constant URL := "https://github.com/alire-project/xstrings";
|
||||
|
||||
Base : constant Release :=
|
||||
Project.Unreleased
|
||||
(Dependencies =>
|
||||
GNATCOLL.Strings.V_20180425.Within_Major or
|
||||
GNATCOLL.Slim.V_20180425.Within_Major,
|
||||
|
||||
Properties =>
|
||||
Author ("alejandro@mosteo.com") and
|
||||
License (GPL_3_0));
|
||||
|
||||
package V_1_0_0 is new Project_Release
|
||||
(Base
|
||||
.Replacing (Git (Repo, "827d9108fbc873299016e924815fe2dd8af8071d")));
|
||||
|
||||
end Alire.Index.XStrings;
|
||||
@@ -1,28 +0,0 @@
|
||||
with Alire.Index.Zlib;
|
||||
|
||||
package Alire.Index.ZLib_Ada is
|
||||
|
||||
function Project is new Catalogued_Project
|
||||
("ZLib for Ada thick binding");
|
||||
|
||||
Repo : constant URL := "https://github.com/alire-project/zlib-ada.git";
|
||||
|
||||
Base : constant Release :=
|
||||
Project.Unreleased
|
||||
(Properties =>
|
||||
Project_File ("zlib.gpr") and
|
||||
Executable ("buffer_demo") and
|
||||
Executable ("mtest") and
|
||||
Executable ("read") and
|
||||
Executable ("test") and
|
||||
|
||||
Author ("Dmitriy Anisimkov") and
|
||||
Website ("http://zlib-ada.sourceforge.net/") and
|
||||
License (Unknown));
|
||||
|
||||
package V_1_3_0 is new Project_Release
|
||||
(Base
|
||||
.Replacing (Git (Repo, "2bacba46c2d4d753c300848fe8134ee150078167"))
|
||||
.Extending (Dependencies => Zlib.V_1_2.Within_Major));
|
||||
|
||||
end Alire.Index.ZLib_Ada;
|
||||
@@ -1,11 +0,0 @@
|
||||
package Alire.Index.GLUT is
|
||||
|
||||
function Project is new Catalogued_Project ("OpenGL Utility Toolkit");
|
||||
|
||||
V_2_8_1 : constant Release :=
|
||||
Project.Register
|
||||
(V ("2.8.1-3"),
|
||||
Native ((Debian | Ubuntu => Packaged_As ("freeglut3-dev"),
|
||||
others => Unavailable)));
|
||||
|
||||
end Alire.Index.GLUT;
|
||||
@@ -1,20 +0,0 @@
|
||||
package Alire.Index.GNAT is
|
||||
|
||||
function Project is new Catalogued_Project
|
||||
("GNAT is a compiler for the Ada programming language");
|
||||
|
||||
Base : constant Release := Project.Unreleased
|
||||
(Properties =>
|
||||
Path ("/usr/bin"),
|
||||
|
||||
Available_When =>
|
||||
Target = Native);
|
||||
|
||||
-- If minor versions proved important they could be segregated with platform-specific knowledge
|
||||
|
||||
package V_7 is new Project_Release
|
||||
(Base.Replacing
|
||||
(Origin => Native ((Debian | Ubuntu => Packaged_As ("gnat-7"),
|
||||
others => Unavailable))));
|
||||
|
||||
end Alire.Index.GNAT;
|
||||
@@ -1,17 +0,0 @@
|
||||
with Alire.Index.GNAT;
|
||||
|
||||
package Alire.Index.GtkAda is
|
||||
|
||||
function Project is new Catalogued_Project ("Ada binding for the GTK+ GUI");
|
||||
|
||||
V_17 : constant Release :=
|
||||
Project.Register
|
||||
(V ("17"),
|
||||
Native ((Debian | Ubuntu => Packaged_As ("libgtkada16.1.0-dev"),
|
||||
others => Unavailable)),
|
||||
|
||||
Dependencies =>
|
||||
GNAT.Project.Current
|
||||
);
|
||||
|
||||
end Alire.Index.GtkAda;
|
||||
@@ -1,12 +0,0 @@
|
||||
package Alire.Index.Libglfw3 is
|
||||
|
||||
function Project is new Catalogued_Project
|
||||
("Portable library for OpenGL, window and input");
|
||||
|
||||
V_3 : constant Release :=
|
||||
Project.Register
|
||||
(V ("3"),
|
||||
Native ((Debian | Ubuntu => Packaged_As ("libglfw3-dev"),
|
||||
others => Unavailable)));
|
||||
|
||||
end Alire.Index.Libglfw3;
|
||||
@@ -1,11 +0,0 @@
|
||||
package Alire.Index.LibGNUTLS is
|
||||
|
||||
function Project is new Catalogued_Project ("GNU TLS library");
|
||||
|
||||
V_3_5_8 : constant Release :=
|
||||
Project.Register
|
||||
(V ("3.5.8"),
|
||||
Native ((Debian | Ubuntu => Packaged_As ("libgnutls28-dev"),
|
||||
others => Unavailable)));
|
||||
|
||||
end Alire.Index.LibGNUTLS;
|
||||
@@ -1,11 +0,0 @@
|
||||
package Alire.Index.Libgraph_Easy_Perl is
|
||||
|
||||
function Project is new Catalogued_Project ("Drawing of ASCII graphs");
|
||||
|
||||
V_Rolling : constant Release :=
|
||||
Project.Register
|
||||
(V ("0.0-rolling"),
|
||||
Native ((Debian | Ubuntu => Packaged_As ("libgraph-easy-perl"),
|
||||
others => Unavailable)));
|
||||
|
||||
end Alire.Index.Libgraph_Easy_Perl;
|
||||
@@ -1,14 +0,0 @@
|
||||
package Alire.Index.Libgsl is
|
||||
|
||||
function Project is new Catalogued_Project
|
||||
("The GNU Scientific Library (GSL)");
|
||||
|
||||
Base : constant Release := Project.Unreleased;
|
||||
|
||||
package V_0 is new Project_Release
|
||||
(Base
|
||||
.Replacing
|
||||
(Native ((Debian | Ubuntu => Packaged_As ("libgsl-dev"),
|
||||
others => Unavailable))));
|
||||
|
||||
end Alire.Index.Libgsl;
|
||||
@@ -1,12 +0,0 @@
|
||||
package Alire.Index.Liblua is
|
||||
|
||||
function Project is new Catalogued_Project
|
||||
("Development files for the Lua language");
|
||||
|
||||
V_5_3 : constant Release :=
|
||||
Project.Register
|
||||
(V ("5.3"),
|
||||
Native ((Debian | Ubuntu => Packaged_As ("liblua5.3-dev"),
|
||||
others => Unavailable)));
|
||||
|
||||
end Alire.Index.Liblua;
|
||||
@@ -1,38 +0,0 @@
|
||||
package Alire.Index.LibSDL2 is
|
||||
|
||||
function Project is new Catalogued_Project
|
||||
("Simple DirectMedia Layer development files");
|
||||
|
||||
V_2 : constant Release :=
|
||||
Project.Register
|
||||
(V ("2"),
|
||||
Native ((Debian | Ubuntu => Packaged_As ("libsdl2-dev"),
|
||||
others => Unavailable)));
|
||||
|
||||
package Image is
|
||||
|
||||
function Project is new Catalogued_Project
|
||||
("Image loading library for Simple DirectMedia Layer 2");
|
||||
|
||||
V_2 : constant Release :=
|
||||
Project.Register
|
||||
(V ("2"),
|
||||
Native ((Debian | Ubuntu => Packaged_As ("libsdl2-image-dev"),
|
||||
others => Unavailable)));
|
||||
|
||||
end Image;
|
||||
|
||||
package TTF is
|
||||
|
||||
function Project is new Catalogued_Project
|
||||
("TrueType Font library for Simple DirectMedia Layer 2");
|
||||
|
||||
V_2 : constant Release :=
|
||||
Project.Register
|
||||
(V ("2"),
|
||||
Native ((Debian | Ubuntu => Packaged_As ("libsdl2-ttf-dev"),
|
||||
others => Unavailable)));
|
||||
|
||||
end TTF;
|
||||
|
||||
end Alire.Index.LibSDL2;
|
||||
@@ -1,11 +0,0 @@
|
||||
package Alire.Index.LibX11 is
|
||||
|
||||
function Project is new Catalogued_Project ("X11 client-side library");
|
||||
|
||||
V_2 : constant Release :=
|
||||
Project.Register
|
||||
(V ("2"),
|
||||
Native ((Debian | Ubuntu => Packaged_As ("libx11-dev"),
|
||||
others => Unavailable)));
|
||||
|
||||
end Alire.Index.LibX11;
|
||||
@@ -1,11 +0,0 @@
|
||||
package Alire.Index.Make is
|
||||
|
||||
function Project is new Catalogued_Project
|
||||
("Utility for directing compilation");
|
||||
|
||||
V_Native : constant Release :=
|
||||
Project.Register (V ("0"),
|
||||
Native ((Debian | Ubuntu => Packaged_As ("make"),
|
||||
others => Unavailable)));
|
||||
|
||||
end Alire.Index.Make;
|
||||
@@ -1,11 +0,0 @@
|
||||
package Alire.Index.Native_Template is
|
||||
|
||||
-- function Project is new Catalogued_Project
|
||||
-- ("description");
|
||||
|
||||
-- V : constant Release :=
|
||||
-- Project.Register (V (""),
|
||||
-- Native ((Debian | Ubuntu => Packaged_As (""),
|
||||
-- others => Unavailable)));
|
||||
|
||||
end Alire.Index.Native_Template;
|
||||
@@ -1,32 +0,0 @@
|
||||
with Alire.Index.GNAT;
|
||||
|
||||
package Alire.Index.NcursesAda is
|
||||
|
||||
function Project is
|
||||
new Catalogued_Project ("Ada binding to the ncurses text interface library");
|
||||
|
||||
Base : constant Release := Project.Unreleased
|
||||
(Dependencies => GNAT.Project.Current);
|
||||
|
||||
package V_6_1_20180127 is new Project_Release
|
||||
(Base.Replacing
|
||||
(Origin =>
|
||||
Native ((Debian |
|
||||
Ubuntu => Packaged_As ("libncursesada6.1.20180127-dev"),
|
||||
others => Unavailable))));
|
||||
|
||||
package V_6 is new Project_Release
|
||||
(Base.Replacing
|
||||
(Origin =>
|
||||
Native ((Debian |
|
||||
Ubuntu => Packaged_As ("libncursesada5-dev"),
|
||||
others => Unavailable))));
|
||||
|
||||
package V_5 is new Project_Release
|
||||
(Base.Replacing
|
||||
(Origin =>
|
||||
Native ((Debian |
|
||||
Ubuntu => Packaged_As ("libncursesada3-dev"),
|
||||
others => Unavailable))));
|
||||
|
||||
end Alire.Index.NcursesAda;
|
||||
@@ -1,14 +0,0 @@
|
||||
package Alire.Index.UnixODBC is
|
||||
|
||||
function Project is new Catalogued_Project
|
||||
("Open Database Connectivity drivers for UNIX platforms");
|
||||
|
||||
V_2_3 : constant Release :=
|
||||
Project.Register
|
||||
(V ("2.3"),
|
||||
Native ((Debian | Ubuntu => Packaged_As ("unixodbc-dev"),
|
||||
others => Unavailable)),
|
||||
Properties =>
|
||||
Website ("www.unixodbc.org"));
|
||||
|
||||
end Alire.Index.UnixODBC;
|
||||
@@ -1,14 +0,0 @@
|
||||
package Alire.Index.ZLib is
|
||||
|
||||
function Project is new Catalogued_Project
|
||||
("Library implementing the deflate method from gzip/PKZIP");
|
||||
|
||||
Base : constant Release := Project.Unreleased;
|
||||
|
||||
package V_1_2 is new Project_Release
|
||||
(Base
|
||||
.Replacing
|
||||
(Native ((Debian | Ubuntu => Packaged_As ("zlib1g-dev"),
|
||||
others => Unavailable))));
|
||||
|
||||
end Alire.Index.ZLib;
|
||||
@@ -1,27 +0,0 @@
|
||||
# Test a couple compiler versions:
|
||||
# Debian testing
|
||||
# Ubuntu LTS
|
||||
# Latest Community Edition
|
||||
|
||||
language: none # ada
|
||||
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- testing
|
||||
|
||||
env:
|
||||
- IMAGE_NAME="reznik/gnat"
|
||||
IMAGE_TAG="gpl.2018.slim"
|
||||
- IMAGE_NAME="mosteo/gnat"
|
||||
IMAGE_TAG="debian-testing"
|
||||
- IMAGE_NAME="mosteo/gnat"
|
||||
IMAGE_TAG="ubuntu-lts"
|
||||
|
||||
build:
|
||||
pre_ci_boot:
|
||||
image_name: $IMAGE_NAME
|
||||
image_tag: $IMAGE_TAG
|
||||
pull: true
|
||||
ci:
|
||||
- gprbuild -j0 -p -P alire_env
|
||||
@@ -1,12 +0,0 @@
|
||||
package body Alire.Actions is
|
||||
|
||||
-------------
|
||||
-- Execute --
|
||||
-------------
|
||||
|
||||
procedure Execute (This : Action; Implementer : access procedure (This : Action'Class)) is
|
||||
begin
|
||||
Implementer (This);
|
||||
end Execute;
|
||||
|
||||
end Alire.Actions;
|
||||
@@ -1,64 +0,0 @@
|
||||
with Alire.Properties;
|
||||
with Alire.Utils;
|
||||
|
||||
package Alire.Actions with Preelaborate is
|
||||
|
||||
type Moments is (
|
||||
Post_Fetch, -- After being downloaded
|
||||
Post_Compile -- After being compiled as the main project
|
||||
);
|
||||
|
||||
-- It's probable that there'll be a need to pre-compile every dependency after being downloaded,
|
||||
-- and then we will have the possibility of having another moment post THAT compilation
|
||||
-- But that compilation may depend on configuration set by the main project... -_-'
|
||||
-- We'll cross that bridge once it proves necessary
|
||||
|
||||
type Action (<>) is abstract new Properties.Property with private;
|
||||
|
||||
function Moment (This : Action) return Moments;
|
||||
|
||||
procedure Execute (This : Action; Implementer : access procedure (This : Action'Class));
|
||||
|
||||
|
||||
type Run (<>) is new Action with private;
|
||||
-- Encapsulates the execution of an external command
|
||||
|
||||
function New_Run (Moment : Moments;
|
||||
Relative_Command_Line : Platform_Independent_Path;
|
||||
Working_Folder : Platform_Independent_Path) return Run;
|
||||
-- Working folder will be entered for execution
|
||||
-- Relative command-line must consider being in working folder
|
||||
|
||||
function Command_Line (This : Run) return String;
|
||||
function Working_Folder (This : Run) return String;
|
||||
|
||||
private
|
||||
|
||||
type Action (Moment : Moments) is abstract new Properties.Property with null record;
|
||||
|
||||
function Moment (This : Action) return Moments is (This.Moment);
|
||||
|
||||
type Run (Moment : Moments; Cmd_Len, Folder_Len : Natural) is new Action (Moment) with record
|
||||
Relative_Command_Line : Platform_Independent_Path (1 .. Cmd_Len);
|
||||
Working_Folder : Platform_Independent_Path (1 .. Folder_Len);
|
||||
end record;
|
||||
|
||||
overriding function Image (This : Run) return String is
|
||||
(Utils.To_Mixed_Case (This.Moment'Img) & " run: <project>" &
|
||||
(if This.Working_Folder /= "" then "/" else "") &
|
||||
This.Working_Folder & "/" & This.Relative_Command_Line);
|
||||
|
||||
function New_Run (Moment : Moments;
|
||||
Relative_Command_Line : Platform_Independent_Path;
|
||||
Working_Folder : Platform_Independent_Path) return Run is
|
||||
(Moment,
|
||||
Relative_Command_Line'Length,
|
||||
Working_Folder'Length,
|
||||
Utils.To_Native (Relative_Command_Line),
|
||||
Utils.To_Native (Working_Folder));
|
||||
|
||||
function Command_Line (This : Run) return String is (This.Relative_Command_Line);
|
||||
|
||||
function Working_Folder (This : Run) return String is (This.Working_Folder);
|
||||
|
||||
end Alire.Actions;
|
||||
@@ -1,189 +0,0 @@
|
||||
with Ada.Containers; use Ada.Containers;
|
||||
|
||||
with GNAT.IO;
|
||||
|
||||
package body Alire.Boolean_Trees is
|
||||
|
||||
----------
|
||||
-- Leaf --
|
||||
----------
|
||||
|
||||
function Leaf (C : Condition) return Tree is
|
||||
begin
|
||||
return T : Tree do
|
||||
T.Append_Child (T.Root, Node'(Leaf, Conditions.To_Holder (C)));
|
||||
end return;
|
||||
end Leaf;
|
||||
|
||||
-----------------
|
||||
-- Merge_Under --
|
||||
-----------------
|
||||
|
||||
function Merge_Under (N : Node; L, R : Tree := Empty_Tree) return Tree is
|
||||
use Trees;
|
||||
begin
|
||||
return T : Tree do
|
||||
T.Append_Child (Parent => T.Root, New_Item => N);
|
||||
|
||||
declare
|
||||
Op : constant Cursor := First_Child (T.Root);
|
||||
begin
|
||||
pragma Assert (Element (Op) = N);
|
||||
|
||||
if L /= Empty_Tree then
|
||||
T.Copy_Subtree (Parent => Op,
|
||||
Before => No_Element,
|
||||
Source => First_Child (L.Root));
|
||||
end if;
|
||||
|
||||
if R /= Empty_Tree then
|
||||
T.Copy_Subtree (Parent => Op,
|
||||
Before => No_Element,
|
||||
Source => First_Child (R.Root));
|
||||
end if;
|
||||
end;
|
||||
end return;
|
||||
end Merge_Under;
|
||||
|
||||
-----------
|
||||
-- "and" --
|
||||
-----------
|
||||
|
||||
function "and" (L, R : Tree) return Tree is
|
||||
begin
|
||||
if L.Is_Empty and then R.Is_Empty then
|
||||
return Empty_Tree;
|
||||
elsif L.Is_Empty then
|
||||
return R;
|
||||
elsif R.Is_Empty then
|
||||
return L;
|
||||
else
|
||||
return Merge_Under (Node'(Kind => And_Node), L, R);
|
||||
end if;
|
||||
end "and";
|
||||
|
||||
----------
|
||||
-- "or" --
|
||||
----------
|
||||
|
||||
function "or" (L, R : Tree) return Tree is
|
||||
begin
|
||||
if L.Is_Empty and then R.Is_Empty then
|
||||
return Empty_Tree;
|
||||
elsif L.Is_Empty then
|
||||
return R;
|
||||
elsif R.Is_Empty then
|
||||
return L;
|
||||
else
|
||||
return Merge_Under (Node'(Kind => Or_Node), L, R);
|
||||
end if;
|
||||
end "or";
|
||||
|
||||
-----------
|
||||
-- "not" --
|
||||
-----------
|
||||
|
||||
function "not" (T : Tree) return Tree is
|
||||
begin
|
||||
return Merge_Under (Node'(Kind => Not_Node), T);
|
||||
end "not";
|
||||
|
||||
-----------
|
||||
-- Check --
|
||||
-----------
|
||||
|
||||
function Check (T : Tree; V : Value; If_Empty : Boolean := True) return Boolean is
|
||||
|
||||
function Check (C : Trees.Cursor) return Boolean is
|
||||
N : constant Node := Trees.Element (C);
|
||||
begin
|
||||
case N.Kind is
|
||||
when Leaf =>
|
||||
return Check (N.Condition.Element, V);
|
||||
when And_Node =>
|
||||
return Check (Trees.First_Child (C)) and then Check (Trees.Last_Child (C));
|
||||
when Or_Node =>
|
||||
return Check (Trees.First_Child (C)) or else Check (Trees.Last_Child (C));
|
||||
when Not_Node =>
|
||||
return not Check (Trees.First_Child (C));
|
||||
end case;
|
||||
end Check;
|
||||
|
||||
begin
|
||||
if T.Is_Empty then
|
||||
return If_Empty;
|
||||
else
|
||||
return Check (Trees.First_Child (T.Root));
|
||||
end if;
|
||||
end Check;
|
||||
|
||||
---------------------
|
||||
-- Image_Recursive --
|
||||
---------------------
|
||||
|
||||
function Image_Recursive (C : Trees.Cursor; Skeleton : Boolean) return String is
|
||||
N : constant Node := Trees.Element (C);
|
||||
begin
|
||||
case N.Kind is
|
||||
when Leaf =>
|
||||
if Skeleton then
|
||||
return "Leaf";
|
||||
else
|
||||
return Image (N.Condition.Constant_Reference);
|
||||
end if;
|
||||
when And_Node =>
|
||||
return "(" & Image_Recursive (Trees.First_Child (C), Skeleton) & " and " &
|
||||
Image_Recursive (Trees.Last_Child (C), Skeleton) & ")";
|
||||
when Or_Node =>
|
||||
return "(" & Image_Recursive (Trees.First_Child (C), Skeleton) & " or " &
|
||||
Image_Recursive (Trees.Last_Child (C), Skeleton) & ")";
|
||||
when Not_Node =>
|
||||
return "(not " & Image_Recursive (Trees.First_Child (C), Skeleton) & ")";
|
||||
end case;
|
||||
end Image_Recursive;
|
||||
|
||||
-----------
|
||||
-- Image --
|
||||
-----------
|
||||
|
||||
function Image (T : Tree) return String is
|
||||
begin
|
||||
if T.Is_Empty then
|
||||
return "(empty tree)";
|
||||
else
|
||||
return Image_Recursive (Trees.First_Child (T.Root), Skeleton => False);
|
||||
end if;
|
||||
end Image;
|
||||
|
||||
-----------
|
||||
-- Print --
|
||||
-----------
|
||||
|
||||
procedure Print (T : Tree) is
|
||||
begin
|
||||
GNAT.IO.Put_Line (T.Image);
|
||||
end Print;
|
||||
|
||||
--------------------
|
||||
-- Image_Skeleton --
|
||||
--------------------
|
||||
|
||||
function Image_Skeleton (T : Tree) return String is
|
||||
begin
|
||||
if T.Is_Empty then
|
||||
return "(empty tree)";
|
||||
else
|
||||
return Image_Recursive (Trees.First_Child (T.Root), Skeleton => True);
|
||||
end if;
|
||||
end Image_Skeleton;
|
||||
|
||||
--------------------
|
||||
-- Print_Skeleton --
|
||||
--------------------
|
||||
|
||||
procedure Print_Skeleton (T : Tree) is
|
||||
begin
|
||||
GNAT.IO.Put_Line (T.Image_Skeleton);
|
||||
end Print_Skeleton;
|
||||
|
||||
end Alire.Boolean_Trees;
|
||||
@@ -1,76 +0,0 @@
|
||||
private with Ada.Containers.Indefinite_Holders;
|
||||
private with Ada.Containers.Indefinite_Multiway_Trees;
|
||||
|
||||
generic
|
||||
type Value (<>) is private;
|
||||
type Condition (<>) is private;
|
||||
with function Check (C : Condition; V : Value) return Boolean;
|
||||
with function Image (C : Condition) return String;
|
||||
package Alire.Boolean_Trees with Preelaborate is
|
||||
|
||||
-- A package to represent trees of logical expressions
|
||||
|
||||
type Tree is tagged private;
|
||||
|
||||
Empty_Tree : constant Tree;
|
||||
|
||||
-- Tree building
|
||||
|
||||
function Leaf (C : Condition) return Tree;
|
||||
function "+" (C : Condition) return Tree renames Leaf;
|
||||
|
||||
function "and" (L, R : Tree) return Tree;
|
||||
function "and" (L : Tree; R : Condition) return Tree is (L and Leaf (R));
|
||||
function "and" (L : Condition; R : Tree) return Tree is (Leaf (L) and R);
|
||||
function "and" (L : Condition; R : Condition) return Tree is (Leaf (L) and Leaf (R));
|
||||
|
||||
function "or" (L, R : Tree) return Tree;
|
||||
function "or" (L : Tree; R : Condition) return Tree is (L or Leaf (R));
|
||||
function "or" (L : Condition; R : Tree) return Tree is (Leaf (L) or R);
|
||||
function "or" (L : Condition; R : Condition) return Tree is (Leaf (L) or Leaf (R));
|
||||
|
||||
function "not" (T : Tree) return Tree
|
||||
with Pre => T /= Empty_Tree;
|
||||
function "not" (C : Condition) return Tree is (not Leaf (C));
|
||||
|
||||
-- Tree evaluation
|
||||
|
||||
function Check (T : Tree; V : Value; If_Empty : Boolean := True) return Boolean;
|
||||
|
||||
-- Access
|
||||
|
||||
function Is_Empty (T : Tree) return Boolean;
|
||||
|
||||
-- Debugging
|
||||
|
||||
function Image_Skeleton (T : Tree) return String;
|
||||
procedure Print_Skeleton (T : Tree);
|
||||
|
||||
function Image (T : Tree) return String;
|
||||
procedure Print (T : Tree);
|
||||
|
||||
private
|
||||
|
||||
type Node_Kinds is (Leaf, And_Node, Or_Node, Not_Node);
|
||||
|
||||
package Values is new Ada.Containers.Indefinite_Holders (Value);
|
||||
package Conditions is new Ada.Containers.Indefinite_Holders (Condition);
|
||||
|
||||
type Node (Kind : Node_Kinds) is record
|
||||
case Kind is
|
||||
when Leaf =>
|
||||
Condition : Conditions.Holder;
|
||||
when others =>
|
||||
null;
|
||||
end case;
|
||||
end record;
|
||||
|
||||
package Trees is new Ada.Containers.Indefinite_Multiway_Trees (Node);
|
||||
|
||||
type Tree is new Trees.Tree with null record;
|
||||
|
||||
Empty_Tree : constant Tree := (Trees.Empty_Tree with null record);
|
||||
|
||||
function Is_Empty (T : Tree) return Boolean is (Trees.Is_Empty (Trees.Tree (T)));
|
||||
|
||||
end Alire.Boolean_Trees;
|
||||
@@ -1,26 +0,0 @@
|
||||
with Alire.Containers;
|
||||
with Alire.Releases;
|
||||
|
||||
package Alire.Conditional.Operations is
|
||||
|
||||
function Contains (Tree : Dependencies; R : Releases.Release) return Boolean;
|
||||
|
||||
function Contains_Some (Tree : Dependencies;
|
||||
Map : Containers.Release_Map) return Boolean;
|
||||
-- If any in Map is also in Tree
|
||||
|
||||
private
|
||||
|
||||
use Conditional.For_Dependencies;
|
||||
|
||||
function Contains (Tree : Dependencies;
|
||||
R : Releases.Release) return Boolean is
|
||||
(for some I in Tree.Iterate =>
|
||||
Tree (I).Kind = Value and then
|
||||
R.Satisfies (Tree (I).Value));
|
||||
|
||||
function Contains_Some (Tree : Dependencies;
|
||||
Map : Containers.Release_Map) return Boolean is
|
||||
(for some R of Map => Contains (Tree, R));
|
||||
|
||||
end Alire.Conditional.Operations;
|
||||
@@ -1,45 +0,0 @@
|
||||
with Alire.Conditional_Trees;
|
||||
with Alire.Dependencies;
|
||||
with Alire.Properties;
|
||||
with Alire.Requisites;
|
||||
|
||||
with Semantic_Versioning;
|
||||
|
||||
package Alire.Conditional with Preelaborate is
|
||||
|
||||
package For_Dependencies is new Conditional_Trees (Dependencies.Dependency,
|
||||
Dependencies.Image);
|
||||
subtype Dependencies is For_Dependencies.Tree;
|
||||
|
||||
subtype Platform_Dependencies is Conditional.Dependencies
|
||||
with Dynamic_Predicate => Platform_Dependencies.Is_Unconditional;
|
||||
-- A plain tree without conditions (but might have OR nodes)
|
||||
|
||||
subtype Forbidden_Dependencies is Platform_Dependencies
|
||||
with Dynamic_Predicate => not Forbidden_Dependencies.Contains_ORs;
|
||||
-- A plain tree without conditions or alternatives
|
||||
|
||||
function New_Dependency (Name : Alire.Project;
|
||||
Versions : Semantic_Versioning.Version_Set)
|
||||
return Dependencies;
|
||||
|
||||
package For_Properties is new Conditional_Trees (Properties.Property'Class,
|
||||
Properties.Image_Classwide);
|
||||
subtype Properties is For_Properties.Tree;
|
||||
|
||||
function New_Property (Property : Alire.Properties.Property'Class)
|
||||
return Properties;
|
||||
|
||||
private
|
||||
|
||||
function New_Dependency (Name : Alire.Project;
|
||||
Versions : Semantic_Versioning.Version_Set)
|
||||
return Dependencies is
|
||||
(For_Dependencies.New_Value
|
||||
(Alire.Dependencies.New_Dependency (Name, Versions)));
|
||||
|
||||
function New_Property (Property : Alire.Properties.Property'Class)
|
||||
return Properties is
|
||||
(For_Properties.New_Value (Property));
|
||||
|
||||
end Alire.Conditional;
|
||||
@@ -1,476 +0,0 @@
|
||||
with GNAT.IO;
|
||||
|
||||
package body Alire.Conditional_Trees is
|
||||
|
||||
-- function To_Code (C : Conjunctions) return String is
|
||||
-- (case C is
|
||||
-- when Anded => "and",
|
||||
-- when Ored => "or");
|
||||
|
||||
----------------------------
|
||||
-- All_But_First_Children --
|
||||
----------------------------
|
||||
|
||||
function All_But_First_Children (This : Tree) return Tree is
|
||||
Children : Vectors.Vector := This.As_Vector;
|
||||
begin
|
||||
Children.Delete_First;
|
||||
return To_Holder (Vector_Inner'(This.Conjunction, Children));
|
||||
end All_But_First_Children;
|
||||
|
||||
-------------
|
||||
-- Flatten --
|
||||
-------------
|
||||
|
||||
procedure Flatten (Inner : in out Vector_Inner; -- The resulting vector
|
||||
This : Inner_Node'Class; -- The next node to flatten
|
||||
Conj : Conjunctions) is -- To prevent mixing
|
||||
begin
|
||||
case This.Kind is
|
||||
when Value | Condition =>
|
||||
Inner.Values.Append (This);
|
||||
when Vector =>
|
||||
-- Flatten ofly if conjunction matches, otherwise just append subtree
|
||||
if Vector_Inner (This).Conjunction = Conj then
|
||||
for Child of Vector_Inner (This).Values loop
|
||||
Flatten (Inner, Child, Conj);
|
||||
end loop;
|
||||
else
|
||||
Inner.Values.Append (This);
|
||||
end if;
|
||||
end case;
|
||||
end Flatten;
|
||||
|
||||
-----------
|
||||
-- "and" --
|
||||
-----------
|
||||
|
||||
function "and" (L, R : Tree) return Tree is
|
||||
Inner : Vector_Inner := (Conjunction => Anded, Values => <>);
|
||||
|
||||
begin
|
||||
if not L.Is_Empty then
|
||||
Flatten (Inner, L.Constant_Reference, Anded);
|
||||
end if;
|
||||
|
||||
if not R.Is_Empty then
|
||||
Flatten (Inner, R.Constant_Reference, Anded);
|
||||
end if;
|
||||
|
||||
if Inner.Values.Is_Empty then
|
||||
return Empty;
|
||||
else
|
||||
return (To_Holder (Inner));
|
||||
end if;
|
||||
end "and";
|
||||
|
||||
----------
|
||||
-- "or" --
|
||||
----------
|
||||
|
||||
function "or" (L, R : Tree) return Tree is
|
||||
Inner : Vector_Inner := (Conjunction => Ored, Values => <>);
|
||||
|
||||
begin
|
||||
if not L.Is_Empty then
|
||||
Flatten (Inner, L.Constant_Reference, Ored);
|
||||
end if;
|
||||
|
||||
if not R.Is_Empty then
|
||||
Flatten (Inner, R.Constant_Reference, Ored);
|
||||
end if;
|
||||
|
||||
if Inner.Values.Is_Empty then
|
||||
return Empty;
|
||||
else
|
||||
return (To_Holder (Inner));
|
||||
end if;
|
||||
end "or";
|
||||
|
||||
----------------
|
||||
-- Leaf_Count --
|
||||
----------------
|
||||
|
||||
function Leaf_Count (This : Tree) return Natural is
|
||||
Count : Natural := 0;
|
||||
begin
|
||||
if This.Is_Empty then
|
||||
return 0;
|
||||
else
|
||||
case This.Kind is
|
||||
when Value =>
|
||||
return 1;
|
||||
when Condition =>
|
||||
return This.True_Value.Leaf_Count + This.False_Value.Leaf_Count;
|
||||
when Vector =>
|
||||
for Child of This loop
|
||||
Count := Count + Child.Leaf_Count;
|
||||
end loop;
|
||||
return Count;
|
||||
end case;
|
||||
end if;
|
||||
end Leaf_Count;
|
||||
|
||||
-----------------
|
||||
-- Materialize --
|
||||
-----------------
|
||||
|
||||
function Materialize (This : Tree; Against : Properties.Vector) return Collection is
|
||||
Col : Collection with Warnings => Off;
|
||||
Pre : constant Tree := This.Evaluate (Against);
|
||||
|
||||
procedure Visit (Inner : Inner_Node'Class) is
|
||||
begin
|
||||
case Inner.Kind is
|
||||
when Value =>
|
||||
Append (Col, Value_Inner (Inner).Value.Constant_Reference);
|
||||
when Condition =>
|
||||
raise Program_Error with "Should not appear in evaluated CV";
|
||||
when Vector =>
|
||||
if Vector_Inner (Inner).Conjunction = Anded then
|
||||
for Child of Vector_Inner (Inner).Values loop
|
||||
Visit (Child);
|
||||
end loop;
|
||||
else
|
||||
raise Constraint_Error with "OR trees cannot be materialized as list";
|
||||
end if;
|
||||
end case;
|
||||
end Visit;
|
||||
|
||||
begin
|
||||
if not Pre.Is_Empty then
|
||||
Visit (Pre.Constant_Reference);
|
||||
end if;
|
||||
return Col;
|
||||
end Materialize;
|
||||
|
||||
---------------
|
||||
-- Enumerate --
|
||||
---------------
|
||||
|
||||
function Enumerate (This : Tree) return Collection is
|
||||
Col : Collection with Warnings => Off;
|
||||
|
||||
procedure Visit (Inner : Inner_Node'Class) is
|
||||
begin
|
||||
case Inner.Kind is
|
||||
when Value =>
|
||||
Append (Col, Value_Inner (Inner).Value.Constant_Reference);
|
||||
when Condition =>
|
||||
Visit (Conditional_Inner (Inner).Then_Value.Constant_Reference);
|
||||
if not Conditional_Inner (Inner).Else_Value.Is_Empty then
|
||||
Visit (Conditional_Inner (Inner).Else_Value.Constant_Reference);
|
||||
end if;
|
||||
when Vector =>
|
||||
for Child of Vector_Inner (Inner).Values loop
|
||||
Visit (Child);
|
||||
end loop;
|
||||
end case;
|
||||
end Visit;
|
||||
|
||||
begin
|
||||
if not This.Is_Empty then
|
||||
Visit (This.Constant_Reference);
|
||||
end if;
|
||||
return Col;
|
||||
end Enumerate;
|
||||
|
||||
--------------
|
||||
-- Evaluate --
|
||||
--------------
|
||||
|
||||
function Evaluate (This : Tree; Against : Properties.Vector) return Tree is
|
||||
|
||||
function Evaluate (This : Inner_Node'Class) return Tree is
|
||||
begin
|
||||
case This.Kind is
|
||||
when Condition =>
|
||||
declare
|
||||
Cond : Conditional_Inner renames Conditional_Inner (This);
|
||||
begin
|
||||
if Cond.Condition.Check (Against) then
|
||||
if not Cond.Then_Value.Is_Empty then
|
||||
return Evaluate (Cond.Then_Value.Element);
|
||||
else
|
||||
return Empty;
|
||||
end if;
|
||||
else
|
||||
if not Cond.Else_Value.Is_Empty then
|
||||
return Evaluate (Cond.Else_Value.Element);
|
||||
else
|
||||
return Empty;
|
||||
end if;
|
||||
end if;
|
||||
end;
|
||||
when Value =>
|
||||
return Tree'(To_Holder (This));
|
||||
when Vector =>
|
||||
return Result : Tree := Empty do
|
||||
for Cond of Vector_Inner (This).Values loop
|
||||
if Vector_Inner (This).Conjunction = Anded then
|
||||
Result := Result and Evaluate (Cond);
|
||||
else
|
||||
Result := Result or Evaluate (Cond);
|
||||
end if;
|
||||
end loop;
|
||||
end return;
|
||||
end case;
|
||||
end Evaluate;
|
||||
|
||||
begin
|
||||
if This.Is_Empty then
|
||||
return This;
|
||||
else
|
||||
return Evaluate (This.Element);
|
||||
end if;
|
||||
end Evaluate;
|
||||
|
||||
------------------
|
||||
-- Contains_ORs --
|
||||
------------------
|
||||
|
||||
function Contains_ORs (This : Tree) return Boolean is
|
||||
|
||||
function Verify (This : Tree) return Boolean is
|
||||
Contains : Boolean := False;
|
||||
begin
|
||||
case This.Kind is
|
||||
when Value =>
|
||||
return False;
|
||||
when Condition =>
|
||||
Return
|
||||
This.True_Value.Contains_ORs or Else
|
||||
This.False_Value.Contains_ORs;
|
||||
when Vector =>
|
||||
if This.Conjunction = Ored then
|
||||
return True;
|
||||
else
|
||||
for Child of This loop
|
||||
Contains := Contains or else Verify (Child);
|
||||
end loop;
|
||||
return Contains;
|
||||
end if;
|
||||
end case;
|
||||
end Verify;
|
||||
|
||||
begin
|
||||
if This.Is_Empty then
|
||||
return False;
|
||||
else
|
||||
return Verify (This);
|
||||
end if;
|
||||
end Contains_ORs;
|
||||
|
||||
----------------------
|
||||
-- Is_Unconditional --
|
||||
----------------------
|
||||
|
||||
function Is_Unconditional (This : Tree) return Boolean is
|
||||
|
||||
function Verify (This : Tree) return Boolean is
|
||||
Pass : Boolean := True;
|
||||
begin
|
||||
case This.Kind is
|
||||
when Value =>
|
||||
return True;
|
||||
when Condition =>
|
||||
return False;
|
||||
when Vector =>
|
||||
for Child of This loop
|
||||
Pass := Pass and then Verify (Child);
|
||||
end loop;
|
||||
return Pass;
|
||||
end case;
|
||||
end Verify;
|
||||
|
||||
begin
|
||||
return This.Is_Empty or else Verify (This);
|
||||
end Is_Unconditional;
|
||||
|
||||
----------------------
|
||||
-- Iterate_Children --
|
||||
----------------------
|
||||
|
||||
procedure Iterate_Children (This : Tree;
|
||||
Visitor : access procedure (CV : Tree))
|
||||
is
|
||||
|
||||
procedure Iterate (This : Inner_Node'Class) is
|
||||
begin
|
||||
case This.Kind is
|
||||
when Value | Condition =>
|
||||
raise Constraint_Error with "Conditional value is not a vector";
|
||||
when Vector =>
|
||||
for Inner of Vector_Inner (This).Values loop
|
||||
Visitor (Tree'(To_Holder (Inner)));
|
||||
end loop;
|
||||
end case;
|
||||
end Iterate;
|
||||
|
||||
begin
|
||||
if not This.Is_Empty then
|
||||
Iterate (This.Constant_Reference);
|
||||
end if;
|
||||
end Iterate_Children;
|
||||
|
||||
---------------------
|
||||
-- Case_Statements --
|
||||
---------------------
|
||||
|
||||
package body Case_Statements is
|
||||
|
||||
function Case_Is (Arr : Arrays) return Tree is
|
||||
Case_Is : Tree := Arr (Arr'Last);
|
||||
-- Since we get the whole array,
|
||||
-- by exhaustion at worst the last must be true
|
||||
begin
|
||||
for I in reverse Arr'First .. Enum'Pred (Arr'Last) loop
|
||||
Case_Is := New_Conditional (If_X => Requisite_Equal (I),
|
||||
Then_X => Arr (I),
|
||||
Else_X => Case_Is);
|
||||
end loop;
|
||||
|
||||
return Case_Is;
|
||||
end Case_Is;
|
||||
|
||||
end Case_Statements;
|
||||
|
||||
-----------
|
||||
-- Print --
|
||||
-----------
|
||||
|
||||
procedure Print (This : Tree;
|
||||
Prefix : String := "";
|
||||
And_Or : Boolean := True) is
|
||||
use GNAT.IO;
|
||||
Tab : constant String := " ";
|
||||
|
||||
-- function Image (C : Conjunctions) return String is
|
||||
-- (case C is
|
||||
-- when Anded => "and",
|
||||
-- when Ored => "or");
|
||||
|
||||
begin
|
||||
if This.Is_Empty then
|
||||
Put_Line (Prefix & "(empty)");
|
||||
return;
|
||||
end if;
|
||||
|
||||
case This.Kind is
|
||||
when Value =>
|
||||
Put_Line (Prefix & Image (This.Value));
|
||||
when Condition =>
|
||||
Put_Line (Prefix & "when " & This.Condition.Image & ":");
|
||||
Print (This.True_Value, Prefix & Tab);
|
||||
if not This.False_Value.Is_Empty then
|
||||
Put_Line (Prefix & "else:");
|
||||
Print (This.False_Value, Prefix & Tab);
|
||||
end if;
|
||||
when Vector =>
|
||||
if And_Or then
|
||||
case This.Conjunction is
|
||||
when Anded => Put_Line (Prefix & "All of:");
|
||||
when Ored => Put_Line (Prefix & "First available of:");
|
||||
end case;
|
||||
end if;
|
||||
|
||||
for I in This.Iterate loop
|
||||
Print (This (I),
|
||||
(if And_Or then Prefix else "") & " ");
|
||||
end loop;
|
||||
end case;
|
||||
end Print;
|
||||
|
||||
-------------
|
||||
-- To_Code --
|
||||
-------------
|
||||
|
||||
-- function To_Code (This : Tree) return Utils.String_Vector is
|
||||
-- begin
|
||||
-- case This.Kind is
|
||||
-- when Value =>
|
||||
-- return To_Code (This.Value);
|
||||
-- when Vector =>
|
||||
-- return V : Utils.String_Vector do
|
||||
-- for I in This.Iterate loop
|
||||
-- V.Append (This (I).To_Code);
|
||||
-- if Has_Element (Next (I)) then
|
||||
-- V.Append (Conj_To_Code (This (I).Conjunction));
|
||||
-- end if;
|
||||
-- end loop;
|
||||
-- end return;
|
||||
-- when Condition =>
|
||||
-- raise Program_Error with "Unimplemented";
|
||||
-- end case;
|
||||
-- end To_Code;
|
||||
|
||||
-----------------
|
||||
-- ITERATORS --
|
||||
-----------------
|
||||
|
||||
type Forward_Iterator is new Iterators.Forward_Iterator with record
|
||||
Children : Vectors.Vector;
|
||||
end record;
|
||||
|
||||
-----------
|
||||
-- First --
|
||||
-----------
|
||||
|
||||
overriding function First (Object : Forward_Iterator) return Cursor is
|
||||
(if Object.Children.Is_Empty
|
||||
then Cursor (Vectors.No_Element)
|
||||
else Cursor (Object.Children.First));
|
||||
|
||||
----------
|
||||
-- Next --
|
||||
----------
|
||||
|
||||
function Next (This : Cursor) return Cursor is
|
||||
(Cursor (Vectors.Next (Vectors.Cursor (This))));
|
||||
|
||||
----------
|
||||
-- Next --
|
||||
----------
|
||||
|
||||
overriding function Next (Object : Forward_Iterator;
|
||||
Position : Cursor) return Cursor is
|
||||
(Next (Position));
|
||||
|
||||
-----------------
|
||||
-- Has_Element --
|
||||
-----------------
|
||||
|
||||
function Has_Element (This : Cursor) return Boolean is
|
||||
(Vectors.Has_Element (Vectors.Cursor (This)));
|
||||
|
||||
-------------
|
||||
-- Iterate --
|
||||
-------------
|
||||
|
||||
function Iterate (Container : Tree)
|
||||
return Iterators.Forward_Iterator'Class is
|
||||
begin
|
||||
if Container.Is_Empty then
|
||||
return Forward_Iterator'(others => <>);
|
||||
end if;
|
||||
|
||||
if Container.Kind /= Vector then
|
||||
raise Constraint_Error
|
||||
with "Cannot iterate over non-vector conditional value";
|
||||
end if;
|
||||
|
||||
return Forward_Iterator'
|
||||
(Children =>
|
||||
Vector_Inner (Container.Constant_Reference.Element.all).Values);
|
||||
end Iterate;
|
||||
|
||||
---------------------
|
||||
-- Indexed_Element --
|
||||
---------------------
|
||||
|
||||
function Indexed_Element (Container : Tree;
|
||||
Pos : Cursor)
|
||||
return Tree is
|
||||
(Tree'(To_Holder (Element (Pos))));
|
||||
|
||||
end Alire.Conditional_Trees;
|
||||
@@ -1,341 +0,0 @@
|
||||
with Ada.Containers; use Ada.Containers;
|
||||
with Ada.Iterator_Interfaces;
|
||||
|
||||
with Alire.Properties;
|
||||
with Alire.Requisites;
|
||||
with Alire.Utils;
|
||||
|
||||
private with Ada.Containers.Indefinite_Holders;
|
||||
private with Ada.Containers.Indefinite_Vectors;
|
||||
|
||||
generic
|
||||
type Values (<>) is private;
|
||||
with function Image (V : Values) return String;
|
||||
package Alire.Conditional_Trees with Preelaborate is
|
||||
|
||||
type Kinds is (Condition, Value, Vector);
|
||||
|
||||
type Tree is tagged private with
|
||||
Default_Iterator => Iterate,
|
||||
Iterator_Element => Tree,
|
||||
Constant_Indexing => Indexed_Element;
|
||||
-- Recursive type that stores conditions (requisites) and values/further conditions if they are met or not
|
||||
-- Iteration is only over direct children, when the tree is AND/OR list
|
||||
|
||||
function Leaf_Count (This : Tree) return Natural;
|
||||
|
||||
generic
|
||||
type Collection is private;
|
||||
with procedure Append (C : in out Collection; V : Values; Count : Count_Type := 1);
|
||||
function Materialize (This : Tree; Against : Properties.Vector) return Collection;
|
||||
-- Materialize against the given properties, and return as list
|
||||
-- NOTE: this presumes there are no OR conditions along the tree
|
||||
-- In Alire context, this is always true for properties and
|
||||
-- potentially never for dependencies
|
||||
|
||||
generic
|
||||
type Collection is private;
|
||||
with procedure Append (C : in out Collection; V : Values; Count : Count_Type := 1);
|
||||
function Enumerate (This : Tree) return Collection;
|
||||
-- Return all value nodes, regardless of dependencies/conjunctions
|
||||
-- This is used for textual search and has no semantic trascendence
|
||||
|
||||
function Evaluate (This : Tree; Against : Properties.Vector) return Tree;
|
||||
-- Materialize against the given properties, returning values as an unconditional tree
|
||||
-- NOTE: the result is unconditional but can still contain a mix of AND/OR subtrees
|
||||
|
||||
function Kind (This : Tree) return Kinds;
|
||||
|
||||
function Is_Empty (This : Tree) return Boolean;
|
||||
|
||||
function Empty return Tree;
|
||||
|
||||
function Image_One_Line (This : Tree) return String;
|
||||
|
||||
function Is_Unconditional (This : Tree) return Boolean;
|
||||
-- Recursively!
|
||||
|
||||
function Contains_ORs (This : Tree) return Boolean;
|
||||
|
||||
---------------
|
||||
-- SINGLES --
|
||||
---------------
|
||||
|
||||
function New_Value (V : Values) return Tree; -- when we don't really need a condition
|
||||
|
||||
function Value (This : Tree) return Values
|
||||
with Pre => This.Kind = Value;
|
||||
|
||||
---------------
|
||||
-- VECTORS --
|
||||
---------------
|
||||
|
||||
function "and" (L, R : Tree) return Tree;
|
||||
-- Concatenation
|
||||
|
||||
function "or" (L, R : Tree) return Tree;
|
||||
|
||||
type Conjunctions is (Anded, Ored);
|
||||
|
||||
function Conjunction (This : Tree) return Conjunctions
|
||||
with Pre => This.Kind = Vector;
|
||||
|
||||
procedure Iterate_Children (This : Tree;
|
||||
Visitor : access procedure (CV : Tree));
|
||||
-- There is "of" notation too, but that bugs out when using this package as generic formal
|
||||
|
||||
type Children_Array is array (Positive range <>) of Tree;
|
||||
|
||||
function First_Child (This : Tree) return Tree;
|
||||
|
||||
function All_But_First_Children (This : Tree) return Tree;
|
||||
|
||||
--------------------
|
||||
-- CONDITIONALS --
|
||||
--------------------
|
||||
|
||||
function New_Conditional (If_X : Requisites.Tree;
|
||||
Then_X : Tree;
|
||||
Else_X : Tree) return Tree;
|
||||
|
||||
function Condition (This : Tree) return Requisites.Tree
|
||||
with Pre => This.Kind = Condition;
|
||||
|
||||
function True_Value (This : Tree) return Tree
|
||||
with Pre => This.Kind = Condition;
|
||||
|
||||
function False_Value (This : Tree) return Tree
|
||||
with Pre => This.Kind = Condition;
|
||||
|
||||
generic
|
||||
type Enum is (<>);
|
||||
with function Requisite_Equal (V : Enum) return Requisites.Tree;
|
||||
-- Function which creates an equality requisite on V
|
||||
package Case_Statements is
|
||||
|
||||
type Arrays is array (Enum) of Tree;
|
||||
|
||||
function Case_Is (Arr : Arrays) return Tree;
|
||||
|
||||
end Case_Statements;
|
||||
|
||||
-----------
|
||||
-- Print --
|
||||
-----------
|
||||
|
||||
procedure Print (This : Tree;
|
||||
Prefix : String := "";
|
||||
And_Or : Boolean := True);
|
||||
-- And_Or is false if only And can appear, thus no necessity to distinguish
|
||||
|
||||
-----------------
|
||||
-- ITERATORS --
|
||||
-----------------
|
||||
|
||||
type Cursor is private;
|
||||
|
||||
function Has_Element (This : Cursor) return Boolean;
|
||||
|
||||
function Next (This : Cursor) return Cursor;
|
||||
|
||||
package Iterators is new Ada.Iterator_Interfaces (Cursor, Has_Element);
|
||||
|
||||
function Iterate (Container : Tree)
|
||||
return Iterators.Forward_Iterator'Class;
|
||||
-- Returns our own iterator, which in general will be defined in the
|
||||
-- private part or the body.
|
||||
|
||||
function Indexed_Element (Container : Tree; Pos : Cursor)
|
||||
return Tree;
|
||||
|
||||
private
|
||||
|
||||
type Inner_Node is interface;
|
||||
|
||||
function Image (Node : Inner_Node) return String is abstract;
|
||||
|
||||
function Image_Classwide (Node : Inner_Node'Class) return String is (Node.Image);
|
||||
|
||||
function Kind (This : Inner_Node'Class) return Kinds;
|
||||
|
||||
package Holders is new Ada.Containers.Indefinite_Holders (Inner_Node'Class);
|
||||
package Vectors is new Ada.Containers.Indefinite_Vectors (Positive, Inner_Node'Class);
|
||||
|
||||
type Cursor is new Vectors.Cursor;
|
||||
|
||||
type Tree is new Holders.Holder with null record;
|
||||
-- Instead of dealing with pointers and finalization, we use this class-wide container
|
||||
|
||||
package Definite_Values is new Ada.Containers.Indefinite_Holders (Values);
|
||||
|
||||
type Value_Inner is new Inner_Node with record
|
||||
Value : Definite_Values.Holder;
|
||||
end record;
|
||||
|
||||
overriding function Image (V : Value_Inner) return String is
|
||||
(Image (V.Value.Constant_Reference));
|
||||
|
||||
-- overriding function To_Code (This : Tree) return Utils.String_Vector;
|
||||
|
||||
type Vector_Inner is new Inner_Node with record
|
||||
Conjunction : Conjunctions;
|
||||
Values : Vectors.Vector;
|
||||
end record;
|
||||
|
||||
function Conjunction (This : Vector_Inner) return Conjunctions is
|
||||
(This.Conjunction);
|
||||
|
||||
package Non_Primitive is
|
||||
function One_Liner_And is new Utils.Image_One_Line
|
||||
(Vectors,
|
||||
Vectors.Vector,
|
||||
Image_Classwide,
|
||||
" and ",
|
||||
"(empty condition)");
|
||||
|
||||
function One_Liner_Or is new Utils.Image_One_Line
|
||||
(Vectors,
|
||||
Vectors.Vector,
|
||||
Image_Classwide,
|
||||
" or ",
|
||||
"(empty condition)");
|
||||
end Non_Primitive;
|
||||
|
||||
overriding function Image (V : Vector_Inner) return String is
|
||||
("(" & (if V.Conjunction = Anded
|
||||
then Non_Primitive.One_Liner_And (V.Values)
|
||||
else Non_Primitive.One_Liner_Or (V.Values)) & ")");
|
||||
|
||||
type Conditional_Inner is new Inner_Node with record
|
||||
Condition : Requisites.Tree;
|
||||
Then_Value : Tree;
|
||||
Else_Value : Tree;
|
||||
end record;
|
||||
|
||||
overriding function Image (V : Conditional_Inner) return String is
|
||||
("if " & V.Condition.Image &
|
||||
" then " & V.Then_Value.Image_One_Line &
|
||||
" else " & V.Else_Value.Image_One_Line);
|
||||
|
||||
--------------
|
||||
-- As_Value --
|
||||
--------------
|
||||
|
||||
function As_Value (This : Tree) return Values
|
||||
is
|
||||
(Value_Inner (This.Element).Value.Element)
|
||||
with Pre => This.Kind = Value;
|
||||
|
||||
--------------------
|
||||
-- As_Conditional --
|
||||
--------------------
|
||||
|
||||
function As_Conditional (This : Tree) return Conditional_Inner'Class is
|
||||
(Conditional_Inner'Class (This.Element))
|
||||
with Pre => This.Kind = Condition;
|
||||
|
||||
---------------
|
||||
-- As_Vector --
|
||||
---------------
|
||||
|
||||
function As_Vector (This : Tree) return Vectors.Vector is
|
||||
(Vector_Inner'Class (This.Element).Values)
|
||||
with Pre => This.Kind = Vector;
|
||||
|
||||
-----------------
|
||||
-- Conjunction --
|
||||
-----------------
|
||||
|
||||
function Conjunction (This : Tree) return Conjunctions is
|
||||
(Vector_Inner'Class (This.Element).Conjunction);
|
||||
|
||||
-----------------
|
||||
-- First_Child --
|
||||
-----------------
|
||||
|
||||
function First_Child (This : Tree) return Tree is
|
||||
(To_Holder (This.As_Vector.First_Element));
|
||||
|
||||
---------------------
|
||||
-- New_Conditional --
|
||||
---------------------
|
||||
|
||||
function New_Conditional (If_X : Requisites.Tree;
|
||||
Then_X : Tree;
|
||||
Else_X : Tree) return Tree is
|
||||
(To_Holder (Conditional_Inner'(Condition => If_X,
|
||||
Then_Value => Then_X,
|
||||
Else_Value => Else_X)));
|
||||
|
||||
---------------
|
||||
-- New_Value --
|
||||
---------------
|
||||
|
||||
function New_Value (V : Values) return Tree is
|
||||
(To_Holder (Value_Inner'(Value => Definite_Values.To_Holder (V))));
|
||||
|
||||
---------------
|
||||
-- Condition --
|
||||
---------------
|
||||
|
||||
function Condition (This : Tree) return Requisites.Tree is
|
||||
(This.As_Conditional.Condition);
|
||||
|
||||
-----------
|
||||
-- Value --
|
||||
-----------
|
||||
|
||||
function Value (This : Tree) return Values renames As_Value;
|
||||
|
||||
----------------
|
||||
-- True_Value --
|
||||
----------------
|
||||
|
||||
function True_Value (This : Tree) return Tree is
|
||||
(This.As_Conditional.Then_Value);
|
||||
|
||||
-----------------
|
||||
-- False_Value --
|
||||
-----------------
|
||||
|
||||
function False_Value (This : Tree) return Tree is
|
||||
(This.As_Conditional.Else_Value);
|
||||
|
||||
-----------
|
||||
-- Empty --
|
||||
-----------
|
||||
|
||||
function Empty return Tree is
|
||||
(Holders.Empty_Holder with null record);
|
||||
|
||||
--------------
|
||||
-- Is_Empty --
|
||||
--------------
|
||||
|
||||
overriding function Is_Empty (This : Tree) return Boolean is
|
||||
(Holders.Holder (This).Is_Empty);
|
||||
|
||||
----------
|
||||
-- Kind --
|
||||
----------
|
||||
|
||||
function Kind (This : Inner_Node'Class) return Kinds is
|
||||
(if This in Value_Inner'Class
|
||||
then Value
|
||||
else (if This in Vector_Inner'Class
|
||||
then Vector
|
||||
else Condition));
|
||||
|
||||
function Kind (This : Tree) return Kinds is
|
||||
(This.Constant_Reference.Kind);
|
||||
|
||||
--------------------
|
||||
-- Image_One_Line --
|
||||
--------------------
|
||||
|
||||
function Image_One_Line (This : Tree) return String is
|
||||
(if This.Is_Empty
|
||||
then "(empty condition)"
|
||||
else This.Constant_Reference.Image);
|
||||
|
||||
end Alire.Conditional_Trees;
|
||||
@@ -1,89 +0,0 @@
|
||||
with Semantic_Versioning;
|
||||
|
||||
package body Alire.Containers is
|
||||
|
||||
------------
|
||||
-- Insert --
|
||||
------------
|
||||
|
||||
procedure Insert (Dst : in out Release_Map; Src : Release_Map) is
|
||||
begin
|
||||
for E of Src loop
|
||||
Dst.Insert (E.Project, E);
|
||||
end loop;
|
||||
end Insert;
|
||||
|
||||
---------------
|
||||
-- Inserting --
|
||||
---------------
|
||||
|
||||
function Inserting (Dst : Release_Map; Src : Release_Map) return Release_Map is
|
||||
begin
|
||||
return Result : Release_Map := Dst do
|
||||
for E of Src loop
|
||||
Result.Insert (E.Project, E);
|
||||
if E.Project /= E.Provides then
|
||||
Result.Insert (E.Provides, E);
|
||||
end if;
|
||||
end loop;
|
||||
end return;
|
||||
end Inserting;
|
||||
|
||||
function Inserting (Dst : Release_Map; Src : Releases.Release) return Release_Map is
|
||||
(Dst.Inserting (To_Map (Src)));
|
||||
|
||||
---------------
|
||||
-- Excluding --
|
||||
---------------
|
||||
|
||||
function Excluding (Map : Release_Map; Name : Alire.Project) return Release_Map is
|
||||
begin
|
||||
return Filtered : Release_Map := Map do
|
||||
Filtered.Exclude (Name);
|
||||
end return;
|
||||
end Excluding;
|
||||
|
||||
---------------
|
||||
-- Including --
|
||||
---------------
|
||||
|
||||
function Including (Map : Release_Map; Release : Releases.Release) return Release_Map is
|
||||
begin
|
||||
return New_Map : Release_Map := Map do
|
||||
New_Map.Include (Release.Project, Release);
|
||||
end return;
|
||||
end Including;
|
||||
|
||||
---------------------
|
||||
-- To_Dependencies --
|
||||
---------------------
|
||||
|
||||
function To_Dependencies (Map : Release_Map) return Conditional.Dependencies is
|
||||
use Conditional.For_Dependencies;
|
||||
use Project_Release_Maps;
|
||||
begin
|
||||
return Deps : Conditional.Dependencies do
|
||||
for I in Map.Iterate loop
|
||||
if Key (I) = Map (I).Provides then -- Avoid duplicates
|
||||
Deps :=
|
||||
Deps and
|
||||
Conditional.New_Dependency
|
||||
(Map (I).Project,
|
||||
Semantic_Versioning.Exactly (Map (I).Version));
|
||||
end if;
|
||||
end loop;
|
||||
end return;
|
||||
end To_Dependencies;
|
||||
|
||||
------------
|
||||
-- To_Map --
|
||||
------------
|
||||
|
||||
function To_Map (R : Releases.Release) return Release_Map is
|
||||
begin
|
||||
return M : Release_Map do
|
||||
M.Include (R.Project, R);
|
||||
end return;
|
||||
end To_Map;
|
||||
|
||||
end Alire.Containers;
|
||||
@@ -1,53 +0,0 @@
|
||||
with Ada.Containers.Indefinite_Doubly_Linked_Lists;
|
||||
with Ada.Containers.Indefinite_Holders;
|
||||
with Ada.Containers.Indefinite_Ordered_Maps;
|
||||
with Ada.Containers.Indefinite_Ordered_Sets;
|
||||
|
||||
with Alire.Conditional;
|
||||
with Alire.Dependencies;
|
||||
with Alire.Milestones;
|
||||
with Alire.Releases;
|
||||
|
||||
package Alire.Containers with Preelaborate is
|
||||
|
||||
package Dependency_Lists Is new Ada.Containers.Indefinite_Doubly_Linked_Lists
|
||||
(Dependencies.Dependency,
|
||||
Dependencies."=");
|
||||
|
||||
package Milestone_Sets is new Ada.Containers.Indefinite_Ordered_Sets (Milestones.Milestone,
|
||||
Milestones."<",
|
||||
Milestones."=");
|
||||
|
||||
|
||||
package Release_Sets is new Ada.Containers.Indefinite_Ordered_Sets (Releases.Release,
|
||||
Releases."<",
|
||||
Releases."=");
|
||||
subtype Release_Set is Release_Sets.Set;
|
||||
|
||||
package Release_Holders is new Ada.Containers.Indefinite_Holders (Releases.Release,
|
||||
Releases."=");
|
||||
subtype Release_H is Release_Holders.Holder;
|
||||
|
||||
|
||||
package Project_Release_Maps is new Ada.Containers.Indefinite_Ordered_Maps
|
||||
(Alire.Project, Releases.Release, "<", Releases."=");
|
||||
type Release_Map is new Project_Release_Maps.Map with null record;
|
||||
|
||||
function Excluding (Map : Release_Map; Name : Alire.Project) return Release_Map;
|
||||
|
||||
function Including (Map : Release_Map; Release : Releases.Release) return Release_Map;
|
||||
-- Finds the current release (if existing) and replaces/adds the new Release
|
||||
|
||||
procedure Insert (Dst : in out Release_Map; Src : Release_Map);
|
||||
|
||||
function Inserting (Dst : Release_Map; Src : Release_Map) return Release_Map;
|
||||
function Inserting (Dst : Release_Map; Src : Releases.release) return Release_Map;
|
||||
-- Those insert both under the actual project name and Provides, if different
|
||||
|
||||
function To_Dependencies (Map : Release_Map)
|
||||
return Conditional.Dependencies;
|
||||
-- Will filter out duplicates under Provides key (only actual projects will remain)
|
||||
|
||||
function To_Map (R : Releases.Release) return Release_Map;
|
||||
|
||||
end Alire.Containers;
|
||||
@@ -1,51 +0,0 @@
|
||||
with Alire.Utils;
|
||||
|
||||
with Semantic_Versioning;
|
||||
|
||||
package Alire.Dependencies with Preelaborate is
|
||||
|
||||
subtype Names is Alire.Project;
|
||||
|
||||
-- A single dependency is a project name plus a version set
|
||||
|
||||
type Dependency (<>) is tagged private;
|
||||
|
||||
function New_Dependency (Project : Alire.Project;
|
||||
Versions : Semantic_Versioning.Version_Set) return Dependency;
|
||||
|
||||
function Project (Dep : Dependency) return Names;
|
||||
|
||||
function Versions (Dep : Dependency) return Semantic_Versioning.Version_Set;
|
||||
|
||||
function Image (Dep : Dependency) return String;
|
||||
|
||||
function Unavailable return Dependency;
|
||||
-- Special never available dependency to beautify a bit textual outputs
|
||||
|
||||
private
|
||||
|
||||
type Dependency (Name_Len : Natural) is tagged record
|
||||
Project : Alire.Project (1 .. Name_Len);
|
||||
Versions : Semantic_Versioning.Version_Set;
|
||||
end record;
|
||||
|
||||
function New_Dependency (Project : Alire.Project;
|
||||
Versions : Semantic_Versioning.Version_Set) return Dependency
|
||||
is (Project'Length, Project, Versions);
|
||||
|
||||
function Project (Dep : Dependency) return Names is (Dep.Project);
|
||||
|
||||
function Versions (Dep : Dependency) return Semantic_Versioning.Version_Set is
|
||||
(Dep.Versions);
|
||||
|
||||
function Image (Dep : Dependency) return String is -- Exceptional case: alire=0.0.0 means Unavailable
|
||||
(if Dep = Unavailable
|
||||
then "Unavailable"
|
||||
else
|
||||
(Utils.To_Lower_Case (+Dep.Project) & " is " &
|
||||
Semantic_Versioning.Image (Dep.Versions)));
|
||||
|
||||
function Unavailable return Dependency is
|
||||
(New_Dependency ("alire", Semantic_Versioning.Exactly (Semantic_Versioning.V ("0"))));
|
||||
|
||||
end Alire.Dependencies;
|
||||
@@ -1,67 +0,0 @@
|
||||
package body Alire.GPR is
|
||||
|
||||
-----------
|
||||
-- Image --
|
||||
-----------
|
||||
|
||||
function Image (V : Variable) return String is
|
||||
|
||||
function Listify (Vals : Value_Vector) return String is
|
||||
Head : constant String := Vals.First_Element;
|
||||
Tail : Value_Vector := Vals;
|
||||
begin
|
||||
Tail.Delete_First;
|
||||
|
||||
return Head &
|
||||
(if Tail.Is_Empty
|
||||
then ""
|
||||
else " | " & Listify (Tail));
|
||||
end Listify;
|
||||
|
||||
begin
|
||||
case V.Kind is
|
||||
when Free_String =>
|
||||
return V.Name & " := <string>";
|
||||
when Enumeration =>
|
||||
return V.Name & " := " & Listify (V.Values);
|
||||
when External =>
|
||||
return V.Name & " := " & V.Value.First_Element;
|
||||
end case;
|
||||
end Image;
|
||||
|
||||
------------------
|
||||
-- Add_Argument --
|
||||
------------------
|
||||
|
||||
procedure Add_Argument (S : in out Scenario; Var : String; Val : String) is
|
||||
begin
|
||||
S.Append (Var);
|
||||
S.Append (Val);
|
||||
end Add_Argument;
|
||||
|
||||
---------------------
|
||||
-- As_Command_Line --
|
||||
---------------------
|
||||
|
||||
function As_Command_Line (S : Scenario) return String is
|
||||
|
||||
-------------
|
||||
-- Listify --
|
||||
-------------
|
||||
|
||||
function Listify (S : Scenario) return String is
|
||||
Var : constant String := S (1);
|
||||
Val : constant String := S (2);
|
||||
Cdr : Scenario := S;
|
||||
begin
|
||||
Cdr.Delete_First;
|
||||
Cdr.Delete_First;
|
||||
return "-X" & Var & "=" & Val &
|
||||
(if Cdr.Is_Empty then "" else " " & Listify (Cdr));
|
||||
end Listify;
|
||||
|
||||
begin
|
||||
return (if S.Is_Empty then "" else Listify (S));
|
||||
end As_Command_Line;
|
||||
|
||||
end Alire.GPR;
|
||||
@@ -1,96 +0,0 @@
|
||||
with Alire.Utils;
|
||||
|
||||
package Alire.GPR with Preelaborate is
|
||||
|
||||
type Variable_Kinds is (Enumeration, Free_String, External);
|
||||
-- Enumeration: Name + all possible values
|
||||
-- Free_String: Name without value
|
||||
-- External : Name=Value
|
||||
|
||||
type Variable (<>) is tagged private;
|
||||
|
||||
function Kind (V : Variable) return Variable_Kinds;
|
||||
|
||||
function Name (V : Variable) return String;
|
||||
|
||||
function Image (V : Variable) return String;
|
||||
|
||||
function Free_Variable (Name : String) return Variable;
|
||||
|
||||
subtype Value is String;
|
||||
|
||||
type Value_Vector is new Utils.String_Vector with null record;
|
||||
|
||||
function Enum_Variable (Name : String;
|
||||
Values : Value_Vector'Class) return Variable;
|
||||
-- Used to represent a Typed enum with its possible values: Name = Value1 | Value2 ...
|
||||
|
||||
function External_Value (Name : String;
|
||||
Value : String) return Variable;
|
||||
-- Used to represent a pair Name=Value
|
||||
|
||||
function Values (V : Variable) return Value_Vector'Class
|
||||
with Pre => V.Kind = Enumeration;
|
||||
|
||||
function External_value (V : Variable) return String
|
||||
with Pre => V.Kind = External;
|
||||
|
||||
function "or" (L, R : Value) return Value_Vector;
|
||||
function "or" (L : Value_Vector; R : Value) return Value_Vector;
|
||||
|
||||
-- A collection of Var=Arg conform a scenario:
|
||||
-- These are used to store -X command-line arguments
|
||||
|
||||
type Scenario is tagged private;
|
||||
|
||||
Empty_Scenario : constant Scenario;
|
||||
|
||||
procedure Add_Argument (S : in out Scenario; Var : String; Val : String);
|
||||
|
||||
function As_Command_Line (S : Scenario) return String;
|
||||
-- -Xvar1=val -Xvar2=val ...
|
||||
|
||||
function Is_Empty (S : Scenario) return Boolean;
|
||||
|
||||
private
|
||||
|
||||
type Variable (Kind : Variable_Kinds; Name_Len : Positive) is tagged record
|
||||
Name : String (1 .. Name_Len);
|
||||
case Kind is
|
||||
when Enumeration =>
|
||||
Values : Value_Vector;
|
||||
when External =>
|
||||
Value : Value_Vector; -- Only one element
|
||||
when Free_String =>
|
||||
null;
|
||||
end case;
|
||||
end record;
|
||||
|
||||
function Kind (V : Variable) return Variable_Kinds is (V.Kind);
|
||||
|
||||
function Name (V : Variable) return String is (V.Name);
|
||||
|
||||
function Free_Variable (Name : String) return Variable is (Free_String, Name'Length, Name);
|
||||
|
||||
function Enum_Variable (Name : String;
|
||||
Values : Value_Vector'Class) return Variable is
|
||||
(Enumeration, Name'Length, Name, Value_Vector (Values));
|
||||
|
||||
function External_Value (Name : String;
|
||||
Value : String) return Variable is
|
||||
(External, Name'Length, Name, To_Vector (Value, 1));
|
||||
|
||||
function Values (V : Variable) return Value_Vector'Class is (V.Values);
|
||||
|
||||
function External_Value (V : Variable) return String is (V.Value.First_Element);
|
||||
|
||||
function "or" (L, R : Value) return Value_Vector is (L & R);
|
||||
function "or" (L : Value_Vector; R : Value) return Value_Vector is (L & R);
|
||||
|
||||
type Scenario is new Utils.String_Vector with null record;
|
||||
|
||||
function Is_Empty (S : Scenario) return Boolean is (Utils.String_Vector (S).Is_Empty);
|
||||
|
||||
Empty_Scenario : constant Scenario := (Utils.String_Vectors.Empty_Vector with null record);
|
||||
|
||||
end Alire.GPR;
|
||||
@@ -1,251 +0,0 @@
|
||||
with Ada.Containers.Indefinite_Ordered_Maps;
|
||||
|
||||
with GNAT.Source_Info;
|
||||
|
||||
package body Alire.Index is
|
||||
|
||||
use all type Version;
|
||||
|
||||
package Name_Entry_Maps is new Ada.Containers.Indefinite_Ordered_Maps (Alire.Project,
|
||||
Catalog_Entry);
|
||||
|
||||
Master_Entries : Name_Entry_Maps.Map;
|
||||
|
||||
type Reflected_Info (Pack_Len, Id_Len : Positive) is record
|
||||
Package_Name : String (1 .. Pack_Len);
|
||||
Identifier : String (1 .. Id_Len);
|
||||
end record;
|
||||
|
||||
--------------
|
||||
-- Identify --
|
||||
--------------
|
||||
|
||||
function Identify (Enclosing : String) return Reflected_Info is
|
||||
use Utils;
|
||||
Identifier : constant String := -- Portion after last dot
|
||||
Split (Enclosing, '.', Side => Tail, From => Tail);
|
||||
Full_Name : constant String := -- Portion after Alire.Index.
|
||||
Split (Enclosing, '.', Side => Tail, From => Head, Count => 2);
|
||||
Pack_Name : constant String := -- Portion between Alire.Index. and .Identifier
|
||||
Split (Full_Name, '.', Side => Head, From => Tail);
|
||||
begin
|
||||
return (Pack_Name'Length, Identifier'Length, Pack_Name, Identifier);
|
||||
end Identify;
|
||||
|
||||
------------------------
|
||||
-- Catalogued_Project --
|
||||
------------------------
|
||||
|
||||
function Catalogued_Project return Catalog_Entry is
|
||||
use Utils;
|
||||
Reflected : constant Reflected_Info :=
|
||||
Identify (GNAT.Source_Info.Enclosing_Entity);
|
||||
begin
|
||||
return C : constant Catalog_Entry :=
|
||||
(Name_Len => Reflected.Pack_Len,
|
||||
Descr_Len => Description'Length,
|
||||
Pack_Len => Reflected.Pack_Len,
|
||||
Self_Len => Reflected.Id_Len,
|
||||
|
||||
Project => +To_Lower_Case (Reflected.Package_Name),
|
||||
Description => Description,
|
||||
Package_Name => Reflected.Package_Name,
|
||||
Self_Name => Reflected.Identifier)
|
||||
do
|
||||
if First_Use.all then
|
||||
First_Use.all := False;
|
||||
|
||||
Master_Entries.Insert (C.Project, C);
|
||||
Projects.Descriptions.Insert (C.Project, Description);
|
||||
end if;
|
||||
end return;
|
||||
end Catalogued_Project;
|
||||
|
||||
-------------
|
||||
-- Current --
|
||||
-------------
|
||||
|
||||
function Current (C : Catalog_Entry) return Release is
|
||||
begin
|
||||
for R of reverse Catalog loop
|
||||
if R.Project = C.Project then
|
||||
return R;
|
||||
end if;
|
||||
end loop;
|
||||
|
||||
raise Program_Error with "Catalog entry without releases: " & (+C.Project);
|
||||
end Current;
|
||||
|
||||
---------
|
||||
-- Get --
|
||||
---------
|
||||
|
||||
function Get (Name : Alire.Project) return Catalog_Entry is
|
||||
(Master_Entries.Element (Name));
|
||||
|
||||
--------------------------
|
||||
-- Is_Currently_Indexed --
|
||||
--------------------------
|
||||
|
||||
function Is_Currently_Indexed (Name : Alire.Project) return Boolean is
|
||||
(Master_Entries.Contains (Name));
|
||||
|
||||
------------
|
||||
-- Exists --
|
||||
------------
|
||||
|
||||
function Exists (Project : Alire.Project;
|
||||
Version : Semantic_Versioning.Version)
|
||||
return Boolean is
|
||||
begin
|
||||
for R of Catalog loop
|
||||
if R.Project = Project and then R.Version = Version then
|
||||
return True;
|
||||
end if;
|
||||
end loop;
|
||||
|
||||
return False;
|
||||
end Exists;
|
||||
|
||||
----------
|
||||
-- Find --
|
||||
----------
|
||||
|
||||
function Find (Project : Alire.Project;
|
||||
Version : Semantic_Versioning.Version) return Release is
|
||||
begin
|
||||
for R of Catalog loop
|
||||
if R.Project = Project and then R.Version = Version then
|
||||
return R;
|
||||
end if;
|
||||
end loop;
|
||||
|
||||
raise Constraint_Error with "Not in index: " & (+Project) & "=" & Semantic_Versioning.Image (Version);
|
||||
end Find;
|
||||
|
||||
-------------------
|
||||
-- Register_Real --
|
||||
-------------------
|
||||
|
||||
function Register_Real (R : Release) return Release is
|
||||
begin
|
||||
if Catalog.Contains (R) then
|
||||
Trace.Error ("Attempt to register duplicate versions: " & R.Milestone.Image);
|
||||
else
|
||||
Catalog.Insert (R);
|
||||
end if;
|
||||
|
||||
return R;
|
||||
end Register_Real;
|
||||
|
||||
--------------
|
||||
-- Register --
|
||||
--------------
|
||||
|
||||
function Register (-- Mandatory
|
||||
This : Catalog_Entry;
|
||||
Version : Semantic_Versioning.Version;
|
||||
Origin : Origins.Origin;
|
||||
-- we force naming beyond this point with this ugly guard:
|
||||
XXXXXXXXXXXXXX : Utils.XXX_XXX := Utils.XXX_XXX_XXX;
|
||||
-- Optional
|
||||
Notes : Description_String := "";
|
||||
Dependencies : Release_Dependencies := No_Dependencies;
|
||||
Properties : Release_Properties := No_Properties;
|
||||
Private_Properties : Release_Properties := No_Properties;
|
||||
Available_When : Release_Requisites := No_Requisites)
|
||||
return Release
|
||||
is
|
||||
pragma Unreferenced (XXXXXXXXXXXXXX);
|
||||
begin
|
||||
return Register_Real
|
||||
(Alire.Releases.New_Release
|
||||
(Project => This.Project,
|
||||
Version => Version,
|
||||
Origin => Origin,
|
||||
Notes => Notes,
|
||||
Dependencies => Dependencies,
|
||||
Properties => Properties,
|
||||
Private_Properties => Private_Properties,
|
||||
Available => Available_When));
|
||||
end Register;
|
||||
|
||||
--------------
|
||||
-- Register --
|
||||
--------------
|
||||
|
||||
function Register (Extension : Catalog_Entry;
|
||||
Extended_Release : Release)
|
||||
return Release
|
||||
is
|
||||
begin
|
||||
return Register_Real (Extended_Release.Replacing
|
||||
(Project => Extension.Project));
|
||||
end Register;
|
||||
|
||||
----------------
|
||||
-- Unreleased --
|
||||
----------------
|
||||
|
||||
function Unreleased (This : Catalog_Entry;
|
||||
Version : Semantic_Versioning.Version := No_Version;
|
||||
Origin : Origins.Origin := No_Origin;
|
||||
Notes : Description_String := "";
|
||||
Dependencies : Release_Dependencies := No_Dependencies;
|
||||
Properties : Release_Properties := No_Properties;
|
||||
Private_Properties : Release_Properties := No_Properties;
|
||||
Available_When : Release_Requisites := No_Requisites)
|
||||
return Release
|
||||
is
|
||||
begin
|
||||
return
|
||||
Alire.Releases.New_Release (Project => This.Project,
|
||||
Version => Version,
|
||||
Origin => Origin,
|
||||
Notes => Notes,
|
||||
Dependencies => Dependencies,
|
||||
Properties => Properties,
|
||||
Private_Properties => Private_Properties,
|
||||
Available => Available_When);
|
||||
end Unreleased;
|
||||
|
||||
-----------------
|
||||
-- New_Release --
|
||||
-----------------
|
||||
|
||||
package body Project_Release is
|
||||
|
||||
The_Release : constant Index.Release :=
|
||||
Project.Register -- Add to catalog
|
||||
(Base.Retagging -- Overriding the version
|
||||
(Versions.From_Identifier -- with the one in the
|
||||
(Identify -- package name
|
||||
(GNAT.Source_Info.Enclosing_Entity).Identifier)));
|
||||
|
||||
-------------
|
||||
-- Release --
|
||||
-------------
|
||||
|
||||
function Release return Index.Release is
|
||||
begin
|
||||
return The_Release;
|
||||
end Release;
|
||||
|
||||
function Version return Semantic_Versioning.Version is
|
||||
(The_Release.Version);
|
||||
|
||||
function Version return Semantic_Versioning.Version_Set is
|
||||
(Exactly (The_Release.Version));
|
||||
|
||||
function This_Version return Conditional.Dependencies is
|
||||
(The_Release.This_Version);
|
||||
|
||||
function Within_Major return Conditional.Dependencies is
|
||||
(The_Release.Within_Major);
|
||||
|
||||
function Within_Minor return Conditional.Dependencies is
|
||||
(The_Release.Within_Minor);
|
||||
|
||||
end Project_Release;
|
||||
|
||||
end Alire.Index;
|
||||
@@ -1,420 +0,0 @@
|
||||
private with Alire_Early_Elaboration; pragma Unreferenced (Alire_Early_Elaboration);
|
||||
|
||||
with Alire.Actions;
|
||||
with Alire.Conditional;
|
||||
with Alire.Containers;
|
||||
with Alire.Dependencies;
|
||||
-- with Alire.Dependencies.Vectors;
|
||||
with Alire.GPR;
|
||||
with Alire.Licensing;
|
||||
with Alire.Origins;
|
||||
with Alire.Platforms;
|
||||
with Alire.Projects;
|
||||
with Alire.Properties;
|
||||
with Alire.Properties.Labeled;
|
||||
with Alire.Properties.Licenses;
|
||||
with Alire.Properties.Scenarios;
|
||||
with Alire.Releases;
|
||||
with Alire.Requisites;
|
||||
-- with Alire.Requisites.Dependencies;
|
||||
with Alire.Requisites.Platform;
|
||||
with Alire.Root;
|
||||
with Alire.Roots;
|
||||
with Alire.Utils;
|
||||
with Alire.Versions;
|
||||
|
||||
with Semantic_Versioning;
|
||||
|
||||
package Alire.Index is
|
||||
|
||||
---------------
|
||||
-- CATALOG --
|
||||
---------------
|
||||
|
||||
Catalog : Containers.Release_Set;
|
||||
|
||||
type Catalog_Entry (<>) is new Projects.Named and Versions.Comparable with private;
|
||||
-- Used to force the declaration of a single variable to refer to a project in index specs
|
||||
-- NOTE that the following generics internally use GNAT.Source_Info to
|
||||
-- ascertain the package and project names.
|
||||
-- This is probably the hardest GNAT dependency all around,
|
||||
-- but at the same time avoids manual duplication and chance of error.
|
||||
|
||||
generic
|
||||
Description : Description_String;
|
||||
|
||||
-- For internal use:
|
||||
First_Use : access Boolean := new Boolean'(True);
|
||||
function Catalogued_Project return Catalog_Entry;
|
||||
-- A regular project
|
||||
-- See above note on Catalog_Entry
|
||||
|
||||
overriding
|
||||
function Project (C : Catalog_Entry) return Alire.Project;
|
||||
|
||||
function Description (C : Catalog_Entry) return Description_String;
|
||||
|
||||
function Ada_Identifier (C : Catalog_Entry) return String;
|
||||
-- Returns Name.Project, for master projects
|
||||
-- Returns Parent.Subproject_Name, for subprojects
|
||||
|
||||
function Package_Name (C : Catalog_Entry) return String;
|
||||
-- Returns the unique part only, e.g. Alr for Alire.Index.Alr
|
||||
-- As an exception, for Alire it returns the full path
|
||||
|
||||
-----------------
|
||||
-- Index types --
|
||||
-----------------
|
||||
|
||||
subtype Release_Dependencies is Conditional.Dependencies;
|
||||
subtype Release_Properties is Conditional.Properties;
|
||||
subtype Release_Requisites is Requisites.Tree;
|
||||
|
||||
No_Dependencies : constant Release_Dependencies := Conditional.For_Dependencies.Empty;
|
||||
No_Properties : constant Release_Properties := Conditional.For_Properties.Empty;
|
||||
No_Requisites : constant Requisites.Tree := Requisites.Trees.Empty_Tree;
|
||||
No_Origin : constant Origins.Origin := Origins.New_Filesystem ("/unavailable");
|
||||
No_Version : constant Semantic_Versioning.Version := Semantic_Versioning.Relaxed ("0");
|
||||
|
||||
subtype Release is Alire.Releases.Release;
|
||||
|
||||
function Register (-- Mandatory
|
||||
This : Catalog_Entry;
|
||||
Version : Semantic_Versioning.Version;
|
||||
Origin : Origins.Origin;
|
||||
-- we force naming beyond this point with this ugly guard:
|
||||
XXXXXXXXXXXXXX : Utils.XXX_XXX := Utils.XXX_XXX_XXX;
|
||||
-- Optional
|
||||
Notes : Description_String := "";
|
||||
Dependencies : Release_Dependencies := No_Dependencies;
|
||||
Properties : Release_Properties := No_Properties;
|
||||
Private_Properties : Release_Properties := No_Properties;
|
||||
Available_When : Release_Requisites := No_Requisites)
|
||||
return Release;
|
||||
-- Properties are generally interesting to the user
|
||||
-- Private_Properties are only interesting to alr
|
||||
|
||||
function Register (Extension : Catalog_Entry;
|
||||
Extended_Release : Release)
|
||||
return Release;
|
||||
-- Register an extension
|
||||
-- A extension is a secondary project in the same commit as its parent release
|
||||
-- Essentially, another project file with additional properties/dependencies
|
||||
-- A extension name is parent:name (e.g.: adayaml:server)
|
||||
-- It inherits all properties (including project files)
|
||||
|
||||
function Unreleased (This : Catalog_Entry;
|
||||
Version : Semantic_Versioning.Version := No_Version;
|
||||
Origin : Origins.Origin := No_Origin;
|
||||
Notes : Description_String := "";
|
||||
Dependencies : Release_Dependencies := No_Dependencies;
|
||||
Properties : Release_Properties := No_Properties;
|
||||
Private_Properties : Release_Properties := No_Properties;
|
||||
Available_When : Release_Requisites := No_Requisites)
|
||||
return Release;
|
||||
-- Does nothing: useful to prepare base releases for extending/upgrading
|
||||
|
||||
------------------------------------------------------------------
|
||||
-- NEW INDEXING FACILITIES USING Enclosing_Entity for the version
|
||||
|
||||
generic
|
||||
Base : Release;
|
||||
with function Project return Catalog_Entry is <>;
|
||||
package Project_Release is
|
||||
|
||||
function Release return Index.Release;
|
||||
|
||||
function Version return Semantic_Versioning.Version;
|
||||
function Version return Semantic_Versioning.Version_Set;
|
||||
|
||||
function This_Version return Conditional.Dependencies;
|
||||
function Within_Major return Conditional.Dependencies;
|
||||
function Within_Minor return Conditional.Dependencies;
|
||||
|
||||
end Project_Release;
|
||||
|
||||
------------------------------------------------------------------
|
||||
|
||||
---------------------
|
||||
-- BASIC QUERIES --
|
||||
---------------------
|
||||
|
||||
function Is_Currently_Indexed (Name : Alire.Project) return Boolean;
|
||||
-- It will depend on the compilation scope
|
||||
|
||||
function Current (C : Catalog_Entry) return Release;
|
||||
-- Get newest release of C project
|
||||
|
||||
function Get (Name : Alire.Project) return Catalog_Entry;
|
||||
-- Master entry for project
|
||||
|
||||
function Exists (Project : Alire.Project;
|
||||
Version : Semantic_Versioning.Version)
|
||||
return Boolean;
|
||||
|
||||
function Find (Project : Alire.Project;
|
||||
Version : Semantic_Versioning.Version) return Release;
|
||||
|
||||
------------------------
|
||||
-- INDEXING SUPPORT --
|
||||
------------------------
|
||||
|
||||
-- Shortcuts for origins:
|
||||
|
||||
function Git (URL : Alire.URL; Commit : Origins.Git_Commit) return Origins.Origin renames Origins.New_Git;
|
||||
function Hg (URL : Alire.URL; Commit : Origins.Hg_Commit) return Origins.Origin renames Origins.New_Hg;
|
||||
function SVN (URL : Alire.URL; Commit : String) return Origins.Origin renames Origins.New_SVN;
|
||||
|
||||
function Packaged_As (S : String) return Origins.Package_Names renames Origins.Packaged_As;
|
||||
|
||||
function Unavailable return Origins.Package_Names renames Origins.Unavailable;
|
||||
|
||||
function Native (Distros : Origins.Native_Packages) return Origins.Origin renames Origins.New_Native;
|
||||
|
||||
function Source_Archive (URL : Alire.URL; Name : String := "") return Origins.Origin
|
||||
renames Origins.New_Source_Archive;
|
||||
|
||||
------------------
|
||||
-- Dependencies --
|
||||
------------------
|
||||
|
||||
package Semver renames Semantic_Versioning;
|
||||
|
||||
function V (Semantic_Version : String) return Semver.Version
|
||||
renames Semver.Relaxed;
|
||||
|
||||
function Unavailable return Release_Dependencies;
|
||||
-- A never available release
|
||||
|
||||
-- DEPENDENCIES BUILT FROM RELEASES
|
||||
|
||||
-- See also Alire.Versions.Versioned'Class methods
|
||||
|
||||
subtype Version is Semantic_Versioning.Version;
|
||||
subtype Version_Set is Semantic_Versioning.Version_Set;
|
||||
|
||||
function Current (C : Catalog_Entry) return Conditional.Dependencies;
|
||||
|
||||
function At_Version (C : Catalog_Entry; V : Version) return Conditional.Dependencies;
|
||||
function At_Version (C : Catalog_Entry; V : String) return Conditional.Dependencies;
|
||||
|
||||
function Within_Major (C : Catalog_Entry; V : Version) return Conditional.Dependencies;
|
||||
function Within_Major (C : Catalog_Entry; V : String) return Conditional.Dependencies;
|
||||
|
||||
function Within_Minor (C : Catalog_Entry; V : Version) return Conditional.Dependencies;
|
||||
function Within_Minor (C : Catalog_Entry; V : String) return Conditional.Dependencies;
|
||||
|
||||
function On_Condition (Condition : Requisites.Tree;
|
||||
When_True : Release_Dependencies;
|
||||
When_False : Release_Dependencies := No_Dependencies)
|
||||
return Release_Dependencies
|
||||
renames Conditional.For_Dependencies.New_Conditional;
|
||||
-- Explicitly conditional
|
||||
|
||||
function Case_Distribution_Is (Arr : Requisites.Platform.Distribution_Cases_Deps.Arrays)
|
||||
return Release_Dependencies
|
||||
renames Requisites.Platform.Distribution_Cases_Deps.Case_Is;
|
||||
|
||||
function "or" (L, R : Release_Dependencies) return Release_Dependencies
|
||||
renames Conditional.For_Dependencies."or";
|
||||
-- In the sense of "or else": the first one that is available will be taken
|
||||
|
||||
function "and" (L, R : Release_Dependencies) return Release_Dependencies
|
||||
renames Conditional.For_Dependencies."and";
|
||||
|
||||
------------------
|
||||
-- Properties --
|
||||
------------------
|
||||
|
||||
function On_Condition (Condition : Requisites.Tree;
|
||||
When_True : Release_Properties;
|
||||
When_False : Release_Properties := No_Properties)
|
||||
return Release_Properties renames Conditional.For_Properties.New_Conditional;
|
||||
-- Conditional properties
|
||||
|
||||
function Case_Compiler_Is (Arr : Requisites.Platform.Compiler_Cases.Arrays)
|
||||
return Release_Properties
|
||||
renames Requisites.Platform.Compiler_Cases.Case_Is;
|
||||
|
||||
function Case_Distribution_Is (Arr : Requisites.Platform.Distribution_Cases_Props.Arrays)
|
||||
return Release_Properties
|
||||
renames Requisites.Platform.Distribution_Cases_Props.Case_Is;
|
||||
|
||||
function Case_Operating_System_Is (Arr : Requisites.Platform.Op_System_Cases.Arrays)
|
||||
return Release_Properties
|
||||
renames Requisites.Platform.Op_System_Cases.Case_Is;
|
||||
|
||||
-- Attributes (named pairs of label-value)
|
||||
-- We need them as Properties.Vector (inside conditionals) but also as
|
||||
-- Conditional vectors (although with unconditional value inside)
|
||||
package PL renames Properties.Labeled;
|
||||
|
||||
function Author is new PL.Cond_New_Label (Properties.Labeled.Author);
|
||||
function Comment is new PL.Cond_New_Label (Properties.Labeled.Comment);
|
||||
function Executable is new PL.Cond_New_Label (Properties.Labeled.Executable);
|
||||
function Maintainer is new PL.Cond_New_Label (Properties.Labeled.Maintainer);
|
||||
function Website is new PL.Cond_New_Label (Properties.Labeled.Website);
|
||||
|
||||
function Path is new PL.Cond_New_Path_Label (Properties.Labeled.Path);
|
||||
function Project_File is new PL.Cond_New_Path_Label (Properties.Labeled.Project_File);
|
||||
|
||||
-- Non-label attributes or processed data require a custom builder function
|
||||
|
||||
function U (Prop : Properties.Property'Class) return Conditional.Properties
|
||||
renames Conditional.For_Properties.New_Value;
|
||||
|
||||
function GPR_Free_Scenario (Name : String) return Conditional.Properties is
|
||||
(U (Properties.Scenarios.New_Property (GPR.Free_Variable (Name))));
|
||||
|
||||
function GPR_Scenario (Name : String; Values : GPR.Value_Vector) return Conditional.Properties is
|
||||
(U (Properties.Scenarios.New_Property (GPR.Enum_Variable (Name, Values))));
|
||||
|
||||
function License (L : Licensing.Licenses) return Conditional.Properties is
|
||||
(U (Properties.Licenses.Values.New_Property (L)));
|
||||
|
||||
-- Concatenate
|
||||
function "and" (L, R : Release_Properties) return Release_Properties
|
||||
renames Conditional.For_Properties."and";
|
||||
|
||||
------------------------
|
||||
-- BUILD PROPERTIES --
|
||||
------------------------
|
||||
-- Those instruct alr on how to build, but are not the main concern of the project user
|
||||
|
||||
function Action_Run (Moment : Actions.Moments;
|
||||
Relative_Command : Platform_Independent_Path;
|
||||
Working_Folder : Platform_Independent_Path := "") return Release_Properties is
|
||||
(U (Actions.New_Run (Moment, Relative_Command, Working_Folder)));
|
||||
|
||||
function GPR_External (Name : String; Value : String) return Conditional.Properties is
|
||||
(U (Properties.Scenarios.New_Property (GPR.External_Value (Name, Value))));
|
||||
|
||||
------------------
|
||||
-- REQUISITES --
|
||||
------------------
|
||||
|
||||
-- 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 Distribution is new Requisites.Platform.Distributions.Factory;
|
||||
|
||||
function Operating_System is new Requisites.Platform.Op_Systems.Factory;
|
||||
|
||||
function Distro_Release is new Requisites.Platform.Versions.Factory;
|
||||
|
||||
function Target is new Requisites.Platform.Targets.Factory;
|
||||
|
||||
function Word_Size is new Requisites.Platform.Word_Sizes.Factory;
|
||||
|
||||
------------
|
||||
-- ROOT --
|
||||
------------
|
||||
-- The root determines the starting point to look for dependencies
|
||||
|
||||
function New_Working_Release
|
||||
(Project : Alire.Project;
|
||||
Origin : Origins.Origin := Origins.New_Filesystem (".");
|
||||
Dependencies : Conditional.Dependencies := Conditional.For_Dependencies.Empty;
|
||||
Properties : Conditional.Properties := Conditional.For_Properties.Empty)
|
||||
return Release renames Releases.New_Working_Release;
|
||||
|
||||
subtype Root is Roots.Root;
|
||||
|
||||
function Set_Root (Project : Catalog_Entry;
|
||||
Version : Semantic_Versioning.Version)
|
||||
return Roots.Root is (Alire.Root.Set (Project.Project, Version));
|
||||
-- All information will be taken from the indexed release
|
||||
|
||||
function Set_Root (R : Release) return Roots.Root renames Alire.Root.Set;
|
||||
-- An unindexed working copy (See New_Working_Release)
|
||||
|
||||
------------
|
||||
-- USES --
|
||||
------------
|
||||
-- For the benefit of child index files
|
||||
|
||||
pragma Warnings (Off);
|
||||
use all type Actions.Moments;
|
||||
use all type Alire.Project;
|
||||
use all type GPR.Value;
|
||||
use all type GPR.Value_Vector;
|
||||
use all type Licensing.Licenses;
|
||||
use all type Platforms.Compilers;
|
||||
use all type Platforms.Distributions;
|
||||
use all type Platforms.Operating_Systems;
|
||||
use all type Platforms.Targets;
|
||||
use all type Platforms.Versions;
|
||||
use all type Platforms.Word_Sizes;
|
||||
use all type Properties.Property'Class;
|
||||
use all type Release_Dependencies;
|
||||
use all type Release_Properties;
|
||||
|
||||
use all type Requisites.Platform.Compilers.Comparable;
|
||||
use all type Requisites.Platform.Distributions.Comparable;
|
||||
use all type Requisites.Platform.Op_Systems.Comparable;
|
||||
use all type Requisites.Platform.Targets.Comparable;
|
||||
use all type Requisites.Platform.Versions.Comparable;
|
||||
use all type Requisites.Platform.Word_Sizes.Comparable;
|
||||
|
||||
use all type Requisites.Tree;
|
||||
|
||||
use Versions.Expressions;
|
||||
use Versions.Expressions_With_Versioned;
|
||||
pragma Warnings (On);
|
||||
|
||||
private
|
||||
|
||||
type Catalog_Entry (Name_Len, Descr_Len, Pack_Len, Self_Len : Natural) is new
|
||||
Projects.Named and Versions.Comparable with
|
||||
record
|
||||
Project : Alire.Project (1 .. Name_Len);
|
||||
Description : Description_String (1 .. Descr_Len);
|
||||
Package_Name : String (1 .. Pack_Len);
|
||||
Self_Name : String (1 .. Self_Len);
|
||||
end record;
|
||||
|
||||
overriding
|
||||
function New_Dependency (L : Catalog_Entry; VS : Semantic_Versioning.Version_Set)
|
||||
return Conditional.Dependencies is
|
||||
(Conditional.For_Dependencies.New_Value -- A conditional (without condition) dependency vector
|
||||
(Dependencies.New_Dependency (L.Project, VS)));
|
||||
|
||||
function Ada_Identifier (C : Catalog_Entry) return String is
|
||||
((if Utils.To_Lower_Case (C.Package_Name) = "alire"
|
||||
then "Alire.Index.Alire"
|
||||
else Utils.To_Mixed_Case (C.Package_Name)) &
|
||||
"." & Utils.To_Mixed_Case (C.Self_Name));
|
||||
|
||||
function Package_Name (C : Catalog_Entry) return String is
|
||||
(Utils.To_Mixed_Case (C.Package_Name));
|
||||
|
||||
function Current (C : Catalog_Entry) return Conditional.Dependencies is
|
||||
(Conditional.New_Dependency (C.Project, Semver.Any));
|
||||
|
||||
function At_Version (C : Catalog_Entry; V : Version) return Conditional.Dependencies is
|
||||
(Conditional.New_Dependency (C.Project, Semver.Exactly (V)));
|
||||
function At_Version (C : Catalog_Entry; V : String) return Conditional.Dependencies is
|
||||
(Conditional.New_Dependency (C.Project, Semver.Exactly (Index.V (V))));
|
||||
|
||||
function Within_Major (C : Catalog_Entry; V : Version) return Conditional.Dependencies is
|
||||
(Conditional.New_Dependency (C.Project, Semver.Within_Major (V)));
|
||||
function Within_Major (C : Catalog_Entry; V : String) return Conditional.Dependencies is
|
||||
(Conditional.New_Dependency (C.Project, Semver.Within_Major (Index.V (V))));
|
||||
|
||||
function Within_Minor (C : Catalog_Entry; V : Version) return Conditional.Dependencies is
|
||||
(Conditional.New_Dependency (C.Project, Semver.Within_Minor (V)));
|
||||
function Within_Minor (C : Catalog_Entry; V : String) return Conditional.Dependencies is
|
||||
(Conditional.New_Dependency (C.Project, Semver.Within_Minor (Index.V (V))));
|
||||
|
||||
function Project (C : Catalog_Entry) return Alire.Project is (C.Project);
|
||||
|
||||
function Description (C : Catalog_Entry) return Description_String is
|
||||
(Projects.Descriptions (C.Project));
|
||||
|
||||
function Unavailable return Conditional.Dependencies is
|
||||
(Conditional.For_Dependencies.New_Value -- A conditional (without condition) dependency vector
|
||||
(Dependencies.Unavailable));
|
||||
|
||||
end Alire.Index;
|
||||
@@ -1,14 +0,0 @@
|
||||
with Alire.Utils;
|
||||
|
||||
package Alire.Interfaces with Preelaborate is
|
||||
|
||||
type Codifiable is limited interface;
|
||||
|
||||
function To_Code (This : Codifiable) return Utils.String_Vector is abstract;
|
||||
|
||||
|
||||
type Imaginable is limited interface;
|
||||
|
||||
function Image (This : Imaginable) return String is abstract;
|
||||
|
||||
end Alire.Interfaces;
|
||||
@@ -1,45 +0,0 @@
|
||||
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,
|
||||
|
||||
-- Extra additions
|
||||
GMGPL_2_0,
|
||||
GMGPL_3_0,
|
||||
Public_Domain,
|
||||
Unknown);
|
||||
|
||||
end Alire.Licensing;
|
||||
@@ -1,41 +0,0 @@
|
||||
with Semantic_Versioning;
|
||||
|
||||
package Alire.Milestones with Preelaborate is
|
||||
|
||||
type Milestone (<>) is tagged private;
|
||||
|
||||
function "<" (L, R : Milestone) return Boolean;
|
||||
|
||||
function New_Milestone (Name : Alire.Project;
|
||||
Version : Semantic_Versioning.Version) return Milestone;
|
||||
|
||||
function Project (M : Milestone) return Alire.Project;
|
||||
|
||||
function Version (M : Milestone) return Semantic_Versioning.Version;
|
||||
|
||||
function Image (M : Milestone) return String;
|
||||
|
||||
private
|
||||
|
||||
type Milestone (Name_Len : Natural) is tagged record
|
||||
Name : Alire.Project (1 .. Name_Len);
|
||||
Version : Semantic_Versioning.Version;
|
||||
end record;
|
||||
|
||||
use all type Semantic_Versioning.Version;
|
||||
|
||||
function "<" (L, R : Milestone) return Boolean is
|
||||
(L.Name < R.Name or else (L.Name = R.Name and then L.Version < R.Version));
|
||||
|
||||
function New_Milestone (Name : Alire.Project;
|
||||
Version : Semantic_Versioning.Version) return Milestone is
|
||||
(Name'Length, Name, Version);
|
||||
|
||||
function Project (M : Milestone) return Alire.Project is (M.Name);
|
||||
|
||||
function Version (M : Milestone) return Semantic_Versioning.Version is (M.Version);
|
||||
|
||||
function Image (M : Milestone) return String is
|
||||
(+M.Project & "=" & Image (M.Version));
|
||||
|
||||
end Alire.Milestones;
|
||||
@@ -1,94 +0,0 @@
|
||||
package body Alire.Origins is
|
||||
|
||||
function Ends_With (S : String; Suffix : String) return Boolean is
|
||||
(S'Length >= Suffix'Length
|
||||
and then S (S'Last - Suffix'Length + 1 .. S'Last) = Suffix);
|
||||
-- Return whether the S string ends with the given Suffix sub-string
|
||||
|
||||
function URL_Basename (URL : Alire.URL) return String;
|
||||
-- Try to get a basename for the given URL. Return an empty string on
|
||||
-- failure.
|
||||
|
||||
function Archive_Format (Name : String) return Source_Archive_Format;
|
||||
-- Guess the format of a source archive from its file name
|
||||
|
||||
------------------
|
||||
-- URL_Basename --
|
||||
------------------
|
||||
|
||||
function URL_Basename (URL : Alire.URL) return String is
|
||||
Separator : Positive;
|
||||
-- Index of the first URL separator we can find ('#' or '?') in URL
|
||||
|
||||
Last_Slash : Natural;
|
||||
-- Index of the last slash character in URL before the first URL
|
||||
-- separator.
|
||||
begin
|
||||
Last_Slash := 0;
|
||||
Separator := URL'Last + 1;
|
||||
for I in URL'Range loop
|
||||
case URL (I) is
|
||||
when '?' | '#' =>
|
||||
Separator := I;
|
||||
exit;
|
||||
|
||||
when '/' =>
|
||||
Last_Slash := I;
|
||||
|
||||
when others =>
|
||||
null;
|
||||
end case;
|
||||
end loop;
|
||||
|
||||
return URL (Last_Slash + 1 .. Separator);
|
||||
end URL_Basename;
|
||||
|
||||
--------------------
|
||||
-- Archive_Format --
|
||||
--------------------
|
||||
|
||||
function Archive_Format (Name : String) return Source_Archive_Format is
|
||||
begin
|
||||
if Ends_With (Name, ".zip") then
|
||||
return Zip_Archive;
|
||||
|
||||
elsif Ends_With (Name, ".tar")
|
||||
or else Ends_With (Name, ".tar.gz")
|
||||
or else Ends_With (Name, ".tgz")
|
||||
or else Ends_With (Name, ".tar.bz2")
|
||||
or else Ends_With (Name, ".tbz2")
|
||||
or else Ends_With (Name, ".tar.xz")
|
||||
then
|
||||
return Tarball;
|
||||
|
||||
else
|
||||
return Unknown;
|
||||
end if;
|
||||
end Archive_Format;
|
||||
|
||||
------------------------
|
||||
-- New_Source_Archive --
|
||||
------------------------
|
||||
|
||||
function New_Source_Archive
|
||||
(URL : Alire.URL; Name : String := "") return Origin
|
||||
is
|
||||
Archive_Name : constant String :=
|
||||
(if Name'Length = 0 then URL_Basename (URL) else Name);
|
||||
Format : Source_Archive_Format;
|
||||
begin
|
||||
if Archive_Name'Length = 0 then
|
||||
raise Unknown_Source_Archive_Name_Error with
|
||||
"Unable to determine archive name: please specify one";
|
||||
end if;
|
||||
|
||||
Format := Archive_Format (Archive_Name);
|
||||
if Format not in Known_Source_Archive_Format then
|
||||
raise Unknown_Source_Archive_Format_Error with
|
||||
"Unable to determine archive format from file extension";
|
||||
end if;
|
||||
|
||||
return (Data => (Source_Archive, +URL, +Archive_Name, Format));
|
||||
end New_Source_Archive;
|
||||
|
||||
end Alire.Origins;
|
||||
@@ -1,213 +0,0 @@
|
||||
with Alire.Interfaces;
|
||||
with Alire.Platforms;
|
||||
with Alire.Utils;
|
||||
|
||||
private with Ada.Strings.Unbounded;
|
||||
|
||||
package Alire.Origins with Preelaborate is
|
||||
|
||||
-- Minimal information about origins of sources.
|
||||
-- We use the term origins to avoid mixing 'alire sources' with 'project sources' or other 'sources'.
|
||||
|
||||
-- The actual capabilities for check-outs or fetches are in alr proper
|
||||
|
||||
--------------------------------------------
|
||||
-- supporting types for native packages --
|
||||
--------------------------------------------
|
||||
-- These are used to represent native packages in a comfortable way in the index
|
||||
|
||||
type Package_Names is tagged private;
|
||||
|
||||
function Image (This : Package_Names) return String;
|
||||
|
||||
function Unavailable return Package_Names;
|
||||
|
||||
function Packaged_As (Name : String) return Package_Names;
|
||||
|
||||
type Native_Packages is array (Platforms.Distributions) of Package_Names;
|
||||
-- The name of a package in every distro for a given version
|
||||
|
||||
type Kinds is (Filesystem, -- Not really an origin, but a working copy of a project
|
||||
Git, -- Remote git repo
|
||||
Hg, -- Remote hg repo
|
||||
SVN, -- Remote svn repo
|
||||
Source_Archive, -- Remote source archive
|
||||
Native -- Native platform package
|
||||
);
|
||||
|
||||
subtype VCS_Kinds is Kinds range Git .. SVN;
|
||||
|
||||
type Source_Archive_Format is (Unknown, Tarball, Zip_Archive);
|
||||
subtype Known_Source_Archive_Format is
|
||||
Source_Archive_Format range Tarball .. Source_Archive_Format'Last;
|
||||
|
||||
Unknown_Source_Archive_Format_Error : exception;
|
||||
|
||||
type Origin is new Interfaces.Codifiable with private;
|
||||
|
||||
function Kind (This : Origin) return Kinds;
|
||||
|
||||
-------------------
|
||||
-- member data --
|
||||
-------------------
|
||||
|
||||
function Commit (This : Origin) return String with Pre => This.Kind in VCS_Kinds;
|
||||
function URL (This : Origin) return Alire.URL with Pre => This.Kind in VCS_Kinds;
|
||||
|
||||
function Path (This : Origin) return String with Pre => This.Kind = Filesystem;
|
||||
|
||||
function Archive_URL (This : Origin) return Alire.URL
|
||||
with Pre => This.Kind = Source_Archive;
|
||||
function Archive_Name (This : Origin) return String
|
||||
with Pre => This.Kind = Source_Archive;
|
||||
function Archive_Format (This : Origin) return Known_Source_Archive_Format
|
||||
with Pre => This.Kind = Source_Archive;
|
||||
|
||||
function Is_Native (This : Origin) return Boolean is (This.Kind = Native);
|
||||
function Package_Name (This : Origin;
|
||||
Distribution : Platforms.Distributions)
|
||||
return String;
|
||||
function All_Native_Names (This : Origin) return Native_Packages;
|
||||
|
||||
-- Helper types
|
||||
|
||||
subtype Git_Commit is String (1 .. 40);
|
||||
subtype Hg_Commit is String (1 .. 40);
|
||||
|
||||
-- Constructors
|
||||
|
||||
function New_Filesystem (Path : String) return Origin;
|
||||
|
||||
function New_Git (URL : Alire.URL;
|
||||
Commit : Git_Commit)
|
||||
return Origin;
|
||||
|
||||
function New_Hg (URL : Alire.URL;
|
||||
Commit : Hg_Commit)
|
||||
return Origin;
|
||||
|
||||
function New_SVN (URL : Alire.URL; Commit : String) return Origin;
|
||||
|
||||
Unknown_Source_Archive_Name_Error : exception;
|
||||
|
||||
function New_Source_Archive
|
||||
(URL : Alire.URL; Name : String := "") return Origin;
|
||||
-- Create a reference to a source archive to be downloaded and extracted.
|
||||
-- URL is the address of the archive to download. Name is the name of the file to download.
|
||||
--
|
||||
-- This raises an Unknown_Source_Archive_Format_Error exception when we
|
||||
-- either cannot deduce the archive format from its filename or when the
|
||||
-- archive format is unknown.
|
||||
--
|
||||
-- If Name is omitted, it is tentatively inferred from URL. If it cannot be
|
||||
-- inferred, this raises a Unknown_Source_Archive_Name_Error exception.
|
||||
|
||||
function New_Native (Packages : Native_Packages) return Origin;
|
||||
|
||||
function Image (This : Origin) return String;
|
||||
|
||||
overriding function To_Code (This : Origin) return Utils.String_Vector;
|
||||
|
||||
private
|
||||
|
||||
use Ada.Strings.Unbounded;
|
||||
function "+" (S : String) return Unbounded_String renames To_Unbounded_String;
|
||||
function "+" (U : Unbounded_String) return String renames To_String;
|
||||
|
||||
type Package_Names is tagged record
|
||||
Name : Unbounded_String;
|
||||
end record;
|
||||
|
||||
function Image (This : Package_Names) return String is (+This.Name);
|
||||
|
||||
function Unavailable return Package_Names is (Name => Null_Unbounded_String);
|
||||
function Packaged_As (Name : String) return Package_Names is (Name => +Name);
|
||||
|
||||
type Origin_Data (Kind : Kinds := Kinds'First) is record
|
||||
case Kind is
|
||||
when Filesystem =>
|
||||
Path : Unbounded_String;
|
||||
|
||||
when VCS_Kinds =>
|
||||
Repo_URL : Unbounded_String;
|
||||
Commit : Unbounded_String;
|
||||
|
||||
when Source_Archive =>
|
||||
Archive_URL : Unbounded_String;
|
||||
Archive_Name : Unbounded_String;
|
||||
Archive_Format : Known_Source_Archive_Format;
|
||||
|
||||
when Native =>
|
||||
Packages : Native_Packages;
|
||||
end case;
|
||||
end record;
|
||||
|
||||
type Origin is new Interfaces.Codifiable with record
|
||||
Data : Origin_Data;
|
||||
end record;
|
||||
|
||||
function New_Filesystem (Path : String) return Origin is
|
||||
(Data => (Filesystem, Path => +Path));
|
||||
|
||||
function New_Git (URL : Alire.URL;
|
||||
Commit : Git_Commit)
|
||||
return Origin is
|
||||
(Data => (Git, +URL, +Commit));
|
||||
|
||||
function New_Hg (URL : Alire.URL;
|
||||
Commit : Hg_Commit)
|
||||
return Origin is
|
||||
(Data => (Hg, +URL, +Commit));
|
||||
|
||||
function New_SVN (URL : Alire.URL; Commit : String) return Origin is
|
||||
(Data => (SVN, +URL, +Commit));
|
||||
|
||||
function New_Native (Packages : Native_Packages) return Origin is
|
||||
(Data => (Native, Packages));
|
||||
|
||||
function Kind (This : Origin) return Kinds is (This.Data.Kind);
|
||||
|
||||
function URL (This : Origin) return Alire.URL is
|
||||
(Alire.URL (+This.Data.Repo_URL));
|
||||
function Commit (This : Origin) return String is
|
||||
(+This.Data.Commit);
|
||||
|
||||
function Path (This : Origin) return String is (+This.Data.Path);
|
||||
|
||||
function Archive_URL (This : Origin) return Alire.URL is
|
||||
(+This.Data.Archive_URL);
|
||||
function Archive_Name (This : Origin) return String is
|
||||
(+This.Data.Archive_Name);
|
||||
function Archive_Format (This : Origin) return Known_Source_Archive_Format
|
||||
is (This.Data.Archive_Format);
|
||||
|
||||
function Package_Name (This : Origin;
|
||||
Distribution : Platforms.Distributions)
|
||||
return String is
|
||||
(+This.Data.Packages (Distribution).Name);
|
||||
|
||||
function All_Native_Names (This : Origin) return Native_Packages is
|
||||
(This.Data.Packages);
|
||||
|
||||
function S (Str : Unbounded_String) return String is (To_String (Str));
|
||||
|
||||
function Image (This : Origin) return String is
|
||||
(case This.Kind is
|
||||
when VCS_Kinds =>
|
||||
"commit " & S (This.Data.Commit)
|
||||
& " from " & S (This.Data.Repo_URL),
|
||||
when Source_Archive =>
|
||||
"source archive " & S (This.Data.Archive_Name)
|
||||
& " at " & S (This.Data.Archive_URL),
|
||||
when Native =>
|
||||
"native package from platform software manager",
|
||||
when Filesystem =>
|
||||
"path " & S (This.Data.Path));
|
||||
|
||||
overriding function To_Code (This : Origin) return Utils.String_Vector is
|
||||
(if This.Kind = Filesystem
|
||||
then Utils.To_Vector (Path (This))
|
||||
else raise Program_Error with "Unimplemented");
|
||||
|
||||
|
||||
end Alire.Origins;
|
||||
@@ -1,20 +0,0 @@
|
||||
with GNAT.OS_Lib;
|
||||
|
||||
package body Alire.OS_Lib is
|
||||
|
||||
----------------
|
||||
-- Exe_Suffix --
|
||||
----------------
|
||||
|
||||
function Exe_Suffix return String is
|
||||
-- Shenanigans needed to stay preelaborable
|
||||
use GNAT.OS_Lib;
|
||||
|
||||
Suffix : String_Access := Get_Executable_Suffix;
|
||||
begin
|
||||
return S : constant String := Suffix.all do
|
||||
Free (Suffix);
|
||||
end return;
|
||||
end Exe_Suffix;
|
||||
|
||||
end Alire.OS_Lib;
|
||||
@@ -1,5 +0,0 @@
|
||||
package Alire.OS_Lib with Preelaborate is
|
||||
|
||||
function Exe_Suffix return String;
|
||||
|
||||
end Alire.OS_Lib;
|
||||
@@ -1,50 +0,0 @@
|
||||
package Alire.Platforms with Preelaborate is
|
||||
|
||||
-- Platform information necessary for some releases
|
||||
|
||||
type Compilers is (GNAT_Unknown,
|
||||
|
||||
GNAT_FSF_Old,
|
||||
GNAT_FSF_7_2, -- Has known bugs compared to 2017
|
||||
GNAT_FSF_7_3_Or_Newer,
|
||||
|
||||
GNAT_GPL_Old,
|
||||
GNAT_GPL_2017,
|
||||
|
||||
GNAT_Community_2018);
|
||||
-- We do a minimum of future proofing. Unless newer version have known problems we don't need to
|
||||
-- isolate their versions
|
||||
|
||||
type Operating_Systems is (GNU_Linux,
|
||||
OSX,
|
||||
Windows,
|
||||
OS_Unknown);
|
||||
|
||||
type Targets is (Native,
|
||||
Unknown_Cross_Target);
|
||||
-- Minimal preparations for cross-compiling
|
||||
|
||||
type Distributions is (Debian,
|
||||
Ubuntu,
|
||||
Distro_Unknown);
|
||||
|
||||
type Versions is (Debian_Buster,
|
||||
Ubuntu_Bionic,
|
||||
Distro_Version_Unknown);
|
||||
-- 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,
|
||||
Bits_Unknown);
|
||||
|
||||
type Package_Managers is (Apt,
|
||||
Packager_Unknown);
|
||||
|
||||
function Package_Manager (D : Distributions) return Package_Managers is
|
||||
(case D is
|
||||
when Debian | Ubuntu => Apt,
|
||||
when others => Packager_Unknown);
|
||||
|
||||
end Alire.Platforms;
|
||||
@@ -1,15 +0,0 @@
|
||||
with Ada.Containers.Indefinite_Ordered_Maps;
|
||||
|
||||
package Alire.Projects with Preelaborate is
|
||||
|
||||
package Project_Description_Maps is new Ada.Containers.Indefinite_Ordered_Maps
|
||||
(Alire.Project, Description_String);
|
||||
|
||||
Descriptions : Project_Description_Maps.Map;
|
||||
-- Master list of known projects & descriptions
|
||||
|
||||
type Named is limited interface;
|
||||
|
||||
function Project (N : Named) return Alire.Project is abstract;
|
||||
|
||||
end Alire.Projects;
|
||||
@@ -1,68 +0,0 @@
|
||||
with Alire.Conditional;
|
||||
|
||||
private with Alire.Utils;
|
||||
|
||||
package Alire.Properties.Labeled with Preelaborate is
|
||||
|
||||
-- Properties that have a single string value and a name
|
||||
|
||||
type Labels is (Author, -- VIP
|
||||
Comment, -- Extra text
|
||||
Description, -- One-liner description, so it is searched too
|
||||
Executable, -- A resulting executable built by the project
|
||||
Maintainer, -- Info about the maintainer of the alr-packaged project
|
||||
Path, -- Extra path for PATH to add to build (prepended)
|
||||
Project_File,-- Buildable project files in the release, with full relative path
|
||||
Website -- A website other than the repository
|
||||
);
|
||||
|
||||
type Label (<>) is new Properties.Property with private;
|
||||
|
||||
function New_Label (Name : Labels;
|
||||
Value : String) return Label;
|
||||
|
||||
function Name (L : Label) return Labels;
|
||||
|
||||
function Value (L : Label) return String;
|
||||
|
||||
overriding function Image (L : Label) return String;
|
||||
|
||||
-- generic
|
||||
-- Name : Labels;
|
||||
-- function Vec_New_Label (Value : String) return Properties.Vector;
|
||||
-- -- Returns a vector so its directly usable during indexing
|
||||
|
||||
generic
|
||||
Name : Labels;
|
||||
function Cond_New_Label (Value : String) return Conditional.Properties;
|
||||
|
||||
generic
|
||||
Name : Labels;
|
||||
function Cond_New_Path_Label (Value : Platform_Independent_Path) return Conditional.Properties;
|
||||
|
||||
private
|
||||
|
||||
type Label (Length : Natural) is new Properties.Property with record
|
||||
Name : Labels;
|
||||
Value : String (1 .. Length);
|
||||
end record;
|
||||
|
||||
function New_Label (Name : Labels; Value : String) return Label is
|
||||
(Properties.Property with Value'Length, Name, Value);
|
||||
|
||||
function Name (L : Label) return Labels is (L.Name);
|
||||
|
||||
function Value (L : Label) return String is (L.Value);
|
||||
|
||||
-- function Vec_New_Label (Value : String) return Properties.Vector is
|
||||
-- (To_Vector (New_Label (Name, Value), 1));
|
||||
|
||||
function Cond_New_Label (Value : String) return Conditional.Properties is
|
||||
(Conditional.For_Properties.New_Value (New_Label (Name, Value)));
|
||||
|
||||
function Cond_New_Path_Label (Value : Platform_Independent_Path) return Conditional.Properties is
|
||||
(Conditional.For_Properties.New_Value (New_Label (Name, Utils.To_Native (Value))));
|
||||
|
||||
overriding function Image (L : Label) return String is (Utils.To_Mixed_Case (L.Name'Img) & ": " & L.Value);
|
||||
|
||||
end Alire.Properties.Labeled;
|
||||
@@ -1,15 +0,0 @@
|
||||
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;
|
||||
@@ -1,38 +0,0 @@
|
||||
with Alire.Platforms;
|
||||
|
||||
package Alire.Properties.Platform with Preelaborate is
|
||||
|
||||
-- The following packages declare types used by requisites so they have to be public --
|
||||
|
||||
package Compilers is new Values (Platforms.Compilers,
|
||||
Platforms.Compilers'IMage);
|
||||
|
||||
package Distributions is new Values (Platforms.Distributions,
|
||||
Platforms.Distributions'Image);
|
||||
|
||||
package Operating_Systems is new Values (Platforms.Operating_Systems,
|
||||
Platforms.Operating_Systems'Image);
|
||||
|
||||
package Targets is new Values (Platforms.Targets,
|
||||
Platforms.Targets'Image);
|
||||
|
||||
package Versions is new Values (Platforms.Versions,
|
||||
Platforms.Versions'Image);
|
||||
|
||||
package Word_Sizes is new Values (Platforms.Word_Sizes,
|
||||
Platforms.Word_Sizes'Image);
|
||||
|
||||
|
||||
function Compiler_Is (C : Platforms.Compilers) return Vector renames Compilers.New_Vector;
|
||||
|
||||
function Distribution_Is (D : Platforms.Distributions) return Vector renames Distributions.New_Vector;
|
||||
|
||||
function System_Is (OS : Platforms.Operating_Systems) return Vector renames Operating_Systems.New_Vector;
|
||||
|
||||
function Target_Is (T : Platforms.Targets) return Vector renames Targets.New_Vector;
|
||||
|
||||
function Version_Is (V : Platforms.Versions) return Vector renames Versions.New_Vector;
|
||||
|
||||
function Word_Size_Is (V : Platforms.Word_Sizes) return Vector renames Word_Sizes.New_Vector;
|
||||
|
||||
end Alire.Properties.Platform;
|
||||
@@ -1,37 +0,0 @@
|
||||
with Alire.GPR;
|
||||
|
||||
private with Ada.Containers.Indefinite_Holders;
|
||||
|
||||
package Alire.Properties.Scenarios with Preelaborate is
|
||||
|
||||
type Property is new Properties.Property with private;
|
||||
|
||||
function New_Property (V : GPR.Variable) return Property;
|
||||
|
||||
overriding function Image (V : Property) return String;
|
||||
|
||||
function Value (V : Property) return Gpr.Variable;
|
||||
|
||||
private
|
||||
|
||||
package Holders is new Ada.Containers.Indefinite_Holders (Gpr.Variable, GPR."=");
|
||||
|
||||
type Property is new Properties.Property with record
|
||||
Var : Holders.Holder;
|
||||
end record;
|
||||
|
||||
function New_Property (V : GPR.Variable) return Property is
|
||||
(Var => Holders.To_Holder (V));
|
||||
|
||||
overriding function Image (V : Property) return String is
|
||||
((case V.Var.Element.Kind is
|
||||
when GPR.External => "GPR External: ",
|
||||
when others => "GPR Scenario: ") & V.Var.Element.Image);
|
||||
|
||||
-- overriding function Image (V : Property) return String is
|
||||
-- ("GPR Scenario: " & V.Var.Constant_Reference.Image);
|
||||
|
||||
function Value (V : Property) return Gpr.Variable is
|
||||
(V.Var.Element);
|
||||
|
||||
end Alire.Properties.Scenarios;
|
||||
@@ -1,91 +0,0 @@
|
||||
with Ada.Containers.Indefinite_Vectors;
|
||||
|
||||
with Alire.Utils;
|
||||
|
||||
package Alire.Properties with Preelaborate is
|
||||
|
||||
-- Properties are the general mechanism used to store all info about a release.
|
||||
-- They can be specialized (e.g. in version, platform, compiler) but that can be transparent to the user.
|
||||
|
||||
-- Since a property can be checked against a variety of conditions, this would require fully fledged
|
||||
-- multiple inheritance for the simplest design.
|
||||
-- Instead, a first check of matching tags is done and then the checks can proceed.
|
||||
|
||||
type Property is interface;
|
||||
|
||||
function Image (P : Property) return String is abstract;
|
||||
|
||||
function Image_Classwide (P : Property'Class) return String is (P.Image);
|
||||
|
||||
package Vectors is new Ada.Containers.Indefinite_Vectors (Positive, Property'Class);
|
||||
|
||||
type Vector is new Vectors.Vector with null record;
|
||||
-- New type so using all it sees "and" below
|
||||
|
||||
No_Properties : constant Vector;
|
||||
|
||||
function Empty_Properties return Vector;
|
||||
|
||||
-- function "and" (L, R : Property'Class) return Vector;
|
||||
-- function "and" (L : Vector; R : Property'Class) return Vector;
|
||||
function "and" (L, R : Vector) return Vector;
|
||||
function "+" (P : Property'Class) return Vector;
|
||||
|
||||
function Image_One_Line (V : Vector) return String;
|
||||
|
||||
-- A generic helper to simply store/retrieve e.g. an enumerated type
|
||||
generic
|
||||
type Value is private;
|
||||
with function Image (V : Value) return String is <>;
|
||||
package Values is
|
||||
|
||||
type Property is new Properties.Property with private;
|
||||
|
||||
function New_Property (V : Value) return Property;
|
||||
|
||||
function New_Vector (V : Value) return Vector;
|
||||
|
||||
function Element (P : Property) return Value;
|
||||
|
||||
private
|
||||
|
||||
overriding function Image (P : Property) return String;
|
||||
|
||||
type Property is new Properties.Property with record
|
||||
V : Value;
|
||||
end record;
|
||||
|
||||
function New_Property (V : Value) return Property is (V => V);
|
||||
|
||||
function New_Vector (V : Value) return Vector is (+New_Property (V));
|
||||
|
||||
function Element (P : Property) return Value is (P.V);
|
||||
|
||||
overriding function Image (P : Property) return String is (Image (P.V));
|
||||
|
||||
end Values;
|
||||
|
||||
private
|
||||
|
||||
No_Properties : constant Vector := (Vectors.Empty_Vector with null record);
|
||||
|
||||
function Empty_Properties return Vector is (No_Properties);
|
||||
|
||||
function "and" (L, R : Vector) return Vector is (L & R);
|
||||
function "+" (P : Property'Class) return Vector is (To_Vector (P, 1));
|
||||
|
||||
-- function "and" (L, R : Property'Class) return Vector is (L & R);
|
||||
-- function "and" (L : Vector; R : Property'Class) return Vector is (L & R);
|
||||
|
||||
package Non_Primitives is
|
||||
function Image_One_Line_Instance is
|
||||
new Utils.Image_One_Line (Vectors,
|
||||
Vector,
|
||||
Image_Classwide,
|
||||
" and ",
|
||||
"(no properties");
|
||||
end Non_Primitives;
|
||||
|
||||
function Image_One_Line (V : Vector) return String renames Non_Primitives.Image_One_Line_Instance;
|
||||
|
||||
end Alire.Properties;
|
||||
@@ -1,470 +0,0 @@
|
||||
with AAA.Table_IO;
|
||||
|
||||
-- with Alire.Platform;
|
||||
with Alire.Platforms;
|
||||
with Alire.Requisites.Booleans;
|
||||
|
||||
with GNAT.IO; -- To keep preelaborable
|
||||
|
||||
package body Alire.Releases is
|
||||
|
||||
use all type Alire.Properties.Labeled.Labels;
|
||||
|
||||
--------------------
|
||||
-- All_Properties --
|
||||
--------------------
|
||||
|
||||
function All_Properties (R : Release;
|
||||
P : Alire.Properties.Vector) return Alire.Properties.Vector is
|
||||
(Materialize (R.Properties and R.Priv_Props, P));
|
||||
|
||||
|
||||
---------------
|
||||
-- Extending --
|
||||
---------------
|
||||
|
||||
function Extending (Base : Release;
|
||||
Dependencies : Conditional.Dependencies := Conditional.For_Dependencies.Empty;
|
||||
Properties : Conditional.Properties := Conditional.For_Properties.Empty;
|
||||
Private_Properties : Conditional.Properties := Conditional.For_Properties.Empty;
|
||||
Available : Alire.Requisites.Tree := Requisites.Trees.Empty_Tree)
|
||||
return Release
|
||||
is
|
||||
use all type Conditional.Dependencies;
|
||||
use all type Requisites.Tree;
|
||||
begin
|
||||
return Extended : Release := Base do
|
||||
Extended.Dependencies := Base.Dependencies and Dependencies;
|
||||
Extended.Properties := Base.Properties and Properties;
|
||||
Extended.Priv_Props := Base.Priv_Props and Private_Properties;
|
||||
Extended.Available := Base.Available and Available;
|
||||
end return;
|
||||
end Extending;
|
||||
|
||||
----------------
|
||||
-- Forbidding --
|
||||
----------------
|
||||
|
||||
function Forbidding (Base : Release;
|
||||
Forbidden : Conditional.Forbidden_Dependencies)
|
||||
return Release is
|
||||
begin
|
||||
return Extended : Release := Base do
|
||||
Extended.Forbidden := Forbidden;
|
||||
end return;
|
||||
end Forbidding;
|
||||
|
||||
--------------
|
||||
-- Renaming --
|
||||
--------------
|
||||
|
||||
function Renaming (Base : Release;
|
||||
Provides : Alire.Project) return Release is
|
||||
begin
|
||||
return Renamed : Release := Base do
|
||||
Renamed.Alias := +(+Provides);
|
||||
end return;
|
||||
end Renaming;
|
||||
|
||||
--------------
|
||||
-- Renaming --
|
||||
--------------
|
||||
|
||||
function Renaming (Base : Release;
|
||||
Provides : Projects.Named'Class) return Release is
|
||||
(Base.Renaming (Provides.Project));
|
||||
|
||||
---------------
|
||||
-- Replacing --
|
||||
---------------
|
||||
|
||||
function Replacing (Base : Release;
|
||||
Origin : Origins.Origin) return Release is
|
||||
begin
|
||||
return Replaced : Release := Base do
|
||||
Replaced.Origin := Origin;
|
||||
end return;
|
||||
end Replacing;
|
||||
|
||||
---------------
|
||||
-- Replacing --
|
||||
---------------
|
||||
|
||||
function Replacing (Base : Release;
|
||||
Dependencies : Conditional.Dependencies) return Release is
|
||||
begin
|
||||
return Replaced : Release := Base do
|
||||
Replaced.Dependencies := Dependencies;
|
||||
end return;
|
||||
end Replacing;
|
||||
|
||||
---------------
|
||||
-- Replacing --
|
||||
---------------
|
||||
|
||||
function Replacing (Base : Release;
|
||||
Project : Alire.Project := "";
|
||||
Notes : Description_String := "") return Release
|
||||
is
|
||||
New_Project : constant Alire.Project := (if Project = ""
|
||||
then Base.Project
|
||||
else Project);
|
||||
New_Notes : constant Description_String := (if Notes = ""
|
||||
then Base.Notes
|
||||
else Notes);
|
||||
begin
|
||||
|
||||
return Replacement : constant Release (New_Project'Length, New_Notes'Length) :=
|
||||
(Prj_Len => New_Project'Length,
|
||||
Notes_Len => New_Notes'Length,
|
||||
Project => New_Project,
|
||||
Notes => New_Notes,
|
||||
|
||||
Alias => Base.Alias,
|
||||
Version => Base.Version,
|
||||
Origin => Base.Origin,
|
||||
Dependencies => Base.Dependencies,
|
||||
Forbidden => Base.Forbidden,
|
||||
Properties => Base.Properties,
|
||||
Priv_Props => Base.Priv_Props,
|
||||
Available => Base.Available)
|
||||
do
|
||||
null;
|
||||
end return;
|
||||
end Replacing;
|
||||
|
||||
---------------
|
||||
-- Retagging --
|
||||
---------------
|
||||
|
||||
function Retagging (Base : Release;
|
||||
Version : Semantic_Versioning.Version) return Release is
|
||||
begin
|
||||
return Upgraded : Release := Base do
|
||||
Upgraded.Version := Version;
|
||||
end return;
|
||||
end Retagging;
|
||||
|
||||
---------------
|
||||
-- Upgrading --
|
||||
---------------
|
||||
|
||||
function Upgrading (Base : Release;
|
||||
Version : Semantic_Versioning.Version;
|
||||
Origin : Origins.Origin) return Release is
|
||||
begin
|
||||
return Upgraded : Release := Base do
|
||||
Upgraded.Version := Version;
|
||||
Upgraded.Origin := Origin;
|
||||
end return;
|
||||
end Upgrading;
|
||||
|
||||
-----------------
|
||||
-- New_Release --
|
||||
-----------------
|
||||
|
||||
function New_Release (Project : Alire.Project;
|
||||
Version : Semantic_Versioning.Version;
|
||||
Origin : Origins.Origin;
|
||||
Notes : Description_String;
|
||||
Dependencies : Conditional.Dependencies;
|
||||
Properties : Conditional.Properties;
|
||||
Private_Properties : Conditional.Properties;
|
||||
Available : Alire.Requisites.Tree) return Release is
|
||||
(Prj_Len => Project'Length,
|
||||
Notes_Len => Notes'Length,
|
||||
Project => Project,
|
||||
Alias => +"",
|
||||
Version => Version,
|
||||
Origin => Origin,
|
||||
Notes => Notes,
|
||||
Dependencies => Dependencies,
|
||||
Forbidden => Conditional.For_Dependencies.Empty,
|
||||
Properties => Properties,
|
||||
Priv_Props => Private_Properties,
|
||||
Available => Available);
|
||||
|
||||
-------------------------
|
||||
-- New_Working_Release --
|
||||
-------------------------
|
||||
|
||||
function New_Working_Release
|
||||
(Project : Alire.Project;
|
||||
Origin : Origins.Origin := Origins.New_Filesystem (".");
|
||||
Dependencies : Conditional.Dependencies := Conditional.For_Dependencies.Empty;
|
||||
Properties : Conditional.Properties := Conditional.For_Properties.Empty)
|
||||
return Release is
|
||||
(Prj_Len => Project'Length,
|
||||
Notes_Len => 0,
|
||||
Project => Project,
|
||||
Alias => +"",
|
||||
Version => +"0.0.0",
|
||||
Origin => Origin,
|
||||
Notes => "",
|
||||
Dependencies => Dependencies,
|
||||
Forbidden => Conditional.For_Dependencies.Empty,
|
||||
Properties => Properties,
|
||||
Priv_Props => Conditional.For_Properties.Empty,
|
||||
Available => Requisites.Booleans.Always_True);
|
||||
|
||||
----------------------------
|
||||
-- On_Platform_Properties --
|
||||
----------------------------
|
||||
|
||||
function On_Platform_Properties (R : Release;
|
||||
P : Alire.Properties.Vector;
|
||||
Descendant_Of : Ada.Tags.Tag := Ada.Tags.No_Tag)
|
||||
return Alire.Properties.Vector
|
||||
is
|
||||
use Ada.Tags;
|
||||
begin
|
||||
if Descendant_Of = No_Tag then
|
||||
return Materialize (R.Properties, P) and Materialize (R.Priv_Props, P);
|
||||
else
|
||||
declare
|
||||
Props : constant Alire.Properties.Vector := R.On_Platform_Properties (P);
|
||||
begin
|
||||
return Result : Alire.Properties.Vector do
|
||||
for P of Props loop
|
||||
if Is_Descendant_At_Same_Level (P'Tag, Descendant_Of) then
|
||||
Result.Append (P);
|
||||
end if;
|
||||
end loop;
|
||||
end return;
|
||||
end;
|
||||
end if;
|
||||
end On_Platform_Properties;
|
||||
|
||||
------------
|
||||
-- Values --
|
||||
------------
|
||||
|
||||
function Values (Props : Alire.Properties.Vector;
|
||||
Label : Alire.Properties.Labeled.Labels)
|
||||
return Utils.String_Vector is
|
||||
-- Extract values of a particular label
|
||||
begin
|
||||
return Strs : Utils.String_Vector do
|
||||
for P of Props loop
|
||||
if P in Alire.Properties.Labeled.Label'Class then
|
||||
declare
|
||||
LP : Alire.Properties.Labeled.Label renames Alire.Properties.Labeled.Label (P);
|
||||
begin
|
||||
if LP.Name = Label then
|
||||
Strs.Append (LP.Value);
|
||||
end if;
|
||||
end;
|
||||
end if;
|
||||
end loop;
|
||||
end return;
|
||||
end Values;
|
||||
|
||||
-----------------
|
||||
-- Executables --
|
||||
----------------
|
||||
|
||||
function Executables (R : Release;
|
||||
P : Alire.Properties.Vector)
|
||||
return Utils.String_Vector
|
||||
is
|
||||
begin
|
||||
return Exes : Utils.String_Vector :=
|
||||
Values (R.All_Properties (P), Executable)
|
||||
do
|
||||
if OS_Lib.Exe_Suffix /= "" then
|
||||
for I in Exes.Iterate loop
|
||||
Exes (I) := Exes (I) & OS_Lib.Exe_Suffix;
|
||||
end loop;
|
||||
end if;
|
||||
end return;
|
||||
end Executables;
|
||||
|
||||
-------------------
|
||||
-- Project_Files --
|
||||
-------------------
|
||||
|
||||
function Project_Files (R : Release;
|
||||
P : Alire.Properties.Vector;
|
||||
With_Path : Boolean)
|
||||
return Utils.String_Vector
|
||||
is
|
||||
use Utils;
|
||||
|
||||
With_Paths : Utils.String_Vector := Values (R.All_Properties (P), Project_File);
|
||||
Without : Utils.String_Vector;
|
||||
begin
|
||||
if With_Paths.Is_Empty then
|
||||
With_Paths.Append (String'((+R.Project) & ".gpr"));
|
||||
end if;
|
||||
|
||||
if With_Path then
|
||||
return With_Paths;
|
||||
else
|
||||
for File of With_Paths loop
|
||||
-- Has path or not
|
||||
if Tail (File, '/') = "" then
|
||||
Without.Append (File); -- As is
|
||||
else
|
||||
Without.Append (Tail (File, '/'));
|
||||
end if;
|
||||
end loop;
|
||||
|
||||
return Without;
|
||||
end if;
|
||||
end Project_Files;
|
||||
|
||||
-------------------
|
||||
-- Project_Paths --
|
||||
-------------------
|
||||
|
||||
function Project_Paths (R : Release;
|
||||
P : Alire.Properties.Vector)
|
||||
return Utils.String_Set
|
||||
is
|
||||
use Utils;
|
||||
Files : constant String_Vector := Project_Files (R, P, With_Path => True);
|
||||
begin
|
||||
return Paths : String_Set do
|
||||
for File of Files loop
|
||||
if Contains (File, "/") then
|
||||
Paths.Include (Head (File, '/'));
|
||||
end if;
|
||||
end loop;
|
||||
end return;
|
||||
end Project_Paths;
|
||||
|
||||
------------------------
|
||||
-- Labeled_Properties --
|
||||
------------------------
|
||||
|
||||
function Labeled_Properties (R : Release;
|
||||
P : Alire.Properties.Vector;
|
||||
Label : Alire.Properties.Labeled.Labels)
|
||||
return Utils.String_Vector
|
||||
is
|
||||
begin
|
||||
return Values (R.All_Properties (P), Label);
|
||||
end Labeled_Properties;
|
||||
|
||||
-----------
|
||||
-- Print --
|
||||
-----------
|
||||
|
||||
procedure Print (R : Release; Private_Too : Boolean := False) is
|
||||
use GNAT.IO;
|
||||
begin
|
||||
-- MILESTONE
|
||||
Put_Line (R.Milestone.Image & ": " & Projects.Descriptions (R.Project));
|
||||
|
||||
if R.Provides /= R.Project then
|
||||
Put_Line ("Provides: " & (+R.Provides));
|
||||
end if;
|
||||
|
||||
if R.Notes /= "" then
|
||||
Put_Line ("Notes: " & R.Notes);
|
||||
end if;
|
||||
|
||||
-- ORIGIN
|
||||
if R.Origin.Is_Native then
|
||||
Put_Line ("Origin (native package):");
|
||||
declare
|
||||
Table : AAA.Table_IO.Table;
|
||||
begin
|
||||
for Dist in Platforms.Distributions loop
|
||||
if R.Origin.Package_Name (Dist) /= Origins.Unavailable.Image then
|
||||
Table.New_Row;
|
||||
Table.Append (" ");
|
||||
Table.Append (Utils.To_Mixed_Case (Dist'Img) & ":");
|
||||
Table.Append (R.Origin.Package_Name (Dist));
|
||||
end if;
|
||||
end loop;
|
||||
Table.Print;
|
||||
end;
|
||||
else
|
||||
Put_Line ("Origin: " & R.Origin.Image);
|
||||
end if;
|
||||
|
||||
-- AVAILABILITY
|
||||
if not R.Available.Is_Empty then
|
||||
Put_Line ("Available when: " & R.Available.Image);
|
||||
end if;
|
||||
|
||||
-- PROPERTIES
|
||||
if not R.Properties.Is_Empty then
|
||||
Put_Line ("Properties:");
|
||||
R.Properties.Print (" ", False);
|
||||
end if;
|
||||
|
||||
-- PRIVATE PROPERTIES
|
||||
if Private_Too and then not R.Properties.Is_Empty then
|
||||
Put_Line ("Private properties:");
|
||||
R.Priv_Props.Print (" ", False);
|
||||
end if;
|
||||
|
||||
-- DEPENDENCIES
|
||||
if not R.Dependencies.Is_Empty then
|
||||
Put_Line ("Dependencies (direct):");
|
||||
R.Dependencies.Print (" ", R.Dependencies.Contains_ORs);
|
||||
end if;
|
||||
end Print;
|
||||
|
||||
-----------------------
|
||||
-- Property_Contains --
|
||||
-----------------------
|
||||
|
||||
function Property_Contains (R : Release; Str : String) return Boolean is
|
||||
use Utils;
|
||||
|
||||
Search : constant String := To_Lower_Case (Str);
|
||||
begin
|
||||
for P of Enumerate (R.Properties and R.Priv_Props) loop
|
||||
declare
|
||||
Text : constant String :=
|
||||
To_Lower_Case
|
||||
((if Utils.Contains (P.Image, ":")
|
||||
then Utils.Tail (P.Image, ':')
|
||||
else P.Image));
|
||||
begin
|
||||
if Utils.Contains (Text, Search) then
|
||||
return True;
|
||||
end if;
|
||||
end;
|
||||
end loop;
|
||||
|
||||
return False;
|
||||
end Property_Contains;
|
||||
|
||||
-------------
|
||||
-- Version --
|
||||
-------------
|
||||
|
||||
function Version (R : Release) return Semantic_Versioning.Version is
|
||||
(R.Version);
|
||||
|
||||
--------------
|
||||
-- Whenever --
|
||||
--------------
|
||||
|
||||
function Whenever (R : Release; P : Alire.Properties.Vector) return Release is
|
||||
begin
|
||||
return Solid : constant Release (R.Prj_Len, R.Notes_Len) :=
|
||||
(Prj_Len => R.Prj_Len,
|
||||
Notes_Len => R.Notes_Len,
|
||||
Project => R.Project,
|
||||
Alias => R.Alias,
|
||||
Version => R.Version,
|
||||
Origin => R.Origin,
|
||||
Notes => R.Notes,
|
||||
Dependencies => R.Dependencies.Evaluate (P),
|
||||
Forbidden => R.Forbidden.Evaluate (P),
|
||||
Properties => R.Properties.Evaluate (P),
|
||||
Priv_Props => R.Priv_Props.Evaluate (P),
|
||||
Available => (if R.Available.Check (P)
|
||||
then Requisites.Booleans.Always_True
|
||||
else Requisites.Booleans.Always_False))
|
||||
do
|
||||
null;
|
||||
end return;
|
||||
end Whenever;
|
||||
|
||||
end Alire.Releases;
|
||||
@@ -1,295 +0,0 @@
|
||||
with Ada.Tags;
|
||||
|
||||
with Alire.Actions;
|
||||
with Alire.Conditional;
|
||||
with Alire.Dependencies;
|
||||
-- with Alire.Interfaces;
|
||||
with Alire.Milestones;
|
||||
with Alire.Origins;
|
||||
with Alire.Projects;
|
||||
with Alire.Properties;
|
||||
with Alire.Properties.Labeled;
|
||||
with Alire.Requisites;
|
||||
with Alire.Utils;
|
||||
with Alire.Versions;
|
||||
|
||||
with Semantic_Versioning;
|
||||
|
||||
private with Alire.OS_Lib;
|
||||
|
||||
package Alire.Releases with Preelaborate is
|
||||
|
||||
-- subtype Dependency_Vector is Dependencies.Vectors.Vector;
|
||||
|
||||
type Release (<>) is
|
||||
new Versions.Versioned
|
||||
with private;
|
||||
|
||||
function "<" (L, R : Release) return Boolean;
|
||||
|
||||
function New_Release (Project : Alire.Project;
|
||||
Version : Semantic_Versioning.Version;
|
||||
Origin : Origins.Origin;
|
||||
Notes : Description_String;
|
||||
Dependencies : Conditional.Dependencies;
|
||||
Properties : Conditional.Properties;
|
||||
Private_Properties : Conditional.Properties;
|
||||
Available : Alire.Requisites.Tree) return Release;
|
||||
|
||||
function New_Working_Release
|
||||
(Project : Alire.Project;
|
||||
Origin : Origins.Origin := Origins.New_Filesystem (".");
|
||||
Dependencies : Conditional.Dependencies := Conditional.For_Dependencies.Empty;
|
||||
Properties : Conditional.Properties := Conditional.For_Properties.Empty)
|
||||
return Release;
|
||||
-- For working project releases that may have incomplete information
|
||||
|
||||
function Extending (Base : Release;
|
||||
Dependencies : Conditional.Dependencies := Conditional.For_Dependencies.Empty;
|
||||
Properties : Conditional.Properties := Conditional.For_Properties.Empty;
|
||||
Private_Properties : Conditional.Properties := Conditional.For_Properties.Empty;
|
||||
Available : Alire.Requisites.Tree := Requisites.Trees.Empty_Tree)
|
||||
return Release;
|
||||
-- Takes a release and merges given fields
|
||||
|
||||
function Renaming (Base : Release;
|
||||
Provides : Alire.Project) return Release;
|
||||
|
||||
function Renaming (Base : Release;
|
||||
Provides : Projects.Named'Class) return Release;
|
||||
-- Fills-in the "provides" field
|
||||
-- During resolution, a project that has a renaming will act as the
|
||||
-- "Provides" project, so both projects cannot be selected simultaneously.
|
||||
|
||||
function Replacing (Base : Release;
|
||||
Project : Alire.Project := "";
|
||||
Notes : Description_String := "") return Release;
|
||||
-- Takes a release and replaces the given fields
|
||||
|
||||
function Replacing (Base : Release;
|
||||
Dependencies : Conditional.Dependencies) return Release;
|
||||
|
||||
function Replacing (Base : Release;
|
||||
Origin : Origins.Origin) return Release;
|
||||
|
||||
function Retagging (Base : Release;
|
||||
Version : Semantic_Versioning.Version) return Release;
|
||||
-- Keep all data but version
|
||||
|
||||
function Upgrading (Base : Release;
|
||||
Version : Semantic_Versioning.Version;
|
||||
Origin : Origins.Origin) return Release;
|
||||
-- Takes a release and replaces version and origin
|
||||
|
||||
function Forbidding (Base : Release;
|
||||
Forbidden : Conditional.Forbidden_Dependencies)
|
||||
return Release;
|
||||
-- Add forbidden dependencies to a release
|
||||
|
||||
function Whenever (R : Release; P : Properties.Vector) return Release;
|
||||
-- Materialize conditions in a Release once the whatever properties are known
|
||||
-- At present dependencies and properties
|
||||
|
||||
overriding function Project (R : Release) return Alire.Project;
|
||||
|
||||
function Project_Str (R : Release) return String is (+R.Project);
|
||||
|
||||
function Project_Base (R : Release) return String;
|
||||
-- Project up to first dot, if any; which is needed for extension projects in templates and so on
|
||||
|
||||
function Provides (R : Release) return Alire.Project;
|
||||
-- The actual project name to be used during dependency resolution
|
||||
-- (But nowhere else)
|
||||
|
||||
function Forbids (R : Release;
|
||||
P : Alire.Properties.Vector)
|
||||
return Conditional.Dependencies;
|
||||
|
||||
function Is_Extension (R : Release) return Boolean;
|
||||
|
||||
function Notes (R : Release) return Description_String; -- Specific to release
|
||||
function Version (R : Release) return Semantic_Versioning.Version;
|
||||
|
||||
function Depends (R : Release) return Conditional.Dependencies;
|
||||
function Dependencies (R : Release) return Conditional.Dependencies
|
||||
renames Depends;
|
||||
|
||||
function Properties (R : Release) return Conditional.Properties;
|
||||
|
||||
function Private_Properties (R : Release) return Conditional.Properties;
|
||||
|
||||
function Depends (R : Release;
|
||||
P : Alire.Properties.Vector)
|
||||
return Conditional.Dependencies;
|
||||
-- Not really conditional anymore, but still a potential tree
|
||||
function Dependencies (R : Release;
|
||||
P : Alire.Properties.Vector)
|
||||
return Conditional.Dependencies renames Depends;
|
||||
|
||||
function Origin (R : Release) return Origins.Origin;
|
||||
function Available (R : Release) return Requisites.Tree;
|
||||
|
||||
function Default_Executable (R : Release) return String;
|
||||
-- We encapsulate here the fixing of platform extension
|
||||
|
||||
function Executables (R : Release;
|
||||
P : Alire.Properties.Vector)
|
||||
return Utils.String_Vector;
|
||||
-- Only explicity declared ones
|
||||
-- Under some conditions (usually current platform)
|
||||
|
||||
function Project_Paths (R : Release;
|
||||
P : Alire.Properties.Vector) return Utils.String_Set;
|
||||
-- Deduced from Project_Files
|
||||
|
||||
function Project_Files (R : Release;
|
||||
P : Alire.Properties.Vector;
|
||||
With_Path : Boolean)
|
||||
return Utils.String_Vector;
|
||||
-- with relative path on demand
|
||||
|
||||
function Unique_Folder (R : Release) return Folder_String;
|
||||
|
||||
-- NOTE: property retrieval functions do not distinguish between public/private, since that's
|
||||
-- merely informative for the users
|
||||
|
||||
function On_Platform_Actions (R : Release; P : Alire.Properties.Vector) return Alire.Properties.Vector;
|
||||
-- Get only Action properties for the platform
|
||||
|
||||
function On_Platform_Properties (R : Release;
|
||||
P : Alire.Properties.Vector;
|
||||
Descendant_Of : Ada.Tags.Tag := Ada.Tags.No_Tag)
|
||||
return Alire.Properties.Vector;
|
||||
-- Return properties that apply to R under platform properties P
|
||||
|
||||
function Labeled_Properties (R : Release;
|
||||
P : Alire.Properties.Vector;
|
||||
Label : Alire.Properties.Labeled.Labels)
|
||||
return Utils.String_Vector;
|
||||
-- Get all values for a given property for a given platform properties
|
||||
|
||||
function Milestone (R : Release) return Milestones.Milestone;
|
||||
|
||||
procedure Print (R : Release; Private_Too : Boolean := False);
|
||||
-- Dump info to console
|
||||
|
||||
-- overriding function To_Code (R : Release) return Utils.String_Vector;
|
||||
|
||||
-- Search helpers
|
||||
|
||||
function Property_Contains (R : Release; Str : String) return Boolean;
|
||||
-- True if some property contains the given string
|
||||
|
||||
function Satisfies (R : Release; Dep : Alire.Dependencies.Dependency) return Boolean;
|
||||
-- Ascertain if this release is a valid candidate for Dep
|
||||
|
||||
private
|
||||
|
||||
use Semantic_Versioning;
|
||||
|
||||
function Materialize is new Conditional.For_Properties.Materialize
|
||||
(Alire.Properties.Vector, Alire.Properties.Append);
|
||||
|
||||
function Enumerate is new Conditional.For_Properties.Enumerate
|
||||
(Alire.Properties.Vector, Alire.Properties.Append);
|
||||
|
||||
function All_Properties (R : Release;
|
||||
P : Alire.Properties.Vector) return Alire.Properties.vector;
|
||||
-- Properties that R has un der platform properties P
|
||||
|
||||
use Alire.Properties;
|
||||
function Comment is new Alire.Properties.Labeled.Cond_New_Label (Alire.Properties.Labeled.Comment);
|
||||
function Describe is new Alire.Properties.Labeled.Cond_New_Label (Alire.Properties.Labeled.Description);
|
||||
|
||||
type Release (Prj_Len,
|
||||
Notes_Len : Natural) is
|
||||
new Versions.Versioned
|
||||
with record
|
||||
Project : Alire.Project (1 .. Prj_Len);
|
||||
Alias : Ustring; -- I finally gave up on constraints
|
||||
Version : Semantic_Versioning.Version;
|
||||
Origin : Origins.Origin;
|
||||
Notes : Description_String (1 .. Notes_Len);
|
||||
Dependencies : Conditional.Dependencies;
|
||||
Forbidden : Conditional.Dependencies;
|
||||
Properties : Conditional.Properties;
|
||||
Priv_Props : Conditional.Properties;
|
||||
Available : Requisites.Tree;
|
||||
end record;
|
||||
|
||||
use all type Conditional.Properties;
|
||||
|
||||
function "<" (L, R : Release) return Boolean is
|
||||
(L.Project < R.Project or else
|
||||
|
||||
(L.Project = R.Project and then
|
||||
L.Version < R.Version) or else
|
||||
|
||||
(L.Project = R.Project and then
|
||||
L.Version = R.Version and then
|
||||
Build (L.Version) < Build (R.Version)));
|
||||
|
||||
function Is_Extension (R : Release) return Boolean is
|
||||
(R.Project_Base'Length < R.Project'Length);
|
||||
|
||||
overriding function Project (R : Release) return Alire.Project is (R.Project);
|
||||
|
||||
function Project_Base (R : Release) return String is
|
||||
(Utils.Head (+R.Project, Extension_Separator));
|
||||
|
||||
function Provides (R : Release) return Alire.Project is
|
||||
((if Ustrings.Length (R.Alias) = 0
|
||||
then R.Project
|
||||
else +(+R.Alias)));
|
||||
|
||||
function Notes (R : Release) return Description_String is (R.Notes);
|
||||
|
||||
function Depends (R : Release) return Conditional.Dependencies is (R.Dependencies);
|
||||
|
||||
function Depends (R : Release;
|
||||
P : Alire.Properties.Vector)
|
||||
return Conditional.Dependencies is
|
||||
(R.Dependencies.Evaluate (P));
|
||||
|
||||
function Forbids (R : Release;
|
||||
P : Alire.Properties.Vector)
|
||||
return Conditional.Dependencies is
|
||||
(R.Forbidden.Evaluate (P));
|
||||
|
||||
function Properties (R : Release) return Conditional.Properties is
|
||||
(R.Properties);
|
||||
|
||||
function Private_Properties (R : Release) return Conditional.Properties is
|
||||
(R.Priv_Props);
|
||||
|
||||
function Origin (R : Release) return Origins.Origin is (R.Origin);
|
||||
function Available (R : Release) return Requisites.Tree is (R.Available);
|
||||
|
||||
function Milestone (R : Release) return Milestones.Milestone is
|
||||
(Milestones.New_Milestone (R.Project, R.Version));
|
||||
|
||||
function Default_Executable (R : Release) return String is
|
||||
(Utils.Replace (+R.Project, ":", "_") & OS_Lib.Exe_Suffix);
|
||||
|
||||
use all type Origins.Kinds;
|
||||
function Unique_Folder (R : Release) return Folder_String is
|
||||
(Utils.Head (+R.Project, Extension_Separator) & "_" &
|
||||
Image (R.Version) & "_" &
|
||||
(case R.Origin.Kind is
|
||||
when Filesystem => "filesystem",
|
||||
when Native => "native",
|
||||
when Source_Archive => "archive",
|
||||
when Git | Hg =>
|
||||
(if R.Origin.Commit'Length <= 8
|
||||
then R.Origin.Commit
|
||||
else R.Origin.Commit (R.Origin.Commit'First .. R.Origin.Commit'First + 7)),
|
||||
when SVN => R.Origin.Commit));
|
||||
|
||||
function On_Platform_Actions (R : Release; P : Alire.Properties.Vector) return Alire.Properties.Vector is
|
||||
(R.On_Platform_Properties (P, Actions.Action'Tag));
|
||||
|
||||
function Satisfies (R : Release; Dep : Alire.Dependencies.Dependency) return Boolean is
|
||||
(R.Project = Dep.Project and then
|
||||
Satisfies (R.Version, Dep.Versions));
|
||||
|
||||
end Alire.Releases;
|
||||
@@ -1,20 +0,0 @@
|
||||
package Alire.Requisites.Booleans with Preelaborate is
|
||||
|
||||
type Requisite_True is new Requisite with null record;
|
||||
|
||||
type Requisite_False is new Requisite with null record;
|
||||
|
||||
pragma Warnings (Off); -- For the unused parameters
|
||||
function Is_Applicable (R : Requisite_True; P : Property'Class) return Boolean is (True);
|
||||
function Satisfies (R : Requisite_True; P : Property'Class) return Boolean is (True);
|
||||
function Image (R : Requisite_True) return String is ("True");
|
||||
|
||||
function Is_Applicable (R : Requisite_False; P : Property'Class) return Boolean is (True);
|
||||
function Satisfies (R : Requisite_False; P : Property'Class) return Boolean is (False);
|
||||
function Image (R : Requisite_False) return String is ("False");
|
||||
pragma Warnings (On);
|
||||
|
||||
function Always_True return Tree is (Trees.Leaf (Requisite_True'(null record)));
|
||||
function Always_False return Tree is (Trees.Leaf (Requisite_False'(null record)));
|
||||
|
||||
end Alire.Requisites.Booleans;
|
||||
@@ -1,102 +0,0 @@
|
||||
with Alire.Utils;
|
||||
|
||||
generic
|
||||
-- Encapsulated basic type
|
||||
type Value is private;
|
||||
with function "<" (L, R : Value) return Boolean;
|
||||
with function Image (V : Value) return String is <>;
|
||||
|
||||
-- Encapsulating property
|
||||
type Property is new Properties.Property with private;
|
||||
with function Element (P : Property) return Value;
|
||||
|
||||
Name : String; -- used for image "Name (operation) Mixed_Case (Image (Value))"
|
||||
package Alire.Requisites.Comparables with Preelaborate is
|
||||
|
||||
package Value_Requisites is new For_Property (Property);
|
||||
|
||||
type Comparable (<>) is new Value_Requisites.Requisite with private;
|
||||
|
||||
overriding function Is_Satisfied (R : Comparable; P : Property) return Boolean;
|
||||
overriding function Image (R : Comparable) return String;
|
||||
|
||||
not overriding function New_Comparable return Comparable;
|
||||
-- This is the root function that can be renamed to a sensible name to appear in expressions
|
||||
|
||||
generic
|
||||
function Factory return Comparable;
|
||||
-- Alternatively this makes for a simpler instantiation since no profile is needed
|
||||
|
||||
function "=" (L : Comparable; R : Value) return Tree;
|
||||
function "=" (L : Value; R : Comparable) return Tree;
|
||||
|
||||
function "/=" (L : Comparable; R : Value) return Tree;
|
||||
function "/=" (L : Value; R : Comparable) return Tree;
|
||||
|
||||
function "<" (L : Comparable; R : Value) return Tree;
|
||||
function "<" (L : Value; R : Comparable) return Tree;
|
||||
|
||||
function "<=" (L : Comparable; R : Value) return Tree;
|
||||
function "<=" (L : Value; R : Comparable) return Tree;
|
||||
|
||||
function ">" (L : Comparable; R : Value) return Tree;
|
||||
function ">" (L : Value; R : Comparable) return Tree;
|
||||
|
||||
function ">=" (L : Comparable; R : Value) return Tree;
|
||||
function ">=" (L : Value; R : Comparable) return Tree;
|
||||
|
||||
function Is_Equal_To (V : Value) return Tree;
|
||||
-- Non-operator function useful elsewhere for case statements
|
||||
|
||||
private
|
||||
|
||||
type Kinds is (Base, Equality, Ordering);
|
||||
|
||||
type Comparable (Kind : Kinds) is new Value_Requisites.Requisite with record
|
||||
Value : Comparables.Value;
|
||||
end record;
|
||||
|
||||
not overriding function New_Comparable return Comparable is (Kind => Base, Value => <>);
|
||||
|
||||
overriding function Is_Satisfied (R : Comparable; P : Property) return Boolean is
|
||||
(case R.Kind is
|
||||
when Base => raise Constraint_Error with "Is_Satisfied: Requisite without operation",
|
||||
when Equality => R.Value = Element (P),
|
||||
when Ordering => Element (P) < R.Value);
|
||||
|
||||
overriding function Image (R : Comparable) return String is
|
||||
(case R.Kind is
|
||||
when Base => raise Constraint_Error with "Image: Requisite without operation",
|
||||
when Equality => Name & " = " & Utils.To_Mixed_Case (Image (R.Value)),
|
||||
when Ordering => Name & " < " & Utils.To_Mixed_Case (Image (R.Value)));
|
||||
|
||||
function Factory return Comparable is (New_Comparable);
|
||||
|
||||
use all type Tree;
|
||||
|
||||
function "/=" (L : Comparable; R : Value) return Tree is (not (L = R));
|
||||
function "/=" (L : Value; R : Comparable) return Tree is (not (L = R));
|
||||
|
||||
function "<=" (L : Comparable; R : Value) return Tree is (L < R or L = R);
|
||||
function "<=" (L : Value; R : Comparable) return Tree is (L < R or L = R);
|
||||
|
||||
function ">" (L : Comparable; R : Value) return Tree is (not (L <= R));
|
||||
function ">" (L : Value; R : Comparable) return Tree is (not (L <= R));
|
||||
|
||||
function ">=" (L : Comparable; R : Value) return Tree is (not (L < R));
|
||||
function ">=" (L : Value; R : Comparable) return Tree is (not (L < R));
|
||||
|
||||
function "=" (L : Comparable; R : Value) return Tree is
|
||||
(Trees.Leaf (Comparable'(Kind => Equality, Value => R)));
|
||||
|
||||
function "=" (L : Value; R : Comparable) return Tree is (R = L);
|
||||
|
||||
function "<" (L : Comparable; R : Value) return Tree is
|
||||
(Trees.Leaf (Comparable'(Kind => Ordering, Value => R)));
|
||||
|
||||
function "<" (L : Value; R : Comparable) return Tree is (R >= L);
|
||||
|
||||
function Is_Equal_To (V : Value) return Tree is
|
||||
(Trees.Leaf (Comparable'(Kind => Equality, Value => V)));
|
||||
|
||||
end Alire.Requisites.Comparables;
|
||||
@@ -1,69 +0,0 @@
|
||||
with Alire.Conditional;
|
||||
with Alire.Platforms;
|
||||
with Alire.Properties.Platform;
|
||||
|
||||
with Alire.Requisites.Comparables;
|
||||
|
||||
package Alire.Requisites.Platform with Preelaborate is
|
||||
|
||||
package Ps renames Platforms;
|
||||
package PrPl renames Properties.Platform;
|
||||
|
||||
use all type Ps.Compilers;
|
||||
use all type Tree;
|
||||
|
||||
package Op_Systems is new Comparables
|
||||
(Ps.Operating_Systems, Ps."<", Ps.Operating_Systems'Image,
|
||||
PrPl.Operating_Systems.Property,
|
||||
PrPl.Operating_Systems.Element,
|
||||
"OS");
|
||||
|
||||
package Op_System_Cases is new Conditional.For_Properties.Case_Statements
|
||||
(Ps.Operating_Systems, Op_Systems.Is_Equal_To);
|
||||
|
||||
package Compilers is new Comparables
|
||||
(Ps.Compilers, Ps."<", Ps.Compilers'Image,
|
||||
PrPl.Compilers.Property,
|
||||
PrPl.Compilers.Element,
|
||||
"Compiler");
|
||||
|
||||
use all type Compilers.Comparable;
|
||||
function Compiler is new Compilers.Factory;
|
||||
|
||||
function Compiler_Is_Native return Tree is
|
||||
(Compiler >= GNAT_FSF_Old and Compiler < GNAT_GPL_Old);
|
||||
|
||||
package Compiler_Cases is new Conditional.For_Properties.Case_Statements
|
||||
(Ps.Compilers, Compilers.Is_Equal_To);
|
||||
|
||||
package Distributions is new Comparables
|
||||
(Ps.Distributions, Ps."<", Ps.Distributions'Image,
|
||||
PrPl.Distributions.Property,
|
||||
PrPl.Distributions.Element,
|
||||
"Distribution");
|
||||
|
||||
package Distribution_Cases_Deps is new Conditional.For_Dependencies.Case_Statements
|
||||
(Ps.Distributions, Distributions.Is_Equal_To);
|
||||
|
||||
package Distribution_Cases_Props is new Conditional.For_Properties.Case_Statements
|
||||
(Ps.Distributions, Distributions.Is_Equal_To);
|
||||
|
||||
package Targets is new Comparables
|
||||
(Ps.Targets, Ps."<", Ps.Targets'Image,
|
||||
PrPl.Targets.Property,
|
||||
PrPl.Targets.Element,
|
||||
"Target");
|
||||
|
||||
package Versions is new Comparables
|
||||
(Ps.Versions, Ps."<", Ps.Versions'Image,
|
||||
PrPl.Versions.Property,
|
||||
PrPl.Versions.Element,
|
||||
"Version");
|
||||
|
||||
package Word_Sizes is new Comparables
|
||||
(Ps.Word_Sizes, Ps."<", Ps.Word_Sizes'Image,
|
||||
PrPl.Word_Sizes.Property,
|
||||
PrPl.Word_Sizes.Element,
|
||||
"Word_Size");
|
||||
|
||||
end Alire.Requisites.Platform;
|
||||
@@ -1,18 +0,0 @@
|
||||
package body Alire.Requisites is
|
||||
|
||||
---------------
|
||||
-- Satisfies --
|
||||
---------------
|
||||
|
||||
function Satisfies (R : Requisite'Class; P : Properties.Vector) return Boolean is
|
||||
begin
|
||||
for Prop of P loop
|
||||
if R.Satisfies (Prop) then
|
||||
return True;
|
||||
end if;
|
||||
end loop;
|
||||
|
||||
return False;
|
||||
end Satisfies;
|
||||
|
||||
end Alire.Requisites;
|
||||
@@ -1,74 +0,0 @@
|
||||
with Alire.Boolean_Trees;
|
||||
with Alire.Properties;
|
||||
|
||||
package Alire.Requisites with Preelaborate is
|
||||
|
||||
use Properties;
|
||||
|
||||
type Requisite is abstract tagged null record;
|
||||
-- A Requisite verifies against some internally stored data that a property is satisfied.
|
||||
-- Here we provide the basic storage of values but the actual checking function must be overridden
|
||||
-- for particular checks.
|
||||
|
||||
function Is_Applicable (R : Requisite; P : Property'Class) return Boolean is abstract;
|
||||
-- Initially there is no compatibility. See helper package below
|
||||
|
||||
-- The following package is the building block to be used to define new compatibility checks.
|
||||
-- Here we tie a class of properties and requisites (e.g., versions and version sets) that make sense.
|
||||
-- A release has a list of properties, and a tree of requisites to be applied to potential dependencies.
|
||||
|
||||
function Satisfies (R : Requisite; P : Property'Class) return Boolean is abstract;
|
||||
-- This function is used later in the generic implementation to automatically downcast,
|
||||
-- so requisite implementations do not need to deal with this MI-mess
|
||||
|
||||
function Image (R : Requisite) return String is abstract;
|
||||
-- A necessary pain to be able to report
|
||||
|
||||
-- Trees of requisites to be matched against a list of properties in a release
|
||||
|
||||
function Satisfies (R : Requisite'Class; P : Properties.Vector) return Boolean;
|
||||
-- True if any of the properties in the vector satisfies the requisite
|
||||
|
||||
function Image_Class (R : Requisite'Class) return String is (R.Image);
|
||||
|
||||
package Trees is new Boolean_Trees (Properties.Vector,
|
||||
Requisite'Class,
|
||||
Satisfies,
|
||||
Image_Class);
|
||||
|
||||
subtype Tree is Trees.Tree;
|
||||
|
||||
function No_Requisites return Trees.Tree is (Trees.Empty_Tree);
|
||||
-- Function instead of constant to keep Preelaborate
|
||||
|
||||
------------------
|
||||
-- For_Property --
|
||||
------------------
|
||||
-- Using these we get free matching of properties to requisites
|
||||
-- It is in essence a work around MI
|
||||
|
||||
generic
|
||||
type Matching_Property (<>) is new Property with private;
|
||||
package For_Property is
|
||||
|
||||
type Requisite is abstract new Requisites.Requisite with null record;
|
||||
|
||||
not overriding
|
||||
function Is_Satisfied (R : Requisite; P : Matching_Property) return Boolean is abstract;
|
||||
-- This is the important function to override by Requisite implementations
|
||||
|
||||
-- The remainder methods are utilities that do not require modifications by the client.
|
||||
|
||||
overriding function Is_Applicable (R : Requisite; P : Property'Class) return Boolean is
|
||||
(P in Matching_Property);
|
||||
-- Convenience for the evaluator to determine which properties might satisfy a requisite
|
||||
|
||||
overriding
|
||||
function Satisfies (R : Requisite; P : Property'Class) return Boolean is
|
||||
(if R.Is_Applicable (P)
|
||||
then Requisite'Class (R).Is_Satisfied (Matching_Property (P))
|
||||
else False);
|
||||
|
||||
end For_Property;
|
||||
|
||||
end Alire.Requisites;
|
||||
@@ -1,69 +0,0 @@
|
||||
with Alire.Index;
|
||||
|
||||
package body Alire.Root is
|
||||
|
||||
Root : access Roots.Root;
|
||||
-- Root dependency (the working project). If Is_Empty we know we must recompile,
|
||||
-- unless the hash already matches. In this case, we know the project file is
|
||||
-- missing the Set call
|
||||
|
||||
-------------
|
||||
-- Current --
|
||||
-------------
|
||||
|
||||
function Current return Roots.Root is (Root.all);
|
||||
|
||||
------------
|
||||
-- Is_Set --
|
||||
------------
|
||||
|
||||
function Is_Set return Boolean is (Root /= null);
|
||||
|
||||
---------
|
||||
-- Set --
|
||||
---------
|
||||
|
||||
function Set (Project : Alire.Project;
|
||||
Version : Semantic_Versioning.Version)
|
||||
return Roots.Root
|
||||
is
|
||||
begin
|
||||
if Index.Exists (Project, Version) then
|
||||
Root := new Roots.Root'(Index.Find (Project, Version) with null record);
|
||||
Trace.Debug ("Storing indexed release as root: " & Root.Milestone.Image);
|
||||
return Root.all;
|
||||
else
|
||||
-- Session is outdated or outside
|
||||
Trace.Error ("Requesting released root not in index: " &
|
||||
(+Project) & "=" & Semantic_Versioning.Image (Version));
|
||||
raise Constraint_Error;
|
||||
end if;
|
||||
end Set;
|
||||
|
||||
---------
|
||||
-- Set --
|
||||
---------
|
||||
|
||||
function Set (Project : Alire.Project;
|
||||
Dependencies : Conditional.Dependencies)
|
||||
return Roots.Root
|
||||
is
|
||||
begin
|
||||
Trace.Debug ("Storing unindexed project as root:" & (+Project));
|
||||
Root := new Roots.Root'
|
||||
(Releases.New_Working_Release (Project, Dependencies => Dependencies) with null record);
|
||||
return Root.all;
|
||||
end Set;
|
||||
|
||||
---------
|
||||
-- Set --
|
||||
---------
|
||||
|
||||
function Set (Release : Releases.Release) return Roots.Root is
|
||||
begin
|
||||
Trace.Debug ("Storing unindexed release as root:" & Release.Milestone.Image);
|
||||
Root := new Roots.Root'(Release with null record);
|
||||
return Root.all;
|
||||
end Set;
|
||||
|
||||
end Alire.Root;
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user