Skip to content

Instantly share code, notes, and snippets.

@mikz
Created August 21, 2016 12:26
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikz/dc710345e6809c0428ea33c8a928d3d1 to your computer and use it in GitHub Desktop.
Save mikz/dc710345e6809c0428ea33c8a928d3d1 to your computer and use it in GitHub Desktop.
LuaRocks Homebrew Formula
require 'formula'
class Luarocks < Formula
homepage 'https://rocks.moonscript.org/'
stable do
url 'https://github.com/keplerproject/luarocks/archive/v2.3.0.tar.gz'
sha256 '92c014889ec6a09c4bb492df6b7f7be784110d6abe031e16418342781ca5c5ce'
end
depends_on "homebrew/nginx/openresty"
def install
openresty_folder = Formula["homebrew/nginx/openresty"].opt_prefix
openresty_luajit_folder = File.join(openresty_folder, 'luajit')
openresty_luajit_include_folder = File.join(openresty_luajit_folder, 'include', 'luajit-2.1')
system "./configure",
"--prefix=#{prefix}",
"--rocks-tree=#{HOMEBREW_PREFIX}",
"--with-lua=#{openresty_luajit_folder}",
"--with-lua-include=#{openresty_luajit_include_folder}",
"--lua-version=5.1",
"--lua-suffix=jit"
system "make", "build"
system "make", "install"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment