residuum/PuRestJson

Include arm64 libraries in Deken package

reduzent opened this issue · 1 comments

The Deken packages appear as multi-arch with support for x86_64 and arm64, but only x86_64 versions of the dependent libraries are included (libcurl, etc):

❯ file rest.pd_darwin
rest.pd_darwin: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit bundle x86_64Mach-O 64-bit bundle x86_64] [arm64:Mach-O 64-bit bundle arm64Mach-O 64-bit bundle arm64]
rest.pd_darwin (for architecture x86_64):	Mach-O 64-bit bundle x86_64
rest.pd_darwin (for architecture arm64):	Mach-O 64-bit bundle arm64
❯ file libcurl.4.dylib
libcurl.4.dylib: Mach-O 64-bit dynamically linked shared library x86_64

Thus, the purest_json objects can only be successfully loaded on x86_64.

As an example of a package with included dependencies that fully support both, M1 and Intel, that's how I did it:

https://netpd.org/~roman/tmp/jackpatch%5bv0.2%5d(Darwin-amd64-32)(Darwin-arm64-32).dek

It use the following layout:

jackpatch$ tree
.
├── amd64
│   ├── libcrypto.1.1.dylib
│   ├── libdb-18.1.dylib
│   ├── libjack.0.1.0.dylib
│   ├── libopus.0.dylib
│   ├── libsamplerate.0.dylib
│   └── libssl.1.1.dylib
├── arm64
│   ├── libcrypto.1.1.dylib
│   ├── libdb-18.1.dylib
│   ├── libjack.0.1.0.dylib
│   ├── libopus.0.dylib
│   ├── libsamplerate.0.dylib
│   └── libssl.1.1.dylib
├── jackpatch.d_amd64
├── jackpatch.d_arm64
├── jackpatch-help.pd
├── jackpatch-meta.pd
├── LICENSE.txt
├── README.md
└── VERSION.txt
❯ otool -L jackpatch.d_arm64
jackpatch.d_arm64:
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.0.0)
	@loader_path/arm64/libjack.0.1.0.dylib (compatibility version 0.1.0, current version 1.9.21)
❯ otool -L jackpatch.d_amd64
jackpatch.d_amd64:
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.0.0)
	@loader_path/amd64/libjack.0.1.0.dylib (compatibility version 0.1.0, current version 1.9.21)