mpv-player / mpv

🎥 Command line video player
https://mpv.io
Other
28.39k stars 2.91k forks source link

Compile issue with libjxl head #10387

Closed eko5624 closed 2 years ago

eko5624 commented 2 years ago

mpv version and platform versions

If you're not using git master or the latest release, update. Releases are listed here: https://github.com/mpv-player/mpv/releases

Reproduction steps

The failed codes:

Creating Mac OS X application bundle (version: 0.34.0-UNKNOWN)...
> copying bundle skeleton
> copying binary
> create bundle symlink
> generating Info.plist
> bundling dependencies
error: /Library/Developer/CommandLineTools/usr/bin/otool-classic: can't open file: @rpath/libjxl_threads.0.7.dylib (No such file or directory)
error: /Library/Developer/CommandLineTools/usr/bin/otool-classic: can't open file: @rpath/libjxl.0.7.dylib (No such file or directory)
Traceback (most recent call last):
  File "/Users/xxx/Downloads/mpv-master/TOOLS/dylib-unhell.py", line 130, in <module>
    main()
  File "/Users/xxx/Downloads/mpv-master/TOOLS/dylib-unhell.py", line 121, in main
    process_libraries(libs, binary)
  File "/Users/xxx/Downloads/mpv-master/TOOLS/dylib-unhell.py", line 80, in process_libraries
    shutil.copy(src, dst)
  File "/usr/local/Cellar/python@3.9/3.9.13_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/shutil.py", line 427, in copy
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "/usr/local/Cellar/python@3.9/3.9.13_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/shutil.py", line 264, in copyfile
    with open(src, 'rb') as fsrc:
FileNotFoundError: [Errno 2] No such file or directory: '@rpath/libjxl_threads.0.7.dylib'
>> gathering all linked libraries
>> copying and processing all linked libraries
done.

Expected behavior

./TOOLS/osxbundle.py build/mpv succeed.

Actual behavior

Succeed: meson build meson compile -C build

Failed: ./TOOLS/osxbundle.py build/mpv

Log file

meson-log.txt

Upload build/config.log or ./waf configure output to https://0x0.st/ or attach it to the github issue, and replace this text with a link to it.

The issue will be closed for ignoring the issue template.

Traneptora commented 2 years ago

Looks like the rpath variable is not being expanded properly

eko5624 commented 2 years ago

@thebombzen Is there a workaround?

Traneptora commented 2 years ago

I have no idea as I don't use macOS, I just was trying to identify the problem.

Akemi commented 2 years ago

btw the macOS bundle script ist not part of the build system and is only an external tool/script in the TOOLS folder.

for a quick hotfix you need to find the dylib that links to libjxl and change its install name. something along the lines:

install_name_tool -change @rpath/libjxl_threads.0.7.dylib /usr/local/lib/libjxl_threads.0.7.dylib /PATH/TO/MPV/OR/DYLIB

linked dylibs can be found with:

otool -L /PATH/TO/BINARY/OR/DYLIB

otherwise the bundle script needs to be extended, since it's currently not meant to work in that case.

eko5624 commented 2 years ago

@Akemi what is "/PATH/TO/MPV/OR/DYLIB"? Can you more specifically? These are my compiling steps:

cd mpv-master
export PKG_CONFIG_PATH=/usr/local/opt/libarchive/lib/pkgconfig:/usr/local/opt/luajit-openresty/lib/pkgconfig:/usr/local/opt/zlib/lib/pkgconfig:/Volumes/USB/Downloads/lib/pkgconfig
meson build
meson compile -C build
./TOOLS/osxbundle.py build/mpv

This is my src dir. What I should do to fix it, thanks.

QQ20220712-090217@2x
Akemi commented 2 years ago

i can't, like i said you must find the specific dylib yourself.

this will show you all linked libraries.

otool -L ./build/mpv

this will show you more specific linking information

otool -l ./build/mpv

then you have to use both those commands on the linked dylibs to find the dylib where @rpath/libjxl_threads.0.7.dylib i slinked with it's @rpath set. with the install_name_tool you can change that path. after that you have to rebuild/link the mpv binary.

eko5624 commented 2 years ago

@Akemi Please take a look. otool -L ./build/mpv

./build/mpv:
    /usr/local/opt/libass/lib/libass.9.dylib (compatibility version 11.0.0, current version 11.4.0)
    /Volumes/USB/Downloads/lib/libavutil.57.dylib (compatibility version 57.0.0, current version 57.27.100)
    /Volumes/USB/Downloads/lib/libavcodec.59.dylib (compatibility version 59.0.0, current version 59.36.100)
    /Volumes/USB/Downloads/lib/libavformat.59.dylib (compatibility version 59.0.0, current version 59.26.100)
    /Volumes/USB/Downloads/lib/libswscale.6.dylib (compatibility version 6.0.0, current version 6.6.100)
    /Volumes/USB/Downloads/lib/libavfilter.8.dylib (compatibility version 8.0.0, current version 8.42.100)
    /Volumes/USB/Downloads/lib/libswresample.4.dylib (compatibility version 4.0.0, current version 4.6.100)
    /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
    /System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore (compatibility version 1.2.0, current version 1.11.0)
    /usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
    /usr/local/opt/mujs/lib/libmujs.dylib (compatibility version 0.0.0, current version 0.0.0)
    /usr/local/opt/little-cms2/lib/liblcms2.2.dylib (compatibility version 3.0.0, current version 3.13.0)
    /usr/local/opt/libarchive/lib/libarchive.13.dylib (compatibility version 20.0.0, current version 20.1.0)
    /Volumes/USB/Downloads/lib/libavdevice.59.dylib (compatibility version 59.0.0, current version 59.6.100)
    /usr/local/opt/libbluray/lib/libbluray.2.dylib (compatibility version 7.0.0, current version 7.1.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.100.3)
    /usr/local/opt/luajit-openresty/lib/libluajit-5.1.2.dylib (compatibility version 2.1.0, current version 2.1.0)
    /usr/local/opt/rubberband/lib/librubberband.2.dylib (compatibility version 2.0.0, current version 2.0.0)
    /usr/local/opt/uchardet/lib/libuchardet.0.dylib (compatibility version 0.0.0, current version 0.0.7)
    /usr/local/opt/vapoursynth/lib/libvapoursynth-script.0.dylib (compatibility version 1.0.0, current version 1.0.0)
    /usr/local/opt/zimg/lib/libzimg.2.dylib (compatibility version 3.0.0, current version 3.0.0)
    /usr/local/opt/zlib/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.12)
    /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1858.112.0)
    /System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio (compatibility version 1.0.0, current version 1.0.0)
    /System/Library/Frameworks/AudioUnit.framework/Versions/A/AudioUnit (compatibility version 1.0.0, current version 1.0.0)
    /System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox (compatibility version 1.0.0, current version 1000.0.0)
    /usr/local/opt/libcaca/lib/libcaca.0.dylib (compatibility version 100.0.0, current version 100.20.0)
    /usr/local/opt/jpeg/lib/libjpeg.9.dylib (compatibility version 15.0.0, current version 15.0.0)
    /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
    /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 2113.40.126)
    /System/Library/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics (compatibility version 64.0.0, current version 1557.5.4)
    /System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo (compatibility version 1.2.0, current version 1.5.0)
    /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 1858.112.0)
    /System/Library/Frameworks/IOSurface.framework/Versions/A/IOSurface (compatibility version 1.0.0, current version 1.0.0)
    /System/Library/Frameworks/MediaPlayer.framework/Versions/A/MediaPlayer (compatibility version 1.0.0, current version 1.0.0)
    /usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)
    /usr/lib/swift/libswiftAVFoundation.dylib (compatibility version 1.0.0, current version 2080.20.4, weak)
    /usr/lib/swift/libswiftAppKit.dylib (compatibility version 1.0.0, current version 109.0.0)
    /usr/lib/swift/libswiftCore.dylib (compatibility version 1.0.0, current version 5.6.0)
    /usr/lib/swift/libswiftCoreAudio.dylib (compatibility version 1.0.0, current version 1.1.0, weak)
    /usr/lib/swift/libswiftCoreData.dylib (compatibility version 1.0.0, current version 19.0.0, weak)
    /usr/lib/swift/libswiftCoreFoundation.dylib (compatibility version 1.0.0, current version 14.0.0, weak)
    /usr/lib/swift/libswiftCoreGraphics.dylib (compatibility version 1.0.0, current version 2.0.0)
    /usr/lib/swift/libswiftCoreImage.dylib (compatibility version 1.0.0, current version 2.0.0, weak)
    /usr/lib/swift/libswiftCoreMIDI.dylib (compatibility version 1.0.0, current version 5.0.0, weak)
    /usr/lib/swift/libswiftCoreMedia.dylib (compatibility version 1.0.0, current version 2940.20.4, weak)
    /usr/lib/swift/libswiftDarwin.dylib (compatibility version 1.0.0, current version 0.0.0, weak)
    /usr/lib/swift/libswiftDispatch.dylib (compatibility version 1.0.0, current version 11.0.0)
    /usr/lib/swift/libswiftFoundation.dylib (compatibility version 1.0.0, current version 72.105.0)
    /usr/lib/swift/libswiftIOKit.dylib (compatibility version 1.0.0, current version 1.0.0, weak)
    /usr/lib/swift/libswiftMetal.dylib (compatibility version 1.0.0, current version 261.13.0, weak)
    /usr/lib/swift/libswiftObjectiveC.dylib (compatibility version 1.0.0, current version 3.0.0)
    /usr/lib/swift/libswiftQuartzCore.dylib (compatibility version 1.0.0, current version 3.0.0, weak)
    /usr/lib/swift/libswiftUniformTypeIdentifiers.dylib (compatibility version 1.0.0, current version 722.6.0, weak)
    /usr/lib/swift/libswiftXPC.dylib (compatibility version 1.0.0, current version 1.1.0, weak)
    /usr/lib/swift/libswiftsimd.dylib (compatibility version 1.0.0, current version 9.0.0, weak)

otool -l ./build/mpv

./build/mpv:
Load command 0
      cmd LC_SEGMENT_64
  cmdsize 72
  segname __PAGEZERO
   vmaddr 0x0000000000000000
   vmsize 0x0000000100000000
  fileoff 0
 filesize 0
  maxprot 0x00000000
 initprot 0x00000000
   nsects 0
    flags 0x0
Load command 1
      cmd LC_SEGMENT_64
  cmdsize 1592
  segname __TEXT
   vmaddr 0x0000000100000000
   vmsize 0x0000000000338000
  fileoff 0
 filesize 3375104
  maxprot 0x00000005
 initprot 0x00000005
   nsects 19
    flags 0x0
Section
  sectname __text
   segname __TEXT
      addr 0x0000000100012e50
      size 0x00000000001329d3
    offset 77392
     align 2^4 (16)
    reloff 0
    nreloc 0
     flags 0x80000400
 reserved1 0
 reserved2 0
Section
  sectname __stubs
   segname __TEXT
      addr 0x0000000100145824
      size 0x0000000000001560
    offset 1333284
     align 2^1 (2)
    reloff 0
    nreloc 0
     flags 0x80000408
 reserved1 0 (index into indirect symbol table)
 reserved2 6 (size of stubs)
