Skip to content

Instantly share code, notes, and snippets.

@directhex
Last active July 30, 2018 15:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save directhex/2570115252ee4f14773b28b2b36f6d23 to your computer and use it in GitHub Desktop.
Save directhex/2570115252ee4f14773b28b2b36f6d23 to your computer and use it in GitHub Desktop.
class GtkSharp3 < Formula
homepage "http://www.mono-project.com/GtkSharp"
url "https://github.com/mono/gtk-sharp/archive/2.99.3.tar.gz"
version "2.99.3"
sha256 "6212a59809951e032f6d2712d5a6680203d0d6869f1c09127c4b9fb3c35ad384"
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
depends_on "pkg-config"
depends_on "gtk+3"
depends_on "pango"
depends_on "harfbuzz"
depends_on "glib"
def install
ENV.append_path "PKG_CONFIG_PATH", "#{HOMEBREW_PREFIX}/lib/pkgconfig"
ENV.append_path "PKG_CONFIG_PATH", "/Library/Frameworks/Mono.framework/Versions/Current/lib/pkgconfig"
ENV.append_path "PATH", "/Library/Frameworks/Mono.framework/Versions/Current/Commands"
ENV.append "CSC", "/Library/Frameworks/Mono.framework/Versions/Current/Commands/mcs"
inreplace "autogen.sh", "libtoolize", "glibtoolize"
inreplace "configure.ac", "ENABLE_THREADCHECK, true", "ENABLE_THREADCHECK, false"
system "./autogen.sh", "--prefix=#{prefix}"
system "make", "install"
end
def post_install
inreplace "#{prefix}/lib/mono/gac/atk-sharp/3.0.0.0__35e10195dab3c99f/atk-sharp.dll.config", "target=\"", "target=\"/usr/local/lib/"
inreplace "#{prefix}/lib/mono/gac/glib-sharp/3.0.0.0__35e10195dab3c99f/glib-sharp.dll.config", "target=\"", "target=\"/usr/local/lib/"
inreplace "#{prefix}/lib/mono/gac/gtk-dotnet/3.0.0.0__35e10195dab3c99f/gtk-dotnet.dll.config", "target=\"", "target=\"/usr/local/lib/"
inreplace "#{prefix}/lib/mono/gac/gio-sharp/3.0.0.0__35e10195dab3c99f/gio-sharp.dll.config", "target=\"", "target=\"/usr/local/lib/"
inreplace "#{prefix}/lib/mono/gac/pango-sharp/3.0.0.0__35e10195dab3c99f/pango-sharp.dll.config", "target=\"", "target=\"/usr/local/lib/"
inreplace "#{prefix}/lib/mono/gac/gtk-sharp/3.0.0.0__35e10195dab3c99f/gtk-sharp.dll.config", "target=\"", "target=\"/usr/local/lib/"
inreplace "#{prefix}/lib/mono/gac/gdk-sharp/3.0.0.0__35e10195dab3c99f/gdk-sharp.dll.config", "target=\"", "target=\"/usr/local/lib/"
end
def caveats; <<~EOS
Root is required to install to the GAC. Please execute:
sudo cp -r #{prefix}/lib/mono/gac/* /Library/Frameworks/Mono.framework/Versions/Current/lib/mono/gac/
EOS
end
test do
# `test do` will create, run in and delete a temporary directory.
#
# This test will fail and we won't accept that! It's enough to just replace
# "false" with the main program this formula installs, but it'd be nice if you
# were more thorough. Run the test with `brew test gtk-sharp`. Options passed
# to `brew install` such as `--HEAD` also need to be provided to `brew test`.
#
# The installed folder is not in the path, so use the entire path to any
# executables being tested: `system "#{bin}/program", "do", "something"`.
system "false"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment