koekeishiya / dotfiles

Configuration files
349 stars 63 forks source link

KiTTY rpath #4

Closed lucas-santoni closed 7 years ago

lucas-santoni commented 7 years ago

Hey !

I am trying to use your kitty_rpaths.sh script in order to build your KiTTY fork. Here is what I did :

$ git clone https://github.com/koekeishiya/kitty.git fork # Get your fork
$ cd fork # Get in
$ python3 setup.py osx-bundle # Build the project
$ cp -R ~/Desktop/kitty.app . # Get latest clean Kitty.app
$ cp linux-package/Contents/MacOS/kitty  kitty.app/Contents/MacOS/kitty # Replace original binary with the one I just built
$ cp linux-package/Contents/Frameworks/kitty/kitty/fast_data_types.so kitty.app/Contents/Frameworks/kitty/kitty/fast_data_types.so # Replace original .so with the one I just built
$ ./kitty_rpaths.sh # Run your script

Then, if I try to open Kitty.app, I get the following error :

$ open ./kitty.app
LSOpenURLsWithRole() failed with error -10810 for the file /Users/geographer/Documents/playground/kitty/fork/kitty.app.

And here is the error I get when trying to run the binary inside the .app :

$ ./kitty.app/Contents/MacOS/kitty
Traceback (most recent call last):
  File "Python/runpy.py", line 280, in run_path
  File "Python/runpy.py", line 85, in _run_code
  File "kitty/__main__.py", line 6, in <module>
  File "kitty/main.py", line 13, in <module>
    from .config import (
  File "kitty/boss.py", line 17, in <module>
    from .tabs import SpecialWindow, TabManager
  File "kitty/borders.py", line 11, in <module>
    send_borders_rects
ImportError: cannot import name 'glMultiDrawArrays'

Here is how the paths look for the binary :

$ otool -l kitty.app/Contents/MacOS/kitty | grep "name"
name /usr/lib/dyld (offset 12)
name /usr/lib/libSystem.B.dylib (offset 24)
name /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (offset 24)
name @executable_path/../Frameworks/Python.framework/Versions/3.6/Python (offset 24)

Look identical to the original binary.

And for the .so :

$ otool -l kitty.app/Contents/Frameworks/kitty/kitty/fast_data_types.so | grep "name"
name @executable_path/../Frameworks/kitty/kitty/fast_data_types.so (offset 24)
name /usr/lib/libSystem.B.dylib (offset 24)
name /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (offset 24)
name @executable_path/../Frameworks/Python.framework/Versions/3.6/Python (offset 24)
name /System/Library/Frameworks/CoreText.framework/Versions/A/CoreText (offset 24)
name /System/Library/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics (offset 24)
name @executable_path/../Frameworks/libglfw.3.dylib (offset 24)
name /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (offset 24)
name /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (offset 24)
name /System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo (offset 24)
name /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (offset 24)
name /usr/local/opt/libunistring/lib/libunistring.2.dylib (offset 24)
name /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (offset 24)
name /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (offset 24)
name /usr/lib/libobjc.A.dylib (offset 24)

Also identical excepted for /usr/local/opt/libunistring/lib/libunistring.2.dylib (offset 24) which is not in the original .so.

Thanks for your help ! :)

koekeishiya commented 7 years ago

Pretty sure you have to copy the entire linux-package/Contents/Frameworks/kitty folder.

lucas-santoni commented 7 years ago

That worked ! Thanks a lot ! :)