← Back to team overview

kicad-developers team mailing list archive

Re: OS X build: bundled dylibs?

 

Patch committed in product branch 5254.  Thank you for the patch Adam.

Wayne

On 11/6/2014 1:30 PM, Adam Wolf wrote:
> Yes.  Thanks Wayne!
> 
> (OS X Kicad is getting more and more useful, everyday!)
> 
> Adam Wolf
> Cofounder and Engineer
> W&L
> 
> 
> On Thu, Nov 6, 2014, 12:27 PM Wayne Stambaugh <stambaughw@xxxxxxxxxxx
> <mailto:stambaughw@xxxxxxxxxxx>> wrote:
> 
>     Hey Adam,
> 
>     Is this your patch?  I want to make sure I give credit to the
>     appropriate author when I commit it.
> 
>     Thanks,
> 
>     Wayne
> 
>     On 11/5/2014 9:53 PM, Adam Wolf wrote:
>     > Hi folks,
>     >
>     > I have isolated the problem and solved it.  Thankfully, the CMake
>     folks
>     > have already ran into it, and solved it.
>     >
>     > (The following is mostly for my own use when I try to figure out how
>     > these bundles are made again.)
>     >
>     > CMake provides BundleUtilities, which use a variety of command
>     line OS X
>     > tools for making standalone bundles.  They copy libraries local to the
>     > build system into the bundle, and rewrite some things so the bundle
>     > executables look for the bundle libraries.  To do that, they have to
>     > modify the libraries because OS X libraries have their path
>     encoded into
>     > the file (or something like that.)  Many of the common ways OS X users
>     > install libraries to their system leave the libraries with no write
>     > permissions.  This means when CMake copies the library in and tries to
>     > modify it, it fails making the modifications.  The end result is the
>     > copied library is included in the bundle, but the bundle executable
>     > doesn't ever look for it.
>     >
>     > At the bottom
>     > of
>     http://www.cmake.org/cmake/__help/v3.0/module/__BundleUtilities.html
>     <http://www.cmake.org/cmake/help/v3.0/module/BundleUtilities.html>,
>     > they mention:
>     >
>     > If the BU_CHMOD_BUNDLE_ITEMS variable is set then bundle items will be
>     > marked writable before install_name_tool tries to change them.
>     >
>     > I added this for kicad.app, and I think that solves the problem
>     for all
>     > the applications (because the other applications are symlinks into
>     > kicad.app.)
>     >
>     > I have ran the results of make install after this through my packaging
>     > script, and then installed contents of the resulting DMG on a clean
>     > image of OS X 10.10 I created for regression testing this type of
>     issue,
>     > and it worked.
>     >
>     > I would like to especially thank Bernhard for helping me
>     troubleshoot this.
>     >
>     > Adam Wolf
>     > Cofounder and Engineer,
>     > W&L
>     >
>     > On Wed, Nov 5, 2014 at 2:50 PM, Bernhard Stegmaier
>     > <stegmaier@xxxxxxxxxxxxx <mailto:stegmaier@xxxxxxxxxxxxx>
>     <mailto:stegmaier@sw-systems.__de <mailto:stegmaier@xxxxxxxxxxxxx>>>
>     wrote:
>     >
>     >     I guess one problem is here:
>     >
>     >     -- 51/66: fixing up
>     >   
>      '/Users/jenkins/remoteroot/__workspace/KiCadMacBuild/bin/__kicad.app/Contents/Frameworks/__libGLEW.1.11.0.dylib'
>     >     error:
>     >   
>      /Library/Developer/__CommandLineTools/usr/bin/__install_name_tool:
>     can't
>     >     open input file:
>     >   
>      /Users/jenkins/remoteroot/__workspace/KiCadMacBuild/bin/__kicad.app/Contents/Frameworks/__libGLEW.1.11.0.dylib
>     >     for writing (Permission denied)
>     >
>     >     Seems as if CMake can’t rewrite libGLEW.1.11.0.dylib of your build
>     >     folder… can you check permissions?
>     >     Do you run make and make install with different users or something
>     >     like that?
>     >
>     >     The script has to rewrite the .dylib to probably make it
>     reference a
>     >     dylib inside the bundle…
>     >
>     >
>     >     Regards,
>     >     Bernhard
>     >
>     >     On 05.11.2014, at 21:47, Adam Wolf
>     <adamwolf@xxxxxxxxxxxxxxxxxxxx <mailto:adamwolf@xxxxxxxxxxxxxxxxxxxx>
>     >     <mailto:adamwolf@__feelslikeburning.com
>     <mailto:adamwolf@xxxxxxxxxxxxxxxxxxxx>>> wrote:
>     >
>     >>     Looking at that output, for me, it is grabbing the libwx
>     >>     libraries, but I don't see libcairo or libpixman or libpng on
>     that
>     >>     list.
>     >>
>     >>     Adam Wolf
>     >>     Cofounder and Engineer
>     >>     W&L
>     >>
>     >>     On Wed, Nov 5, 2014 at 2:46 PM, Adam Wolf
>     >>     <adamwolf@xxxxxxxxxxxxxxxxxxxx
>     <mailto:adamwolf@xxxxxxxxxxxxxxxxxxxx>
>     >>     <mailto:adamwolf@__feelslikeburning.com
>     <mailto:adamwolf@xxxxxxxxxxxxxxxxxxxx>>> wrote:
>     >>
>     >>         Hi Bernhard,
>     >>
>     >>         Thank you!  Here is the make install output:
>     >>          http://pastebin.com/pPSNTLv5
>     >>
>     >>         Adam Wolf
>     >>         Cofounder and Engineer
>     >>         W&L
>     >>
>     >>         On Wed, Nov 5, 2014 at 2:35 PM, Bernhard Stegmaier
>     >>         <stegmaier@xxxxxxxxxxxxx <mailto:stegmaier@xxxxxxxxxxxxx>
>     <mailto:stegmaier@sw-systems.__de <mailto:stegmaier@xxxxxxxxxxxxx>>>
>     wrote:
>     >>
>     >>             Hi Adam,
>     >>
>     >>             can you send me the output of the “make install” command?
>     >>             This uses CMake functions similar to what macdylibbundler
>     >>             does… and for me it relocates all non-standard libs
>     to the
>     >>             bundle.
>     >>
>     >>
>     >>             Regards,
>     >>             Bernhard
>     >>
>     >>             On 05.11.2014, at 20:55, Adam Wolf
>     >>             <adamwolf@xxxxxxxxxxxxxxxxxxxx
>     <mailto:adamwolf@xxxxxxxxxxxxxxxxxxxx>
>     >>             <mailto:adamwolf@__feelslikeburning.com
>     <mailto:adamwolf@xxxxxxxxxxxxxxxxxxxx>>> wrote:
>     >>
>     >>>             Hi folks,
>     >>>
>     >>>             After sending out my dev preview to a few users, the
>     >>>             biggest issue by far is that my OS X build points to
>     some
>     >>>             libraries in /usr/local, vs inside the bundle.
>     >>>
>     >>>             For instance,
>     >>>
>     >>>           
>      dlopen(/Volumes/Kicad/Kicad/__kicad.app/Contents/PlugIns/___pcbnew.kiface,
>     >>>             10): Library not loaded:
>     /usr/local/lib/libpixman-1.0.__dylib
>     >>>               Referenced from:
>     >>>           
>      /Volumes/Kicad/Kicad/kicad.__app/Contents/Frameworks/__libcairo.2.dylib
>     >>>               Reason: image not found
>     >>>
>     >>>             as well as libpng.
>     >>>
>     >>>             I see that there's a copy of libpng
>     >>>             at
>     kicad.app/Contents/Frameworks/__libpng16.16.dylib.  Any
>     >>>             idea how to make it point to there instead?
>     >>>
>     >>>             Could we use
>     https://github.com/auriamg/__macdylibbundler/
>     <https://github.com/auriamg/macdylibbundler/>
>     >>>             to make sure this doesn't happen in the future?
>     >>>
>     >>>             Adam Wolf
>     >>>             Cofounder and Engineer
>     >>>             W&L
>     >>>             _________________________________________________
>     >>>             Mailing list:
>     https://launchpad.net/~kicad-__developers
>     <https://launchpad.net/~kicad-developers>
>     >>>             Post to     : kicad-developers@lists.__launchpad.net
>     <mailto:kicad-developers@xxxxxxxxxxxxxxxxxxx>
>     >>>             <mailto:kicad-developers@__lists.launchpad.net
>     <mailto:kicad-developers@xxxxxxxxxxxxxxxxxxx>>
>     >>>             Unsubscribe :
>     https://launchpad.net/~kicad-__developers
>     <https://launchpad.net/~kicad-developers>
>     >>>             More help   : https://help.launchpad.net/__ListHelp
>     <https://help.launchpad.net/ListHelp>
>     >>
>     >>
>     >>
>     >
>     >
>     >
>     >
>     > _________________________________________________
>     > Mailing list: https://launchpad.net/~kicad-__developers
>     <https://launchpad.net/~kicad-developers>
>     > Post to     : kicad-developers@lists.__launchpad.net
>     <mailto:kicad-developers@xxxxxxxxxxxxxxxxxxx>
>     > Unsubscribe : https://launchpad.net/~kicad-__developers
>     <https://launchpad.net/~kicad-developers>
>     > More help   : https://help.launchpad.net/__ListHelp
>     <https://help.launchpad.net/ListHelp>
>     >
> 
> 
> 
>     _________________________________________________
>     Mailing list: https://launchpad.net/~kicad-__developers
>     <https://launchpad.net/~kicad-developers>
>     Post to     : kicad-developers@lists.__launchpad.net
>     <mailto:kicad-developers@xxxxxxxxxxxxxxxxxxx>
>     Unsubscribe : https://launchpad.net/~kicad-__developers
>     <https://launchpad.net/~kicad-developers>
>     More help   : https://help.launchpad.net/__ListHelp
>     <https://help.launchpad.net/ListHelp>
> 




References