-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use make install #17
base: master
Are you sure you want to change the base?
Use make install #17
Changes from all commits
e573315
8afa4f7
0581dd8
2390876
d447c2a
d97c123
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,13 @@ class Gap < Formula | |
homepage "https://www.gap-system.org/" | ||
url "https://github.com/gap-system/gap/releases/download/v4.13.0/gap-4.13.0.tar.gz" | ||
sha256 "cc76ecbe33d6719450a593e613fb87e9e4247faa876f632dd0f97c398f92265d" | ||
license "GPL-2.0-or-later" | ||
|
||
|
||
head do | ||
url "https://github.com/gap-system/gap.git", branch: "master" | ||
depends_on "autoconf" => :build # required by packages below | ||
end | ||
|
||
depends_on "gmp" | ||
# GAP cannot be built against the native macOS version of readline | ||
|
@@ -11,46 +18,127 @@ class Gap < Formula | |
# So we depend on GNU readline here. | ||
depends_on "readline" | ||
|
||
# for packages | ||
depends_on "cddlib" # CddInterface | ||
depends_on "curl" # curlInterface | ||
depends_on "fplll" # float | ||
depends_on "libmpc" # float | ||
depends_on "mpfi" # float | ||
depends_on "mpfr" # float, normalizinterface | ||
depends_on "ncurses" # browse | ||
depends_on "zeromq" # ZeroMQInterface | ||
depends_on "singular" # many packages | ||
depends_on "pari" # many packages | ||
|
||
def install | ||
# XXX: Currently there is no `install` target in `Makefile`. | ||
# According to the manual installation instructions in | ||
# | ||
# https://github.com/gap-system/gap/blob/master/INSTALL.md | ||
# | ||
# the compiled "bundle" is intended to be used "as is," and there is | ||
# no instructions for how to remove the source and other unnecessary | ||
# files after compilation. Moreover, the content of the | ||
# subdirectories with special names, such as `bin` and `lib`, is not | ||
# suitable for merging with the content of the corresponding | ||
# subdirectories of `/usr/local`. The easiest temporary solution seems | ||
# to be to drop the compiled bundle into `<prefix>/libexec` and to | ||
# create a symlink `<prefix>/bin/gap` to the startup script. | ||
# This use of `libexec` seems to contradict Linux Filesystem Hierarchy | ||
# Standard, but is recommended in Homebrew's "Formula Cookbook." | ||
|
||
libexec.install Dir["*"] | ||
|
||
# GAP does not support "make install" so it has to be compiled in place | ||
|
||
cd libexec do | ||
system "./configure", "--with-readline=#{Formula["readline"].opt_prefix}" | ||
system "make" | ||
|
||
|
||
no_compilation_packages = [ | ||
"atlasrep", "aclib", "agt", "alnuth", "automata", "automgrp", | ||
"autpgrp", "circle", "classicpres", "congruence", "corelg", | ||
"crime", "crisp", "cryst", "crystcat", "ctbllib", "cubefree", | ||
"design", "difsets", "factint", "fga", "fining", "format", | ||
"forms", "fr", "francy", "fwtree", "gapdoc", "gbnp", "genss", | ||
"groupoids", "grpconst", "guarana", "hap", "hapcryst", "hecke", | ||
"help", "idrel", "images", "intpic", "irredsol", "itc", | ||
"jupyterkernel", "jupyterviz", "kan", "laguna", "liealgdb", | ||
"liepring", "liering", "loops", "lpres", "majoranaalgebras", | ||
"mapclass", "matgrp", "modisom", "nilmat", "nock", | ||
"numericalsgps", "openmath", "packagemanager", "patternclass", | ||
"permut", "polenta", "polycyclic", "polymaking", "primgrp", | ||
"qpa", "quagroup", "radiroot", "rcwa", "rds", "recog", | ||
"repndecomp", "repsn", "resclasses", "scscp", "sglppow", | ||
"sgpviz", "singular", "sl2reps", "sla", "smallgrp", "smallsemi", | ||
"sonata", "sophus", "spinsym", "standardff", "symbcompcc", | ||
"thelma", "tomlib", "toric", "transgrp", "ugaly", "unipot", | ||
"unitlib", "utils", "uuid", "walrus", "wedderga", "xmod", | ||
"xmodalg", "yangbaxter", | ||
# These packages have `doc` and `test` make targets, but we | ||
# don't actually call them | ||
"4ti2interface", "autodoc", "cap", "examplesforhomalg", | ||
"gaussforhomalg", "generalizedmorphismsforcap", "gradedmodules", | ||
"gradedringforhomalg", "homalg", "homalgtocas", "io_forhomalg", | ||
"linearalgebraforcap", "localizeringforhomalg", | ||
"matricesforhomalg", "modulepresentationsforcap", "modules", | ||
"monoidalcategories", "nconvex", "ringsforhomalg", "sco", | ||
"toolsforhomalg", "toricvarieties", | ||
] | ||
|
||
# These two packages either don't build or don't work | ||
# "cddinterface", "xgap", | ||
configure_packages = [ | ||
"anupq", "caratinterface", "crypting", "curlinterface", "cvec", | ||
"datastructures", "deepthought", "digraphs", "ferret", "float", | ||
"gauss", "grape", "io", "json", "normalizinterface", "nq", | ||
"orb", "profiling", "semigroups", "simpcomp", "zeromqinterface", | ||
] | ||
|
||
old_configure_packages = [ | ||
"ace", "browse", "cohomolo", "edim", "example", "fplsa", | ||
"guava", "kbmag", | ||
] | ||
|
||
|
||
|
||
all_packages = no_compilation_packages | ||
.concat(configure_packages) | ||
.concat(configure_packages) | ||
|
||
# Start actually building GAP | ||
if build.head? | ||
system "./autogen.sh" | ||
end | ||
|
||
libexec.install Dir["pkg"] | ||
|
||
system "./configure", "--prefix", libexec/"gap", "--with-readline=#{Formula["readline"].opt_prefix}" | ||
if build.head? | ||
system "make", "bootstrap-pkg-full" | ||
# system "make", "doc" # Do we need this? | ||
end | ||
system "make", "install" | ||
|
||
# Create a symlink `bin/gap` from the `gap` binary | ||
bin.install_symlink libexec/"gap" => "gap" | ||
bin.install_symlink libexec/"gap/bin/gap" => "gap" | ||
|
||
ohai "Building included packages. Please be patient, it may take a while" | ||
pkg_dir = "#{libexec}/pkg" | ||
|
||
cd libexec/"pkg" do | ||
# NOTE: This script will build most of the packages that require | ||
# compilation. It is known to produce a number of warnings and | ||
# error messages, possibly failing to build several packages. | ||
system "../bin/BuildPackages.sh", "--with-gaproot=#{libexec}" | ||
|
||
system "mkdir", "#{libexec}/gap/lib/gap/pkg/" | ||
|
||
# The makefiles appear to only be used for docs... | ||
# The BuildPackages.sh script didn't call them | ||
all_packages.each do |pkg| | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So here one could instead iterate over all subdirs (I am sure there is a ruby way to do that) |
||
system "cp", "-R", pkg, "#{libexec}/gap/lib/gap/pkg/" | ||
cd pkg do | ||
if File.exist?("./prerequisites.sh") | ||
system "./prerequisites.sh", "#{libexec}/gap/lib/gap" | ||
end | ||
end | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of having the Though actually, with GAP 4.13.0, all but one configure script support |
||
end | ||
|
||
configure_packages.each do |pkg| | ||
cd pkg do | ||
system "./configure", "--with-gaproot=#{libexec}/gap/lib/gap" | ||
system "make" | ||
system "cp", "-R", "bin/", "#{libexec}/gap/lib/gap/pkg/#{pkg}" | ||
end | ||
end | ||
old_configure_packages.each do |pkg| | ||
cd pkg do | ||
system "./configure", "#{libexec}/gap/lib/gap" | ||
system "make" | ||
system "cp", "-R", "bin/", "#{libexec}/gap/lib/gap/pkg/#{pkg}" | ||
end | ||
end | ||
end | ||
end | ||
|
||
test do | ||
ENV["LC_CTYPE"] = "en_GB.UTF-8" | ||
system bin/"gap", "-r", "-A", "#{libexec}/tst/testinstall.g" | ||
end | ||
|
||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Such a long list seems error prone and annoying because it needs to be updated for each GAP release.
Can't you instead just compute a list of the names of all subdirs of the
pkg
directory on the fly? Resp. not even use that list, just iterate over them all