Closed totaam closed 7 months ago
And the problem comes from:
$ otool -L $JHBUILD_PREFIX/lib/libjpeg.62.3.0.dylib
$JHBUILD_PREFIX/lib/libjpeg.62.3.0.dylib:
@rpath/libjpeg.62.dylib (compatibility version 62.0.0, current version 62.3.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1281.0.0)
$ otool -L $JHBUILD_PREFIX/lib/libturbojpeg.0.2.0.dylib
$JHBUILD_PREFIX/lib/libturbojpeg.0.2.0.dylib:
@rpath/libturbojpeg.0.dylib (compatibility version 0.0.0, current version 0.2.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1281.0.0)
Found that I can set the install name directly without reference to the old install name by passing the -id flag. So this can be fixed with:
install_name_tool -id "$JHBUILD_PREFIX/lib/libjpeg.62.dylib" $JHBUILD_PREFIX/lib/libjpeg.62.3.0.dylib
install_name_tool -id "$JHBUILD_PREFIX/lib/libturbojpeg.0.dylib" $JHBUILD_PREFIX/lib/libturbojpeg.0.2.0.dylib
Then rebuild any library that linked with the broken id. (ie: libtiff
, libwebp
, gdk-pixbuf
, gstreamer
, etc)
There must be a way to tell cmake
to use this path instead of injecting rpath
in there.
Which would be a much better solution than patching things up afterwards.
Bumped to 2.1.2 in 66f0aa33baa2a498381865d96658157e1854fe0e
No rush to upgrade to 3.0.x which may well cause us some new problems!
Still had to manually fix things with install_name_tool
for libjpeg-turbo
2.1.4 : cc8463d2b9d0674e80cd35048ab4dce064433aa0
Bumped to 2.1.5.1 in b57ba2e9c7abc9a1ffcebeb4b5e4d34c8f9264b3
After a lot of trial and error, well, mostly errors: cc47e60e660714bc8f3335c43d4f44bcf8ef3ea5, 70cd71ba87756eddc340e7cd22494ae1b86d09f5.
These magic incantations override the default cmakeargs
and the resulting libjpeg.62.dylib
has the correct paths: e0ce1f51d54ba55357f703b1c1229e10381a30f1 + 321c427162f50db74fdb2cd3565f5b64a2c621e7
$ otool -L ${JHBUILD_PREFIX}/lib/libjpeg.62.3.0.dylib
/Users/macos/gtk/inst/lib/libjpeg.62.3.0.dylib:
@rpath/libjpeg.62.dylib (compatibility version 62.0.0, current version 62.3.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1281.0.0)
No it doesn't :disappointed: Still needed:
install_name_tool -id "$JHBUILD_PREFIX/lib/libjpeg.62.dylib" $JHBUILD_PREFIX/lib/libjpeg.62.3.0.dylib
install_name_tool -id "$JHBUILD_PREFIX/lib/libturbojpeg.0.dylib" $JHBUILD_PREFIX/lib/libturbojpeg.0.2.0.dylib
Looks finally fixed thanks to CMAKE_MACOSX_RPATH=true
in de72485ffc3c204df5cf7e29ad40a57dd582150d.
Recommended reading: Understanding RPATH (With CMake)
This was also causing problems with brotli
(which was picked up be freetype
if re-building..), now also fixed: 78501f83813125195ee730149fdbfa512439381d
Nope, this might have worked for packaging thanks to rpath support in gtk-mac-bundler but this now causes problems earlier when building gdk-pixbuf
... :sob:
Bumped to 3.0.1 in dcc45120f130150077a1d98a12a37e709550342f + fixups in 49dfe00058314959c0d98fd8f1f54df95fd7452b + f0c382ca6a1b83e302114d28aaddc1685fb4e428
The dyld path still needs fixing:
install_name_tool -id "$JHBUILD_PREFIX/lib/libjpeg.62.dylib" $JHBUILD_PREFIX/lib/libjpeg.62.4.0.dylib
install_name_tool -id "$JHBUILD_PREFIX/lib/libturbojpeg.0.dylib" $JHBUILD_PREFIX/lib/libturbojpeg.0.3.0.dylib
Correct solution detailed here: https://github.com/Xpra-org/xpra/issues/4085#issuecomment-1876041460
For the rpath issue, I may have found a fix: https://github.com/cpatulea/gtk-osx-build/commit/7841daaf6fc67ee12da813576c78a3f85274a9df
Seems other modules take similar flags: https://github.com/cpatulea/gtk-osx-build/blob/7841daaf6fc67ee12da813576c78a3f85274a9df/jhbuildrc-gtk-osx#L500C1-L500C17
Finally, it works:
$ jhbuild buildone -f libjpeg
(..)
$ jhbuild shell
(..)
$ otool -L $JHBUILD_PREFIX/lib/libjpeg.dylib
/Users/totaam/gtk/inst/lib/libjpeg.dylib:
/Users/totaam/gtk/inst/lib/libjpeg.62.dylib (compatibility version 62.0.0, current version 62.4.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.100.3)
Thanks @cpatulea !
Not so easy:
checkoutdir
for github archives f6e3e6fc7c21b0167951be487d1ec9544324ec63Then hit the same issues as https://github.com/Xpra-org/gtk-osx-build/issues/2#issuecomment-765494560: