Skip to content

Instantly share code, notes, and snippets.

@Gurpartap
Last active December 15, 2015 02:59
Show Gist options
  • Save Gurpartap/5191039 to your computer and use it in GitHub Desktop.
Save Gurpartap/5191039 to your computer and use it in GitHub Desktop.
brew formula for http://slash-lang.org/
# brew install ./slash --HEAD --with-lib-dir=/... --sapi=apache2 --with-json --without-mysql
require 'formula'
class Slash < Formula
homepage 'http://slash-lang.org/'
head 'git://github.com/slash-lang/slash.git'
# Core dependencies
depends_on 'gmp'
depends_on 'pcre'
# depends_on 'libiconv' # OS X already has it.
# Extension dependencies
depends_on 'libgcrypt' if build.with? 'gcrypt' or build.with? 'base64'
depends_on 'yajl' if build.with? 'json'
depends_on 'discount' if build.with? 'markdown'
depends_on 'mysql' if build.with? 'mysql'
depends_on 'curl' if build.with? 'curl'
depends_on 'libsass' if build.with? 'sass'
# depends_on 'ruby' if build.with? 'ruby' # OS X already has it.
# API dependencies
depends_on 'httpd' if build.include? 'sapi=apache2'
def install
args = ["--prefix=#{prefix}"]
build.args.to_a.each do |arg|
if arg.to_s =~ /^--with-lib-dir/ || arg.to_s =~ /sapi/ # || arg.to_s =~ /ext/
args << arg
end
end
['mysql', 'json', 'base64', 'gcrypt', 'inflect', 'markdown', 'curl', 'ruby', 'sass', 'socket'].each do |ext|
if build.with? ext
args << "--no-ext=#{ext}"
else
args << "--ext=#{ext}"
end
end
system './configure', *args
system 'make'
system 'make install'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment