Commit d26e5a5cc3dd1375a2354003598b3744fadb9722

Thomas de Grivel 2023-08-24T11:58:46

override make command for c3

diff --git a/lib/rbpkg/repo.rb b/lib/rbpkg/repo.rb
index 120c341..81a3f57 100644
--- a/lib/rbpkg/repo.rb
+++ b/lib/rbpkg/repo.rb
@@ -29,14 +29,22 @@ class Rbpkg::Repo
     if ! tag_present?("build-done")
       configure()
       if File.file?("#{src_dir}/Makefile")
-        cmd! "cd #{sh_quote(src_dir)} && #{make} -j #{Rbpkg.ncpu}"
+        make
       elsif File.file?("#{src_dir}/CMakeLists.txt")
-        cmd! "cmake -j #{Rbpkg.ncpu} --build #{sh_quote(obj_dir)}"
+        cmake
       end
       tag_set("build-done")
     end
   end
 
+  def cmake
+    cmd! "cmake -j #{Rbpkg.ncpu} --build #{sh_quote(obj_dir)}"
+  end
+
+  def make
+    cmd! "cd #{sh_quote(src_dir)} && #{make} -j #{Rbpkg.ncpu}"
+  end
+
   def checkout(branch)
     verbose(3, "repo(#{name.inspect}).checkout")
     sh_branch=sh_quote(branch)
diff --git a/lib/rbpkg/repos/c3.rb b/lib/rbpkg/repos/c3.rb
index 514bf8d..2d46769 100644
--- a/lib/rbpkg/repos/c3.rb
+++ b/lib/rbpkg/repos/c3.rb
@@ -12,5 +12,9 @@ class Rbpkg::Repos::C3 < Rbpkg::Repo
     "https://git.kmx.io/c3-lang/c3.git"
   end
 
+  def make
+    cmd! "cd #{sh_quote(src_dir)} && #{make}"
+  end
+
   repo_register
 end