2011-03-10 05:11:03 +00:00
|
|
|
class Io < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "Small prototype-based programming language"
|
2014-05-08 15:03:25 +00:00
|
|
|
homepage "http://iolanguage.com/"
|
2015-11-12 13:42:04 +00:00
|
|
|
url "https://github.com/stevedekorte/io/archive/2015.11.11.tar.gz"
|
|
|
|
sha256 "00d7be0b69ad04891dd5f6c77604049229b08164d0c3f5877bfab130475403d3"
|
2012-02-22 04:48:36 +00:00
|
|
|
|
2014-05-08 15:03:25 +00:00
|
|
|
head "https://github.com/stevedekorte/io.git"
|
2009-12-05 15:42:26 +00:00
|
|
|
|
2015-11-06 23:45:30 +00:00
|
|
|
bottle do
|
2015-11-12 14:41:46 +00:00
|
|
|
sha256 "741314b5c2629688c17eabca50e0a623a9318a44d94568d4d0cf53e86560c2b2" => :el_capitan
|
|
|
|
sha256 "e34facca9debca217eaab84e55c036fe1bbd30a34a18bac927dc4a435947604b" => :yosemite
|
|
|
|
sha256 "6c0b0d22dd8184f20c60b9d35437645314c7149b0a2e34d8c406546faf44e570" => :mavericks
|
2015-11-06 23:45:30 +00:00
|
|
|
end
|
|
|
|
|
2014-05-08 15:03:25 +00:00
|
|
|
option "without-addons", "Build without addons"
|
2012-08-12 19:45:59 +00:00
|
|
|
|
2014-05-08 15:03:25 +00:00
|
|
|
depends_on "cmake" => :build
|
2015-01-17 12:57:27 +00:00
|
|
|
depends_on "pkg-config" => :build
|
2012-10-15 18:40:55 +00:00
|
|
|
|
2014-05-08 15:03:25 +00:00
|
|
|
if build.with? "addons"
|
|
|
|
depends_on "glib"
|
|
|
|
depends_on "cairo"
|
|
|
|
depends_on "gmp"
|
|
|
|
depends_on "jpeg"
|
|
|
|
depends_on "libevent"
|
|
|
|
depends_on "libffi"
|
|
|
|
depends_on "libogg"
|
|
|
|
depends_on "libpng"
|
|
|
|
depends_on "libsndfile"
|
|
|
|
depends_on "libtiff"
|
|
|
|
depends_on "libvorbis"
|
|
|
|
depends_on "ossp-uuid"
|
|
|
|
depends_on "pcre"
|
|
|
|
depends_on "yajl"
|
|
|
|
depends_on "xz"
|
2014-05-09 19:36:20 +00:00
|
|
|
depends_on :python => :optional
|
2014-05-08 15:03:25 +00:00
|
|
|
end
|
2012-07-19 04:08:25 +00:00
|
|
|
|
2009-11-12 18:15:15 +00:00
|
|
|
def install
|
2010-03-01 19:04:42 +00:00
|
|
|
ENV.j1
|
2014-05-09 19:36:20 +00:00
|
|
|
|
2014-05-11 19:14:31 +00:00
|
|
|
# FSF GCC needs this to build the ObjC bridge
|
2015-08-03 12:55:31 +00:00
|
|
|
ENV.append_to_cflags "-fobjc-exceptions"
|
2014-05-11 19:14:31 +00:00
|
|
|
|
2014-05-08 15:03:25 +00:00
|
|
|
if build.without? "addons"
|
|
|
|
# Turn off all add-ons in main cmake file
|
2014-05-09 19:36:20 +00:00
|
|
|
inreplace "CMakeLists.txt", "add_subdirectory(addons)",
|
2015-08-03 12:55:31 +00:00
|
|
|
"#add_subdirectory(addons)"
|
2014-05-08 15:03:25 +00:00
|
|
|
else
|
2014-05-09 15:33:18 +00:00
|
|
|
inreplace "addons/CMakeLists.txt" do |s|
|
2014-05-09 19:36:20 +00:00
|
|
|
if build.without? "python"
|
2015-08-03 12:55:31 +00:00
|
|
|
s.gsub! "add_subdirectory(Python)", "#add_subdirectory(Python)"
|
2014-05-09 19:36:20 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
# Turn off specific add-ons that are not currently working
|
|
|
|
|
2014-05-08 15:03:25 +00:00
|
|
|
# Looks for deprecated Freetype header
|
2015-11-06 23:02:56 +00:00
|
|
|
s.gsub!(/(add_subdirectory\(Font\))/, '#\1')
|
2014-05-08 15:03:25 +00:00
|
|
|
# Builds against older version of memcached library
|
2015-11-06 23:02:56 +00:00
|
|
|
s.gsub!(/(add_subdirectory\(Memcached\))/, '#\1')
|
2014-05-08 15:03:25 +00:00
|
|
|
end
|
2012-08-12 19:45:59 +00:00
|
|
|
end
|
2014-05-08 15:03:25 +00:00
|
|
|
|
|
|
|
mkdir "buildroot" do
|
2014-01-04 13:07:51 +00:00
|
|
|
system "cmake", "..", *std_cmake_args
|
2014-05-08 15:03:25 +00:00
|
|
|
system "make"
|
2015-08-03 12:55:31 +00:00
|
|
|
output = `./_build/binaries/io ../libs/iovm/tests/correctness/run.io`
|
2012-02-21 06:04:21 +00:00
|
|
|
if $?.exitstatus != 0
|
|
|
|
opoo "Test suite not 100% successful:\n#{output}"
|
|
|
|
else
|
|
|
|
ohai "Test suite ran successfully:\n#{output}"
|
|
|
|
end
|
2015-08-03 12:55:31 +00:00
|
|
|
system "make", "install"
|
2011-09-20 03:45:16 +00:00
|
|
|
end
|
2009-11-12 18:15:15 +00:00
|
|
|
end
|
2015-11-06 23:02:56 +00:00
|
|
|
|
|
|
|
test do
|
|
|
|
(testpath/"test.io").write <<-EOS.undent
|
|
|
|
"it works!" println
|
|
|
|
EOS
|
|
|
|
|
|
|
|
assert_equal "it works!\n", shell_output("#{bin}/io test.io")
|
|
|
|
end
|
2011-11-30 18:56:07 +00:00
|
|
|
end
|