Add new formula unar #15322

Merged
merged 0 commits into from Nov 27, 2012

4 participants

@jaimeMF

This formula installs unar and lsar, the first one can extract archives with diferent formats and the last one list the contents of an archive.

@jacknagel jacknagel commented on an outdated diff Oct 6, 2012
Library/Formula/unar.rb
+ #system "make install" # if this fails, try separate make/make install steps
+ tempDirectory = "#{prefix}/tempDir"
+ system "mkdir #{tempDirectory}"
+ #Build dependencies:
+ system "cd ./UniversalDetector;xcodebuild -target libUniversalDetector.a SYMROOT=#{tempDirectory}"
+ system "cd ./XADMaster; xcodebuild -target libXADMaster.a SYMROOT=#{tempDirectory};"
+ system "mv #{tempDirectory}/Release/libUniversalDetector.a #{tempDirectory}/Debug/libUniversalDetector.a"
+ #Build unar and lsar
+ system "cd ./XADMaster; xcodebuild -target unar SYMROOT=#{tempDirectory} build;"
+ system "cd ./XADMaster; xcodebuild -target lsar SYMROOT=#{tempDirectory} build;"
+ system "mkdir #{bin};mv #{tempDirectory}/Debug/unar #{bin}/unar; mv #{tempDirectory}/Debug/lsar #{bin}/lsar"
+ #Remove temp:
+ system "rm -r #{tempDirectory}"
+ #Copy man pages
+ system "cd ./Extra;mkdir #{share};mkdir #{man};mkdir #{man1}; mv ./lsar.1 #{man1}/lsar.1; mv ./unar.1 #{man1}/unar.1"
+ end
@jacknagel
jacknagel added a line comment Oct 6, 2012

Don't chain commands in shell invocations, and calls to things like mv, cd, mkdir, etc. should be done using the included FileUtils methods rather than shelling out. e.g.:

cd 'foo' do
  # do some things
end

cd 'bar' do
  # do other things
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@jacknagel jacknagel commented on an outdated diff Oct 6, 2012
Library/Formula/unar.rb
@@ -0,0 +1,27 @@
+require 'formula'
+
+class Unar < Formula
+ homepage 'http://unarchiver.c3.cx/commandline'
+ url 'http://theunarchiver.googlecode.com/files/unar1.2_src.zip'
+ version '1.2'
+ sha1 '6fcc27f6d37dc254b8c473b7616049083c566f4a'
+
+ def install
+ #system "make install" # if this fails, try separate make/make install steps
+ tempDirectory = "#{prefix}/tempDir"
+ system "mkdir #{tempDirectory}"
@jacknagel
jacknagel added a line comment Oct 6, 2012

Don't stick a temporary directory in prefix. The entire build is already staged in a temporary directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@jacknagel

Indents should be 2sp.

@Sharpie

Needs a depends_on :xcode if calling xcodebuild.

@adamv

Please squash to a single commit for review, thanks.

@jacknagel jacknagel and 1 other commented on an outdated diff Oct 12, 2012
Library/Formula/unar.rb
@@ -0,0 +1,22 @@
+require 'formula'
+
+class Unar < Formula
+ homepage 'http://unarchiver.c3.cx/commandline'
+ url 'http://theunarchiver.googlecode.com/files/unar1.2_src.zip'
+ version '1.2'
+ sha1 '6fcc27f6d37dc254b8c473b7616049083c566f4a'
+ depends_on :xcode => :xcodebuild
@jacknagel
jacknagel added a line comment Oct 12, 2012

Just depends_on :xcode, no => :xcodebuild.

@jaimeMF
jaimeMF added a line comment Oct 12, 2012

Ok, should I made a new commit?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@jaimeMF

I have made a single commit

@jaimeMF

It has passed a month, so I'm trying to bump
@adamv, @Sharpie, @jacknagel

@jaimeMF jaimeMF merged commit f899878 into Homebrew:master Nov 27, 2012
@jaimeMF jaimeMF referenced this pull request Nov 27, 2012
Closed

Add formula unar #16276

@jaimeMF jaimeMF deleted the unknown repository branch Jan 5, 2013
@xu-cheng xu-cheng locked and limited conversation to collaborators Feb 16, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.