Skip to content

Commit 7e5eecf

Browse files
authored
Merge pull request #28 from cossacklabs/openssl-1.1.1w
* OpenSSL 1.1.1w * Experimental support for VisionOS
2 parents f35370a + 13a999a commit 7e5eecf

File tree

12 files changed

+120
-8
lines changed

12 files changed

+120
-8
lines changed

Makefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,21 @@ endif
1111
#===== Versioning ==============================================================
1212

1313
## OpenSSL version to build
14-
VERSION ?= 1.1.1v
14+
VERSION ?= 1.1.1w
1515

1616
## Extra version of the distributed package
1717
PACKAGE_VERSION ?= 1
1818
export PACKAGE_VERSION
1919

2020
MIN_IOS_SDK = 11.0
2121
MIN_OSX_SDK = 10.13
22-
export MIN_IOS_SDK MIN_OSX_SDK
22+
MIN_XROS_SDK = 1.1
23+
export MIN_IOS_SDK MIN_OSX_SDK MIN_XROS_SDK
2324

2425
BUILD_TARGETS += ios-sim-cross-x86_64
2526
BUILD_TARGETS += ios64-cross-arm64
2627
BUILD_TARGETS += macos64-x86_64
28+
BUILD_TARGETS += visionos-sim-cross-x86_64 visionos-sim-cross-arm64 visionos-cross-arm64
2729

2830
# Automatically enable Apple Silicon support if running with Xcode 12.2+
2931
# unless the user has decided explicitly.
@@ -45,6 +47,7 @@ BUILD_FLAGS += --version=$(VERSION)
4547
BUILD_FLAGS += --targets="$(BUILD_TARGETS)"
4648
BUILD_FLAGS += --min-ios-sdk=$(MIN_IOS_SDK)
4749
BUILD_FLAGS += --min-macos-sdk=$(MIN_OSX_SDK)
50+
BUILD_FLAGS += --min-xros-sdk=$(MIN_XROS_SDK)
4851

4952

5053
#===== Building ================================================================
@@ -64,6 +67,7 @@ endif
6467
.PHONY: build
6568

6669
$(OUTPUT)/done.build:
70+
@echo $(BUILD_FLAGS)
6771
@./build-libssl.sh $(BUILD_FLAGS)
6872
@mkdir -p $(OUTPUT)
6973
@touch $(OUTPUT)/done.build

Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ let package = Package(
1414
targets: [
1515
.binaryTarget(name: "openssl",
1616
// update version in URL path
17-
url:"https://github.com/cossacklabs/openssl-apple/releases/download/1.1.12201/openssl-static-xcframework.zip",
17+
url:"https://github.com/cossacklabs/openssl-apple/releases/download/1.1.12301/openssl-static-xcframework.zip",
1818
// Run from package directory:
1919
// swift package compute-checksum output/openssl-static-xcframework.zip
20-
checksum: "a3363e4297428d2497c481791f6ac3c17c118b6829ee6246781efe0a3593ae16"),
20+
checksum: "348382db8c5cdc2c4c7802b9ec05a247f2cbe831fc8cdc3c2ecd5f663f40fb94"),
2121
]
2222
)

RELEASING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ How to update to newer OpenSSL version, build, and publish a release.
7373
6. **Update the Carthage package settings and prepare the copy of files**
7474
During the 'make' process, the scripts in the 'scripts' folder had to update the json files in the carthage folder. Check it out.
7575

76-
`cat carthage/openssl-dynamic-framework.json`
76+
`cat carthage/openssl-dynamic-xcframework.json`
7777
```
7878
{
7979
"1.1.12201": "https://github.com/cossacklabs/openssl-apple/releases/download/1.1.12201/openssl-dynamic-xcframework.zip",

assets/Vision/Info.plist

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleDevelopmentRegion</key>
6+
<string>en</string>
7+
<key>CFBundleExecutable</key>
8+
<string>openssl</string>
9+
<key>CFBundleIdentifier</key>
10+
<string>com.cossacklabs.OpenSSL</string>
11+
<key>CFBundleInfoDictionaryVersion</key>
12+
<string>6.0</string>
13+
<key>CFBundleName</key>
14+
<string>openssl</string>
15+
<key>CFBundlePackageType</key>
16+
<string>FMWK</string>
17+
<key>CFBundleShortVersionString</key>
18+
<string>$(OPENSSL_VERSION)</string>
19+
<key>CFBundleVersion</key>
20+
<string>1</string>
21+
<key>MinimumOSVersion</key>
22+
<string>$(MIN_SDK_VERSION)</string>
23+
</dict>
24+
</plist>

assets/xrOS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Vision

assets/xrSimulator

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Vision

build-libssl.sh

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ set -u
2525
# SCRIPT DEFAULTS
2626

2727
# Default version in case no version is specified
28-
DEFAULTVERSION="1.1.1v"
28+
DEFAULTVERSION="1.1.1w"
2929

3030
# Default (=full) set of targets (OpenSSL >= 1.1.1) to build
3131
DEFAULTTARGETS=`cat <<TARGETS
@@ -42,6 +42,7 @@ MACOS_MIN_SDK_VERSION="10.15"
4242
CATALYST_MIN_SDK_VERSION="10.15"
4343
WATCHOS_MIN_SDK_VERSION="4.0"
4444
TVOS_MIN_SDK_VERSION="12.0"
45+
XROS_MIN_SDK_VERSION="1.1"
4546
4647
# Init optional env variables (use available variable or default to empty string)
4748
CURL_OPTIONS="${CURL_OPTIONS:-}"
@@ -64,6 +65,7 @@ echo_help()
6465
echo " --min-macos-sdk=SDKVERSION Set minimum macOS SDK version (default: $MACOS_MIN_SDK_VERSION)"
6566
echo " --min-watchos-sdk=SDKVERSION Set minimum watchOS SDK version (default: $WATCHOS_MIN_SDK_VERSION)"
6667
echo " --min-tvos-sdk=SDKVERSION Set minimum tvOS SDK version (default: $TVOS_MIN_SDK_VERSION)"
68+
echo " --min-xros-sdk=SDKVERSION Set mininum xrOS SDK version (default: $XROS_MIN_SDK_VERSION)"
6769
echo " --noparallel Disable running make with parallel jobs (make -j)"
6870
echo " --disable-bitcode Disable embedding Bitcode"
6971
echo " -v, --verbose Enable verbose logging"
@@ -197,6 +199,14 @@ finish_build_loop()
197199
else
198200
OPENSSLCONF_SUFFIX="tvos_${ARCH}"
199201
fi
202+
elif [[ "${PLATFORM}" == xrSimulator* ]]; then
203+
LIBSSL_XROS+=("${TARGETDIR}/lib/libssl.a")
204+
LIBCRYPTO_XROS+=("${TARGETDIR}/lib/libcrypto.a")
205+
OPENSSLCONF_SUFFIX="xros_sim_${ARCH}"
206+
elif [[ "${PLATFORM}" == xrOS* ]]; then
207+
LIBSSL_XROS+=("${TARGETDIR}/lib/libssl.a")
208+
LIBCRYPTO_XROS+=("${TARGETDIR}/lib/libcrypto.a")
209+
OPENSSLCONF_SUFFIX="xros_${ARCH}"
200210
elif [[ "${PLATFORM}" == Catalyst* ]]; then
201211
LIBSSL_CATALYST+=("${TARGETDIR}/lib/libssl.a")
202212
LIBCRYPTO_CATALYST+=("${TARGETDIR}/lib/libcrypto.a")
@@ -230,6 +240,7 @@ MACOS_SDKVERSION=""
230240
CATALYST_SDKVERSION=""
231241
WATCHOS_SDKVERSION=""
232242
TVOS_SDKVERSION=""
243+
XROS_SDKVERSION=""
233244
LOG_VERBOSE=""
234245
PARALLEL=""
235246
TARGETS=""
@@ -279,6 +290,10 @@ case $i in
279290
TVOS_SDKVERSION="${i#*=}"
280291
shift
281292
;;
293+
--xros-sdk=*)
294+
XROS_SDKVERSION="${i#*=}"
295+
shift
296+
;;
282297
--min-ios-sdk=*)
283298
IOS_MIN_SDK_VERSION="${i#*=}"
284299
shift
@@ -295,6 +310,10 @@ case $i in
295310
TVOS_MIN_SDK_VERSION="${i#*=}"
296311
shift
297312
;;
313+
--min-xros-sdk=*)
314+
XROS_MIN_SDK_VERSION="${i#*=}"
315+
shift
316+
;;
298317
--noparallel)
299318
PARALLEL="false"
300319
;;
@@ -382,6 +401,9 @@ fi
382401
if [ ! -n "${TVOS_SDKVERSION}" ]; then
383402
TVOS_SDKVERSION=$(xcrun -sdk appletvos --show-sdk-version)
384403
fi
404+
if [ ! -n "${XROS_SDKVERSION}" ]; then
405+
XROS_SDKVERSION=$(xcrun -sdk xros --show-sdk-version)
406+
fi
385407
386408
# Truncate to minor version
387409
MINOR_VERSION=(${MACOS_SDKVERSION//./ })
@@ -436,6 +458,7 @@ echo " macOS SDK: ${MACOS_SDKVERSION} (min ${MACOS_MIN_SDK_VERSION})"
436458
echo " macOS SDK (Catalyst): ${CATALYST_SDKVERSION} (min ${CATALYST_MIN_SDK_VERSION})"
437459
echo " watchOS SDK: ${WATCHOS_SDKVERSION} (min ${WATCHOS_MIN_SDK_VERSION})"
438460
echo " tvOS SDK: ${TVOS_SDKVERSION} (min ${TVOS_MIN_SDK_VERSION})"
461+
echo " visionOS SDK: ${XROS_SDKVERSION} (min ${XROS_MIN_SDK_VERSION})"
439462
if [ "${CONFIG_DISABLE_BITCODE}" == "true" ]; then
440463
echo " Bitcode embedding disabled"
441464
fi
@@ -490,6 +513,7 @@ OPENSSL_CHECKSUMS="
490513
1.1.1k 892a0875b9872acd04a9fde79b1f943075d5ea162415de3047c327df33fbaee5
491514
1.1.1u e2f8d84b523eecd06c7be7626830370300fbcc15386bf5142d72758f6963ebc6
492515
1.1.1v d6697e2871e77238460402e9362d47d18382b15ef9f246aba6c7bd780d38a6b0
516+
1.1.1w cf3098950cb4d853ad95c0841f1f9c6d3dc102dccfcacd521d93925208b76ac8
493517
"
494518
checksum_checked=false
495519
while read version expectedSHA256; do
@@ -556,6 +580,9 @@ LIBSSL_WATCHOS=()
556580
LIBCRYPTO_WATCHOS=()
557581
LIBSSL_TVOS=()
558582
LIBCRYPTO_TVOS=()
583+
LIBSSL_XROS=()
584+
LIBCRYPTO_XROS=()
585+
559586
560587
source "${SCRIPTDIR}/scripts/build-loop-targets.sh"
561588
@@ -628,6 +655,15 @@ if [ ${#OPENSSLCONF_ALL[@]} -gt 1 ]; then
628655
*_tvos_sim_x86_64.h)
629656
DEFINE_CONDITION="TARGET_OS_TV && TARGET_OS_SIMULATOR && TARGET_CPU_X86_64"
630657
;;
658+
*_xros_sim_x86_64.h)
659+
DEFINE_CONDITION="TARGET_OS_VISION && TARGET_OS_SIMULATOR && TARGET_CPU_X86_64"
660+
;;
661+
*_xros_sim_arm64.h)
662+
DEFINE_CONDITION="TARGET_OS_VISION && TARGET_OS_SIMULATOR && TARGET_CPU_ARM64"
663+
;;
664+
*_xros_arm64.h)
665+
DEFINE_CONDITION="TARGET_OS_VISION && TARGET_OS_EMBEDDED && TARGET_CPU_ARM64"
666+
;;
631667
*)
632668
# Don't run into unexpected cases by setting the default condition to false
633669
DEFINE_CONDITION="0"

