danomatika / joyosc

(maintained) hid device to osc event daemon used in the robotcowboy project
http://robotcowboy.com
GNU General Public License v3.0
41 stars 2 forks source link

porting joyosc on macos #6

Open fdch opened 4 years ago

fdch commented 4 years ago

I tried making this package for joyosc to use on another mac, and I got the following error:

dyld: Library not loaded: /usr/local/opt/sdl2/lib/libSDL2-2.0.0.dylib
  Referenced from: /Users/camarahalac.1/Downloads/package/./joyosc
  Reason: image not found
Abort trap: 6

Which makes me think that the executable is trying to load its dependencies from their original location obtained from pkg-config, and not from the current directory. I suspect the same thing is happening on Windows (https://github.com/danomatika/joyosc/issues/5), since it's the same type of build.

In any case, this makes me think that the package won't run easily on other people's computers...

danomatika commented 4 years ago

In any case, this makes me think that the package won't run easily on other people's computers...

Not true. It needs to be built to either 1. look for precompiled dynamic libraries in a local, alternate location or 2. statically link all library dependencies into the executables directly.

danomatika commented 3 years ago

Another option is to wrap everything up into .app bundle. The executable would need to be told to look locally with install_name_tool.

danomatika commented 3 years ago

Actually, it doesn't need to be in a bundle. A script could copy the binaries into a folder with the dynamic libs and then run install_name_tool to make sure the binaries look locally first. This would be true for liblo and tinyxml as well as the helper libs in the lib folder.

Another option is to statically link everything, but then you end up with lsjs and joyosc being relatively fat with a full copy of all libs in each.

danomatika commented 1 year ago

Thinking about this again: it should be possible to build the apps using the SDL framework instead of linking to the libs installed from Homebrew.