swi-prolog: remove options, fix head

Closes #35595.

Signed-off-by: FX Coudert <fxcoudert@gmail.com>
This commit is contained in:
FX Coudert 2019-01-01 12:13:22 +01:00
parent cde9c27483
commit 3425e8ffb3

View file

@ -3,6 +3,7 @@ class SwiProlog < Formula
homepage "http://www.swi-prolog.org/" homepage "http://www.swi-prolog.org/"
url "http://www.swi-prolog.org/download/stable/src/swipl-7.6.4.tar.gz" url "http://www.swi-prolog.org/download/stable/src/swipl-7.6.4.tar.gz"
sha256 "2d3d7aabd6d99a02dcc2da5d7604e3500329e541c6f857edc5aa06a3b1267891" sha256 "2d3d7aabd6d99a02dcc2da5d7604e3500329e541c6f857edc5aa06a3b1267891"
revision 1
bottle do bottle do
sha256 "5076f120b7f2775fc0968885d2d0e82cb7a93f3040c1c39243abdd8ec3ba1e59" => :mojave sha256 "5076f120b7f2775fc0968885d2d0e82cb7a93f3040c1c39243abdd8ec3ba1e59" => :mojave
@ -14,33 +15,29 @@ class SwiProlog < Formula
head do head do
url "https://github.com/SWI-Prolog/swipl-devel.git" url "https://github.com/SWI-Prolog/swipl-devel.git"
depends_on "autoconf" => :build depends_on "cmake" => :build
end end
option "with-jpl", "Enable JPL (Java Prolog Bridge)"
option "with-xpce", "Enable XPCE (Prolog Native GUI Library)"
depends_on "pkg-config" => :build depends_on "pkg-config" => :build
depends_on "gmp" depends_on "gmp"
depends_on "libarchive"
depends_on "openssl" depends_on "openssl"
depends_on "readline" depends_on "readline"
depends_on "libarchive" => :optional
if build.with? "xpce"
depends_on :x11
depends_on "jpeg"
end
def install def install
if build.with? "libarchive" if build.head?
ENV["ARPREFIX"] = Formula["libarchive"].opt_prefix mkdir "build" do
else system "cmake", "..", *std_cmake_args,
ENV.append "DISABLE_PKGS", "archive" "-DSWIPL_PACKAGES_JAVA=OFF",
"-DSWIPL_PACKAGES_JAVA=OFF",
"-DSWIPL_PACKAGES_X=OFF",
"-DCMAKE_INSTALL_PREFIX=#{libexec}"
system "make", "install"
end end
else
args = ["--prefix=#{libexec}", "--mandir=#{man}"] ENV["ARPREFIX"] = Formula["libarchive"].opt_prefix
ENV.append "DISABLE_PKGS", "jpl" if build.without? "jpl" ENV.append "DISABLE_PKGS", "jpl"
ENV.append "DISABLE_PKGS", "xpce" if build.without? "xpce" ENV.append "DISABLE_PKGS", "xpce"
# SWI-Prolog's Makefiles don't add CPPFLAGS to the compile command, but do # SWI-Prolog's Makefiles don't add CPPFLAGS to the compile command, but do
# include CIFLAGS. Setting it here. Also, they clobber CFLAGS, so including # include CIFLAGS. Setting it here. Also, they clobber CFLAGS, so including
@ -48,13 +45,10 @@ class SwiProlog < Formula
ENV["CIFLAGS"] = ENV.cppflags ENV["CIFLAGS"] = ENV.cppflags
ENV["COFLAGS"] = ENV.cflags ENV["COFLAGS"] = ENV.cflags
# './prepare' prompts the user to build documentation system "./configure", "--prefix=#{libexec}", "--mandir=#{man}"
# (which requires other modules). '3' is the option
# to ignore documentation.
system "echo 3 | ./prepare" if build.head?
system "./configure", *args
system "make" system "make"
system "make", "install" system "make", "install"
end
bin.write_exec_script Dir["#{libexec}/bin/*"] bin.write_exec_script Dir["#{libexec}/bin/*"]
end end