@@ -2,6 +2,7 @@ class Macaulay2 < Formula
22 @name = "M2"
33 desc "Software system for algebraic geometry research"
44 homepage "http://macaulay2.com"
5+ # when bumping to a new release, also update the submodule commits below
56 url "https://github.com/Macaulay2/M2/archive/refs/tags/release-1.25.11.tar.gz"
67 sha256 "9700005196e4368af52156efaff081a4771fd21545a3cd8c2ee3b0571aeaa17f"
78 license any_of : [ "GPL-2.0-only" , "GPL-3.0-only" ]
@@ -57,6 +58,13 @@ class Macaulay2 < Formula
5758
5859 patch :DATA
5960
61+ def git_clone_at_commit ( url , dir , commit )
62+ system "git" , "clone" , url , dir
63+ cd dir do
64+ system "git" , "checkout" , commit
65+ end
66+ end
67+
6068 def install
6169 # Don't print the shims prefix path
6270 inreplace "M2/Macaulay2/packages/Macaulay2Doc/functions/findProgram-doc.m2" , "Verbose => true" , "Verbose => false"
@@ -68,10 +76,29 @@ def install
6876 inreplace "M2/Macaulay2/d/CMakeLists.txt" , "M2-supervisor" , "M2-supervisor quadmath" unless OS . mac?
6977
7078 # Place the submodules, since the tarfile doesn't include them
71- system "git" , "clone" , "https://github.com/Macaulay2/M2-emacs.git" , "M2/Macaulay2/editors/emacs"
72- system "git" , "clone" , "https://github.com/Macaulay2/memtailor.git" , "M2/submodules/memtailor"
73- system "git" , "clone" , "https://github.com/Macaulay2/mathic.git" , "M2/submodules/mathic"
74- system "git" , "clone" , "https://github.com/Macaulay2/mathicgb.git" , "M2/submodules/mathicgb"
79+ git_clone_at_commit (
80+ "https://github.com/Macaulay2/M2-emacs.git" ,
81+ "M2/Macaulay2/editors/emacs" ,
82+ "524968452e95d010769ece30092edaa09d1e814f" ,
83+ )
84+
85+ git_clone_at_commit (
86+ "https://github.com/Macaulay2/memtailor.git" ,
87+ "M2/submodules/memtailor" ,
88+ "07c84a6852212495182ec32c3bdb589579e342b5" ,
89+ )
90+
91+ git_clone_at_commit (
92+ "https://github.com/Macaulay2/mathic.git" ,
93+ "M2/submodules/mathic" ,
94+ "7abf77e4ce493b3830c7f8cc09722bbd6c03818e" ,
95+ )
96+
97+ git_clone_at_commit (
98+ "https://github.com/Macaulay2/mathicgb.git" ,
99+ "M2/submodules/mathicgb" ,
100+ "de139564927563afef383174fd3cf8c93ee18ab3" ,
101+ )
75102
76103 # Prefix paths for dependencies
77104 lib_prefix = deps . map { |lib | Formula [ lib . name ] . prefix } . join ( ";" )
0 commit comments