Section
  sectname __stub_helper
   segname __TEXT
      addr 0x0000000100146d84
      size 0x00000000000023b0
    offset 1338756
     align 2^2 (4)
    reloff 0
    nreloc 0
     flags 0x80000400
 reserved1 0
 reserved2 0
Section
  sectname __const
   segname __TEXT
      addr 0x0000000100149140
      size 0x00000000001745f8
    offset 1347904
     align 2^4 (16)
    reloff 0
    nreloc 0
     flags 0x00000000
 reserved1 0
 reserved2 0
Section
  sectname __objc_methname
   segname __TEXT
      addr 0x00000001002bd738
      size 0x0000000000002ecc
    offset 2873144
     align 2^0 (1)
    reloff 0
    nreloc 0
     flags 0x00000002
 reserved1 0
 reserved2 0
Section
  sectname __swift5_typeref
   segname __TEXT
      addr 0x00000001002c0604
      size 0x0000000000000b80
    offset 2885124
     align 2^1 (2)
    reloff 0
    nreloc 0
     flags 0x00000000
 reserved1 0
 reserved2 0
Section
  sectname __cstring
   segname __TEXT
      addr 0x00000001002c1190
      size 0x000000000006e3bf
    offset 2888080
     align 2^4 (16)
    reloff 0
    nreloc 0
     flags 0x00000002
 reserved1 0
 reserved2 0
Section
  sectname __swift5_reflstr
   segname __TEXT
      addr 0x000000010032f550
      size 0x0000000000000e78
    offset 3339600
     align 2^4 (16)
    reloff 0
    nreloc 0
     flags 0x00000000
 reserved1 0
 reserved2 0
Section
  sectname __swift5_fieldmd
   segname __TEXT
      addr 0x00000001003303c8
      size 0x00000000000015ac
    offset 3343304
     align 2^2 (4)
    reloff 0
    nreloc 0
     flags 0x00000000
 reserved1 0
 reserved2 0
Section
  sectname __swift5_builtin
   segname __TEXT
      addr 0x0000000100331974
      size 0x0000000000000410
    offset 3348852
     align 2^2 (4)
    reloff 0
    nreloc 0
     flags 0x00000000
 reserved1 0
 reserved2 0
Section
  sectname __swift5_assocty
   segname __TEXT
      addr 0x0000000100331d84
      size 0x0000000000000198
    offset 3349892
     align 2^2 (4)
    reloff 0
    nreloc 0
     flags 0x00000000
 reserved1 0
 reserved2 0
Section
  sectname __swift5_capture
   segname __TEXT
      addr 0x0000000100331f1c
      size 0x0000000000000314
    offset 3350300
     align 2^2 (4)
    reloff 0
    nreloc 0
     flags 0x00000000
 reserved1 0
 reserved2 0
Section
  sectname __swift5_proto
   segname __TEXT
      addr 0x0000000100332230
      size 0x0000000000000098
    offset 3351088
     align 2^2 (4)
    reloff 0
    nreloc 0
     flags 0x00000000
 reserved1 0
 reserved2 0
Section
  sectname __swift5_types
   segname __TEXT
      addr 0x00000001003322c8
      size 0x0000000000000108
    offset 3351240
     align 2^2 (4)
    reloff 0
    nreloc 0
     flags 0x00000000
 reserved1 0
 reserved2 0
Section
  sectname __objc_classname
   segname __TEXT
      addr 0x00000001003323d0
      size 0x00000000000000bb
    offset 3351504
     align 2^0 (1)
    reloff 0
    nreloc 0
     flags 0x00000002
 reserved1 0
 reserved2 0
Section
  sectname __objc_methtype
   segname __TEXT
      addr 0x000000010033248b
      size 0x0000000000000ef3
    offset 3351691
     align 2^0 (1)
    reloff 0
    nreloc 0
     flags 0x00000002
 reserved1 0
 reserved2 0
Section
  sectname __ustring
   segname __TEXT
      addr 0x000000010033337e
      size 0x00000000000001b2
    offset 3355518
     align 2^1 (2)
    reloff 0
    nreloc 0
     flags 0x00000000
 reserved1 0
 reserved2 0
Section
  sectname __unwind_info
   segname __TEXT
      addr 0x0000000100333530
      size 0x0000000000002ae0
    offset 3355952
     align 2^2 (4)
    reloff 0
    nreloc 0
     flags 0x00000000
 reserved1 0
 reserved2 0
Section
  sectname __eh_frame
   segname __TEXT
      addr 0x0000000100336010
      size 0x0000000000001ff0
    offset 3366928
     align 2^3 (8)
    reloff 0
    nreloc 0
     flags 0x00000000
 reserved1 0
 reserved2 0
Load command 2
      cmd LC_SEGMENT_64
  cmdsize 552
  segname __DATA_CONST
   vmaddr 0x0000000100338000
   vmsize 0x000000000003c000
  fileoff 3375104
 filesize 245760
  maxprot 0x00000003
 initprot 0x00000003
   nsects 6
    flags 0x10
Section
  sectname __got
   segname __DATA_CONST
      addr 0x0000000100338000
      size 0x0000000000000510
    offset 3375104
     align 2^3 (8)
    reloff 0
    nreloc 0
     flags 0x00000006
 reserved1 912 (index into indirect symbol table)
 reserved2 0
Section
  sectname __const
   segname __DATA_CONST
      addr 0x0000000100338510
      size 0x0000000000035e28
    offset 3376400
     align 2^4 (16)
    reloff 0
    nreloc 0
     flags 0x00000000
 reserved1 0
 reserved2 0
