Issue for making Apple Silicon package
Hello KDE Developers! I am new to the open-source community and this might be my first contribution!
Kid3 is an excellent tag editing software with some exclusive features such as modifying the encoding for the cover, which is extremely helpful, big thanks to the developers! Yet the lack of Apple Silicon support is always somehow bothering me because everyone likes native software!
After some working and shallow learning of Linux operation, I managed to figure out how to make an ARM64 binary. I discovered some scripts that might get in the way of doing so, and now I want to share how I modified them, hoping that you might add official support.
My environment:
Macbook Pro 2021 M1 Max 64GB RAM
macOS Ventura 13.4.1
XCode fully installed
According to the build.sh
, I cloned the git to a dedicated partition whose filesystem is APFS(Case Sensitive). Then a build directory was created in the same directory of kid3, like this:
-Develop
|--kid3
|--build
Then I cd
to the build directory and executed ../kid3/build.sh
. After some waiting, all the libs were retrieved from the internet, and here was the first issue:
...
### Extracting taglib
### Extracting libogg
patching file debian/changelog
patching file debian/compat
patching file debian/control
patching file debian/copyright
patching file debian/libogg-dev.install
patching file debian/libogg0.install
patching file debian/libogg0.symbols
patching file debian/rules
patching file debian/source/lintian-overrides
patching file include/ogg/os_types.h
### Extracting libvorbis
patching file test/Makefile.am
patching file lib/vorbisfile.c
### Extracting libflac
patching file doc/Makefile.am
patching file src/flac/decode.c
patching file src/flac/decode.h
patching file src/flac/main.c
patching file include/share/alloc.h
Hunk #1 succeeded at 48 with fuzz 2 (offset 15 lines).
patching file patches/fixrpath.sh
patching file patches/ltmain.sh.patch
patching file patches/nasm.h.patch
can't find file to patch at input line 69
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -ru flac-1.3.0/src/plugin_xmms/Makefile.in flac-1.3.0.new/src/plugin_xmms/Makefile.in
|--- flac-1.3.0/src/plugin_xmms/Makefile.in 2013-05-27 10:11:57.000000000 +0200
|+++ flac-1.3.0.new/src/plugin_xmms/Makefile.in 2013-10-16 13:30:02.000000000 +0200
--------------------------
File to patch:
I was confused and I pressed Ctrl+C to abort this process. Then I re-executed the command ../kid3/build.sh
, and this issue was just gone. But I think this is worth noting.
Then the second issue rise: the id3lib
failed to build because the configure
of the id3lib
was somehow "outdated" and it was unable to correctly detect the type of my build machine. Here I will show you some of the log and which part of the configure
cause this issue.
From terminal:
...
checking dependency style of gcc... gcc3
checking for library containing strerror... none required
checking build system type... configure: error: /bin/sh ./config.sub -apple-darwin22.5.0 failed
configure: WARNING: cache variable ac_cv_build contains a newline
...
From build/id3lib-3.8.3/config.log
:
...
configure:4759: $? = 0
configure:4779: result: none required
configure:4864: checking build system type
configure:4876: error: /bin/sh ./config.sub -apple-darwin22.5.0 failed
## ---------------- ##
## Cache variables. ##
## ---------------- ##
configure:4876: WARNING: cache variable ac_cv_build contains a newline
ac_cv_c_compiler_gnu=yes
...
I checked the build/id3lib-3.8.3/configure
and build/id3lib-3.8.3/config.sub
(both files are opened by VSCode, despite the first one looks like a binary file, but it was actually a shell script), and I have no clue how to modify the code to add support for my machine. Hence I used brutal force ;-). From the log we could pinpoint where the error was, and then I will show you the original script:
From build/id3lib-3.8.3/configure
:(the number at the beginning of each line represents line number)
...
4864 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
4865 printf %s "checking build system type... " >&6; }
4866 if test ${ac_cv_build+y}
4867 then :
4868 printf %s "(cached) " >&6
4869 else $as_nop
4870 ac_build_alias=$build_alias
4871 test "x$ac_build_alias" = x &&
4872 ac_build_alias=`$SHELL "${ac_aux_dir}config.guess"`
4873 test "x$ac_build_alias" = x &&
4874 as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
4875 ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` ||
4876 as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $ac_build_alias failed" "$LINENO" 5
...
And using brutal force, I modified this piece like this:
...
4864 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
4865 printf %s "checking build system type... " >&6; }
4866 if test ${ac_cv_build+y}
4867 then :
4868 printf %s "(cached) " >&6
4869 else $as_nop
4870 ac_build_alias=$build_alias
4871 test "x$ac_build_alias" = x &&
4872 ac_build_alias=`$SHELL "${ac_aux_dir}config.guess"`
4873 test "x$ac_build_alias" = x &&
4874 as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
4875 ac_cv_build=arm-apple-darwin
4876 #ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` ||
4877 # as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $ac_build_alias failed" "$LINENO" 5
...
Simply put, I added line 4875 to forcefully set the compile machine type because the script (config.sub
) that is responsible for this step cannot correctly detect the machine type and I have no idea how to add the support. The value ac_cv_build
was chosen as "arm-apple-darwin" because I read config.sub
and this might be the best fit. Plus the configure
will do a check to ensure the ac_cv_build
looks like *-*-*
.
Then the id3lib
is all good. The exact same situation happens for zlib
, as shown below:
From terminal:
...
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets ${MAKE}... yes
checking build system type... configure: error: /bin/sh ./../config.sub -apple-darwin22.5.0 failed
configure: error: ./configure failed for zlib
...
From build/id3lib-3.8.3/zlib/config.log
:
...
configure:1618: checking whether make sets ${MAKE}
configure:1638: result: yes
configure:1818: checking build system type
configure:1831: error: /bin/sh ./../config.sub -apple-darwin22.5.0 failed
...
And here we go again by modifying build/id3lib-3.8.3/zlib/configure
using VSCode like before, the original configure
looks like:
...
1830 ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
1831 { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5
1832 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;}
1833 { (exit 1); exit 1; }; }
...
My modify:
...
1830 ac_cv_build=arm-apple-darwin
1831 # ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
1832 # { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5
1833 # echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;}
1834 # { (exit 1); exit 1; }; }
...
Then the script ../kid3/build.sh
is working like a charm (for just a moment)! But these two issues are not kid3's, they are much more related to id3lib
, and this library hasn't been updated for like 5 years. HOWEVER I think I must point out that the "arm-apple-darwin" is just a fantasy option out of nowhere. I gave it to the compiler and I have no idea why this would ever work! This question is left to the developers, maybe!
The next issue is directly related to the makefile
of kid3.
...
-- Found OpenGL: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/System/Library/Frameworks/OpenGL.framework
-- Found WrapOpenGL: TRUE
-- Could NOT find WrapVulkanHeaders (missing: Vulkan_INCLUDE_DIR)
-- Could NOT find WrapVulkanHeaders (missing: Vulkan_INCLUDE_DIR)
-- Found Qt-Version 6.5.1 (using /opt/homebrew/bin/qmake)
CMake Error at CMakeLists.txt:410 (message):
Could not find HTML docbook.xsl
-- Configuring incomplete, errors occurred!
...
I am 100% sure I have installed docbook-xsl
using homebrew. The cause is that in kid3/CMakeLists.txt
, line 395-411, it could not find where the installed docbook-xsl
was. For me, the correct path is /opt/homebrew/Cellar/docbook-xsl/1.79.2_1/docbook-xsl
. Again I am premature to linux family and I used brutal force again. I firmly believe that you can definitely come up with a better solution.
The original part of CMakeLists.txt
looks like this:
...
395 ### Check for HTML docbook.xsl
396 file(GLOB _versionedStyleSheetDir /usr/share/xml/docbook/xsl-stylesheets-*)
397 find_path(DOCBOOK_XSL_DIR xhtml/docbook.xsl
398 PATHS ${WITH_DOCBOOKDIR}
399 /usr/share/xml/docbook/stylesheet/nwalsh
400 /usr/share/xml/docbook/stylesheet/nwalsh/current
401 /usr/share/xml/docbook/stylesheet/docbook-xsl
402 /usr/share/xml/docbook/stylesheet/docbook-xsl-ns
403 /usr/share/sgml/docbook/xsl-stylesheets
404 /usr/share/apps/ksgmltools2/docbook/xsl
405 ${_versionedStyleSheetDir}
406 $ENV{DOCBOOKDIR}
407 $ENV{HOME}/docbook-xsl-1.72.0
408 NO_DEFAULT_PATH)
409 if(NOT DOCBOOK_XSL_DIR)
410 message(FATAL_ERROR "Could not find HTML docbook.xsl")
411 endif()
...
And I modified like this:
...
395 ### Check for HTML docbook.xsl
396 set(DOCBOOK_XSL_DIR /opt/homebrew/Cellar/docbook-xsl/1.79.2_1/docbook-xsl)
397 if(NOT DOCBOOK_XSL_DIR)
398 message(FATAL_ERROR "Could not find HTML docbook.xsl")
399 endif()
...
Then executed ../kid3/build.sh
again. This time the compile was almost done, but the last step was an error...
...
[534/535] Run CPack packaging tool...
CPack: Create package using DragNDrop
CPack: Install projects
CPack: - Install project: kid3 []
CMake Error at /Volumes/Develop/build/kid3/src/plugins/kid3qml/cmake_install.cmake:67 (file):
file INSTALL cannot find "/opt/homebrew/qml/QtQuick/qmldir": No such file
or directory.
Call Stack (most recent call first):
/Volumes/Develop/build/kid3/src/plugins/cmake_install.cmake:92 (include)
/Volumes/Develop/build/kid3/src/cmake_install.cmake:42 (include)
/Volumes/Develop/build/kid3/cmake_install.cmake:42 (include)
CMake Error at /Volumes/Develop/build/kid3/src/plugins/kid3qml/cmake_install.cmake:71 (file):
file INSTALL cannot find "/opt/homebrew/qml/QtQuick/Layouts/qmldir": No
such file or directory.
Call Stack (most recent call first):
/Volumes/Develop/build/kid3/src/plugins/cmake_install.cmake:92 (include)
/Volumes/Develop/build/kid3/src/cmake_install.cmake:42 (include)
/Volumes/Develop/build/kid3/cmake_install.cmake:42 (include)
CMake Error at /Volumes/Develop/build/kid3/src/plugins/kid3qml/cmake_install.cmake:75 (file):
file INSTALL cannot find "/opt/homebrew/qml/QtQml/WorkerScript/qmldir": No
such file or directory.
Call Stack (most recent call first):
/Volumes/Develop/build/kid3/src/plugins/cmake_install.cmake:92 (include)
/Volumes/Develop/build/kid3/src/cmake_install.cmake:42 (include)
/Volumes/Develop/build/kid3/cmake_install.cmake:42 (include)
CMake Error at /Volumes/Develop/build/kid3/src/plugins/kid3qml/cmake_install.cmake:79 (file):
file INSTALL cannot find
"/opt/homebrew/qml/QtQuick/libqtquick2plugin.dylib": No such file or
directory.
Call Stack (most recent call first):
/Volumes/Develop/build/kid3/src/plugins/cmake_install.cmake:92 (include)
/Volumes/Develop/build/kid3/src/cmake_install.cmake:42 (include)
/Volumes/Develop/build/kid3/cmake_install.cmake:42 (include)
...
Then I realized this is another directory problem. The problem occurs at build/kid3/src/plugins/kid3qml/cmake_install.cmake
, at line 67, 71, 75, 79. I will show you how this file originally looks like:
From build/kid3/src/plugins/kid3qml/cmake_install.cmake
:
...
66 if(CMAKE_INSTALL_COMPONENT STREQUAL "Unspecified" OR NOT CMAKE_INSTALL_COMPONENT)
67 file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/kid3.app/Contents/Resources/qml/imports/QtQuick" TYPE FILE FILES "/opt/homebrew/qml/QtQuick/qmldir")
68 endif()
69
70 if(CMAKE_INSTALL_COMPONENT STREQUAL "Unspecified" OR NOT CMAKE_INSTALL_COMPONENT)
71 file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/kid3.app/Contents/Resources/qml/imports/QtQuick/Layouts" TYPE FILE FILES "/opt/homebrew/qml/QtQuick/Layouts/qmldir")
72 endif()
73
74 if(CMAKE_INSTALL_COMPONENT STREQUAL "Unspecified" OR NOT CMAKE_INSTALL_COMPONENT)
75 file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/kid3.app/Contents/Resources/qml/imports/QtQml/WorkerScript" TYPE FILE FILES "/opt/homebrew/qml/QtQml/WorkerScript/qmldir")
76 endif()
77
78 if(CMAKE_INSTALL_COMPONENT STREQUAL "Unspecified" OR NOT CMAKE_INSTALL_COMPONENT)
79 file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/kid3.app/Contents/PlugIns" TYPE FILE FILES
80 "/opt/homebrew/qml/QtQuick/libqtquick2plugin.dylib"
81 "/opt/homebrew/qml/QtQuick/Layouts/libqquicklayoutsplugin.dylib"
82 "/opt/homebrew/qml/QtQml/WorkerScript/libworkerscriptplugin.dylib"
83 )
84 endif()
...
I installed qt (version 6.5.1) using homebrew as well. The correct qml
path should be /opt/homebrew/Cellar/qt/6.5.1_2/share/qt/qml
, hence I modified the cmake
file like this:
...
66 if(CMAKE_INSTALL_COMPONENT STREQUAL "Unspecified" OR NOT CMAKE_INSTALL_COMPONENT)
67 file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/kid3.app/Contents/Resources/qml/imports/QtQuick" TYPE FILE FILES "/opt/homebrew/Cellar/qt/6.5.1_2/share/qt/qml/QtQuick/qmldir")
68 endif()
69
70 if(CMAKE_INSTALL_COMPONENT STREQUAL "Unspecified" OR NOT CMAKE_INSTALL_COMPONENT)
71 file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/kid3.app/Contents/Resources/qml/imports/QtQuick/Layouts" TYPE FILE FILES "/opt/homebrew/Cellar/qt/6.5.1_2/share/qt/qml/QtQuick/Layouts/qmldir")
72 endif()
73
74 if(CMAKE_INSTALL_COMPONENT STREQUAL "Unspecified" OR NOT CMAKE_INSTALL_COMPONENT)
75 file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/kid3.app/Contents/Resources/qml/imports/QtQml/WorkerScript" TYPE FILE FILES "/opt/homebrew/Cellar/qt/6.5.1_2/share/qt/qml/QtQml/WorkerScript/qmldir")
76 endif()
77
78 if(CMAKE_INSTALL_COMPONENT STREQUAL "Unspecified" OR NOT CMAKE_INSTALL_COMPONENT)
79 file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/kid3.app/Contents/PlugIns" TYPE FILE FILES
80 "/opt/homebrew/Cellar/qt/6.5.1_2/share/qt/qml/QtQuick/libqtquick2plugin.dylib"
81 "/opt/homebrew/Cellar/qt/6.5.1_2/share/qt/qml/QtQuick/Layouts/libqquicklayoutsplugin.dylib"
82 "/opt/homebrew/Cellar/qt/6.5.1_2/share/qt/qml/QtQml/WorkerScript/libworkerscriptplugin.dylib"
83 )
84 endif()
...
After this step, we could finally successfully compile an ARM64 native binary. However this binary could not run because of the signing issues. If we open build/kid3/kid3-3.9.4-Darwin.dmg/kid3.app
now, the app would crash, with crash reports like this (only important parts are shown):
...
Exception Type: EXC_BAD_ACCESS (SIGKILL (Code Signature Invalid))
Exception Codes: UNKNOWN_0x32 at 0x00000001003f8000
Exception Codes: 0x0000000000000032, 0x00000001003f8000
Termination Reason: Namespace CODESIGNING, Code 2 Invalid Page
...
And from last compile we could see warnings like:
...
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: warning: changes being made to the file will invalidate the code signature in: /Volumes/Develop/build/kid3/_CPack_Packages/Darwin/DragNDrop/kid3-3.9.4-Darwin/kid3.app/Contents/Frameworks/libglib-2.0.0.dylib
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: warning: changes being made to the file will invalidate the code signature in: /Volumes/Develop/build/kid3/_CPack_Packages/Darwin/DragNDrop/kid3-3.9.4-Darwin/kid3.app/Contents/Frameworks/libdbus-1.3.dylib
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: warning: changes being made to the file will invalidate the code signature in: /Volumes/Develop/build/kid3/_CPack_Packages/Darwin/DragNDrop/kid3-3.9.4-Darwin/kid3.app/Contents/Frameworks/libfreetype.6.dylib
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: warning: changes being made to the file will invalidate the code signature in: /Volumes/Develop/build/kid3/_CPack_Packages/Darwin/DragNDrop/kid3-3.9.4-Darwin/kid3.app/Contents/Frameworks/libintl.8.dylib
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: warning: changes being made to the file will invalidate the code signature in: /Volumes/Develop/build/kid3/_CPack_Packages/Darwin/DragNDrop/kid3-3.9.4-Darwin/kid3.app/Contents/Frameworks/libgthread-2.0.0.dylib
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: warning: changes being made to the file will invalidate the code signature in: /Volumes/Develop/build/kid3/_CPack_Packages/Darwin/DragNDrop/kid3-3.9.4-Darwin/kid3.app/Contents/Frameworks/libharfbuzz.0.dylib
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: warning: changes being made to the file will invalidate the code signature in: /Volumes/Develop/build/kid3/_CPack_Packages/Darwin/DragNDrop/kid3-3.9.4-Darwin/kid3.app/Contents/Frameworks/libb2.1.dylib
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: warning: changes being made to the file will invalidate the code signature in: /Volumes/Develop/build/kid3/_CPack_Packages/Darwin/DragNDrop/kid3-3.9.4-Darwin/kid3.app/Contents/Frameworks/libpng16.16.dylib
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: warning: changes being made to the file will invalidate the code signature in: /Volumes/Develop/build/kid3/_CPack_Packages/Darwin/DragNDrop/kid3-3.9.4-Darwin/kid3.app/Contents/Frameworks/libpcre2-16.0.dylib
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: warning: changes being made to the file will invalidate the code signature in: /Volumes/Develop/build/kid3/_CPack_Packages/Darwin/DragNDrop/kid3-3.9.4-Darwin/kid3.app/Contents/Frameworks/libpcre2-8.0.dylib
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: warning: changes being made to the file will invalidate the code signature in: /Volumes/Develop/build/kid3/_CPack_Packages/Darwin/DragNDrop/kid3-3.9.4-Darwin/kid3.app/Contents/Frameworks/QtCore.framework/Versions/A/QtCore
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: warning: changes being made to the file will invalidate the code signature in: /Volumes/Develop/build/kid3/_CPack_Packages/Darwin/DragNDrop/kid3-3.9.4-Darwin/kid3.app/Contents/Frameworks/QtDBus.framework/Versions/A/QtDBus
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: warning: changes being made to the file will invalidate the code signature in: /Volumes/Develop/build/kid3/_CPack_Packages/Darwin/DragNDrop/kid3-3.9.4-Darwin/kid3.app/Contents/Frameworks/QtGui.framework/Versions/A/QtGui
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: warning: changes being made to the file will invalidate the code signature in: /Volumes/Develop/build/kid3/_CPack_Packages/Darwin/DragNDrop/kid3-3.9.4-Darwin/kid3.app/Contents/Frameworks/QtSvg.framework/Versions/A/QtSvg
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: warning: changes being made to the file will invalidate the code signature in: /Volumes/Develop/build/kid3/_CPack_Packages/Darwin/DragNDrop/kid3-3.9.4-Darwin/kid3.app/Contents/PlugIns/imageformats/libqjpeg.dylib
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: warning: changes being made to the file will invalidate the code signature in: /Volumes/Develop/build/kid3/_CPack_Packages/Darwin/DragNDrop/kid3-3.9.4-Darwin/kid3.app/Contents/Frameworks/QtNetwork.framework/Versions/A/QtNetwork
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: warning: changes being made to the file will invalidate the code signature in: /Volumes/Develop/build/kid3/_CPack_Packages/Darwin/DragNDrop/kid3-3.9.4-Darwin/kid3.app/Contents/Frameworks/QtXml.framework/Versions/A/QtXml
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: warning: changes being made to the file will invalidate the code signature in: /Volumes/Develop/build/kid3/_CPack_Packages/Darwin/DragNDrop/kid3-3.9.4-Darwin/kid3.app/Contents/Frameworks/QtMultimedia.framework/Versions/A/QtMultimedia
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: warning: changes being made to the file will invalidate the code signature in: /Volumes/Develop/build/kid3/_CPack_Packages/Darwin/DragNDrop/kid3-3.9.4-Darwin/kid3.app/Contents/Frameworks/QtOpenGL.framework/Versions/A/QtOpenGL
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: warning: changes being made to the file will invalidate the code signature in: /Volumes/Develop/build/kid3/_CPack_Packages/Darwin/DragNDrop/kid3-3.9.4-Darwin/kid3.app/Contents/Frameworks/QtQml.framework/Versions/A/QtQml
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: warning: changes being made to the file will invalidate the code signature in: /Volumes/Develop/build/kid3/_CPack_Packages/Darwin/DragNDrop/kid3-3.9.4-Darwin/kid3.app/Contents/Frameworks/QtQmlModels.framework/Versions/A/QtQmlModels
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: warning: changes being made to the file will invalidate the code signature in: /Volumes/Develop/build/kid3/_CPack_Packages/Darwin/DragNDrop/kid3-3.9.4-Darwin/kid3.app/Contents/Frameworks/QtQuick.framework/Versions/A/QtQuick
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: warning: changes being made to the file will invalidate the code signature in: /Volumes/Develop/build/kid3/_CPack_Packages/Darwin/DragNDrop/kid3-3.9.4-Darwin/kid3.app/Contents/Frameworks/QtWidgets.framework/Versions/A/QtWidgets
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: warning: changes being made to the file will invalidate the code signature in: /Volumes/Develop/build/kid3/_CPack_Packages/Darwin/DragNDrop/kid3-3.9.4-Darwin/kid3.app/Contents/Frameworks/QtQuickLayouts.framework/Versions/A/QtQuickLayouts
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: warning: changes being made to the file will invalidate the code signature in: /Volumes/Develop/build/kid3/_CPack_Packages/Darwin/DragNDrop/kid3-3.9.4-Darwin/kid3.app/Contents/Frameworks/QtQmlWorkerScript.framework/Versions/A/QtQmlWorkerScript
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: warning: changes being made to the file will invalidate the code signature in: /Volumes/Develop/build/kid3/_CPack_Packages/Darwin/DragNDrop/kid3-3.9.4-Darwin/kid3.app/Contents/Frameworks/libdouble-conversion.3.3.0.dylib
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: warning: changes being made to the file will invalidate the code signature in: /Volumes/Develop/build/kid3/_CPack_Packages/Darwin/DragNDrop/kid3-3.9.4-Darwin/kid3.app/Contents/Frameworks/libgraphite2.3.2.1.dylib
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: warning: changes being made to the file will invalidate the code signature in: /Volumes/Develop/build/kid3/_CPack_Packages/Darwin/DragNDrop/kid3-3.9.4-Darwin/kid3.app/Contents/Frameworks/libicudata.73.2.dylib
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: warning: changes being made to the file will invalidate the code signature in: /Volumes/Develop/build/kid3/_CPack_Packages/Darwin/DragNDrop/kid3-3.9.4-Darwin/kid3.app/Contents/Frameworks/libicui18n.73.2.dylib
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: warning: changes being made to the file will invalidate the code signature in: /Volumes/Develop/build/kid3/_CPack_Packages/Darwin/DragNDrop/kid3-3.9.4-Darwin/kid3.app/Contents/Frameworks/libicuuc.73.2.dylib
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: warning: changes being made to the file will invalidate the code signature in: /Volumes/Develop/build/kid3/_CPack_Packages/Darwin/DragNDrop/kid3-3.9.4-Darwin/kid3.app/Contents/Frameworks/libmd4c.0.4.8.dylib
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: warning: changes being made to the file will invalidate the code signature in: /Volumes/Develop/build/kid3/_CPack_Packages/Darwin/DragNDrop/kid3-3.9.4-Darwin/kid3.app/Contents/Frameworks/libjpeg.8.2.2.dylib
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: warning: changes being made to the file will invalidate the code signature in: /Volumes/Develop/build/kid3/_CPack_Packages/Darwin/DragNDrop/kid3-3.9.4-Darwin/kid3.app/Contents/Frameworks/libbrotlidec.1.0.9.dylib
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: warning: changes being made to the file will invalidate the code signature in: /Volumes/Develop/build/kid3/_CPack_Packages/Darwin/DragNDrop/kid3-3.9.4-Darwin/kid3.app/Contents/Frameworks/libbrotlicommon.1.0.9.dylib
...
The last step is to copy all these files' path and sign. Here I would only show one of them, but all the files mentioned above must be signed like the example. You shall drag the kid3.app out of the .dmg file and then sign the files inside the package like the command shown below. YOU MAY NEED TO HAVE YOUR APPLE DEVELOPER CERTIFICATE INSTALLED CORRECTLY BEFORE SIGNING ANY FILES. NO 99$ DEVELOPER ID NEEDED, YOU JUST NEED A REGULAR APPLE ID TO DO SO.
codesign -s - -f -vvvvv /Volumes/Develop/build/kid3/kid3.app/Contents/Frameworks/libglib-2.0.0.dylib
For me I just copied all the warnings above and edited them in batch, then this file was executed as a shell script. You should notice that the path here is changed, and I tried signing both build/kid3/kid3-3.9.4-Darwin.dmg/kid3 and the build/kid3/_CPack_Packages/Darwin/DragNDrop/kid3-3.9.4-Darwin/kid3.app, and the results are exactly the same, both .app run fine. After that, the ARM64 native version of the kid3 is able to run smoothly, and most important, NATIVELY.
I am not sure if I am allowed to distribute the binary file signed with my own identity, because the entire code is written by you guys! Also, I am not sure if id3lib
will update to add the support for Apple Silicon Macs, hence I just open the issue here. I sincerely appreciate your development of this software and I really want you to add official Apple Silicon support, hopefully using a more elegant solution over my brutal force ;-)
During the discovery, special thanks to miaopass for giving me guidance and advice.