[Rubycocoa-devel 1141] Re: standaloneify patch

Back to archive index

Laurent Sansonetti lsans****@apple*****
Sat Aug 11 02:03:39 JST 2007


Seems good, please apply :)

Laurent

On Aug 10, 2007, at 3:40 PM, Eloy Duran wrote:

> Hello,
>
> I just used standaloneify and ran into a bug, which is that
> standaloneify assumes that the RubyCocoa.framework isn't already
> inside your app bundle.
>
> I have this patch, shall I commit it?
>
> Index: framework/tool/standaloneify.rb
> ===================================================================
> --- framework/tool/standaloneify.rb     (revision 1987)
> +++ framework/tool/standaloneify.rb     (working copy)
> @@ -262,24 +262,27 @@
>     lib_d = File.join(contents_d,"lib")
>     macos_d = File.join(contents_d,"MacOS")
>
> -    # Create Frameworks dir and copy RubyCocoa in there
> -    FileUtils.mkdir_p(frameworks_d)
> -    FileUtils.mkdir_p(lib_d)
> -    rc_path = [
> -      "/System/Library/Frameworks/RubyCocoa.framework",
> -      "/Library/Frameworks/RubyCocoa.framework"
> -    ].find { |p| File.exist?(p) }
> -    raise "Cannot locate RubyCocoa.framework" unless rc_path
> -    #FileUtils.cp_r(rc_path,frameworks_d)
> -    # Do not use FileUtils.cp_r because it tries to follow symlinks.
> -    unless system("cp -R \"#{rc_path}\" \"#{frameworks_d}\"")
> -      raise "cannot copy #{rc_path} to #{frameworks_d}"
> -    end
> -
> -    # Calculate paths to newly copied RubyCocoa framework
> +    # Calculate paths to the to-be copied RubyCocoa framework
>     ruby_cocoa_d = File.join(frameworks_d,"RubyCocoa.framework")
>     ruby_cocoa_inc = File.join(ruby_cocoa_d,"Resources","ruby")
>     ruby_cocoa_lib = File.join(ruby_cocoa_d,"RubyCocoa")
> +
> +    # First check if the developer might already have added the
> RubyCocoa framework (in a copy phase)
> +    unless File.exist? ruby_cocoa_d
> +      # Create Frameworks dir and copy RubyCocoa in there
> +      FileUtils.mkdir_p(frameworks_d)
> +      FileUtils.mkdir_p(lib_d)
> +      rc_path = [
> +        "/System/Library/Frameworks/RubyCocoa.framework",
> +        "/Library/Frameworks/RubyCocoa.framework"
> +      ].find { |p| File.exist?(p) }
> +      raise "Cannot locate RubyCocoa.framework" unless rc_path
> +      # FileUtils.cp_r(rc_path,frameworks_d)
> +      # Do not use FileUtils.cp_r because it tries to follow  
> symlinks.
> +      unless system("cp -R \"#{rc_path}\" \"#{frameworks_d}\"")
> +        raise "cannot copy #{rc_path} to #{frameworks_d}"
> +      end
> +    end
>
>     # Copy in and update library references for RubyCocoa
>     fixer = LibraryFixer.new
>
> Cheers,
> Eloy
>
> _______________________________________________
> Rubycocoa-devel mailing list
> Rubyc****@lists*****
> http://lists.sourceforge.jp/mailman/listinfo/rubycocoa-devel




More information about the Rubycocoa-devel mailing list
Back to archive index