PageRenderTime 48ms CodeModel.GetById 22ms RepoModel.GetById 1ms app.codeStats 0ms

/Library/Formula/gd.rb

https://bitbucket.org/JoshHagins/homebrew
Ruby | 81 lines | 66 code | 15 blank | 0 comment | 7 complexity | 55dfe839da5475fa03ca118127c58bd2 MD5 | raw file
  1. require 'formula'
  2. class Gd < Formula
  3. homepage 'http://libgd.bitbucket.org/'
  4. url 'https://bitbucket.org/libgd/gd-libgd/downloads/libgd-2.1.0.tar.gz'
  5. sha1 'a0f3053724403aef9e126f4aa5c662573e5836cd'
  6. revision 2
  7. bottle do
  8. cellar :any
  9. revision 1
  10. sha1 "370029d382be7ea5c8d5975f20b7668eced29f9c" => :yosemite
  11. sha1 "e183bfd8da0354da3e0b046f2d092b099f4c6356" => :mavericks
  12. sha1 "8fee5a15e1ed1331c52d9a286431fdd1b56c126e" => :mountain_lion
  13. end
  14. head 'https://bitbucket.org/libgd/gd-libgd', :using => :hg
  15. option :universal
  16. depends_on 'libpng' => :recommended
  17. depends_on 'jpeg' => :recommended
  18. depends_on 'fontconfig' => :recommended
  19. depends_on 'freetype' => :recommended
  20. depends_on 'libtiff' => :recommended
  21. depends_on 'libvpx' => :optional
  22. fails_with :llvm do
  23. build 2326
  24. cause "Undefined symbols when linking"
  25. end
  26. def install
  27. ENV.universal_binary if build.universal?
  28. args = %W{--disable-dependency-tracking --prefix=#{prefix}}
  29. if build.with? "libpng"
  30. args << "--with-png=#{Formula["libpng"].opt_prefix}"
  31. else
  32. args << "--without-png"
  33. end
  34. if build.with? "fontconfig"
  35. args << "--with-fontconfig=#{Formula["fontconfig"].opt_prefix}"
  36. else
  37. args << "--without-fontconfig"
  38. end
  39. if build.with? "freetype"
  40. args << "--with-freetype=#{Formula["freetype"].opt_prefix}"
  41. else
  42. args << "--without-freetype"
  43. end
  44. if build.with? "jpeg"
  45. args << "--with-jpeg=#{Formula["jpeg"].opt_prefix}"
  46. else
  47. args << "--without-jpeg"
  48. end
  49. if build.with? "libtiff"
  50. args << "--with-tiff=#{Formula["libtiff"].opt_prefix}"
  51. else
  52. args << "--without-tiff"
  53. end
  54. if build.with? "libvpx"
  55. args << "--with-vpx=#{Formula["libvpx"].opt_prefix}"
  56. else
  57. args << "--without-vpx"
  58. end
  59. system "./configure", *args
  60. system "make install"
  61. end
  62. test do
  63. system "#{bin}/pngtogd", test_fixtures("test.png"), "gd_test.gd"
  64. system "#{bin}/gdtopng", "gd_test.gd", "gd_test.png"
  65. end
  66. end