Skip to content

Instantly share code, notes, and snippets.

@trmcnvn
Last active February 17, 2019 13:30
Show Gist options
  • Save trmcnvn/88e88a418f85786e9eb28bc0760e7412 to your computer and use it in GitHub Desktop.
Save trmcnvn/88e88a418f85786e9eb28bc0760e7412 to your computer and use it in GitHub Desktop.
Premake 5 for Linuxbrew
class Premake < Formula
desc "Write once, build anywhere Lua-based build system"
homepage "https://premake.github.io/"
url "https://downloads.sourceforge.net/project/premake/Premake/4.4/premake-4.4-beta5-src.zip"
sha256 "0fa1ed02c5229d931e87995123cdb11d44fcc8bd99bba8e8bb1bbc0aaa798161"
version_scheme 1
head "https://github.com/premake/premake-core.git"
bottle do
cellar :any_skip_relocation
sha256 "07c29fc6cf66a091b2cac29c3d6efb079f0212d7a66c5a96153117eac7cf6d77" => :mojave
sha256 "b2ad51fca2552a674929ec4d048fc05a88d24373673a701705e3b35c50a8611e" => :high_sierra
sha256 "9e5d1dd706b3b3af1c8fc5cfe42141cf2a023185f9d19bb25dc58f8aced440e2" => :sierra
sha256 "9e5d1dd706b3b3af1c8fc5cfe42141cf2a023185f9d19bb25dc58f8aced440e2" => :el_capitan
sha256 "4b1ce1c63cc3ecca7e195d4c0350fb6f823f659c36ff6c1193fd99023ed25b12" => :yosemite
sha256 "aa6e7f314ec8636d79601dfc5f1ef30861288b238c2cb1f02ec37d9bda773818" => :x86_64_linux
end
def install
if build.head?
system "make", "-f", "Bootstrap.mak", "#{OS.mac? ? "osx" : "linux"}"
system "./bin/release/premake5", "gmake"
system "./bin/release/premake5", "embed"
system "make"
else
system "make", "-C", "build/gmake.#{OS.mac? ? "macosx" : "unix"}"
end
if build.head?
bin.install "bin/release/premake5"
else
bin.install "bin/release/premake4"
end
end
test do
if build.head?
assert_match version.to_s, shell_output("#{bin}/premake5 --version")
else
assert_match version.to_s, shell_output("#{bin}/premake4 --version", 1)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment