Skip to content
This repository
Browse code

upx: enable lzma compression

upx can compress 30% better using lzma. Per user request, add
a subformula to extract the lzma sdk into the buildpath and
unleash greatness.

Fixes #15413

Closes #15496.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
  • Loading branch information...
commit 7467ec47644e000090d4216ebc80ed88febf7879 1 parent d6a0a71
2bits authored October 16, 2012 adamv committed October 16, 2012

Showing 1 changed file with 12 additions and 3 deletions. Show diff stats Hide diff stats

  1. 15  Library/Formula/upx.rb
15  Library/Formula/upx.rb
... ...
@@ -1,15 +1,24 @@
1 1
 require 'formula'
2 2
 
  3
+class Lzma < Formula
  4
+  url 'http://sourceforge.net/projects/sevenzip/files/LZMA%20SDK/4.65/lzma465.tar.bz2'
  5
+  sha1 '5ec1c4606fec88c770a9712073e83916f8aed173'
  6
+end
  7
+
3 8
 class Upx < Formula
4  
-  url 'http://upx.sourceforge.net/download/upx-3.08-src.tar.bz2'
5  
-  head 'http://upx.hg.sourceforge.net:8000/hgroot/upx/upx', :using => :hg
6 9
   homepage 'http://upx.sourceforge.net'
  10
+  url 'http://upx.sourceforge.net/download/upx-3.08-src.tar.bz2'
7 11
   sha1 '5ccbc0aacfd3aaee407eceab06ec5989bf1d153a'
  12
+  head 'http://upx.hg.sourceforge.net:8000/hgroot/upx/upx', :using => :hg
8 13
 
9 14
   depends_on 'ucl'
10 15
 
11 16
   def install
  17
+    Lzma.new.brew {(buildpath+'lzmasdk').install Dir['*']}
  18
+    ENV['UPX_LZMADIR'] = (buildpath+'lzmasdk')
  19
+    ENV['UPX_LZMA_VERSION'] = '0x465'
12 20
     system "make all"
13  
-    bin.install "src/upx.out" => "upx"
  21
+    bin.install  'src/upx.out' => 'upx'
  22
+    man1.install 'doc/upx.1'
14 23
   end
15 24
 end

0 notes on commit 7467ec4

Please sign in to comment.
Something went wrong with that request. Please try again.