From 9ba483b9b945233a73a1b4b8bd9cb47c8f07ae9a Mon Sep 17 00:00:00 2001 From: "Alejandro R. Mosteo" Date: Mon, 27 Aug 2018 19:08:01 +0200 Subject: [PATCH] Removed old extension mechanism Now superseeded by actual packages --- index/alire-index-adayaml.ads | 2 +- index/alire-index-sdlada.ads | 6 +- index/alire-index-simple_components.ads | 465 +++++++++++++----------- index/native/alire-index-libsdl2.ads | 44 ++- src/alire-index.adb | 34 -- src/alire-index.ads | 12 +- 6 files changed, 291 insertions(+), 272 deletions(-) diff --git a/index/alire-index-adayaml.ads b/index/alire-index-adayaml.ads index 46b9f8d7..5aaca577 100644 --- a/index/alire-index-adayaml.ads +++ b/index/alire-index-adayaml.ads @@ -63,7 +63,7 @@ package Alire.Index.AdaYaml is Executable ("yaml-server"), Dependencies => - Simple_Components.Connections_V_4_27.Within_Major)); + Simple_Components.Connections.V_4_27.Within_Major)); end Server; diff --git a/index/alire-index-sdlada.ads b/index/alire-index-sdlada.ads index 8e0f6a02..1bd71e54 100644 --- a/index/alire-index-sdlada.ads +++ b/index/alire-index-sdlada.ads @@ -14,9 +14,9 @@ package Alire.Index.SDLAda is Git (Prj_Repo, "570232193facb90a58f67aadac93df9dfae8bcd4"), Dependencies => - LibSDL2.SDL_V_2.Within_Major and - LibSDL2.SDL_Image_V_2.Within_Major and - LibSDL2.SDL_TTF_V_2.Within_Major, + 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 diff --git a/index/alire-index-simple_components.ads b/index/alire-index-simple_components.ads index dd4c6c9c..076819f1 100644 --- a/index/alire-index-simple_components.ads +++ b/index/alire-index-simple_components.ads @@ -12,35 +12,9 @@ package Alire.Index.Simple_Components is function Project is new Catalogued_Project ("Simple Components (root project)"); -- This is a special project because it contains no code. - -- The first usable extension is Strings_Edit - -- Having this one though is better for canonical name and listing -- NOTE: since all extensions reside in the same commit/folder, there's no need for interdependencies - function Strings_Edit is new Extension (Project, - "Simple Components (strings)"); - - function Tables is new Extension (Project, - "Simple Components (tables)"); - - function Core is new Extension (Project, - "Simple Components (core components)"); - - function Connections is new Extension (Project, - "Simple Components (clients/servers)"); - - function Secure is new Extension (Connections, - "Simple Components (clients/servers over TLS)"); - - function NTP is new Extension (Connections, - "Simple Components (Network Time Protocol)"); - - function ODBC is new Extension (Project, - "Simple Components (ODBC bindings)"); - - function SQLite is new Extension (Project, - "Simple Components (SQLite)"); - Base_V_4_27 : constant Release := Project.Unreleased (V ("4.27"), @@ -54,177 +28,106 @@ package Alire.Index.Simple_Components is Author (DAK_Author) and Website (DAK_Website)); - Strings_Edit_V_4_27 : constant Release := - Strings_Edit.Register - (Base_V_4_27 --- .Replacing (Origin => Git (Repo, "8ac67a28d666dde3a0f96b5a08a7016e4f29d491")) - .Extending - (Properties => - Project_File ("strings_edit.gpr"), + ----------------- + -- Connections -- + ----------------- - Private_Properties => - Executable ("test_base64") and - Executable ("test_strings_edit") and - Executable ("test_string_streams") and + package Connections is - Project_File ("test_strings_edit/strings_edit-test.gpr"))); + function Project is new Catalogued_Project + ("Simple Components (clients/servers)"); - Tables_V_4_27 : constant Release := - Tables.Register - (Base_V_4_27 --- .Replacing (Origin => Git (Repo, "19205e4981d72242daf72da7d59c5faf2b4c91fd")) - .Extending - (Properties => - Project_File ("tables.gpr"), + 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, - Private_Properties => - Executable ("test_tables") and - Project_File ("test_tables/tables-test.gpr"))); + 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"), - Components_V_4_27 : constant Release := - Core.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 + 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 - 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 + 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 - Comment ("Tasking=Single seems to be broken at persistent-single_file-text_io.adb"), + -- 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")) + )); - 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 + --------- + -- NTP -- + --------- - Project_File ("test_components/components-tests.gpr"))); + package NTP is - NTP_V_4_27 : constant Release := - NTP.Register - (Base_V_4_27 --- .Replacing (Origin => Git (Repo, "34fb305d6ef360cde5e272b51409097a5de72017")) - .Extending - ( --- Dependencies => --- Components_V_4_27.Within_Major, + function Project is new Catalogued_Project + ("Simple Components (Network Time Protocol)"); - Properties => - Project_File ("components-ntp.gpr"), + V_4_27 : constant Release := + Project.Register + (Base_V_4_27 + -- .Replacing (Origin => Git (Repo, "34fb305d6ef360cde5e272b51409097a5de72017")) + .Extending + ( + -- Dependencies => + -- Components_V_4_27.Within_Major, - Private_Properties => - Executable ("test_ntp") and - Project_File ("test_components/components-ntp-test_ntp.gpr"))); + Properties => + Project_File ("components-ntp.gpr"), - Sqlite_V_4_27 : constant Release := - SQLite.Register - (Base_V_4_27 --- .Replacing (Origin => Git (Repo, "6fda0f3f7494815c87b329f7411b9a49ff97b9ba")) - .Extending - ( --- Dependencies => --- Components_V_4_27.Within_Major, + Private_Properties => + Executable ("test_ntp") and + Project_File ("test_components/components-ntp-test_ntp.gpr"))); - Properties => - Project_File ("components-sqlite.gpr"), + end NTP; - 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 + ------------ + -- Secure -- + ------------ - Project_File ("test_components/components-sqlite-benchmark_tests.gpr") and - Project_File ("test_components/components-sqlite-sqlite_persistence_tests.gpr")) - )); + package Secure is - Connections_V_4_27 : constant Release := - Connections.Register - (Base_V_4_27 --- .Replacing (Git (Repo, "008935d5a89396cc0c39afb39f04bf6a89a92058")) - .Extending - ( --- Dependencies => --- Components_V_4_27.Within_Major and --- Sqlite_V_4_27.Within_Major, + function Project is new Catalogued_Project + ("Simple Components (clients/servers over TLS)"); - 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")) - )); - - Secure_V_4_27 : constant Release := - Secure.Register + V_4_27 : constant Release := + Project.Register (Base_V_4_27 -- .Replacing (Origin => Git (Repo, "ca72cf4150ae14ba6d40c3d2dd92c7846cb4cb5d")) .Extending @@ -244,34 +147,188 @@ package Alire.Index.Simple_Components is 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"))); - ODBC_V_4_27 : constant Release := - ODBC.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, + end Secure; - Properties => - Project_File ("components-odbc.gpr"), + end Connections; - Private_Properties => - Executable ("test_odbc_bindings") and + ---------- + -- Core -- + ---------- - Project_File ("test_components/components-odbc-odbc_bindings_tests.gpr") and + package Core is - 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")))); + 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; diff --git a/index/native/alire-index-libsdl2.ads b/index/native/alire-index-libsdl2.ads index a5c662f5..14b70080 100644 --- a/index/native/alire-index-libsdl2.ads +++ b/index/native/alire-index-libsdl2.ads @@ -3,30 +3,36 @@ package Alire.Index.LibSDL2 is function Project is new Catalogued_Project ("Simple DirectMedia Layer development files"); - function Image is new Extension - (Project, - "Image loading library for Simple DirectMedia Layer 2"); - - function TTF is new Extension - (Project, - "TrueType Font library for Simple DirectMedia Layer 2"); - - SDL_V_2 : constant Release := + V_2 : constant Release := Project.Register (V ("2"), Native ((Debian | Ubuntu => Packaged_As ("libsdl2-dev"), others => Unavailable))); - SDL_Image_V_2 : constant Release := - Image.Register - (V ("2"), - Native ((Debian | Ubuntu => Packaged_As ("libsdl2-image-dev"), - others => Unavailable))); + package Image is - SDL_TTF_V_2 : constant Release := - TTF.Register - (V ("2"), - Native ((Debian | Ubuntu => Packaged_As ("libsdl2-ttf-dev"), - others => Unavailable))); + 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; diff --git a/src/alire-index.adb b/src/alire-index.adb index f128394f..aa87e5af 100644 --- a/src/alire-index.adb +++ b/src/alire-index.adb @@ -61,40 +61,6 @@ package body Alire.Index is end return; end Catalogued_Project; - --------------- - -- Extension -- - --------------- - - function Extension return Catalog_Entry is - use Utils; - Reflected : constant Reflected_Info := - Identify (GNAT.Source_Info.Enclosing_Entity); - begin --- Trace.Always ("Encl: " & GNAT.Source_Info.Enclosing_Entity); --- Trace.Always ("self: " & Self_Name); --- Trace.Always ("full: " & Full_Name); --- Trace.Always ("pack: " & Pack_Name); - return C : constant Catalog_Entry := - (Name_Len => Reflected.Id_Len + Base.Project'Length + 1, - Descr_Len => Description'Length, - Pack_Len => Reflected.Pack_Len, - Self_Len => Reflected.Id_Len, - - Project => - +To_Lower_Case ((+Base.Project) & Extension_Separator & Reflected.Identifier), - 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 Extension; - ------------- -- Current -- ------------- diff --git a/src/alire-index.ads b/src/alire-index.ads index ed5354ac..6345b024 100644 --- a/src/alire-index.ads +++ b/src/alire-index.ads @@ -47,17 +47,7 @@ package Alire.Index is First_Use : access Boolean := new Boolean'(True); function Catalogued_Project return Catalog_Entry; -- A regular project - -- See above note on Catalog_Entry - - generic - with function Base return Catalog_Entry; - Description : Description_String; - - -- For internal use - First_Use : access Boolean := new Boolean'(True); - function Extension return Catalog_Entry; - -- A "variant/flavor" project that resides in the same package. - -- It may either extend or override a base project + -- See above note on Catalog_Entry overriding function Project (C : Catalog_Entry) return Alire.Project;