Skip to content

Instantly share code, notes, and snippets.

@sedm0784
Created September 6, 2010 11:12
Show Gist options
  • Save sedm0784/566916 to your computer and use it in GitHub Desktop.
Save sedm0784/566916 to your computer and use it in GitHub Desktop.
require 'formula'
class Tads2Compiler <Formula
url 'http://www.tads.org/frobtads/frobtads-t2compiler-0.13.tar.gz'
md5 '12caf94d9c1e646ae04b44da0df83a30'
end
class Tads3Compiler <Formula
url 'http://www.tads.org/frobtads/frobtads-t3compiler-0.13.tar.gz'
md5 '231d359f389be3d28e8134a2b832dd70'
end
class Frobtads <Formula
url 'http://www.tads.org/frobtads/frobtads-0.13.tar.gz'
homepage 'http://www.tads.org/frobtads.htm'
md5 'b6f25787b9ff7b89931d765046c68642'
def options
[
['--tads2-compiler', "Include TADS 2 compiler"],
['--tads3-compiler', "Include TADS 3 compiler"]
]
end
def install
workdir=Pathname.getwd
if ARGV.include? '--tads2-compiler'
Tads2Compiler.new.brew { workdir.install Dir["*"] }
end
if ARGV.include? '--tads3-compiler'
Tads3Compiler.new.brew { workdir.install Dir["*"] }
end
system "./configure", "--disable-dependency-tracking",
"--prefix=#{prefix}"
system "make install"
end
end
@sedm0784
Copy link
Author

Attempting to achieve this:

There are no extra configuration steps required to build the compilers. Just unpack them inside the FrobTADS directory and reconfigure the package. The FrobTADS configuration script will detect the presence of the compiler sources and build them along with the interpreter. For example, if you previously unpacked FrobTADS in

~/downloads/frobtads-0.11

and your downloaded TADS 3 compiler package is

~/downloads/frobtads-t3compiler-0.11.tar.gz

you can unpack the compiler with:

cd ~/downloads/frobtads-0.11
tar -xzf ~/downloads/frobtads-t3compiler-0.11.tar.gz

But it fails because both the main frobtads archive and the compiler archives both contain directories named "t3compiler" and the workdir.install call fails, even though the two similarly-named directories have different contents.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment