Skip to content

Commit

Permalink
Merge pull request #208 from XITRIX/tvOS
Browse files Browse the repository at this point in the history
tvOS support added
  • Loading branch information
krzyzanowskim authored May 3, 2024
2 parents 91d5e17 + 876ddd2 commit 8944631
Show file tree
Hide file tree
Showing 13 changed files with 1,711 additions and 44 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ OPENSSL_VERSION=3.1.5
IPHONEOS_DEPLOYMENT_VERSION=12.0
MACOSX_DEPLOYMENT_TARGET=10.15
XROS_DEPLOYMENT_VERSION=1.0
APPLETVOS_DEPLOYMENT_VERSION=12.0

CWD := $(abspath $(patsubst %/,%,$(dir $(abspath $(lastword $(MAKEFILE_LIST))))))

Expand Down
1,020 changes: 980 additions & 40 deletions OpenSSL.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1530"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES"
buildArchitectures = "Automatic">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D1FBB91E2BDFB043008AF202"
BuildableName = "OpenSSL.framework"
BlueprintName = "OpenSSL (tvOS Simulator)"
ReferencedContainer = "container:OpenSSL.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D1FBB91E2BDFB043008AF202"
BuildableName = "OpenSSL.framework"
BlueprintName = "OpenSSL (tvOS Simulator)"
ReferencedContainer = "container:OpenSSL.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
67 changes: 67 additions & 0 deletions OpenSSL.xcodeproj/xcshareddata/xcschemes/OpenSSL (tvOS).xcscheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1530"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES"
buildArchitectures = "Automatic">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D1FBB8882BDFB02D008AF202"
BuildableName = "OpenSSL.framework"
BlueprintName = "OpenSSL (tvOS)"
ReferencedContainer = "container:OpenSSL.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D1FBB8882BDFB02D008AF202"
BuildableName = "OpenSSL.framework"
BlueprintName = "OpenSSL (tvOS)"
ReferencedContainer = "container:OpenSSL.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
3 changes: 2 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ let package = Package(
platforms: [
.iOS(.v12),
.macOS(.v10_15),
.tvOS(.v12),
.custom("xros", versionString: "1.0")
],
products: [
Expand All @@ -20,4 +21,4 @@ let package = Package(
path: "Frameworks/OpenSSL.xcframework"
)
]
)
)
84 changes: 84 additions & 0 deletions Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,90 @@ let project = Project(
"SKIP_INSTALL": "NO",
"COPY_PHASE_STRIP": "NO",

"DEVELOPMENT_TEAM": developmentTeam,
"CODE_SIGN_IDENTITY": "Apple Distribution",
"CODE_SIGN_STYLE": "Manual"
])
)
),
.target(
name: "OpenSSL (tvOS)",
destinations: [.tvOS],
product: .framework,
productName: "OpenSSL",
bundleId: "com.github.krzyzanowskim.OpenSSL",
deploymentTargets: .tvOS("12.0"),
infoPlist: .file(path: .relativeToRoot("support/appletvos/Info.plist")),
sources: [],
resources: [
"support/PrivacyInfo.xcprivacy"
],
headers: .headers(
public: .list([.glob("appletvos/include/OpenSSL/*.h", excluding: "**/asn1_mac.h"), "support/appletvos/OpenSSL.h"])
),
dependencies: [
.library(path: .relativeToRoot("appletvos/lib/libcrypto.a"), publicHeaders: .relativeToRoot("appletvos/include/OpenSSL"), swiftModuleMap: nil, condition: nil),
.library(path: .relativeToRoot("appletvos/lib/libssl.a"), publicHeaders: .relativeToRoot("appletvos/include/OpenSSL"), swiftModuleMap: nil, condition: nil)
],
settings: .settings(base: SettingsDictionary()
.marketingVersion(marketingVersion)
.currentProjectVersion("1")
.bitcodeEnabled(false)
.otherLinkerFlags([
"-Xlinker -all_load"
])
.merging([
"SUPPORTED_PLATFORMS": "appletvos",

"BUILD_LIBRARY_FOR_DISTRIBUTION": "YES",
"APPLICATION_EXTENSION_API_ONLY": "YES",
"DEFINES_MODULE": "YES",

"SKIP_INSTALL": "NO",
"COPY_PHASE_STRIP": "NO",

"DEVELOPMENT_TEAM": developmentTeam,
"CODE_SIGN_IDENTITY": "Apple Distribution",
"CODE_SIGN_STYLE": "Manual"
])
)
),
.target(
name: "OpenSSL (tvOS Simulator)",
destinations: [.tvOS],
product: .framework,
productName: "OpenSSL",
bundleId: "com.github.krzyzanowskim.OpenSSL",
deploymentTargets: .tvOS("12.0"),
infoPlist: .file(path: .relativeToRoot("support/appletvsimulator/Info.plist")),
sources: [],
resources: [
"support/PrivacyInfo.xcprivacy"
],
headers: .headers(
public: .list([.glob("appletvsimulator/include/OpenSSL/*.h", excluding: "**/asn1_mac.h"), "support/appletvsimulator/OpenSSL.h"])
),
dependencies: [
.library(path: .relativeToRoot("appletvsimulator/lib/libcrypto.a"), publicHeaders: .relativeToRoot("appletvsimulator/include/OpenSSL"), swiftModuleMap: nil, condition: nil),
.library(path: .relativeToRoot("appletvsimulator/lib/libssl.a"), publicHeaders: .relativeToRoot("appletvsimulator/include/OpenSSL"), swiftModuleMap: nil, condition: nil)
],
settings: .settings(base: SettingsDictionary()
.marketingVersion(marketingVersion)
.currentProjectVersion("1")
.bitcodeEnabled(false)
.otherLinkerFlags([
"-Xlinker -all_load"
])
.merging([
"SUPPORTED_PLATFORMS": "appletvsimulator",

"BUILD_LIBRARY_FOR_DISTRIBUTION": "YES",
"APPLICATION_EXTENSION_API_ONLY": "YES",
"DEFINES_MODULE": "YES",

"SKIP_INSTALL": "NO",
"COPY_PHASE_STRIP": "NO",

"DEVELOPMENT_TEAM": developmentTeam,
"CODE_SIGN_IDENTITY": "Apple Distribution",
"CODE_SIGN_STYLE": "Manual"
Expand Down
76 changes: 76 additions & 0 deletions config/20-apple.conf
Original file line number Diff line number Diff line change
Expand Up @@ -215,5 +215,81 @@ my %targets = ();
sys_id => "XROS",
},

## Base settings for tvOS
"tvos-cross-base" => {
template => 1,
cflags => combine('-isysroot $(CROSS_TOP)/SDKs/$(CROSS_SDK) -fno-common', sub { defined($ENV{'APPLETVOS_DEPLOYMENT_VERSION'}) ? '-mtvos-version-min=$(APPLETVOS_DEPLOYMENT_VERSION)' : '-mtvos-version-min=9.0'; }),
disable => [ "engine", "async" ],
defines => [ "HAVE_FORK=0" ]
},

## Base settings for tvOS Simulator
"tvos-sim-cross-base" => {
inherit_from => [ "tvos-cross-base" ],
template => 1,
cflags => add( sub { defined($ENV{'APPLETVOS_DEPLOYMENT_VERSION'}) ? '-mtvos-simulator-version-min=$(APPLETVOS_DEPLOYMENT_VERSION)' : '-mtvos-simulator-version-min=9.0'; }),
},

## Apple tvOS simulator
"tvos-sim-cross-x86_64" => {
inherit_from => [ "darwin-common", "tvos-sim-cross-base" ],
CC => "xcrun -sdk appletvsimulator cc",
cflags => add('-arch x86_64'),
lib_cppflags => add("-DL_ENDIAN"),
bn_ops => "SIXTY_FOUR_BIT_LONG",
sys_id => "tvOS",
perlasm_scheme => "tvos64",
},

"tvos-sim-cross-i386" => {
inherit_from => [ "darwin-common", "tvos-sim-cross-base" ],
CC => "xcrun -sdk appletvsimulator cc",
cflags => add('-arch i386'),
lib_cppflags => add("-DL_ENDIAN"),
bn_ops => "BN_LLONG RC4_INT",
asm_arch => 'x86',
sys_id => "tvOS",
},

"tvos-sim-cross-arm64e" => {
inherit_from => [ "darwin-common", "tvos-sim-cross-base" ],
CC => "xcrun -sdk appletvsimulator cc",
cflags => add('-arch arm64e'),
asm_arch => 'aarch64',
lib_cppflags => add("-DL_ENDIAN"),
bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
perlasm_scheme => "tvos64",
sys_id => "tvOS",
},

"tvos-sim-cross-arm64" => {
inherit_from => [ "darwin-common", "tvos-sim-cross-base" ],
CC => "xcrun -sdk appletvsimulator cc",
cflags => add('-arch arm64'),
asm_arch => 'aarch64',
lib_cppflags => add("-DL_ENDIAN"),
bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
perlasm_scheme => "tvos64",
sys_id => "tvOS",
},

## Apple tvOS
"tvos-cross-arm64" => {
inherit_from => [ "darwin-common", "tvos-cross-base" ],
cflags => add("-arch arm64"),
asm_arch => 'aarch64',
bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
lib_cppflags => add("-DL_ENDIAN"),
perlasm_scheme => "tvos64",
sys_id => "tvOS",
},

"tvos-cross-arm64e" => {
inherit_from => [ "darwin-common", "tvos-cross-base" ],
cflags => add("-arch arm64e"),
asm_arch => 'aarch64',
bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
perlasm_scheme => "tvos64",
sys_id => "tvOS",
},
);
Loading

0 comments on commit 8944631

Please sign in to comment.