Section
  sectname __cfstring
   segname __DATA_CONST
      addr 0x000000010036e338
      size 0x0000000000002240
    offset 3597112
     align 2^3 (8)
    reloff 0
    nreloc 0
     flags 0x00000000
 reserved1 0
 reserved2 0
Section
  sectname __objc_classlist
   segname __DATA_CONST
      addr 0x0000000100370578
      size 0x0000000000000090
    offset 3605880
     align 2^3 (8)
    reloff 0
    nreloc 0
     flags 0x10000000
 reserved1 0
 reserved2 0
Section
  sectname __objc_protolist
   segname __DATA_CONST
      addr 0x0000000100370608
      size 0x0000000000000038
    offset 3606024
     align 2^3 (8)
    reloff 0
    nreloc 0
     flags 0x00000000
 reserved1 0
 reserved2 0
Section
  sectname __objc_imageinfo
   segname __DATA_CONST
      addr 0x0000000100370640
      size 0x0000000000000008
    offset 3606080
     align 2^2 (4)
    reloff 0
    nreloc 0
     flags 0x00000000
 reserved1 0
 reserved2 0
Load command 3
      cmd LC_SEGMENT_64
  cmdsize 1192
  segname __DATA
   vmaddr 0x0000000100374000
   vmsize 0x0000000000010000
  fileoff 3620864
 filesize 65536
  maxprot 0x00000003
 initprot 0x00000003
   nsects 14
    flags 0x0
Section
  sectname __la_symbol_ptr
   segname __DATA
      addr 0x0000000100374000
      size 0x0000000000001c80
    offset 3620864
     align 2^3 (8)
    reloff 0
    nreloc 0
     flags 0x00000007
 reserved1 1074 (index into indirect symbol table)
 reserved2 0
Section
  sectname __objc_const
   segname __DATA
      addr 0x0000000100375c80
      size 0x0000000000004a00
    offset 3628160
     align 2^3 (8)
    reloff 0
    nreloc 0
     flags 0x00000000
 reserved1 0
 reserved2 0
Section
  sectname __objc_selrefs
   segname __DATA
      addr 0x000000010037a680
      size 0x0000000000000e68
    offset 3647104
     align 2^3 (8)
    reloff 0
    nreloc 0
     flags 0x10000005
 reserved1 0
 reserved2 0
Section
  sectname __objc_protorefs
   segname __DATA
      addr 0x000000010037b4e8
      size 0x0000000000000010
    offset 3650792
     align 2^3 (8)
    reloff 0
    nreloc 0
     flags 0x00000000
 reserved1 0
 reserved2 0
Section
  sectname __objc_classrefs
   segname __DATA
      addr 0x000000010037b4f8
      size 0x00000000000001d0
    offset 3650808
     align 2^3 (8)
    reloff 0
    nreloc 0
     flags 0x10000000
 reserved1 0
 reserved2 0
Section
  sectname __objc_superrefs
   segname __DATA
      addr 0x000000010037b6c8
      size 0x0000000000000038
    offset 3651272
     align 2^3 (8)
    reloff 0
    nreloc 0
     flags 0x10000000
 reserved1 0
 reserved2 0
Section
  sectname __objc_ivar
   segname __DATA
      addr 0x000000010037b700
      size 0x00000000000000e0
    offset 3651328
     align 2^3 (8)
    reloff 0
    nreloc 0
     flags 0x00000000
 reserved1 0
 reserved2 0
Section
  sectname __objc_data
   segname __DATA
      addr 0x000000010037b7e0
      size 0x0000000000002760
    offset 3651552
     align 2^3 (8)
    reloff 0
    nreloc 0
     flags 0x00000000
 reserved1 0
 reserved2 0
Section
  sectname __data
   segname __DATA
      addr 0x000000010037df40
      size 0x0000000000001aa0
    offset 3661632
     align 2^4 (16)
    reloff 0
    nreloc 0
     flags 0x00000000
 reserved1 0
 reserved2 0
Section
  sectname __objc_intobj
   segname __DATA
      addr 0x000000010037f9e0
      size 0x0000000000000060
    offset 3668448
     align 2^3 (8)
    reloff 0
    nreloc 0
     flags 0x00000000
 reserved1 0
 reserved2 0
Section
  sectname __objc_arraydata
   segname __DATA
      addr 0x000000010037fa40
      size 0x0000000000000310
    offset 3668544
     align 2^3 (8)
    reloff 0
    nreloc 0
     flags 0x00000000
 reserved1 0
 reserved2 0
Section
  sectname __objc_dictobj
   segname __DATA
      addr 0x000000010037fd50
      size 0x00000000000004b0
    offset 3669328
     align 2^3 (8)
    reloff 0
    nreloc 0
     flags 0x00000000
 reserved1 0
 reserved2 0
Section
  sectname __bss
   segname __DATA
      addr 0x0000000100380200
      size 0x0000000000001990
    offset 0
     align 2^4 (16)
    reloff 0
    nreloc 0
     flags 0x00000001
 reserved1 0
 reserved2 0
Section
  sectname __common
   segname __DATA
      addr 0x0000000100381b90
      size 0x0000000000000050
    offset 0
     align 2^3 (8)
    reloff 0
    nreloc 0
     flags 0x00000001
 reserved1 0
 reserved2 0
Load command 4
      cmd LC_SEGMENT_64
  cmdsize 72
  segname __LINKEDIT
   vmaddr 0x0000000100384000
   vmsize 0x000000000010c000
  fileoff 3686400
 filesize 1081752
  maxprot 0x00000001
 initprot 0x00000001
   nsects 0
    flags 0x0
