diff --git a/Formula/ngspice.rb b/Formula/ngspice.rb index 52afff22f0b47..9bd0696bc1416 100644 --- a/Formula/ngspice.rb +++ b/Formula/ngspice.rb @@ -11,6 +11,7 @@ class Ngspice < Formula end option "without-xspice", "Build without x-spice extensions" + option "with-shared", "Build shared library" deprecated_option "with-x" => "with-x11" @@ -29,6 +30,19 @@ def install end args << "--enable-xspice" if build.with? "xspice" + if build.with? "shared" + # The build system cannot build both the executable and the shared + # library in one sequence, see + # https://sourceforge.net/p/ngspice/support-requests/19 . + # But we can build the shared library first, clean up, and then build + # the executable. + args << "--with-ngshared" + system "./configure", *args + system "make", "install" + system "make", "clean" + args.pop + end + system "./configure", *args system "make", "install" end