Skip to content

Commit

Permalink
Merge pull request #45 from daxcore/feature/openSSL
Browse files Browse the repository at this point in the history
  • Loading branch information
jkloetzke authored Jan 21, 2021
2 parents b9874d0 + bd42c25 commit f4a53e1
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 8 deletions.
61 changes: 55 additions & 6 deletions recipes/libs/openssl.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
inherit: [make, install]

metaEnvironment:
PKG_VERSION: "1.1.1d"
PKG_VERSION: "1.1.1i"

depends:
- libs::zlib-dev
Expand All @@ -13,25 +13,70 @@ depends:
checkoutSCM:
scm: url
url: https://www.openssl.org/source/openssl-${PKG_VERSION}.tar.gz
digestSHA256: 1e3a91bc1f9dfce01af26026f856e064eab4c8ee0a8f457b5ae30b40b8b711f2
digestSHA256: e8be6a35fe41d10603c3cc635e93289ed00bf34b79671a3a4de64fcee00d5242
extract: False

buildTools: [target-toolchain]
buildVars: [PKG_VERSION, CC, AR, RANLIB, ARCH, AUTOCONF_BUILD, AUTOCONF_HOST]
buildVars: [PKG_VERSION, CC, AR, RANLIB, ARCH, AUTOCONF_BUILD, AUTOCONF_HOST, BASEMENT_LIBS]
buildScript: |
export TARGETMACH=${AUTOCONF_HOST}
export LDFLAGS="-Wl,-rpath-link=${BOB_DEP_PATHS[libs::zlib-dev]}/usr/lib"
mkdir -p install
tar -xzf $1/openssl-${PKG_VERSION}.tar.gz
pushd openssl-${PKG_VERSION}
SHARED_ONLY="false"
if [[ -n "${BASEMENT_LIBS:-}" ]] ; then
case "$BASEMENT_LIBS" in
static)
SHARED_STATIC=( "-static" "zlib" )
;;
shared)
SHARED_STATIC=( "shared" "zlib-dynamic" )
SHARED_ONLY="true"
;;
both)
SHARED_STATIC=( "shared" "zlib-dynamic" )
;;
*)
echo "Invalid BASEMENT_LIBS value: $BASEMENT_LIBS" >&2
exit 1
;;
esac
elif [[ "${AUTOCONF_BUILD:-unknown}" == "${AUTOCONF_HOST:-${AUTOCONF_BUILD:-unknown}}" ]]; then
SHARED_STATIC=( "-static" "zlib" )
else
SHARED_STATIC=( "shared" "zlib-dynamic" )
SHARED_ONLY="true"
fi
# refer: https://github.com/openssl/openssl/blob/master/Configurations/10-main.conf
case "$ARCH" in
arm)
ARCH="armv4"
;;
arm64)
ARCH="aarch64"
;;
i386)
ARCH="x86"
;;
x86_64)
;;
*)
echo "Architecture $ARCH currently not supported." >&2
exit 1
;;
esac
./Configure \
--prefix=/usr \
--openssldir=/etc/ssl \
--libdir=lib \
shared \
zlib-dynamic \
"${SHARED_STATIC[@]}" \
"-I${BOB_DEP_PATHS[libs::zlib-dev]}/usr/include" \
"-Wl,-L${BOB_DEP_PATHS[libs::zlib-dev]}/usr/lib" \
"-Wl,-rpath-link=${BOB_DEP_PATHS[libs::zlib-dev]}/usr/lib" \
linux-${ARCH}
#make depend
Expand All @@ -40,6 +85,10 @@ buildScript: |
popd
if [[ "$SHARED_ONLY" == "true" ]] ; then
find install -iname "*.a" -exec rm -rf {} \;
fi
multiPackage:
dev:
packageScript: installPackageDev "$1/install/"
Expand Down
26 changes: 24 additions & 2 deletions recipes/libs/zlib.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ checkoutSCM:
extract: False

buildTools: [target-toolchain]
buildVars: [CROSS_COMPILE, AUTOCONF_BUILD, AUTOCONF_HOST, CFLAGS, LDFLAGS]
buildVars: [CROSS_COMPILE, AUTOCONF_BUILD, AUTOCONF_HOST, CFLAGS, LDFLAGS, BASEMENT_LIBS]
buildScript: |
# zlib uses CROSS_PREFIX instead of CROSS_COMPILE
if [[ ${CROSS_COMPILE:+true} ]] ; then
Expand All @@ -24,8 +24,26 @@ buildScript: |
)
# compile static on native builds
if [[ ${AUTOCONF_BUILD} == ${AUTOCONF_HOST:-${AUTOCONF_BUILD}} ]] ; then
SHARED_ONLY="false"
if [[ -n "${BASEMENT_LIBS:-}" ]] ; then
case "$BASEMENT_LIBS" in
static)
CONFIGURE_OPTS+=( --static )
;;
shared)
SHARED_ONLY="true"
;;
both)
;;
*)
echo "Invalid BASEMENT_LIBS value: $BASEMENT_LIBS" >&2
exit 1
;;
esac
elif [[ "${AUTOCONF_BUILD:-unknown}" == "${AUTOCONF_HOST:-${AUTOCONF_BUILD:-unknown}}" ]]; then
CONFIGURE_OPTS+=( --static )
else
SHARED_ONLY="true"
fi
mkdir -p install
Expand All @@ -35,6 +53,10 @@ buildScript: |
make install DESTDIR=${PWD}/../install
popd
if [[ "$SHARED_ONLY" == "true" ]] ; then
find install -iname "*.a" -exec rm -rf {} \;
fi
multiPackage:
dev:
packageScript: installPackageDev "$1/install/"
Expand Down

0 comments on commit f4a53e1

Please sign in to comment.