Load command 5
            cmd LC_DYLD_INFO_ONLY
        cmdsize 48
     rebase_off 3686400
    rebase_size 8376
       bind_off 3694776
      bind_size 9008
  weak_bind_off 0
 weak_bind_size 0
  lazy_bind_off 3703784
 lazy_bind_size 27216
     export_off 3731000
    export_size 42928
Load command 6
     cmd LC_SYMTAB
 cmdsize 24
  symoff 3781400
   nsyms 31406
  stroff 4291840
 strsize 476312
Load command 7
            cmd LC_DYSYMTAB
        cmdsize 80
      ilocalsym 0
      nlocalsym 28348
     iextdefsym 28348
     nextdefsym 1911
      iundefsym 30259
      nundefsym 1147
         tocoff 0
           ntoc 0
      modtaboff 0
        nmodtab 0
   extrefsymoff 0
    nextrefsyms 0
 indirectsymoff 4283896
  nindirectsyms 1986
      extreloff 0
        nextrel 0
      locreloff 0
        nlocrel 0
Load command 8
          cmd LC_LOAD_DYLINKER
      cmdsize 32
         name /usr/lib/dyld (offset 12)
Load command 9
     cmd LC_UUID
 cmdsize 24
    uuid C03042BD-892E-3ABE-833E-0B6734089EAA
Load command 10
      cmd LC_BUILD_VERSION
  cmdsize 32
 platform 1
    minos 12.0
      sdk 12.3
   ntools 1
     tool 3
  version 764.0
Load command 11
      cmd LC_SOURCE_VERSION
  cmdsize 16
  version 0.0
Load command 12
       cmd LC_MAIN
   cmdsize 24
  entryoff 1157216
 stacksize 0
Load command 13
          cmd LC_LOAD_DYLIB
      cmdsize 72
         name /usr/local/opt/libass/lib/libass.9.dylib (offset 24)
   time stamp 2 Thu Jan  1 08:00:02 1970
      current version 11.4.0
compatibility version 11.0.0
Load command 14
          cmd LC_LOAD_DYLIB
      cmdsize 72
         name /Volumes/USB/Downloads/lib/libavutil.57.dylib (offset 24)
   time stamp 2 Thu Jan  1 08:00:02 1970
      current version 57.27.100
compatibility version 57.0.0
Load command 15
          cmd LC_LOAD_DYLIB
      cmdsize 72
         name /Volumes/USB/Downloads/lib/libavcodec.59.dylib (offset 24)
   time stamp 2 Thu Jan  1 08:00:02 1970
      current version 59.36.100
compatibility version 59.0.0
Load command 16
          cmd LC_LOAD_DYLIB
      cmdsize 72
         name /Volumes/USB/Downloads/lib/libavformat.59.dylib (offset 24)
   time stamp 2 Thu Jan  1 08:00:02 1970
      current version 59.26.100
compatibility version 59.0.0
Load command 17
          cmd LC_LOAD_DYLIB
      cmdsize 72
         name /Volumes/USB/Downloads/lib/libswscale.6.dylib (offset 24)
   time stamp 2 Thu Jan  1 08:00:02 1970
      current version 6.6.100
compatibility version 6.0.0
Load command 18
          cmd LC_LOAD_DYLIB
      cmdsize 72
         name /Volumes/USB/Downloads/lib/libavfilter.8.dylib (offset 24)
   time stamp 2 Thu Jan  1 08:00:02 1970
      current version 8.42.100
compatibility version 8.0.0
Load command 19
          cmd LC_LOAD_DYLIB
      cmdsize 80
         name /Volumes/USB/Downloads/lib/libswresample.4.dylib (offset 24)
   time stamp 2 Thu Jan  1 08:00:02 1970
      current version 4.6.100
compatibility version 4.0.0
Load command 20
          cmd LC_LOAD_DYLIB
      cmdsize 88
         name /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (offset 24)
   time stamp 2 Thu Jan  1 08:00:02 1970
      current version 275.0.0
compatibility version 1.0.0
Load command 21
          cmd LC_LOAD_DYLIB
      cmdsize 96
         name /System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore (offset 24)
   time stamp 2 Thu Jan  1 08:00:02 1970
      current version 1.11.0
compatibility version 1.2.0
Load command 22
          cmd LC_LOAD_DYLIB
      cmdsize 56
         name /usr/lib/libiconv.2.dylib (offset 24)
   time stamp 2 Thu Jan  1 08:00:02 1970
      current version 7.0.0
compatibility version 7.0.0
Load command 23
          cmd LC_LOAD_DYLIB
      cmdsize 64
         name /usr/local/opt/mujs/lib/libmujs.dylib (offset 24)
   time stamp 2 Thu Jan  1 08:00:02 1970
      current version 0.0.0
compatibility version 0.0.0
Load command 24
          cmd LC_LOAD_DYLIB
      cmdsize 72
         name /usr/local/opt/little-cms2/lib/liblcms2.2.dylib (offset 24)
   time stamp 2 Thu Jan  1 08:00:02 1970
      current version 3.13.0
compatibility version 3.0.0
Load command 25
          cmd LC_LOAD_DYLIB
      cmdsize 80
         name /usr/local/opt/libarchive/lib/libarchive.13.dylib (offset 24)
   time stamp 2 Thu Jan  1 08:00:02 1970
      current version 20.1.0
compatibility version 20.0.0
Load command 26
          cmd LC_LOAD_DYLIB
      cmdsize 72
         name /Volumes/USB/Downloads/lib/libavdevice.59.dylib (offset 24)
   time stamp 2 Thu Jan  1 08:00:02 1970
      current version 59.6.100