carthage/openssl-dynamic-xcframework.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"1.1.12301": "https://github.com/cossacklabs/openssl-apple/releases/download/1.1.12301/openssl-dynamic-xcframework.zip",
23
"1.1.12201": "https://github.com/cossacklabs/openssl-apple/releases/download/1.1.12201/openssl-dynamic-xcframework.zip",
34
"1.1.12101": "https://github.com/cossacklabs/openssl-apple/releases/download/1.1.12101/openssl-dynamic-xcframework.zip",
45
"1.1.11101": "https://github.com/cossacklabs/openssl-apple/releases/download/1.1.11101/openssl-dynamic-xcframework.zip",

carthage/openssl-static-xcframework.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"1.1.12301": "https://github.com/cossacklabs/openssl-apple/releases/download/1.1.12301/openssl-static-xcframework.zip",
23
"1.1.12201": "https://github.com/cossacklabs/openssl-apple/releases/download/1.1.12201/openssl-static-xcframework.zip",
34
"1.1.12101": "https://github.com/cossacklabs/openssl-apple/releases/download/1.1.12101/openssl-static-xcframework.zip",
45
"1.1.11101": "https://github.com/cossacklabs/openssl-apple/releases/download/1.1.11101/openssl-static-xcframework.zip",

config/20-all-platforms.conf

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,4 +163,35 @@ my %targets = ();
163163
inherit_from => [ "darwin64-x86_64-cc", "tvos-cross-base" ],
164164
sys_id => "tvOS",
165165
},
166+
167+
## Apple visionOS -- visionos -- VISIONOS
168+
"visionos-cross-base" => {
169+
inherit_from => [ "all-base" ],
170+
template => 1,
171+
defines => [ "HAVE_FORK=0" ],
172+
sys_id => "visionOS",
173+
cflags => add("-fembed-bitcode", sub { defined($ENV{'XROS_MIN_SDK_VERSION'}) ? '-target arm64-apple-xros$(VISIONOS_MIN_SDK_VERSION)': '-target arm64-apple-xros1.0 '; }),
174+
},
175+
"visionos-sim-cross-x86_64" => {
176+
inherit_from => [ "darwin64-x86_64", "visionos-cross-base" ],
177+
cflags => add("-arch x86_64", sub { defined($ENV{'XROS_MIN_SDK_VERSION'}) ? '-target x86_64-apple-xros$(VISIONOS_MIN_SDK_VERSION)-simulator' : '-target x86_64-apple-xros1.0-simulator'; }),
178+
sys_id => "visionOS",
179+
asm_arch => 'aarch64',
180+
perlasm_scheme => "macosx",
181+
},
182+
"visionos-sim-cross-arm64" => {
183+
inherit_from => [ "darwin-common", "visionos-cross-base" ],
184+
cflags => add("-arch arm64", sub { defined($ENV{'XROS_MIN_SDK_VERSION'}) ? '-target arm64-apple-xros$(VISIONOS_MIN_SDK_VERSION)-simulator' : '-target arm64-apple-xros1.0-simulator'; }),
185+
sys_id => "visionOS",
186+
asm_arch => 'aarch64',
187+
perlasm_scheme => "macosx",
188+
},
189+
"visionos-cross-arm64" => {
190+
inherit_from => [ "darwin-common", "visionos-cross-base" ],
191+
cflags => add("-arch arm64"),
192+
perlasm_scheme => "ios64",
193+
sys_id => "visionOS",
194+
asm_arch => 'aarch64',
195+
},
196+
166197
);

0 commit comments

Comments
 (0)