Skip to content

Commit

Permalink
gnuplot: add libcerf support
Browse files Browse the repository at this point in the history
Closes #9733.

Signed-off-by: JCount <JCount42@gmail.com>
  • Loading branch information
equal-l2 authored and JCount committed Feb 12, 2017
1 parent 2892ef0 commit b690d64
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Formula/gnuplot.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class Gnuplot < Formula
option "with-tex", "Build with LaTeX support"
option "with-aquaterm", "Build with AquaTerm support"
option "without-gd", "Build without gd based terminals"
option "with-libcerf", "Build with libcerf support"

deprecated_option "with-x" => "with-x11"
deprecated_option "pdf" => "with-pdflib-lite"
Expand Down Expand Up @@ -53,6 +54,12 @@ class Gnuplot < Formula

needs :cxx11 if build.with? "qt@5.7"

resource "libcerf" do
url "http://apps.jcns.fz-juelich.de/src/libcerf/libcerf-1.5.tgz"
mirror "https://www.mirrorservice.org/sites/distfiles.macports.org/libcerf/libcerf-1.5.tgz"
sha256 "e36dc147e7fff81143074a21550c259b5aac1b99fc314fc0ae33294231ca5c86"
end

def install
# Qt5 requires c++11 (and the other backends do not care)
ENV.cxx11 if build.with? "qt@5.7"
Expand All @@ -65,6 +72,15 @@ def install
ENV.prepend "LDFLAGS", "-F/Library/Frameworks"
end

if build.with? "libcerf"
# Build libcerf
resource("libcerf").stage do
system "./configure", "--prefix=#{buildpath}/libcerf", "--enable-static", "--disable-shared"
system "make", "install"
end
ENV.prepend "PKG_CONFIG_PATH", buildpath/"libcerf/lib/pkgconfig"
end

# Help configure find libraries
pdflib = Formula["pdflib-lite"].opt_prefix

Expand All @@ -75,6 +91,8 @@ def install
--with-readline=#{Formula["readline"].opt_prefix}
]

args << "--without-libcerf" if build.without? "libcerf"

args << "--with-pdf=#{pdflib}" if build.with? "pdflib-lite"

args << "--without-gd" if build.without? "gd"
Expand Down

0 comments on commit b690d64

Please sign in to comment.