Skip to content

Commit

Permalink
build: build squirrel and its dependencies from source
Browse files Browse the repository at this point in the history
  • Loading branch information
MarshallOfSound committed Jun 26, 2020
1 parent 16a3f41 commit 3fdbc03
Show file tree
Hide file tree
Showing 7 changed files with 561 additions and 44 deletions.
39 changes: 14 additions & 25 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,8 @@ source_set("electron_lib") {
deps += [
"//components/remote_cocoa/app_shim",
"//content/common:mac_helpers",
"//third_party/squirrel.mac:reactiveobjc_framework+link",
"//third_party/squirrel.mac:squirrel_framework+link",
"//ui/accelerated_widget_mac",
]

Expand Down Expand Up @@ -497,16 +499,12 @@ source_set("electron_lib") {
} else {
libs += [
"Squirrel.framework",
"ReactiveCocoa.framework",
"ReactiveObjC.framework",
"Mantle.framework",
]
cflags_objcc = [
"-F",
rebase_path("external_binaries", root_build_dir),
]

# ReactiveCocoa which is used by Squirrel requires using __weak.
cflags_objcc += [ "-fobjc-weak" ]
# ReactiveObjC which is used by Squirrel requires using __weak.
cflags_objcc = [ "-fobjc-weak" ]
}
}
if (is_linux) {
Expand Down Expand Up @@ -811,8 +809,6 @@ if (is_mac) {
}

ldflags = [
"-F",
rebase_path("external_binaries", root_build_dir),
"-Wl,-install_name,@rpath/$output_name.framework/$output_name",
"-rpath",
"@loader_path/Libraries",
Expand Down Expand Up @@ -867,13 +863,18 @@ if (is_mac) {
sources = [ "$root_out_dir/$electron_framework_name.framework" ]
if (!is_mas_build) {
sources += [
"external_binaries/Mantle.framework",
"external_binaries/ReactiveCocoa.framework",
"external_binaries/Squirrel.framework",
"$root_out_dir/Mantle.framework",
"$root_out_dir/ReactiveObjC.framework",
"$root_out_dir/Squirrel.framework",
]
}
outputs = [ "{{bundle_contents_dir}}/Frameworks/{{source_file_part}}" ]
public_deps = [ ":electron_framework+link" ]
public_deps = [
":electron_framework+link",
"//third_party/squirrel.mac:mantle_framework",
"//third_party/squirrel.mac:reactiveobjc_framework+link",
"//third_party/squirrel.mac:squirrel_framework+link",
]

foreach(helper_params, content_mac_helpers) {
sources +=
Expand Down Expand Up @@ -1179,18 +1180,6 @@ test("shell_browser_ui_unittests") {
"//ui/base",
"//ui/strings",
]

if (is_mac) {
# Resolve paths owing to different test executable locations
ldflags = [
"-F",
rebase_path("external_binaries", root_build_dir),
"-rpath",
"@loader_path",
"-rpath",
"@executable_path/" + rebase_path("external_binaries", root_build_dir),
]
}
}

template("dist_zip") {
Expand Down
7 changes: 7 additions & 0 deletions DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ vars = {
'v12.18.1',
'nan_version':
'2c4ee8a32a299eada3cd6e468bbd0a473bfea96d',
'squirrel.mac_version':
'c7186061da815eb82dfba181caaac6f98e729b5c',

'boto_version': 'f7574aa6cc2c819430c1f05e9a1a1a666ef8169b',
'pyyaml_version': '3.12',
Expand Down Expand Up @@ -101,6 +103,10 @@ deps = {
'url': Var('requests_git') + '/requests.git' + '@' + Var('requests_version'),
'condition': 'checkout_requests and process_deps',
},
'src/third_party/squirrel.mac': {
'url': Var("electron_git") + '/Squirrel.Mac.git@' + Var("squirrel.mac_version"),
'condition': 'process_deps',
}
}

hooks = [
Expand Down Expand Up @@ -156,4 +162,5 @@ hooks = [

recursedeps = [
'src',
'src/third_party/squirrel.mac',
]
1 change: 1 addition & 0 deletions patches/ReactiveObjC/.patches
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build_conditionally_import_ext_headers_from_framework_or_from.patch

0 comments on commit 3fdbc03

Please sign in to comment.