compatibility version 59.0.0
Load command 27
          cmd LC_LOAD_DYLIB
      cmdsize 72
         name /usr/local/opt/libbluray/lib/libbluray.2.dylib (offset 24)
   time stamp 2 Thu Jan  1 08:00:02 1970
      current version 7.1.0
compatibility version 7.0.0
Load command 28
          cmd LC_LOAD_DYLIB
      cmdsize 56
         name /usr/lib/libSystem.B.dylib (offset 24)
   time stamp 2 Thu Jan  1 08:00:02 1970
      current version 1311.100.3
compatibility version 1.0.0
Load command 29
          cmd LC_LOAD_DYLIB
      cmdsize 88
         name /usr/local/opt/luajit-openresty/lib/libluajit-5.1.2.dylib (offset 24)
   time stamp 2 Thu Jan  1 08:00:02 1970
      current version 2.1.0
compatibility version 2.1.0
Load command 30
          cmd LC_LOAD_DYLIB
      cmdsize 80
         name /usr/local/opt/rubberband/lib/librubberband.2.dylib (offset 24)
   time stamp 2 Thu Jan  1 08:00:02 1970
      current version 2.0.0
compatibility version 2.0.0
Load command 31
          cmd LC_LOAD_DYLIB
      cmdsize 72
         name /usr/local/opt/uchardet/lib/libuchardet.0.dylib (offset 24)
   time stamp 2 Thu Jan  1 08:00:02 1970
      current version 0.0.7
compatibility version 0.0.0
Load command 32
          cmd LC_LOAD_DYLIB
      cmdsize 88
         name /usr/local/opt/vapoursynth/lib/libvapoursynth-script.0.dylib (offset 24)
   time stamp 2 Thu Jan  1 08:00:02 1970
      current version 1.0.0
compatibility version 1.0.0
Load command 33
          cmd LC_LOAD_DYLIB
      cmdsize 64
         name /usr/local/opt/zimg/lib/libzimg.2.dylib (offset 24)
   time stamp 2 Thu Jan  1 08:00:02 1970
      current version 3.0.0
compatibility version 3.0.0
Load command 34
          cmd LC_LOAD_DYLIB
      cmdsize 64
         name /usr/local/opt/zlib/lib/libz.1.dylib (offset 24)
   time stamp 2 Thu Jan  1 08:00:02 1970
      current version 1.2.12
compatibility version 1.0.0
Load command 35
          cmd LC_LOAD_DYLIB
      cmdsize 104
         name /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (offset 24)
   time stamp 2 Thu Jan  1 08:00:02 1970
      current version 1858.112.0
compatibility version 150.0.0
Load command 36
          cmd LC_LOAD_DYLIB
      cmdsize 96
         name /System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio (offset 24)
   time stamp 2 Thu Jan  1 08:00:02 1970
      current version 1.0.0
compatibility version 1.0.0
Load command 37
          cmd LC_LOAD_DYLIB
      cmdsize 96
         name /System/Library/Frameworks/AudioUnit.framework/Versions/A/AudioUnit (offset 24)
   time stamp 2 Thu Jan  1 08:00:02 1970
      current version 1.0.0
compatibility version 1.0.0
Load command 38
          cmd LC_LOAD_DYLIB
      cmdsize 104
         name /System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox (offset 24)
   time stamp 2 Thu Jan  1 08:00:02 1970
      current version 1000.0.0
compatibility version 1.0.0
Load command 39
          cmd LC_LOAD_DYLIB
      cmdsize 72
         name /usr/local/opt/libcaca/lib/libcaca.0.dylib (offset 24)
   time stamp 2 Thu Jan  1 08:00:02 1970
      current version 100.20.0
compatibility version 100.0.0
Load command 40
          cmd LC_LOAD_DYLIB
      cmdsize 64
         name /usr/local/opt/jpeg/lib/libjpeg.9.dylib (offset 24)
   time stamp 2 Thu Jan  1 08:00:02 1970
      current version 15.0.0
compatibility version 15.0.0
Load command 41
          cmd LC_LOAD_DYLIB
      cmdsize 88
         name /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (offset 24)
   time stamp 2 Thu Jan  1 08:00:02 1970
      current version 1.0.0
compatibility version 1.0.0
Load command 42
          cmd LC_LOAD_DYLIB
      cmdsize 88
         name /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (offset 24)
   time stamp 2 Thu Jan  1 08:00:02 1970
      current version 2113.40.126
compatibility version 45.0.0
Load command 43
          cmd LC_LOAD_DYLIB
      cmdsize 104
         name /System/Library/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics (offset 24)
   time stamp 2 Thu Jan  1 08:00:02 1970
      current version 1557.5.4
compatibility version 64.0.0
Load command 44
          cmd LC_LOAD_DYLIB
      cmdsize 96
         name /System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo (offset 24)
   time stamp 2 Thu Jan  1 08:00:02 1970
      current version 1.5.0
compatibility version 1.2.0
Load command 45
          cmd LC_LOAD_DYLIB
      cmdsize 96
         name /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (offset 24)
   time stamp 2 Thu Jan  1 08:00:02 1970
      current version 1858.112.0
compatibility version 300.0.0
Load command 46
          cmd LC_LOAD_DYLIB
      cmdsize 96
         name /System/Library/Frameworks/IOSurface.framework/Versions/A/IOSurface (offset 24)
   time stamp 2 Thu Jan  1 08:00:02 1970
      current version 1.0.0
