diff --git a/specs/gnatcoll-bindings.anod b/specs/gnatcoll-bindings.anod index e9044e3..bf428f1 100644 --- a/specs/gnatcoll-bindings.anod +++ b/specs/gnatcoll-bindings.anod @@ -8,7 +8,7 @@ import os class GNATcollBindings(spec("common")): @property def version(self): - return "22.0.0" + return "24.0.0" @property def tarball(self): @@ -31,7 +31,7 @@ class GNATcollBindings(spec("common")): @property def build_deps(self): deps = [ - Anod.Dependency("gcc"), + Anod.Dependency("base_gcc"), Anod.Dependency("gprbuild"), Anod.Dependency("gnatcoll"), Anod.Dependency("libgpr"), diff --git a/specs/gnatcoll.anod b/specs/gnatcoll.anod index 1aef9c8..88e17f4 100644 --- a/specs/gnatcoll.anod +++ b/specs/gnatcoll.anod @@ -9,7 +9,7 @@ import os class GNATcoll(spec("common")): @property def version(self): - return "22.0.0" + return "24.0.0" @property def tarball(self): diff --git a/specs/gpr2.anod b/specs/gpr2.anod new file mode 100644 index 0000000..f1743a2 --- /dev/null +++ b/specs/gpr2.anod @@ -0,0 +1,120 @@ +from e3.os.fs import touch +from e3.anod.helper import Make, text_replace +from e3.anod.spec import Anod +from e3.anod.loader import spec +from e3.fs import cp, rm, ls +from e3.diff import patch +import os +from datetime import date + + +class LibGPR2(spec("common")): + @property + def version(self): + return "24.0.0" + + @property + def tarball(self): + return "gpr-%s.tar.gz" % self.version + + @property + def tools_only(self): + return "tools_only" in self.parsed_qualifier + + @property + def source_pkg_build(self): + return [ + self.HTTPSSourceBuilder( + name=self.tarball, + url="https://github.com/AdaCore/gpr/archive/v%s.tar.gz" + % self.version, + ) + ] + + @property + def build_source_list(self): + return [ + Anod.Source(name=self.tarball, publish=True, dest=""), + ] + + @property + def build_deps(self): + return [ + Anod.Dependency("base_gcc", track=True), + Anod.Dependency("gprbuild", track=True), + Anod.Dependency("xmlada", track=True), + Anod.Dependency("libgpr", track=True), + Anod.Dependency("gnatcoll", track=True), + Anod.Dependency("gnatcoll-bindings", track=True), + Anod.Dependency("gprconfig_kb", track=True), + ] + + def update_version(self): + text_replace( + os.path.join(self["SRC_DIR"], "src", "lib", "gpr2-version.ads"), + [ + ( + "Build_Type : constant GNAT_Build_Type.*", + "Build_Type : constant GNAT_Build_Type := FSF;", + ), + ( + "Short_Value : constant String.*", + 'Short_Value : constant String := "%s";' % self.version, + ), + ( + "Date : constant String.*", + 'Date : constant String := "%s-gpr2";' % str(date.today()), + ), + ( + "Current_Year : constant String.*", + 'Current_Year : constant String := "%s";' % str(date.today().year), + ), + ], + ) + + @property + def productized_tools(self): + """List of tools from gpr2-tools.gpr we want to push in the released + package""" + return [ + "gprclean", + "gprinspect", + "gprinstall", + "gprls", + "gprremote", + "gprconfig", + ] + + + @Anod.primitive() + def build(self): + for m in self.deps: + if m != "gprconfig_kb": + self.deps[m].setenv() + + self.update_version() + + gprconfig_kb_dir = os.path.join(self.deps["gprconfig_kb"]["SRC_DIR"], + "db") + + make = Make(self, exec_dir=self["SRC_DIR"]) + make("setup") + make.set_var("GPR2KBDIR", gprconfig_kb_dir) + make.set_var("prefix", self["INSTALL_DIR"]) + make.set_var("ENABLE_SHARED", "no") + + make() + make("install") + + if self.tools_only: + rm(os.path.join(self["INSTALL_DIR"], 'share'), recursive=True) + rm(os.path.join(self["INSTALL_DIR"], 'include'), recursive=True) + rm(os.path.join(self["INSTALL_DIR"], 'lib'), recursive=True) + + bin_dir = os.path.join(self["INSTALL_DIR"], 'bin', "*") + for file in ls(bin_dir): + if os.path.basename(file) not in self.productized_tools: + rm(file) + + + self.clean() diff --git a/specs/gprbuild.anod b/specs/gprbuild.anod index 16f7d47..1a1432f 100644 --- a/specs/gprbuild.anod +++ b/specs/gprbuild.anod @@ -9,7 +9,7 @@ from datetime import date class GPRbuild(spec("gh-artifact")): @property def version(self): - return "22.0.0" + return "24.0.0" @property def tarball(self): diff --git a/specs/libgpr.anod b/specs/libgpr.anod index a66afe4..db2f7e0 100644 --- a/specs/libgpr.anod +++ b/specs/libgpr.anod @@ -9,7 +9,7 @@ import os class LibGPR(spec("common")): @property def version(self): - return "22.0.0" + return "24.0.0" @property def tarball(self): diff --git a/specs/release_package.anod b/specs/release_package.anod index 266ef25..fc46f1c 100644 --- a/specs/release_package.anod +++ b/specs/release_package.anod @@ -98,7 +98,8 @@ class ReleasePackage(spec("common")): def build_deps(self): pck = self.package if pck == "gprbuild": - return [Anod.Dependency("gprbuild", track=True)] + return [Anod.Dependency("gprbuild"), + Anod.Dependency("gpr2", qualifier="tools_only")] if pck == "gnatcov": return [Anod.Dependency("gnatcov", track=True)] diff --git a/specs/xmlada.anod b/specs/xmlada.anod index 5d4a3cb..aa8deb7 100644 --- a/specs/xmlada.anod +++ b/specs/xmlada.anod @@ -8,7 +8,7 @@ from e3.anod.loader import spec class XMLAda(spec("common")): @property def version(self): - return "22.0.0" + return "24.0.0" @property def tarball(self): diff --git a/specs/zlib.anod b/specs/zlib.anod index c0d60c4..b871254 100644 --- a/specs/zlib.anod +++ b/specs/zlib.anod @@ -7,15 +7,10 @@ from e3.diff import patch import os -# patch from msys2: -# https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-zlib/01-zlib-1.2.11-1-buildsys.mingw.patch -patch_name = "zlib-buildsys-mingw.patch" - - class ZLib(spec("common")): @property def version(self): - return "1.2.11" + return "1.3" @property def tarball(self): @@ -27,19 +22,17 @@ class ZLib(spec("common")): self.HTTPSSourceBuilder( name=self.tarball, url="https://zlib.net/current/%s" % self.tarball ), - self.LocalSourceBuilder(name=patch_name), ] @property def build_source_list(self): return [ Anod.Source(name=self.tarball, publish=True, dest=""), - self.Source(name=patch_name, publish=True, unpack_cmd=cp, dest="patches"), ] @property def build_deps(self): - return [Anod.Dependency("gcc")] + return [Anod.Dependency("base_gcc")] def setenv(self): self.env.add_search_path( @@ -54,16 +47,6 @@ class ZLib(spec("common")): for m in self.deps: self.deps[m].setenv() - # Little hack to apply the patch only once, there is probably a clean - # way to do that. - patched = os.path.join(self["SRC_DIR"], "patches", ".patched") - if not os.path.exists(patched): - patch( - os.path.join(self["SRC_DIR"], "patches", patch_name), - self.build_space.src_dir, - ) - touch(patched) - configure = Configure(self, exec_dir=self["SRC_DIR"], auto_target=False) configure.add("--prefix=%s" % unixpath(self["INSTALL_DIR"])) configure.add("--static")