$NetBSD$ * Part of patchset to build electron on NetBSD * Based on OpenBSD's chromium patches, and FreeBSD's electron patches --- third_party/squirrel.mac/BUILD.gn.orig 2025-07-08 14:12:31.421039664 +0000 +++ third_party/squirrel.mac/BUILD.gn @@ -0,0 +1,242 @@ +assert(is_mac) + +import("//build/config/mac/rules.gni") +import("build/xcrun.gni") +import("filenames.gni") + +bundle_data("mantle_headers") { + sources = [] + public_deps = [] + sources += mantle_filenames.headers + outputs = [ "{{bundle_contents_dir}}/Headers/{{source_file_part}}" ] +} + +mac_framework_bundle("mantle_framework") { + output_name = "Mantle" + framework_version = "A" + framework_contents = [ + "Headers", + "Resources", + ] + info_plist = "vendor/Mantle/Mantle/Info.plist" + extra_substitutions = [ "CURRENT_PROJECT_VERSION=0.0.0" ] + + configs -= [ + "//build/config/compiler:chromium_code", + "//build/config/gcc:symbol_visibility_hidden", + ] + configs += [ "//build/config/compiler:no_chromium_code" ] + public_deps = [ ":mantle_headers" ] + deps = [] + frameworks = [ + "CoreData.framework", + "Foundation.framework", + ] + sources = mantle_filenames.headers + mantle_filenames.sources + + include_dirs = [ + "vendor/Mantle/Mantle", + "vendor/Mantle/Mantle/extobjc", + ] + + cflags_objc = [ + "-fobjc-arc", + "-Wno-block-capture-autoreleasing", + ] + + ldflags = [ "-Wl,-install_name,@rpath/$output_name.framework/$output_name" ] +} + +dtrace_header_dir = "$target_gen_dir/dtrace" + +xcrun_action("reactiveobjc_signalprovider_dtrace") { + cmd = "dtrace" + inputs = [ "vendor/ReactiveObjC/ReactiveObjC/RACSignalProvider.d" ] + outputs = [ "$dtrace_header_dir/RACSignalProvider.h" ] + args = [ + "-h", + "-s", + ] + rebase_path(inputs) + [ "-o" ] + rebase_path(outputs) +} + +xcrun_action("reactiveobjc_disposableprovider_dtrace") { + cmd = "dtrace" + inputs = + [ "vendor/ReactiveObjC/ReactiveObjC/RACCompoundDisposableProvider.d" ] + outputs = [ "$dtrace_header_dir/RACCompoundDisposableProvider.h" ] + args = [ + "-h", + "-s", + ] + rebase_path(inputs) + [ "-o" ] + rebase_path(outputs) +} + +bundle_data("reactiveobjc_headers") { + sources = [] + public_deps = [] + sources += reactiveobjc_filenames.public_headers + outputs = [ "{{bundle_contents_dir}}/Headers/{{source_file_part}}" ] +} + +mac_framework_bundle("reactiveobjc_framework") { + output_name = "ReactiveObjC" + framework_version = "A" + framework_contents = [ + "Headers", + "Resources", + ] + info_plist = "vendor/ReactiveObjC/ReactiveObjC/Info.plist" + extra_substitutions = [ + "CURRENT_PROJECT_VERSION=0.0.0", + "PRODUCT_BUNDLE_IDENTIFIER=com.electron.reactive", + ] + defines = [ + "BUILDING_RAC_FRAMEWORK=1", + "DTRACE_PROBES_DISABLED", + ] + + configs -= [ + "//build/config/compiler:chromium_code", + "//build/config/gcc:symbol_visibility_hidden", + ] + configs += [ "//build/config/compiler:no_chromium_code" ] + deps = [ + ":reactiveobjc_disposableprovider_dtrace", + ":reactiveobjc_headers", + ":reactiveobjc_headers", + ":reactiveobjc_signalprovider_dtrace", + ] + frameworks = [ + "AppKit.framework", + "Foundation.framework", + ] + sources = + reactiveobjc_filenames.public_headers + + reactiveobjc_filenames.private_headers + reactiveobjc_filenames.sources + + include_dirs = [ + "vendor/ReactiveObjC/ReactiveObjC", + "vendor/ReactiveObjC/ReactiveObjC/extobjc", + "$dtrace_header_dir", + ] + + cflags_objc = [ + "-fobjc-arc", + "-Wno-deprecated-declarations", + ] + + ldflags = [ "-Wl,-install_name,@rpath/$output_name.framework/$output_name" ] +} + +executable("squirrel_shipit") { + output_name = "ShipIt" + configs -= [ "//build/config/compiler:chromium_code" ] + configs += [ "//build/config/compiler:no_chromium_code" ] + sources = [ + "Squirrel/NSBundle+SQRLVersionExtensions.h", + "Squirrel/NSBundle+SQRLVersionExtensions.m", + "Squirrel/NSError+SQRLVerbosityExtensions.h", + "Squirrel/NSError+SQRLVerbosityExtensions.m", + "Squirrel/NSProcessInfo+SQRLVersionExtensions.h", + "Squirrel/NSProcessInfo+SQRLVersionExtensions.m", + "Squirrel/RACSignal+SQRLTransactionExtensions.h", + "Squirrel/RACSignal+SQRLTransactionExtensions.m", + "Squirrel/SQRLCodeSignature.h", + "Squirrel/SQRLCodeSignature.m", + "Squirrel/SQRLInstaller+Private.h", + "Squirrel/SQRLInstaller.h", + "Squirrel/SQRLInstaller.m", + "Squirrel/SQRLInstallerOwnedBundle.h", + "Squirrel/SQRLInstallerOwnedBundle.m", + "Squirrel/SQRLShipItRequest.h", + "Squirrel/SQRLShipItRequest.m", + "Squirrel/SQRLTerminationListener.h", + "Squirrel/SQRLTerminationListener.m", + "Squirrel/ShipIt-main.m", + ] + deps = [ + ":mantle_framework+link", + ":reactiveobjc_framework+link", + ] + frameworks = [ + "AppKit.framework", + "Foundation.framework", + "IOKit.framework", + "Security.framework", + ] + + cflags_objc = [ + "-fobjc-weak", + "-Wno-unknown-warning-option", + "-Wno-block-capture-autoreleasing", + "-fobjc-arc", + ] + + ldflags = [ + "-rpath", + "@executable_path/../..", + "-rpath", + "@executable_path/../../../..", + ] + + include_dirs = [ "vendor/ReactiveObjC/ReactiveObjC/extobjc" ] +} + +bundle_data("squirrel_framework_shipit") { + sources = [] + public_deps = [ ":squirrel_shipit" ] + sources += [ "$root_out_dir/ShipIt" ] + outputs = [ "{{bundle_contents_dir}}/Resources/{{source_file_part}}" ] +} + +bundle_data("squirrel_framework_headers") { + sources = [] + public_deps = [] + sources += squirrel_filenames.headers + outputs = [ "{{bundle_contents_dir}}/Headers/{{source_file_part}}" ] +} + +mac_framework_bundle("squirrel_framework") { + output_name = "Squirrel" + framework_version = "A" + framework_contents = [ + "Headers", + "Resources", + ] + info_plist = "Squirrel/Squirrel-Info.plist" + extra_substitutions = [ + "CURRENT_PROJECT_VERSION=0.0.0", + "PRODUCT_BUNDLE_IDENTIFIER=com.github.Squirrel", + ] + + configs -= [ + "//build/config/compiler:chromium_code", + "//build/config/gcc:symbol_visibility_hidden", + ] + configs += [ "//build/config/compiler:no_chromium_code" ] + public_deps = [ + ":squirrel_framework_headers", + ":squirrel_framework_shipit", + ] + deps = [ + ":mantle_framework+link", + ":reactiveobjc_framework+link", + ] + frameworks = [ + "AppKit.framework", + "Foundation.framework", + "IOKit.framework", + "Security.framework", + "ServiceManagement.framework", + ] + sources = squirrel_filenames.headers + squirrel_filenames.sources + + cflags_objc = [ + "-fobjc-weak", + "-fobjc-arc", + "-Wno-block-capture-autoreleasing", + ] + + ldflags = [ "-Wl,-install_name,@rpath/$output_name.framework/$output_name" ] + + include_dirs = [ "vendor/ReactiveObjC/ReactiveObjC/extobjc" ] +}