aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2014-04-06 21:34:40 -0500
committerJack Nagel2014-04-06 21:34:40 -0500
commit7f1c91166150c1b9fca6c37adb41b6e12e3dd6cd (patch)
treed0795430a000d28b7915105763ee781153bff4ad /Library
parent97dd4ed3d7dff9c73605a3cbbbd2eb4f40f3cd05 (diff)
downloadhomebrew-7f1c91166150c1b9fca6c37adb41b6e12e3dd6cd.tar.bz2
nzbget: use resources
Diffstat (limited to 'Library')
-rw-r--r--Library/Formula/nzbget.rb41
1 files changed, 22 insertions, 19 deletions
diff --git a/Library/Formula/nzbget.rb b/Library/Formula/nzbget.rb
index a13dde3bd..6a5e90652 100644
--- a/Library/Formula/nzbget.rb
+++ b/Library/Formula/nzbget.rb
@@ -1,17 +1,5 @@
require 'formula'
-class Libpar2 < Formula
- homepage 'http://parchive.sourceforge.net/'
- url 'https://downloads.sourceforge.net/project/parchive/libpar2/0.2/libpar2-0.2.tar.gz'
- sha1 '4b3da928ea6097a8299aadafa703fc6d59bdfb4b'
-
- # Bugfixes and ability to cancel par2 repair
- patch do
- url "https://gist.github.com/raw/4576230/e722f2113195ee9b8ee67c1c424aa3f2085b1066/libpar2-0.2-nzbget.patch"
- sha1 "0dca03f42c0997fd6b537a7dc539d705afb76157"
- end
-end
-
class Nzbget < Formula
homepage 'http://sourceforge.net/projects/nzbget/'
url 'https://downloads.sourceforge.net/project/nzbget/nzbget-stable/12.0/nzbget-12.0.tar.gz'
@@ -24,23 +12,38 @@ class Nzbget < Formula
fails_with :clang do
build 500
- cause "Clang older than 5.1 requires flexible array members to be trivially destructible"
+ cause <<-EOS.undent
+ Clang older than 5.1 requires flexible array members to be POD types.
+ More recent versions require only that they be trivially destructible.
+ EOS
+ end
+
+ resource "libpar2" do
+ url "https://downloads.sourceforge.net/project/parchive/libpar2/0.2/libpar2-0.2.tar.gz"
+ sha1 "4b3da928ea6097a8299aadafa703fc6d59bdfb4b"
+ end
+
+ # Bugfixes and ability to cancel par2 repair
+ resource "libpar2_patch" do
+ url "https://gist.github.com/raw/4576230/e722f2113195ee9b8ee67c1c424aa3f2085b1066/libpar2-0.2-nzbget.patch"
+ sha1 "0dca03f42c0997fd6b537a7dc539d705afb76157"
end
def install
- # Install libpar2 privately
- libpar2_prefix = libexec/'libpar2'
- Libpar2.new('libpar2').brew do
+ resource("libpar2").stage do
+ buildpath.install resource("libpar2_patch")
+ system "patch -p1 < #{buildpath}/libpar2-0.2-nzbget.patch"
+
system "./configure", "--disable-debug", "--disable-dependency-tracking",
- "--prefix=#{libpar2_prefix}"
+ "--prefix=#{libexec}/lp2"
system "make install"
end
# Tell configure where libpar2 is, and tell it to use OpenSSL
system "./configure", "--disable-debug", "--disable-dependency-tracking",
"--prefix=#{prefix}",
- "--with-libpar2-includes=#{libpar2_prefix}/include",
- "--with-libpar2-libraries=#{libpar2_prefix}/lib",
+ "--with-libpar2-includes=#{libexec}/lp2/include",
+ "--with-libpar2-libraries=#{libexec}/lp2/lib",
"--with-tlslib=OpenSSL"
system "make"
ENV.j1