compatibility version 1.0.0
Load command 47
          cmd LC_LOAD_DYLIB
      cmdsize 96
         name /System/Library/Frameworks/MediaPlayer.framework/Versions/A/MediaPlayer (offset 24)
   time stamp 2 Thu Jan  1 08:00:02 1970
      current version 1.0.0
compatibility version 1.0.0
Load command 48
          cmd LC_LOAD_DYLIB
      cmdsize 56
         name /usr/lib/libobjc.A.dylib (offset 24)
   time stamp 2 Thu Jan  1 08:00:02 1970
      current version 228.0.0
compatibility version 1.0.0
Load command 49
          cmd LC_LOAD_WEAK_DYLIB
      cmdsize 72
         name /usr/lib/swift/libswiftAVFoundation.dylib (offset 24)
   time stamp 2 Thu Jan  1 08:00:02 1970
      current version 2080.20.4
compatibility version 1.0.0
Load command 50
          cmd LC_LOAD_DYLIB
      cmdsize 64
         name /usr/lib/swift/libswiftAppKit.dylib (offset 24)
   time stamp 2 Thu Jan  1 08:00:02 1970
      current version 109.0.0
compatibility version 1.0.0
Load command 51
          cmd LC_LOAD_DYLIB
      cmdsize 64
         name /usr/lib/swift/libswiftCore.dylib (offset 24)
   time stamp 2 Thu Jan  1 08:00:02 1970
      current version 5.6.0
compatibility version 1.0.0
Load command 52
          cmd LC_LOAD_WEAK_DYLIB
      cmdsize 64
         name /usr/lib/swift/libswiftCoreAudio.dylib (offset 24)
   time stamp 2 Thu Jan  1 08:00:02 1970
      current version 1.1.0
compatibility version 1.0.0
Load command 53
          cmd LC_LOAD_WEAK_DYLIB
      cmdsize 64
         name /usr/lib/swift/libswiftCoreData.dylib (offset 24)
   time stamp 2 Thu Jan  1 08:00:02 1970
      current version 19.0.0
compatibility version 1.0.0
Load command 54
          cmd LC_LOAD_WEAK_DYLIB
      cmdsize 72
         name /usr/lib/swift/libswiftCoreFoundation.dylib (offset 24)
   time stamp 2 Thu Jan  1 08:00:02 1970
      current version 14.0.0
compatibility version 1.0.0
Load command 55
          cmd LC_LOAD_DYLIB
      cmdsize 72
         name /usr/lib/swift/libswiftCoreGraphics.dylib (offset 24)
   time stamp 2 Thu Jan  1 08:00:02 1970
      current version 2.0.0
compatibility version 1.0.0
Load command 56
          cmd LC_LOAD_WEAK_DYLIB
      cmdsize 64
         name /usr/lib/swift/libswiftCoreImage.dylib (offset 24)
   time stamp 2 Thu Jan  1 08:00:02 1970
      current version 2.0.0
compatibility version 1.0.0
Load command 57
          cmd LC_LOAD_WEAK_DYLIB
      cmdsize 64
         name /usr/lib/swift/libswiftCoreMIDI.dylib (offset 24)
   time stamp 2 Thu Jan  1 08:00:02 1970
      current version 5.0.0
compatibility version 1.0.0
Load command 58
          cmd LC_LOAD_WEAK_DYLIB
      cmdsize 64
         name /usr/lib/swift/libswiftCoreMedia.dylib (offset 24)
   time stamp 2 Thu Jan  1 08:00:02 1970
      current version 2940.20.4
compatibility version 1.0.0
Load command 59
          cmd LC_LOAD_WEAK_DYLIB
      cmdsize 64
         name /usr/lib/swift/libswiftDarwin.dylib (offset 24)
   time stamp 2 Thu Jan  1 08:00:02 1970
      current version 0.0.0
compatibility version 1.0.0
Load command 60
          cmd LC_LOAD_DYLIB
      cmdsize 64
         name /usr/lib/swift/libswiftDispatch.dylib (offset 24)
   time stamp 2 Thu Jan  1 08:00:02 1970
      current version 11.0.0
compatibility version 1.0.0
Load command 61
          cmd LC_LOAD_DYLIB
      cmdsize 64
         name /usr/lib/swift/libswiftFoundation.dylib (offset 24)
   time stamp 2 Thu Jan  1 08:00:02 1970
      current version 72.105.0
compatibility version 1.0.0
Load command 62
          cmd LC_LOAD_WEAK_DYLIB
      cmdsize 64
         name /usr/lib/swift/libswiftIOKit.dylib (offset 24)
   time stamp 2 Thu Jan  1 08:00:02 1970
      current version 1.0.0
compatibility version 1.0.0
Load command 63
          cmd LC_LOAD_WEAK_DYLIB
      cmdsize 64
         name /usr/lib/swift/libswiftMetal.dylib (offset 24)
   time stamp 2 Thu Jan  1 08:00:02 1970
      current version 261.13.0
compatibility version 1.0.0
Load command 64
          cmd LC_LOAD_DYLIB
      cmdsize 64
         name /usr/lib/swift/libswiftObjectiveC.dylib (offset 24)
   time stamp 2 Thu Jan  1 08:00:02 1970
      current version 3.0.0
compatibility version 1.0.0
Load command 65
          cmd LC_LOAD_WEAK_DYLIB
      cmdsize 64
         name /usr/lib/swift/libswiftQuartzCore.dylib (offset 24)
   time stamp 2 Thu Jan  1 08:00:02 1970
      current version 3.0.0
compatibility version 1.0.0
Load command 66
          cmd LC_LOAD_WEAK_DYLIB
      cmdsize 80
         name /usr/lib/swift/libswiftUniformTypeIdentifiers.dylib (offset 24)
   time stamp 2 Thu Jan  1 08:00:02 1970
      current version 722.6.0
