Git Product home page Git Product logo

Comments (8)

VityaSchel avatar VityaSchel commented on August 27, 2024 1

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

from openssl.

XITRIX avatar XITRIX commented on August 27, 2024 1

I've made it #216

from openssl.

VityaSchel avatar VityaSchel commented on August 27, 2024

why

from openssl.

VityaSchel avatar VityaSchel commented on August 27, 2024

why even visionos but no watchos

from openssl.

VityaSchel avatar VityaSchel commented on August 27, 2024

I'll briefly describe steps for future reference:

  1. add build_watchos function to scripts/build.sh with call in the end of this script
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}
}
  1. add section to scripts/create-frameworks.sh
# 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}"
  1. add configurations to conf/20-apple.conf otherwise you'll get Usage: Configure [no-<cipher> ...] [enable-<cipher> ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [no-hw-xxx|no-hw] [[no-]threads] [[no-]shared] [[no-]zlib|zlib-dynamic] [no-asm] [no-egd] [sctp] [386] [--prefix=DIR] [--openssldir=OPENSSLDIR] [--with-xxx[=vvv]] [--config=FILE] os/compiler[:flags] and pick os/compiler from: and Using os-specific seed configuration
'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 defines => [ "HAVE_FORK=0" ] in base config because watchos does not support fork()

then run make and it should create watchos and watchsimulator directories in repo root, after than figure out on your own how to add these to frameworks in xcode project

from openssl.

krzyzanowskim avatar krzyzanowskim commented on August 27, 2024

There's always a way to make a PR. This may be an inspiration how to make it: #205

from openssl.

VityaSchel avatar VityaSchel commented on August 27, 2024

I've made it #216

yippeee-yippee-gif

from openssl.

krzyzanowskim avatar krzyzanowskim commented on August 27, 2024

thx #216

from openssl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.