summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabio Alessandrelli <fabio.alessandrelli@gmail.com>2023-12-19 16:38:02 +0100
committerFabio Alessandrelli <fabio.alessandrelli@gmail.com>2023-12-20 12:55:43 +0100
commit7a4e27e5f054f418f4aa08c6c0c3c22c50bf0c97 (patch)
tree998bf3f252e6e94d3cc2f1f8f66ab778538c9dc7
parentd768508435cfb0b940486b4fec54339f5d9c096f (diff)
downloadfork-godot-webrtc-native-7a4e27e5f054f418f4aa08c6c0c3c22c50bf0c97.tar.gz
fork-godot-webrtc-native-7a4e27e5f054f418f4aa08c6c0c3c22c50bf0c97.tar.bz2
fork-godot-webrtc-native-7a4e27e5f054f418f4aa08c6c0c3c22c50bf0c97.zip
[MacOS] Use framekwork to package GDExtension
This allows it to be code-signed as a bundle so gatekeeper won't complain when loaded by the editor.
-rw-r--r--SConstruct14
-rw-r--r--misc/dist/macos/Info.plist28
-rwxr-xr-xmisc/scripts/package_release.sh2
-rw-r--r--misc/webrtc.gdextension4
4 files changed, 44 insertions, 4 deletions
diff --git a/SConstruct b/SConstruct
index 9080be6..6d012ff 100644
--- a/SConstruct
+++ b/SConstruct
@@ -177,7 +177,19 @@ env.Depends(sources, ssl + rtc)
# Make the shared library
result_name = "libwebrtc_native{}{}".format(env["suffix"], env["SHLIBSUFFIX"])
-library = env.SharedLibrary(target=os.path.join(result_path, "lib", result_name), source=sources)
+if env["godot_version"] != "3" and env["platform"] == "macos":
+ framework_path = os.path.join(
+ result_path, "lib", "libwebrtc_native.macos.{}.{}.framework".format(env["target"], env["arch"])
+ )
+ library_file = env.SharedLibrary(target=os.path.join(framework_path, result_name), source=sources)
+ plist_file = env.Substfile(
+ os.path.join(framework_path, "Resources", "Info.plist"),
+ "misc/dist/macos/Info.plist",
+ SUBST_DICT={"{LIBRARY_NAME}": result_name, "{DISPLAY_NAME}": "libwebrtc_native" + env["suffix"]},
+ )
+ library = [library_file, plist_file]
+else:
+ library = env.SharedLibrary(target=os.path.join(result_path, "lib", result_name), source=sources)
Default(library)
# GDNativeLibrary
diff --git a/misc/dist/macos/Info.plist b/misc/dist/macos/Info.plist
new file mode 100644
index 0000000..679f64c
--- /dev/null
+++ b/misc/dist/macos/Info.plist
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleExecutable</key>
+ <string>{LIBRARY_NAME}</string>
+ <key>CFBundleIdentifier</key>
+ <string>org.godotengine.webrtc-native</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleDisplayName</key>
+ <string>{DISPLAY_NAME}</string>
+ <key>CFBundleName</key>
+ <string>webrtc_native</string>
+ <key>CFBundlePackageType</key>
+ <string>FMWK</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0.0</string>
+ <key>CFBundleSupportedPlatforms</key>
+ <array>
+ <string>MacOSX</string>
+ </array>
+ <key>CFBundleVersion</key>
+ <string>1.0.0</string>
+ <key>LSMinimumSystemVersion</key>
+ <string>11.0</string>
+</dict>
+</plist>
diff --git a/misc/scripts/package_release.sh b/misc/scripts/package_release.sh
index 3ca5a2b..c3cf553 100755
--- a/misc/scripts/package_release.sh
+++ b/misc/scripts/package_release.sh
@@ -16,7 +16,7 @@ DESTDIR="${DESTINATION}/${VERSION}/${TYPE}"
mkdir -p ${DESTDIR}/lib
-find "${ARTIFACTS}" -wholename "*/${VERSION}/${TYPE}/lib/*" | xargs cp -t "${DESTDIR}/lib/"
+find "${ARTIFACTS}" -maxdepth 5 -wholename "*/${VERSION}/${TYPE}/lib/*" | xargs cp -r -t "${DESTDIR}/lib/"
find "${ARTIFACTS}" -wholename "*/LICENSE*" | xargs cp -t "${DESTDIR}/"
if [ $VERSION = "gdnative" ]; then
diff --git a/misc/webrtc.gdextension b/misc/webrtc.gdextension
index 6b25ce5..9cb89c1 100644
--- a/misc/webrtc.gdextension
+++ b/misc/webrtc.gdextension
@@ -9,7 +9,7 @@ linux.debug.x86_64 = "lib/libwebrtc_native.linux.template_debug.x86_64.so"
linux.debug.x86_32 = "lib/libwebrtc_native.linux.template_debug.x86_32.so"
linux.debug.arm64 = "lib/libwebrtc_native.linux.template_debug.arm64.so"
linux.debug.arm32 = "lib/libwebrtc_native.linux.template_debug.arm32.so"
-macos.debug = "lib/libwebrtc_native.macos.template_debug.universal.dylib"
+macos.debug = "lib/libwebrtc_native.macos.template_debug.universal.framework"
windows.debug.x86_64 = "lib/libwebrtc_native.windows.template_debug.x86_64.dll"
windows.debug.x86_32 = "lib/libwebrtc_native.windows.template_debug.x86_32.dll"
android.debug.arm64 = "lib/libwebrtc_native.android.template_debug.arm64.so"
@@ -21,7 +21,7 @@ linux.release.x86_64 = "lib/libwebrtc_native.linux.template_release.x86_64.so"
linux.release.x86_32 = "lib/libwebrtc_native.linux.template_release.x86_32.so"
linux.release.arm64 = "lib/libwebrtc_native.linux.template_release.arm64.so"
linux.release.arm32 = "lib/libwebrtc_native.linux.template_release.arm32.so"
-macos.release = "lib/libwebrtc_native.macos.template_release.universal.dylib"
+macos.release = "lib/libwebrtc_native.macos.template_release.universal.framework"
windows.release.x86_64 = "lib/libwebrtc_native.windows.template_release.x86_64.dll"
windows.release.x86_32 = "lib/libwebrtc_native.windows.template_release.x86_32.dll"
android.release.arm64 = "lib/libwebrtc_native.android.template_release.arm64.so"