compatibility version 1.0.0
Load command 67
          cmd LC_LOAD_WEAK_DYLIB
      cmdsize 64
         name /usr/lib/swift/libswiftXPC.dylib (offset 24)
   time stamp 2 Thu Jan  1 08:00:02 1970
      current version 1.1.0
compatibility version 1.0.0
Load command 68
          cmd LC_LOAD_WEAK_DYLIB
      cmdsize 64
         name /usr/lib/swift/libswiftsimd.dylib (offset 24)
   time stamp 2 Thu Jan  1 08:00:02 1970
      current version 9.0.0
compatibility version 1.0.0
Load command 69
          cmd LC_RPATH
      cmdsize 72
         path /Library/Developer/CommandLineTools/usr/lib/swift/macosx (offset 12)
Load command 70
          cmd LC_RPATH
      cmdsize 32
         path /usr/lib/swift (offset 12)
Load command 71
          cmd LC_RPATH
      cmdsize 48
         path /usr/local/Cellar/libass/0.16.0/lib (offset 12)
Load command 72
          cmd LC_RPATH
      cmdsize 40
         path /Volumes/USB/Downloads/lib (offset 12)
Load command 73
          cmd LC_RPATH
      cmdsize 48
         path /usr/local/Cellar/mujs/1.2.0/lib (offset 12)
Load command 74
          cmd LC_RPATH
      cmdsize 56
         path /usr/local/Cellar/little-cms2/2.13.1/lib (offset 12)
Load command 75
          cmd LC_RPATH
      cmdsize 56
         path /usr/local/Cellar/libarchive/3.6.1/lib (offset 12)
Load command 76
          cmd LC_RPATH
      cmdsize 56
         path /usr/local/Cellar/libbluray/1.3.1/lib (offset 12)
Load command 77
          cmd LC_RPATH
      cmdsize 64
         path /usr/local/Cellar/luajit-openresty/2.1-20220411/lib (offset 12)
Load command 78
          cmd LC_RPATH
      cmdsize 56
         path /usr/local/Cellar/rubberband/2.0.2/lib (offset 12)
Load command 79
          cmd LC_RPATH
      cmdsize 56
         path /usr/local/Cellar/uchardet/HEAD-6f38ab9/lib (offset 12)
Load command 80
          cmd LC_RPATH
      cmdsize 56
         path /usr/local/Cellar/vapoursynth/59/lib (offset 12)
Load command 81
          cmd LC_RPATH
      cmdsize 48
         path /usr/local/Cellar/zimg/3.0.4/lib (offset 12)
Load command 82
          cmd LC_RPATH
      cmdsize 48
         path /usr/local/Cellar/zlib/1.2.12/lib (offset 12)
Load command 83
          cmd LC_RPATH
      cmdsize 56
         path /usr/local/Cellar/libcaca/0.99b20/lib (offset 12)
Load command 84
          cmd LC_RPATH
      cmdsize 48
         path /usr/local/Cellar/jpeg/9e/lib (offset 12)
Load command 85
      cmd LC_FUNCTION_STARTS
  cmdsize 16
  dataoff 3773928
 datasize 6896
Load command 86
      cmd LC_DATA_IN_CODE
  cmdsize 16
  dataoff 3780824
 datasize 576
eko5624 commented 2 years ago

My libjxl head compiling codes:

brew install brotli
git clone https://github.com/libjxl/libjxl.git 
cd libjxl
git submodule update --init --recursive --depth 1 --recommend-shallow third_party/{highway,skcms}
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DJPEGXL_EMSCRIPTEN=OFF -DJPEGXL_BUNDLE_LIBPNG=OFF -DJPEGXL_ENABLE_TOOLS=OFF -DJPEGXL_ENABLE_VIEWERS=OFF -DJPEGXL_ENABLE_DOXYGEN=OFF -DJPEGXL_ENABLE_EXAMPLES=OFF -DJPEGXL_ENABLE_MANPAGES=OFF -DJPEGXL_ENABLE_JNI=OFF -DJPEGXL_ENABLE_PLUGINS=OFF -DJPEGXL_ENABLE_DEVTOOLS=OFF -DJPEGXL_ENABLE_BENCHMARK=OFF -DJPEGXL_ENABLE_SJPEG=OFF -DJPEGXL_FORCE_SYSTEM_BROTLI=ON ..
cmake --build .
cmake --install . 
Akemi commented 2 years ago

i am not going to walk you trough this. find out wich of the linked libs depends on libjxl and adjust thy dylib. but i am repeating myself here.

alternatively adjust the bundle script and output all the nested/recursive dependencies.

eko5624 commented 2 years ago

@Akemi Could you pull a PR to fix this?

Akemi commented 2 years ago

if i had the time i would, but i don't have any atm.

deus0ww commented 2 years ago

@eko5624 If you're using my homebrew-tap (as indicated in https://github.com/deus0ww/homebrew-tap/issues/4), I have it working.

eko5624 commented 2 years ago

@Akemi @deus0ww I firgure it out.

If I installed libjxl-head with brew, there is no rpath in shared library id at all. If I build libjxl-head from source with cmake, then there is rpath in them.

INSTALL_NAME_DIR is a string specifying the directory portion of the "install_name" field of shared libraries on Apple platforms for installed targets. When not set, the default directory used is determined by MACOSX_RPATH. But setting INSTALL_NAME_DIR manually overrides the effect of MACOSX_RPATH.

There's one option to fix it: If build with cmake, added: -DCMAKE_INSTALL_NAME_DIR=/usr/local

Traneptora commented 2 years ago

It appears this is resolved.