Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Add new formula unar #15322

Merged
merged 0 commits into from

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.

Library/Formula/unar.rb
((10 lines not shown))
+ #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 Collaborator

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
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 Collaborator

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
Collaborator

Indents should be 2sp.

@Sharpie
Collaborator

Needs a depends_on :xcode if calling xcodebuild.

@adamv
Owner

Please squash to a single commit for review, thanks.

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 Collaborator

Just depends_on :xcode, no => :xcodebuild.

@jaimeMF
jaimeMF added a note

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
@jaimeMF jaimeMF referenced this pull request
Closed

Add formula unar #16276

@jaimeMF jaimeMF deleted the jaimeMF:unarFormula branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 0 additions and 0 deletions.
Something went wrong with that request. Please try again.