Skip to content

Commit 5f3785a

Browse files
committed
Update gnatcov specification
1 parent ad30d2b commit 5f3785a

File tree

7 files changed

+62
-522
lines changed

7 files changed

+62
-522
lines changed

specs/binary_install.anod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ class binary_install(spec("common")):
1111
@property
1212
def tarball(self):
1313
raise NotImplementedError
14-
14+
1515
@property
1616
def url(self):
1717
raise NotImplementedError
18-
18+
1919
@property
2020
def remove_root_dir(self):
2121
return True

specs/gnatcov.anod

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ from e3.fs import cp
33
from e3.anod.helper import Make
44
from e3.anod.spec import Anod
55
from e3.anod.loader import spec
6-
from e3.diff import patch
76

87
import os
98

@@ -13,7 +12,7 @@ patch_name = "gnatcov.patch"
1312
class GNATcov(spec("common")):
1413
@property
1514
def version(self):
16-
return "22.0"
15+
return "26.0"
1716

1817
@property
1918
def tarball(self):
@@ -34,7 +33,6 @@ class GNATcov(spec("common")):
3433
def build_source_list(self):
3534
return [
3635
Anod.Source(name=self.tarball, publish=True, dest=""),
37-
self.Source(name=patch_name, publish=True, unpack_cmd=cp, dest="patches"),
3836
]
3937

4038
@property
@@ -45,13 +43,14 @@ class GNATcov(spec("common")):
4543
Anod.Dependency("libgpr", track=True),
4644
Anod.Dependency("gnatcoll", track=True),
4745
Anod.Dependency("gnatcoll-bindings", track=True),
48-
Anod.Dependency("langkit", track=True),
46+
Anod.Dependency("langkit_support", track=True),
4947
Anod.Dependency("libadalang", track=True),
5048
Anod.Dependency("binutils", track=True),
5149
Anod.Dependency("gnatutil", track=True),
5250
Anod.Dependency("xmlada", track=True),
5351
Anod.Dependency("zlib", track=True),
54-
Anod.Dependency("gmp", track=True)
52+
Anod.Dependency("gmp", track=True),
53+
Anod.Dependency("llvm", track=True),
5554
]
5655
if self.env.target.os.name == "windows":
5756
deps.append(Anod.Dependency("libiconv"))
@@ -63,23 +62,14 @@ class GNATcov(spec("common")):
6362
for m in [d for d in self.deps if d != "binutils"]:
6463
self.deps[m].setenv()
6564

66-
# Little hack to apply the patch only once, there is probably a clean
67-
# way to do that.
68-
patched = os.path.join(self["SRC_DIR"], "patches", ".patched")
69-
if not os.path.exists(patched):
70-
patch(
71-
os.path.join(self["SRC_DIR"], "patches", patch_name),
72-
self.build_space.src_dir,
73-
)
74-
touch(patched)
75-
7665
build_mode = "prod"
7766
exec_dir = os.path.join(self["SRC_DIR"], "tools", "gnatcov")
7867

7968
make_all = Make(self, exec_dir=exec_dir, jobs=1)
8069
make_all.set_default_target("all")
8170
make_all.set_var("BINUTILS_SRC_DIR", self.deps["binutils"]["SRC_DIR"])
8271
make_all.set_var("BINUTILS_BUILD_DIR", self.deps["binutils"]["BUILD_DIR"])
72+
make_all.set_var("C_SUPPORT", "False")
8373

8474
make_distrib = Make(self, exec_dir=exec_dir)
8575
make_distrib.set_var("PREFIX", unixpath(self["INSTALL_DIR"]))
@@ -89,8 +79,21 @@ class GNATcov(spec("common")):
8979
m.set_var("BITS_ARCH", str(self.env.target.cpu.bits))
9080
m.set_var("DISTRIB_ARCH", self.env.build.cpu.name)
9181
m.set_var("BUILD_MODE", build_mode)
92-
m.set_var("ADAPTERS_LIST", "")
82+
m.set_var("ADAPTERS_LIST", "llvm_json")
9383

9484
make_all()
9585
make_distrib()
86+
87+
cp(
88+
source=os.path.join(
89+
self.deps["llvm"]["INSTALL_DIR"],
90+
"bin",
91+
"llvm-profdata" + self.env.build.os.exeext,
92+
),
93+
target=os.path.join(
94+
self["PKG_DIR"],
95+
"libexec",
96+
"gnatcoverage",
97+
),
98+
)
9699
self.clean()

specs/gnatutil.anod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import os
88
class GNATUTIL(spec("common")):
99
@property
1010
def version(self):
11-
return "20.0w-20190814-1532A"
11+
return "26.0w-20250825"
1212

1313
@property
1414
def tarball(self):

specs/llvm.anod

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
from e3.anod.loader import spec
2+
from e3.fs import sync_tree
3+
from e3.anod.spec import Anod
4+
import os
5+
6+
class LLVM(spec("binary_install")):
7+
@property
8+
def version(self):
9+
return "20.1.8"
10+
11+
@property
12+
def platform(self):
13+
if self.env.host.os.name == "windows":
14+
return "x86_64-pc-windows-msvc"
15+
if self.env.host.os.name == "darwin":
16+
if self.env.host.cpu.name == "arm":
17+
return "macos-arm64"
18+
else:
19+
# Unsupported
20+
raise NotImplementedError
21+
else:
22+
if self.env.host.cpu.name == "x86_64":
23+
return "linux-x64"
24+
else:
25+
return "linux-arm64"
26+
27+
@property
28+
def tool(self):
29+
if self.env.host.os.name == "windows":
30+
return "clang+llvm"
31+
else:
32+
return "LLVM"
33+
34+
@property
35+
def tarball(self):
36+
return f"{self.tool}-{self.version}-{self.platform}.tar.xz"
37+
38+
@property
39+
def url(self):
40+
return f"https://github.com/llvm/llvm-project/releases/download/llvmorg-{self.version}/{self.tarball}"
-887 KB
Binary file not shown.
573 KB
Binary file not shown.

0 commit comments

Comments
 (0)