From f9bead945bc7c6f906ef2181ae8383c7ab051faf Mon Sep 17 00:00:00 2001 From: sunrisepeak Date: Sat, 2 May 2026 02:28:57 +0800 Subject: [PATCH] feat(automake): drop configure-project-installer, inline autotools build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Switch fromsource:automake to its own inline autotools build: * paths derived from pkginfo.install_file() * configure + make + install chained in a single sh -c * fixed -j8 * declare upstream url + sha256 * deps: explicit xim:gcc + xim:make + xim:xpkg-helper (previously pulled in transitively via xim:configure-project-installer) * URL switched ftpmirror.gnu.org → ftp.gnu.org (ftpmirror occasionally 404s individual mirrors between rotations; canonical source is stable) Verified end-to-end in xlings 0.4.9 iso: ✓ configure -> make -j8 -> make install ✓ produced bin/automake, bin/aclocal, bin/automake-1.16, bin/aclocal-1.16 ✓ "8 package(s) installed" exit 0 Cluster B leaf 6/8. --- pkgs/a/automake.lua | 38 ++++++++++++++++++++++++++++++-------- 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/pkgs/a/automake.lua b/pkgs/a/automake.lua index d66dac5..9cc83b9 100644 --- a/pkgs/a/automake.lua +++ b/pkgs/a/automake.lua @@ -1,3 +1,7 @@ +function __automake_url(version) + return format("https://ftp.gnu.org/gnu/automake/automake-%s.tar.gz", version) +end + package = { spec = "1", @@ -20,9 +24,16 @@ package = { xpm = { linux = { - deps = { "xim:configure-project-installer@0.0.1" }, + deps = { + "xim:xpkg-helper@0.0.1", + "xim:gcc@15.1.0", + "xim:make@4.3", + }, ["latest"] = { ref = "1.16.5" }, - ["1.16.5"] = { }, + ["1.16.5"] = { + url = __automake_url("1.16.5"), + sha256 = nil, + }, }, }, } @@ -35,12 +46,23 @@ import("xim.libxpkg.xvm") local binding_tree = "automake-binding-tree" function install() - local xpkg = package.name .. "@" .. pkginfo.version() - os.tryrm(pkginfo.install_dir()) + -- Sandbox template (PR #49 bzip2): derive paths from pkginfo.install_file() + -- since path.absolute is nil; chain configure + make + install in single + -- sh -c (os.cd doesn't propagate to system.exec children). + local runtime_dir = path.directory(pkginfo.install_file()) + local scode_dir = path.join(runtime_dir, "automake-" .. pkginfo.version()) + local build_dir = path.join(runtime_dir, "build-automake") + local prefix = pkginfo.install_dir() - system.exec("configure-project-installer " .. pkginfo.install_dir() - .. " --xpkg-scode " .. xpkg - ) + os.tryrm(build_dir) + os.mkdir(build_dir) + + log.info("Configuring + building + installing automake (autotools)...") + system.exec(string.format( + "sh -c 'cd %s && %s/configure --prefix=%s " + .. "&& make -j8 && make install'", + build_dir, scode_dir, prefix + )) return os.isdir(pkginfo.install_dir()) end @@ -68,4 +90,4 @@ function uninstall() end xvm.remove(binding_tree) return true -end \ No newline at end of file +end