homebrew-core/Formula/squirrel.rb
Jack Nagel 9a39338aca Fix some issues with generated pc files
- Use #opt_prefix instead of #prefix or HOMEBREW_PREFIX
 - Use #version rather than hardcoded strings or @version
 - Unify pc file method naming
 - Use String#undent

Closes Homebrew/homebrew#18695.
2013-03-24 21:12:30 -05:00

36 lines
866 B
Ruby

require 'formula'
class Squirrel < Formula
homepage 'http://www.squirrel-lang.org'
url 'http://squirrel.googlecode.com/files/squirrel_3_0_4_stable.tar.gz'
version '3.0.4'
sha1 '384d278630040902bc111d8b9fb607d4d4941904'
def install
system "make"
prefix.install %w[bin include lib]
doc.install Dir['doc/*.pdf']
doc.install %w[etc samples]
# See: https://github.com/mxcl/homebrew/pull/9977
(lib+'pkgconfig/libsquirrel.pc').write pc_file
end
def pc_file; <<-EOS.undent
prefix=#{opt_prefix}
exec_prefix=${prefix}
libdir=/${exec_prefix}/lib
includedir=/${prefix}/include
bindir=/${prefix}/bin
ldflags= -L/${prefix}/lib
Name: libsquirrel
Description: squirrel library
Version: #{version}
Requires:
Libs: -L${libdir} -lsquirrel -lsqstdlib
Cflags: -I${includedir}
EOS
end
end