-
-
Notifications
You must be signed in to change notification settings - Fork 328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for apple watch / watchos #192
Comments
why |
why even visionos but no watchos |
wow even tvos I surely think someone uses openssl on tv I literally can imagine how you open your pentium tv and generate pgp crypto keys on it for watching youtube |
I'll briefly describe steps for future reference:
build_watchos() {
local TMP_BUILD_DIR=$( mktemp -d )
# Clean up whatever was left from our previous build
rm -rf "${SCRIPT_DIR}"/../{watchsimulator/include,watchsimulator/lib}
mkdir -p "${SCRIPT_DIR}"/../{watchsimulator/include,watchsimulator/lib}
build "x86_64" "WatchSimulator" ${TMP_BUILD_DIR} "watchsimulator"
build "arm64" "WatchSimulator" ${TMP_BUILD_DIR} "watchsimulator"
rm -rf "${SCRIPT_DIR}"/../{watchos/include,watchos/lib}
mkdir -p "${SCRIPT_DIR}"/../{watchos/include,watchos/lib}
build "arm64" "WatchOS" ${TMP_BUILD_DIR} "watchos"
ditto "${TMP_BUILD_DIR}/${OPENSSL_VERSION}-WatchOS-arm64/include/openssl" "${SCRIPT_DIR}/../watchos/include/${FWNAME}"
cp -f "${SCRIPT_DIR}/../shim/shim.h" "${SCRIPT_DIR}/../watchos/include/${FWNAME}/shim.h"
# Copy headers
ditto "${TMP_BUILD_DIR}/${OPENSSL_VERSION}-WatchSimulator-arm64/include/openssl" "${SCRIPT_DIR}/../watchsimulator/include/${FWNAME}"
cp -f "${SCRIPT_DIR}/../shim/shim.h" "${SCRIPT_DIR}/../watchsimulator/include/${FWNAME}/shim.h"
# fix inttypes.h
# find "${SCRIPT_DIR}/../appletvos/include/${FWNAME}" -type f -name "*.h" -exec sed -i "" -e "s/include <inttypes\.h>/include <sys\/types\.h>/g" {} \;
# find "${SCRIPT_DIR}/../appletvsimulator/include/${FWNAME}" -type f -name "*.h" -exec sed -i "" -e "s/include <inttypes\.h>/include <sys\/types\.h>/g" {} \;
local OPENSSLCONF_PATH="${SCRIPT_DIR}/../watchsimulator/include/${FWNAME}/opensslconf.h"
echo "#if defined(__APPLE__) && defined (__x86_64__)" >> ${OPENSSLCONF_PATH}
cat ${TMP_BUILD_DIR}/${OPENSSL_VERSION}-WatchSimulator-x86_64/include/openssl/opensslconf.h >> ${OPENSSLCONF_PATH}
echo "#elif defined(__APPLE__) && defined (__arm64__)" >> ${OPENSSLCONF_PATH}
cat ${TMP_BUILD_DIR}/${OPENSSL_VERSION}-WatchSimulator-arm64/include/openssl/opensslconf.h >> ${OPENSSLCONF_PATH}
echo "#endif" >> ${OPENSSLCONF_PATH}
OPENSSLCONF_PATH="${SCRIPT_DIR}/../watchos/include/${FWNAME}/opensslconf.h"
echo "#if defined(__APPLE__) && defined (__x86_64__)" >> ${OPENSSLCONF_PATH}
echo "#elif defined(__APPLE__) && defined (__arm64__)" >> ${OPENSSLCONF_PATH}
cat ${TMP_BUILD_DIR}/${OPENSSL_VERSION}-WatchOS-arm64/include/openssl/opensslconf.h >> ${OPENSSLCONF_PATH}
echo "#endif" >> ${OPENSSLCONF_PATH}
# Update include "openssl/" to "OpenSSL/"
grep -rl '#\s*include\s*<openssl' --include \*.h ${SCRIPT_DIR}/../watchos/include | xargs -I@ sed -i '' -e 's/#[[:space:]]*include[[:space:]]*<openssl/#include <OpenSSL/gi' @
grep -rl '#\s*include\s*<openssl' --include \*.h ${SCRIPT_DIR}/../watchsimulator/include | xargs -I@ sed -i '' -e 's/#[[:space:]]*include[[:space:]]*<openssl/#include <OpenSSL/gi' @
rm -rf ${TMP_BUILD_DIR}
}
# watchOS
DERIVED_DATA_PATH=$( mktemp -d )
xcrun xcodebuild build \
$COMMON_SETUP \
-scheme "${FWNAME} (watchOS)" \
-derivedDataPath "${DERIVED_DATA_PATH}" \
-destination 'generic/platform=watchOS'
rm -rf "${OUTPUT_DIR}/watchos"
mkdir -p "${OUTPUT_DIR}/watchos"
ditto "${DERIVED_DATA_PATH}/Build/Products/Release-watchos/${FWNAME}.framework" "${OUTPUT_DIR}/watchos/${FWNAME}.framework"
rm -rf "${DERIVED_DATA_PATH}"
# watchOS Simulator
DERIVED_DATA_PATH=$( mktemp -d )
xcrun xcodebuild build \
$COMMON_SETUP \
-scheme "${FWNAME} (watchOS Simulator)" \
-derivedDataPath "${DERIVED_DATA_PATH}" \
-destination 'generic/platform=watchOS Simulator'
rm -rf "${OUTPUT_DIR}/watchsimulator"
mkdir -p "${OUTPUT_DIR}/watchsimulator"
ditto "${DERIVED_DATA_PATH}/Build/Products/Release-watchsimulator/${FWNAME}.framework" "${OUTPUT_DIR}/watchsimulator/${FWNAME}.framework"
rm -rf "${DERIVED_DATA_PATH}"
'watchos-cross-base' => {
template => 1,
cflags => combine('-isysroot $(CROSS_TOP)/SDKs/$(CROSS_SDK) -fno-common',
sub { defined($ENV{'WATCHOS_DEPLOYMENT_VERSION'}) ? '-mwatchos-version-min=$(WATCHOS_DEPLOYMENT_VERSION)' : '-mwatchos-version-min=4.0'; }),
disable => [ 'engine', 'async' ],
defines => [ "HAVE_FORK=0" ]
},
'watchos-sim-cross-base' => {
inherit_from => [ 'watchos-cross-base' ],
template => 1,
cflags => add(sub { defined($ENV{'WATCHOS_DEPLOYMENT_VERSION'}) ? '-mwatchos-simulator-version-min=$(WATCHOS_DEPLOYMENT_VERSION)' : '-mwatchos-simulator-version-min=4.0'; }),
},
'watchos-sim-cross-x86_64' => {
inherit_from => [ 'darwin-common', 'watchos-sim-cross-base' ],
CC => 'xcrun -sdk watchsimulator cc',
cflags => add('-arch x86_64'),
lib_cppflags => add('-DL_ENDIAN'),
bn_ops => 'SIXTY_FOUR_BIT_LONG',
sys_id => 'watchOS',
perlasm_scheme => 'watchos64',
},
'watchos-sim-cross-arm64' => {
inherit_from => [ 'darwin-common', 'watchos-sim-cross-base' ],
CC => 'xcrun -sdk watchsimulator cc',
cflags => add('-arch arm64'),
asm_arch => 'aarch64',
lib_cppflags => add('-DL_ENDIAN'),
bn_ops => 'SIXTY_FOUR_BIT_LONG RC4_CHAR',
perlasm_scheme => 'watchos64',
sys_id => 'watchOS',
},
'watchos-cross-arm64' => {
inherit_from => [ 'darwin-common', 'watchos-cross-base' ],
cflags => add('-arch arm64'),
asm_arch => 'aarch64',
bn_ops => 'SIXTY_FOUR_BIT_LONG RC4_CHAR',
lib_cppflags => add('-DL_ENDIAN'),
perlasm_scheme => 'watchos64',
sys_id => 'watchOS',
},
'watchos-cross-armv7k' => {
inherit_from => [ 'darwin-common', 'watchos-cross-base' ],
cflags => add('-arch armv7k'),
asm_arch => 'arm',
bn_ops => 'BN_LLONG RC4_INT',
lib_cppflags => add('-DL_ENDIAN'),
perlasm_scheme => 'ios32',
sys_id => 'watchOS',
}, we're also having then run |
There's always a way to make a PR. This may be an inspiration how to make it: #205 |
No description provided.
The text was updated successfully, but these errors were encountered: