2010-06-13 18:06:08 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Hllib < Formula
|
2010-06-13 18:06:08 +00:00
|
|
|
homepage 'http://nemesis.thewavelength.net/index.php?p=35'
|
2011-07-24 10:34:06 +00:00
|
|
|
url 'http://nemesis.thewavelength.net/files/files/hllib242.zip'
|
2013-09-27 18:35:22 +00:00
|
|
|
sha1 '0407ab96755dd4a1f061f059d0e2afd92d1760f0'
|
2011-07-24 10:34:06 +00:00
|
|
|
version '2.4.2'
|
2010-06-13 18:06:08 +00:00
|
|
|
|
|
|
|
def install
|
|
|
|
# Library
|
|
|
|
cd 'HLLib' do
|
|
|
|
# Set perms so we can replace the strings
|
|
|
|
chmod 0777, 'Makefile'
|
2010-06-13 21:12:08 +00:00
|
|
|
inreplace 'Makefile' do |s|
|
|
|
|
# Set prefix correctly
|
|
|
|
s.gsub! '/usr/local', prefix
|
|
|
|
# Remove -soname directive
|
|
|
|
s.gsub! '-shared -Wl,-soname,libhl.so.2', '-shared -Wl'
|
|
|
|
# Ownership isn't needed here
|
|
|
|
s.gsub! %r{ -[og] root}, ''
|
|
|
|
# .dylib is the OS X equivalent of .so
|
|
|
|
s.gsub! 'libhl.so.$(HLLIB_VERS)', 'libhl.$(HLLIB_VERS).dylib'
|
|
|
|
s.gsub! '$(PREFIX)/lib/libhl.so.2', '$(PREFIX)/lib/libhl.2.dylib'
|
|
|
|
s.gsub! '$(PREFIX)/lib/libhl.so', '$(PREFIX)/lib/libhl.dylib'
|
|
|
|
end
|
2010-06-13 18:06:08 +00:00
|
|
|
# Install
|
|
|
|
system "make install"
|
|
|
|
end
|
|
|
|
# Extract tool
|
|
|
|
cd 'HLExtract' do
|
|
|
|
# Set prefix correctly
|
|
|
|
chmod 0777, 'Main.c'
|
|
|
|
# Fix limits header for OS X
|
|
|
|
inreplace 'Main.c', 'linux/limits.h', 'limits.h'
|
|
|
|
# OS X friendly binary name
|
|
|
|
inreplace 'Main.c', 'HLExtract.exe', 'hlextract'
|
|
|
|
# Make the binary build path and build
|
|
|
|
bin.mkpath
|
2012-05-15 18:47:30 +00:00
|
|
|
system ENV.cc, 'Main.c', "-I#{include}", "-L#{lib}", '-lhl', '-o', bin+'hlextract'
|
2010-06-13 18:06:08 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|