PageRenderTime 43ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/Library/Formula/mpg321.rb

https://github.com/directionless/homebrew
Ruby | 60 lines | 42 code | 8 blank | 10 comment | 0 complexity | d3506cb2ae253f0898d0eca744040ec2 MD5 | raw file
  1. require 'formula'
  2. class Mpg321 < Formula
  3. homepage 'http://mpg321.sourceforge.net/'
  4. url 'http://sourceforge.net/projects/mpg321/files/mpg321/0.3.2/mpg321_0.3.2.orig.tar.gz'
  5. sha1 'bf1c22542c86af69267828e45f217fdeb49e5d43'
  6. depends_on 'mad'
  7. depends_on 'libid3tag'
  8. depends_on 'libao'
  9. # 1. Apple defines semun already. Skip redefining it to fix build errors.
  10. # This is a homemade patch fashioned using deduction.
  11. # 2. Also a couple of IPV6 values are not defined on OSX that are needed.
  12. # This patch was seen in the wild for an app called lscube:
  13. # http://lscube.org/pipermail/lscube-commits/2009-March/000500.html
  14. # Both patches have been reported upstream here:
  15. # https://sourceforge.net/tracker/?func=detail&aid=3587769&group_id=36274&atid=416544
  16. # Remove these at: Unknown. These have not been merged as of 0.3.2.
  17. def patches; DATA; end
  18. def install
  19. system "./configure", "--disable-dependency-tracking",
  20. "--disable-debug",
  21. "--prefix=#{prefix}",
  22. "--disable-mpg123-symlink",
  23. "--enable-ipv6",
  24. "--disable-alsa"
  25. system "make install"
  26. end
  27. end
  28. __END__
  29. --- a/mpg321.h 2012-03-25 05:27:49.000000000 -0700
  30. +++ b/mpg321.h 2012-11-15 20:54:28.000000000 -0800
  31. @@ -290,7 +290,7 @@
  32. /* Shared total decoded frames */
  33. decoded_frames *Decoded_Frames;
  34. -#if defined(__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED)
  35. +#if defined(__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED) || defined(__APPLE__)
  36. /* */
  37. #else
  38. union semun {
  39. --- a/network.c 2012-03-25 05:27:49.000000000 -0700
  40. +++ b/network.c 2012-11-15 20:58:02.000000000 -0800
  41. @@ -50,6 +50,13 @@
  42. #define IFVERB if(options.opt & MPG321_VERBOSE_PLAY)
  43. +/* The following defines are needed to emulate the Linux interface on
  44. + * BSD-based systems like FreeBSD and OS X */
  45. +#if !defined(IPV6_ADD_MEMBERSHIP) && defined(IPV6_JOIN_GROUP)
  46. +#define IPV6_ADD_MEMBERSHIP IPV6_JOIN_GROUP
  47. +#define IPV6_DROP_MEMBERSHIP IPV6_LEAVE_GROUP
  48. +#endif
  49. +
  50. int proxy_enable = 0;
  51. char *proxy_server;
  52. int auth_enable = 0;