Skip to content
This repository was archived by the owner on Jan 16, 2025. It is now read-only.

Growl 1.3.2 #8649

Closed
wants to merge 5 commits into from
Closed

Growl 1.3.2 #8649

wants to merge 5 commits into from

Conversation

ColinHebert
Copy link
Contributor

Add Growl 1.3.2 to Homebrew

I know there is a restriction on ".app" applications but this one seems appropriate (just as aqua-less, chmox, djview4 and many others).

There is three patches :

Two to remove issues with case-sensitive systems and tarballs ( see : http://code.google.com/p/growl/issues/detail?id=374)

The last one is used to remove the code sign.

@jacknagel
Copy link
Contributor

Isn't it easier to install this from the dmg?

@ColinHebert
Copy link
Contributor Author

Not anymore, the packaged version of growl is only available in the AppStore (for $2~)

@jacknagel
Copy link
Contributor

Ugh.

@Sharpie
Copy link
Contributor

Sharpie commented Nov 17, 2011

Seems reasonable to me. Please squash into one commit.

@ColinHebert
Copy link
Contributor Author

It should be okay now.

end

def caveats
s = "For build options see:\n brew options growl\n\n\n"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As the caveats are post-install, I think this line is something we should avoid.

I know it's done in several other formula, but I think that is a mistake.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It can be useful when you do a brew info growl before installing it. I think that's why it was done like this at first.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In that case we should probably just add the options to brew info so that all formulae benefit from it. Telling the user that options exist isn't really a caveat.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, I must agree there. IMHO each package should have a oneline description, a listing of every option available, and caveats listed somewhere (brew info). Something similar to man pages.

Meanwhile, I'll remove this line.

@ColinHebert
Copy link
Contributor Author

I'll re-squash everything once every point has been cleared.

@ColinHebert ColinHebert mentioned this pull request Nov 19, 2011
@ColinHebert
Copy link
Contributor Author

Add some other changes due to #8680 .

I think it's ready to be merged.

@hoodja
Copy link

hoodja commented Dec 10, 2011

I'm trying to install growl using this Formula but I can't seem to find the 'osx/plist' dependency. Can you point me to that dependency?

Thanks!

@Sharpie
Copy link
Contributor

Sharpie commented Dec 10, 2011

I'm trying to install growl using this Formula but I can't seem to find the 'osx/plist' dependency.

We don't have an osx/plist formula. Currently, slashes are not valid characters for a formula name.

This sounds like a bug, please post the output of brew install -v growl.

@hoodja
Copy link

hoodja commented Dec 10, 2011

Since it hasn't been merged yet I'm installing it from the raw github url:

brew install https://raw.github.com/ColinHebert/homebrew/growl/Library/Formula/growl.rb

which yields:

Error: Unsatisfied external dependency: osx/plist
Homebrew does not provide Ruby dependencies, rubygems does:

    gem install osx/plist

Looks like it's line 18 in growl.rb:

ColinHebert@96d84b2#L0R18

@Sharpie
Copy link
Contributor

Sharpie commented Dec 10, 2011

Ahh...

Then, have you tried following the the directions printed and running:

gem install osx/plist

?

@ColinHebert
Copy link
Contributor Author

My bad, there is an incoming caveat on this particular subject.

Growl uses an external lib to handle plist files, you'll have to do :

gem sources -a http://gems.github.com/
gem install kballard-osx-plist

I know it doesn't match the name "osx/plist" but it just works that way.

But I'm not sure if a caveat is enough as it will only show if the install is successful, and as osx/plist is a dependency I can't event print a message before to give instructions.

On the other hand, if I don't give any instruction and remove the dependency, an error will/should show during the installation.

@Sharpie, what do you think about this ?

@ColinHebert
Copy link
Contributor Author

I may have a solution for the dependency documentation but I find it a bit ugly :

unless ARGV.include? "--disable-hardware"
    opoo <<-EOS.undent
      To install HardwareGrowler, an additional library, osx/plist, is required.
      To add this library:
        gem sources -a http://gems.github.com/
        gem install kballard-osx-plist
    EOS
    depends_on 'osx/plist' => :ruby
end

Instead of

depends_on 'osx/plist' => :ruby unless ARGV.include? "--disable-hardware"

@hoodja
Copy link

hoodja commented Dec 10, 2011

Thanks both of you for your help so far.

@Sharpie I did - couldn't find that dep (because of the name).

@ColinHebert I eventually found that package and tried it, but it didn't seem to work:

~ > rvm all do gem install kballard-osx-plist
Building native extensions.  This could take a while...
WARNING: kballard-osx-plist-1.0.3 has an invalid nil value for @licenses
Successfully installed kballard-osx-plist-1.0.3
1 gem installed
Installing ri documentation for kballard-osx-plist-1.0.3...
Installing RDoc documentation for kballard-osx-plist-1.0.3...

then...

~ > brew install https://raw.github.com/ColinHebert/homebrew/growl/Library/Formula/growl.rb
######################################################################## 100.0%
Error: Unsatisfied external dependency: osx/plist
Homebrew does not provide Ruby dependencies, rubygems does:

    gem install osx/plist

So then I'm thinking it is something to do w/ rvm and multiple ruby versions so...

~ > ruby --version
ruby 1.8.7 (2010-01-10 patchlevel 249) [universal-darwin11.0]
~ > gem list --local

*** LOCAL GEMS ***

Ok, gem isn't there.

~ > rvm use 1.9.3
Using /Users/hoodja/.rvm/gems/ruby-1.9.3-p0
~ > gem list --local

*** LOCAL GEMS ***

bundler (1.0.21 ruby)
kballard-osx-plist (1.0.3)
plist (3.1.0)
rake (0.9.2)

Great! should work now!

~ > brew install https://raw.github.com/ColinHebert/homebrew/growl/Library/Formula/growl.rb
######################################################################## 100.0%
Error: Unsatisfied external dependency: osx/plist
Homebrew does not provide Ruby dependencies, rubygems does:

    gem install osx/plist

rats!

I'm stumped. :-/

@jacknagel
Copy link
Contributor

If the gem can't be installed by gem install osx/plist, then why use that name at all? Them external dependency should list the name of the package that is required.

@ColinHebert
Copy link
Contributor Author

@jacknagel Because it's the actual name of this package. You can't install it with gem install osx/plist but you have to import osx/plist and the dependency check only works if the given name is osx/plist.

It is used in this script :
http://code.google.com/p/growl/source/browse/scripts/xpc-rename-move.rb

@jacknagel
Copy link
Contributor

Ah.

@ColinHebert
Copy link
Contributor Author

I had the exact same reaction.

@hoodja, I investigated your problem and it seems that it's due to ruby 1.9.3 (something with the close operation in the quiet_system). As you're probably working with Mac OS Lion, you won't be able to install any other ruby environment with rvm.

The best thing to do is to stick to the provided ruby environment. It should work.

@hoodja
Copy link

hoodja commented Dec 30, 2011

Thanks @ColinHebert.

I've uninstalled / reinsalled xcode 4.1 (the error output from the formula was reporting 4.2 even though I downgraded). But even after all the hoops I still have problesm. Below is the full error output from running the latest. Note the environment is reporting XCode 4.1 and the system ruby (1.8.7-249):

$ brew install https://raw.github.com/ColinHebert/homebrew/growl/Library/Formula/growl.rb
...
ProcessPCH "/var/folders/4s/ncv2s8wj5v99md3dpqyp3tgr0000gn/C/com.apple.Xcode.501/SharedPrecompiledHeaders/Display Plugins_Prefix-fgfhvctnyqxmrbgbrpiibbxiajhz/Display Plugins_Prefix.pch.pth" "Plugins/Displays/Display Plugins_Prefix.pch" normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
    cd /tmp/homebrew-growl-1.3.2-oFWU/Growl-stable--4d49890e785a
    setenv LANG en_US.US-ASCII
    /Developer/usr/bin/clang -x objective-c-header -arch x86_64 -fmessage-length=0 -fdiagnostics-print-source-range-info -fdiagnostics-show-category=id -fdiagnostics-parseable-fixits -std=gnu99 -Wno-trigraphs -fpascal-strings -Os -Werror -Wmissing-prototypes -Wno-return-type -Wmissing-braces -Wparentheses -Wswitch -Wunused-function -Wunused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wuninitialized -Wunknown-pragmas -Wshadow -Wsign-compare -Wshorten-64-to-32 -Wnewline-eof -DNDEBUG -DNS_BLOCK_ASSERTIONS -isysroot /Developer/SDKs/MacOSX10.7.sdk -fasm-blocks -fobjc-gc -mmacosx-version-min=10.7 -gdwarf-2 "-DIBOutlet=__attribute__((iboutlet))" "-DIBOutletCollection(ClassName)=__attribute__((iboutletcollection(ClassName)))" "-DIBAction=void)__attribute__((ibaction)" -iquote /private/tmp/homebrew-growl-1.3.2-oFWU/Growl-stable--4d49890e785a/build/Growl.build/Release/Brushed.build/Brushed-generated-files.hmap -I/private/tmp/homebrew-growl-1.3.2-oFWU/Growl-stable--4d49890e785a/build/Growl.build/Release/Brushed.build/Brushed-own-target-headers.hmap -I/private/tmp/homebrew-growl-1.3.2-oFWU/Growl-stable--4d49890e785a/build/Growl.build/Release/Brushed.build/Brushed-all-target-headers.hmap -iquote /private/tmp/homebrew-growl-1.3.2-oFWU/Growl-stable--4d49890e785a/build/Growl.build/Release/Brushed.build/Brushed-project-headers.hmap -iquote/private/tmp/homebrew-growl-1.3.2-oFWU/Growl-stable--4d49890e785a/build/Release/include -I/private/tmp/homebrew-growl-1.3.2-oFWU/Growl-stable--4d49890e785a/build/Release/include -ISource -I/private/tmp/homebrew-growl-1.3.2-oFWU/Growl-stable--4d49890e785a/build/Growl.build/Release/Brushed.build/DerivedSources/x86_64 -I/private/tmp/homebrew-growl-1.3.2-oFWU/Growl-stable--4d49890e785a/build/Growl.build/Release/Brushed.build/DerivedSources -Wall -Wextra -Wpointer-arith -Wformat=2 -Wfloat-equal -Wstrict-overflow=4 -Wbad-function-cast -Winline -Wstrict-aliasing -Wno-unused-parameter -Wno-format-nonliteral -Wno-multichar -Wno-arc-performSelector-leaks -F/private/tmp/homebrew-growl-1.3.2-oFWU/Growl-stable--4d49890e785a/build/Release -c "/tmp/homebrew-growl-1.3.2-oFWU/Growl-stable--4d49890e785a/Plugins/Displays/Display Plugins_Prefix.pch" -o "/var/folders/4s/ncv2s8wj5v99md3dpqyp3tgr0000gn/C/com.apple.Xcode.501/SharedPrecompiledHeaders/Display Plugins_Prefix-fgfhvctnyqxmrbgbrpiibbxiajhz/Display Plugins_Prefix.pch.pth" -MMD -MT dependencies -MF "/var/folders/4s/ncv2s8wj5v99md3dpqyp3tgr0000gn/C/com.apple.Xcode.501/SharedPrecompiledHeaders/Display Plugins_Prefix-fgfhvctnyqxmrbgbrpiibbxiajhz/Display Plugins_Prefix.pch.d"
error: unknown warning option '-Wno-arc-performSelector-leaks' [-Werror,-Wunknown-warning-option]


** BUILD FAILED **


The following build commands failed:
    ProcessPCH "/var/folders/4s/ncv2s8wj5v99md3dpqyp3tgr0000gn/C/com.apple.Xcode.501/SharedPrecompiledHeaders/Display Plugins_Prefix-fgfhvctnyqxmrbgbrpiibbxiajhz/Display Plugins_Prefix.pch.pth" "Plugins/Displays/Display Plugins_Prefix.pch" normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
==> Exit Status: 65
http://github.com/mxcl/homebrew/blob/master/Library/Formula/.rb#L
==> Environment
HOMEBREW_VERSION: 0.8
HEAD: c9eca803d676961ead136b07ab145cc1e826b314
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_REPOSITORY: /usr/local
HOMEBREW_LIBRARY_PATH: /usr/local/Library/Homebrew
Hardware: quad-core 64-bit arrandale
OS X: 10.7.2
Kernel Architecture: x86_64
Ruby: 1.8.7-249
/usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
Xcode: 4.1
GCC-4.0: N/A
GCC-4.2: build 5666
LLVM: build 2335
Clang: 2.1-163.7.1
MacPorts or Fink? false
X11 installed? true
==> Build Flags
CXXFLAGS: -O3 -march=core2 -w -pipe
MAKEFLAGS: -j4

Error: Failed executing: xcodebuild -configuration Release SYMROOT=/private/tmp/homebrew-growl-1.3.2-oFWU/Growl-stable--4d49890e785a/build 

@FryDay
Copy link

FryDay commented Jan 4, 2012

I am receiving the same error as hoodja. I'm really not sure why this is failing.

@ttilley
Copy link
Contributor

ttilley commented Feb 17, 2012

I have replaced osx-plist in that script for other reasons (doesn't compile on [REDACTED REDACTED]):

Growl: Travis Tilley <[email protected]> maintenance-1.3 * 6479:bcb080d44a03 growl/scripts/xpc-rename-move.rb: tweak xpc-rename-move.rb to have zero external dependencies, leveraging /usr/libexec/PlistBuddy

The automagic performed in that script is what most of you are having trouble with. New version:

#!/usr/bin/env ruby
# -*- encoding: utf-8 -*-

require 'fileutils'

$xpc_extension = ".xpc"
$service_name = "GNTPClientService"
$start_base_id = "com.company.application"
$start_id = $start_base_id + "." + $service_name
$start_package = $start_id + $xpc_extension
$new_package = $start_package
$entitlement_path = File.join("Contents", "Resources", $service_name + ".entitlements")


class PlistBuddy
  BIN = '/usr/libexec/PlistBuddy'

  def initialize(plist)
    @plist = plist
  end

  def [](prop)
    value = `#{BIN} -c 'Print :#{prop}' #{@plist} 2>/dev/null`
    $?.success? ? value.strip : nil
  end

  def []=(prop, val)
    if val.nil?
      `#{BIN} -c 'Delete :#{prop}' #{@plist} 2>/dev/null`
    else
      prev = self[prop]
      if prev.nil?
        `#{BIN} -c 'Add :#{prop} string #{val}' #{@plist} 2>/dev/null`
      else
        `#{BIN} -c 'Set :#{prop} #{val}' #{@plist} 2>/dev/null`
      end
    end

    val
  end
end


def rename(bundle_id)
  if File.exists?($start_package)
    puts("Creating " + $new_package + " from " + $start_package)

    #remove an existing copy, helpful for us because we could be building a new XPC to test
    FileUtils.rm_r($new_package) if File.exists?($new_package)

    #make our new XPC
    FileUtils.cp_r($start_package, $new_package)
    info_path = File.join($new_package, "Contents", "Info.plist")

    #fix the Info.plist
    plist = PlistBuddy.new(info_path)
    plist['CFBundleIdentifier'] = bundle_id
    plist['CFBundleExecutable'] = bundle_id
    plist['CFBundleName'] = bundle_id

    #Fix the executable
    exec_dir = File.join($new_package, "Contents", "MacOS")
    old_exec = File.join(exec_dir, $start_id)
    new_exec = File.join(exec_dir, bundle_id)
    File.rename(old_exec, new_exec)
  else
    puts("No bundle named " + $start_package + " found")
  end
end

def resign(identity)
  if File.exists?($new_package)
    puts("Resigning with identity " + identity)
    system("codesign", "-f", "-s", identity, "--entitlements", File.join($new_package, $entitlement_path), $new_package)

    #system("codesign", "-dvvvv", "--entitlements", ":-", $new_package)
    if system("codesign", "-v", $new_package)
      puts("Code resign valid")
    else
      puts("There was an error with the signature")
    end
  end
end

def main
  #where is the original XPC (it might be beside us, but let the argument tell us)
  #For us in an Extra or Dev tool this is $SRCROOT/../../build/$CONFIGURATION
  start_location = ARGV[0]
  #What app are we putting this in?
  # ex: $BUILT_PRODUCTS_DIR/$WRAPPER_NAME
  app_base = ARGV[1]
  #use $CODE_SIGNING_IDENTITY
  new_signing_identity = ARGV[2]

  contents_path = File.join(app_base, "Contents")
  info_path = File.join(contents_path, "Info.plist")

  #get the app's bundle id, this will be our base ID
  plist = PlistBuddy.new(info_path)
  bundle_id = plist['CFBundleIdentifier']

  xpc_id = bundle_id + "." + $service_name
  $new_package = xpc_id + $xpc_extension

  #keep things simpler in rename/resign and move to that directory
  #for us this is usefull, for developers, they may not need this
  cur_dir = Dir.getwd
  Dir.chdir(start_location)

  rename(xpc_id)
  resign(new_signing_identity)

  Dir.chdir(cur_dir)

  xpcs_dir = File.join(contents_path, "XPCServices")
  xpc_origin = File.join(start_location, $new_package)
  xpc_dest = File.join(xpcs_dir, $new_package)

  #make <app>/Contents/XPCServices if it doesn't exist
  Dir.mkdir(xpcs_dir) unless File.exists?(xpcs_dir)

  #remove an existing copy if it exists
  FileUtils.rm_r(xpc_dest) if File.exists?(xpc_dest)
  FileUtils.cp_r(xpc_origin, xpc_dest)
end

if __FILE__ == $0
  main
end

@ttilley
Copy link
Contributor

ttilley commented Feb 17, 2012

the latest xcode is required. period. the recently released commandline tools from apple should also be sufficient.

Add Growl 1.3.1 to Homebrew
The growlnotify application is available with brew install growl --notify
Also upgrade GrowlHardware to 1.3.1
@ColinHebert
Copy link
Contributor Author

Growl 1.3.3 is available, a new issue will be opened (as this one has been forgotten a long time ago)

@ColinHebert ColinHebert closed this Mar 4, 2012
@ColinHebert ColinHebert mentioned this pull request Mar 4, 2012
@Homebrew Homebrew 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.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants