Skip to content

Commit 5e0a409

Browse files
committed
Add testcase for alire support.
Refs #668
1 parent eb9fb7d commit 5e0a409

File tree

13 files changed

+323
-0
lines changed

13 files changed

+323
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export ALIRE="True"
2+
export GNAT_NATIVE_ALIRE_PREFIX="/home/max/.config/alire/cache/dependencies/gnat_native_12.2.1_11f3b811"
3+
export GPRBUILD_ALIRE_PREFIX="/home/max/.config/alire/cache/dependencies/gprbuild_22.0.1_24dfc1b5"
4+
export GPR_PROJECT_PATH="${DIR}:${DIR}/alire/cache/dependencies/libhello_1.0.1_3c15bc7f"
5+
export HELLO_ALIRE_PREFIX="${DIR}"
6+
export LIBHELLO_ALIRE_PREFIX="${DIR}/alire/cache/dependencies/libhello_1.0.1_3c15bc7f"
7+
export PATH="/usr/sbin:/usr/bin:/sbin:/bin"
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
hello=1.0.2: 'Hello, world!' demonstration project
2+
Origin: path /tmp/hello_1.0.2_5715870b
3+
Properties:
4+
Author: Alejandro R. Mosteo
5+
Description: 'Hello, world!' demonstration project
6+
Executable: hello
7+
License: MIT
8+
Maintainer: Alejandro R. Mosteo <alejandro@mosteo.com>
9+
Maintainers_Logins: mosteo
10+
Name: hello
11+
Tag: hello
12+
Tag: demo
13+
Version: 1.0.2
14+
Website: https://github.com/alire-project/hello
15+
Dependencies (direct):
16+
libhello^1.0
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
authors = [
2+
"Alejandro R. Mosteo",
3+
]
4+
description = "'Hello, world!' demonstration project"
5+
executables = [
6+
"hello",
7+
]
8+
licenses = "MIT"
9+
maintainers = [
10+
"Alejandro R. Mosteo <alejandro@mosteo.com>",
11+
]
12+
maintainers-logins = [
13+
"mosteo",
14+
]
15+
name = "hello"
16+
tags = [
17+
"hello",
18+
"demo",
19+
]
20+
version = "1.0.2"
21+
website = "https://github.com/alire-project/hello"
22+
[[depends-on]]
23+
libhello = "^1.0"
24+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
-- Configuration for libhello generated by Alire
2+
abstract project Libhello_Config is
3+
Crate_Version := "1.0.1";
4+
Crate_Name := "libhello";
5+
6+
Alire_Host_OS := "linux";
7+
8+
Alire_Host_Arch := "x86_64";
9+
10+
Alire_Host_Distro := "ubuntu";
11+
Ada_Compiler_Switches := External_As_List ("ADAFLAGS", " ");
12+
Ada_Compiler_Switches := Ada_Compiler_Switches &
13+
(
14+
"-O3" -- Optimize for performance
15+
,"-gnatn" -- Enable inlining
16+
,"-ffunction-sections" -- Separate ELF section for each function
17+
,"-fdata-sections" -- Separate ELF section for each variable
18+
);
19+
20+
type Build_Profile_Kind is ("release", "validation", "development");
21+
Build_Profile : Build_Profile_Kind := "release";
22+
23+
end Libhello_Config;
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
with "config/libhello_config.gpr";
2+
project Libhello is
3+
4+
for Library_Name use "Libhello";
5+
for Library_Version use Project'Library_Name & ".so." & Libhello_Config.Crate_Version;
6+
7+
for Source_Dirs use ("src/", "config/");
8+
for Object_Dir use "obj/" & Libhello_Config.Build_Profile;
9+
for Create_Missing_Dirs use "True";
10+
for Library_Dir use "lib";
11+
12+
type Library_Type_Type is ("relocatable", "static", "static-pic");
13+
Library_Type : Library_Type_Type :=
14+
external ("LIBHELLO_LIBRARY_TYPE", external ("LIBRARY_TYPE", "static"));
15+
for Library_Kind use Library_Type;
16+
17+
package Compiler is
18+
for Default_Switches ("Ada") use Libhello_Config.Ada_Compiler_Switches;
19+
end Compiler;
20+
21+
package Binder is
22+
for Switches ("Ada") use ("-Es"); -- Symbolic traceback
23+
end Binder;
24+
25+
package Install is
26+
for Artifacts (".") use ("share");
27+
end Install;
28+
29+
end Libhello;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
with Ada.Text_IO;
2+
3+
package body Libhello is
4+
5+
-----------------
6+
-- Hello_World --
7+
-----------------
8+
9+
procedure Hello_World is
10+
use Ada.Text_IO;
11+
begin
12+
Put_Line ("Hello, world!");
13+
end Hello_World;
14+
15+
end Libhello;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package Libhello is
2+
3+
procedure Hello_World;
4+
5+
end Libhello;
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/sh
2+
set -e
3+
# A dummy Alire replacement for testing purposes
4+
while [ $# -gt 1 ] ; do shift ; done
5+
DIR=`dirname $(realpath $0)`
6+
sed -e "s#\${DIR}#${DIR}#g" .alr_$1
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
-- Configuration for hello generated by Alire
2+
with "libhello.gpr";
3+
abstract project Hello_Config is
4+
Crate_Version := "1.0.2";
5+
Crate_Name := "hello";
6+
7+
Alire_Host_OS := "linux";
8+
9+
Alire_Host_Arch := "x86_64";
10+
11+
Alire_Host_Distro := "ubuntu";
12+
Ada_Compiler_Switches := External_As_List ("ADAFLAGS", " ");
13+
Ada_Compiler_Switches := Ada_Compiler_Switches &
14+
(
15+
"-Og" -- Optimize for debug
16+
,"-ffunction-sections" -- Separate ELF section for each function
17+
,"-fdata-sections" -- Separate ELF section for each variable
18+
,"-g" -- Generate debug info
19+
,"-gnatwa" -- Enable all warnings
20+
,"-gnatw.X" -- Disable warnings for No_Exception_Propagation
21+
,"-gnatVa" -- All validity checks
22+
,"-gnaty3" -- Specify indentation level of 3
23+
,"-gnatya" -- Check attribute casing
24+
,"-gnatyA" -- Use of array index numbers in array attributes
25+
,"-gnatyB" -- Check Boolean operators
26+
,"-gnatyb" -- Blanks not allowed at statement end
27+
,"-gnatyc" -- Check comments
28+
,"-gnaty-d" -- Disable check no DOS line terminators present
29+
,"-gnatye" -- Check end/exit labels
30+
,"-gnatyf" -- No form feeds or vertical tabs
31+
,"-gnatyh" -- No horizontal tabs
32+
,"-gnatyi" -- Check if-then layout
33+
,"-gnatyI" -- check mode IN keywords
34+
,"-gnatyk" -- Check keyword casing
35+
,"-gnatyl" -- Check layout
36+
,"-gnatym" -- Check maximum line length
37+
,"-gnatyn" -- Check casing of entities in Standard
38+
,"-gnatyO" -- Check that overriding subprograms are explicitly marked as such
39+
,"-gnatyp" -- Check pragma casing
40+
,"-gnatyr" -- Check identifier references casing
41+
,"-gnatyS" -- Check no statements after THEN/ELSE
42+
,"-gnatyt" -- Check token spacing
43+
,"-gnatyu" -- Check unnecessary blank lines
44+
,"-gnatyx" -- Check extra parentheses
45+
);
46+
47+
type Build_Profile_Kind is ("release", "validation", "development");
48+
Build_Profile : Build_Profile_Kind := "development";
49+
50+
end Hello_Config;
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
with "config/hello_config.gpr";
2+
project Hello is
3+
4+
for Source_Dirs use ("src/", "config/");
5+
for Object_Dir use "obj/" & Hello_Config.Build_Profile;
6+
for Create_Missing_Dirs use "True";
7+
for Exec_Dir use "bin";
8+
for Main use ("hello.adb");
9+
10+
package Compiler is
11+
for Default_Switches ("Ada") use Hello_Config.Ada_Compiler_Switches;
12+
end Compiler;
13+
14+
package Binder is
15+
for Switches ("Ada") use ("-Es"); -- Symbolic traceback
16+
end Binder;
17+
18+
package Install is
19+
for Artifacts (".") use ("share");
20+
end Install;
21+
22+
end Hello;

0 commit comments

Comments
 (0)