From 18de525327c836ee2f9ee37d8d639538098bc160 Mon Sep 17 00:00:00 2001 From: Ned Konz Date: Wed, 20 Jan 2016 13:04:00 -0800 Subject: [PATCH] ploticus: add prefabs to installation The existing formula for Ploticus 2.42 omits the installation of the "prefabs" directory, which most users will need. This patch ensures that the prefabs are installed into pkgshare, and that ploticus knows where to find them without having to set the PREFABS_DIR environment variable. Closes Homebrew/homebrew#48296. Signed-off-by: Dominyk Tiller --- Formula/ploticus.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Formula/ploticus.rb b/Formula/ploticus.rb index d015cee45c..761390aa0e 100644 --- a/Formula/ploticus.rb +++ b/Formula/ploticus.rb @@ -4,6 +4,7 @@ class Ploticus < Formula url "https://downloads.sourceforge.net/project/ploticus/ploticus/2.42/ploticus242_src.tar.gz" version "2.42" sha256 "3f29e4b9f405203a93efec900e5816d9e1b4381821881e241c08cab7dd66e0b0" + revision 1 bottle do cellar :any @@ -18,10 +19,17 @@ class Ploticus < Formula # Use alternate name because "pl" conflicts with OS X "pl" utility args=["INSTALLBIN=#{bin}", "EXE=ploticus"] + inreplace "src/pl.h", /#define\s+PREFABS_DIR\s+""/, "#define PREFABS_DIR \"#{pkgshare}\"" system "make", "-C", "src", *args # Required because the Makefile assumes INSTALLBIN dir exists bin.mkdir system "make", "-C", "src", "install", *args + pkgshare.install Dir["prefabs/*"] + end + + def caveats; <<-EOS.undent + Ploticus prefabs have been installed to #{opt_pkgshare} + EOS end test do