diff options
| author | Jack Nagel | 2013-03-24 21:09:38 -0500 |
|---|---|---|
| committer | Jack Nagel | 2013-03-24 21:12:30 -0500 |
| commit | 21ae58b8b4b1e85ed3a6bfb283530fc3e9ee3a3b (patch) | |
| tree | 65c3a234635c97f2a0affdf866942ce6492002e1 | |
| parent | e527a029c3f7decb4c880296e693e793913cf4b2 (diff) | |
| download | homebrew-21ae58b8b4b1e85ed3a6bfb283530fc3e9ee3a3b.tar.bz2 | |
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 #18695.
| -rw-r--r-- | Library/Formula/gd.rb | 34 | ||||
| -rw-r--r-- | Library/Formula/libid3tag.rb | 41 | ||||
| -rw-r--r-- | Library/Formula/libspotify.rb | 6 | ||||
| -rw-r--r-- | Library/Formula/mad.rb | 27 | ||||
| -rw-r--r-- | Library/Formula/nss.rb | 26 | ||||
| -rw-r--r-- | Library/Formula/squirrel.rb | 8 |
6 files changed, 68 insertions, 74 deletions
diff --git a/Library/Formula/gd.rb b/Library/Formula/gd.rb index 31344ee8c..9bbe31d59 100644 --- a/Library/Formula/gd.rb +++ b/Library/Formula/gd.rb @@ -23,25 +23,25 @@ class Gd < Formula args << "--without-freetype" unless build.with? 'freetype' system "./configure", *args system "make install" - (lib+'pkgconfig/gdlib.pc').write pkg_file + (lib+'pkgconfig/gdlib.pc').write pc_file end - def pkg_file; <<-EOF -prefix=#{prefix} -exec_prefix=${prefix} -libdir=/${exec_prefix}/lib -includedir=/${prefix}/include -bindir=/${prefix}/bin -ldflags= -L/${prefix}/lib - -Name: gd -Description: A graphics library for quick creation of PNG or JPEG images -Version: 2.0.36RC1 -Requires: -Libs: -L${libdir} -lgd -Libs.private: -ljpeg -lpng12 -lz -lm -Cflags: -I${includedir} -EOF + 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: gd + Description: A graphics library for quick creation of PNG or JPEG images + Version: #{version} + Requires: + Libs: -L${libdir} -lgd + Libs.private: -ljpeg -lpng12 -lz -lm + Cflags: -I${includedir} + EOS end test do diff --git a/Library/Formula/libid3tag.rb b/Library/Formula/libid3tag.rb index 58da1c851..cc0435b0d 100644 --- a/Library/Formula/libid3tag.rb +++ b/Library/Formula/libid3tag.rb @@ -1,31 +1,10 @@ require 'formula' class Libid3tag < Formula + homepage 'http://www.underbit.com/products/mad/' url 'http://downloads.sourceforge.net/project/mad/libid3tag/0.15.1b/libid3tag-0.15.1b.tar.gz' sha1 '4d867e8a8436e73cd7762fe0e85958e35f1e4306' - def id3tag_pc - return <<-EOS -prefix=#{HOMEBREW_PREFIX} -exec_prefix=${prefix} -libdir=${exec_prefix}/lib -includedir=${prefix}/include - -Name: id3tag -Description: ID3 tag reading library -Version: #{@version} -Requires: -Conflicts: -Libs: -L${libdir} -lid3tag -lz -Cflags: -I${includedir} - EOS - end - - - def homepage - Formula.factory('mad').homepage - end - # Fixes serious memory leaks; see https://bugs.launchpad.net/mixxx/+bug/403586 def patches base = "http://mirror.ovh.net/gentoo-portage/media-libs/libid3tag/files/0.15.1b/" @@ -52,6 +31,22 @@ Cflags: -I${includedir} system "./configure", "--prefix=#{prefix}", "--disable-debug", "--disable-dependency-tracking" system "make install" - (lib+'pkgconfig/id3tag.pc').write id3tag_pc + (lib+'pkgconfig/id3tag.pc').write pc_file + end + + def pc_file; <<-EOS.undent + prefix=#{opt_prefix} + exec_prefix=${prefix} + libdir=${exec_prefix}/lib + includedir=${prefix}/include + + Name: id3tag + Description: ID3 tag reading library + Version: #{version} + Requires: + Conflicts: + Libs: -L${libdir} -lid3tag -lz + Cflags: -I${includedir} + EOS end end diff --git a/Library/Formula/libspotify.rb b/Library/Formula/libspotify.rb index 5df2b203c..fae30f80b 100644 --- a/Library/Formula/libspotify.rb +++ b/Library/Formula/libspotify.rb @@ -17,11 +17,11 @@ class Libspotify < Formula ln_s "libspotify.12.1.51.dylib", "libspotify.12.dylib" end - (lib+'pkgconfig/libspotify.pc').write pc_content + (lib+'pkgconfig/libspotify.pc').write pc_file end - def pc_content; <<-EOS.undent - prefix=#{HOMEBREW_PREFIX} + def pc_file; <<-EOS.undent + prefix=#{opt_prefix} exec_prefix=${prefix} libdir=${exec_prefix}/lib includedir=${prefix}/include diff --git a/Library/Formula/mad.rb b/Library/Formula/mad.rb index 29c89cf18..2ae42c9db 100644 --- a/Library/Formula/mad.rb +++ b/Library/Formula/mad.rb @@ -9,23 +9,22 @@ class Mad < Formula fpm = MacOS.prefer_64_bit? ? '64bit': 'intel' system "./configure", "--disable-debugging", "--enable-fpm=#{fpm}", "--prefix=#{prefix}" system "make", "CFLAGS=#{ENV.cflags}", "LDFLAGS=#{ENV.ldflags}", "install" - (lib+'pkgconfig/mad.pc').write mad_pc + (lib+'pkgconfig/mad.pc').write pc_file end - def mad_pc - return <<-EOS -prefix=#{HOMEBREW_PREFIX} -exec_prefix=${prefix} -libdir=${exec_prefix}/lib -includedir=${prefix}/include + def pc_file; <<-EOS.undent + prefix=#{opt_prefix} + exec_prefix=${prefix} + libdir=${exec_prefix}/lib + includedir=${prefix}/include -Name: mad -Description: MPEG Audio Decoder -Version: #{@version} -Requires: -Conflicts: -Libs: -L${libdir} -lmad -lm -Cflags: -I${includedir} + Name: mad + Description: MPEG Audio Decoder + Version: #{version} + Requires: + Conflicts: + Libs: -L${libdir} -lmad -lm + Cflags: -I${includedir} EOS end end diff --git a/Library/Formula/nss.rb b/Library/Formula/nss.rb index 5b955d8d3..52dbaa97d 100644 --- a/Library/Formula/nss.rb +++ b/Library/Formula/nss.rb @@ -52,7 +52,7 @@ class Nss < Formula cp file, lib end - (lib+'pkgconfig/nss.pc').write pkg_file + (lib+'pkgconfig/nss.pc').write pc_file end test do @@ -62,18 +62,18 @@ class Nss < Formula system "#{bin}/certutil", "-L", "-d", pwd end - def pkg_file; <<-EOF -prefix=#{HOMEBREW_PREFIX} -exec_prefix=${prefix} -libdir=${exec_prefix}/lib -includedir=${prefix}/include/nss + def pc_file; <<-EOS.undent + prefix=#{opt_prefix} + exec_prefix=${prefix} + libdir=${exec_prefix}/lib + includedir=${prefix}/include/nss -Name: NSS -Description: Mozilla Network Security Services -Version: 3.14.1 -Requires: nspr -Libs: -L${libdir} -lnss3 -lnssutil3 -lsmime3 -lssl3 -Cflags: -I${includedir} -EOF + Name: NSS + Description: Mozilla Network Security Services + Version: #{version} + Requires: nspr + Libs: -L${libdir} -lnss3 -lnssutil3 -lsmime3 -lssl3 + Cflags: -I${includedir} + EOS end end diff --git a/Library/Formula/squirrel.rb b/Library/Formula/squirrel.rb index 51ac4bdc9..e3fba8af1 100644 --- a/Library/Formula/squirrel.rb +++ b/Library/Formula/squirrel.rb @@ -13,11 +13,11 @@ class Squirrel < Formula doc.install Dir['doc/*.pdf'] doc.install %w[etc samples] # See: https://github.com/mxcl/homebrew/pull/9977 - (lib+'pkgconfig/libsquirrel.pc').write pkg_file + (lib+'pkgconfig/libsquirrel.pc').write pc_file end - def pkg_file; <<-EOS.undent - prefix=#{prefix} + def pc_file; <<-EOS.undent + prefix=#{opt_prefix} exec_prefix=${prefix} libdir=/${exec_prefix}/lib includedir=/${prefix}/include @@ -26,7 +26,7 @@ class Squirrel < Formula Name: libsquirrel Description: squirrel library - Version: 3.0.2 + Version: #{version} Requires: Libs: -L${libdir} -lsquirrel -lsqstdlib |
