Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 50 additions & 16 deletions recipes/libs/openssl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ inherit: [cpackage, make, install, patch]

metaEnvironment:
PKG_LICENSE: "Apache-2.0"
PKG_VERSION: "3.3.1"
PKG_VERSION: "3.5.4"

depends:
- libs::zlib-dev
Expand All @@ -14,33 +14,48 @@ depends:
checkoutSCM:
scm: url
url: https://www.openssl.org/source/openssl-${PKG_VERSION}.tar.gz
digestSHA256: 777cd596284c883375a2a7a11bf5d2786fc5413255efab20c50d6ffe6d020b7e
digestSHA256: 967311f84955316969bdb1d8d4b983718ef42338639c621ec4c34fddef355e99
stripComponents: 1

checkoutDeterministic: True
checkoutScript: |
patchApplySeries $<@openssl/*.patch@>

Config:
OPENSSL_ADDITIONAL_OPTIONS:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it make sense to name the algorithms explicitly like buildroot does? This catch-all variable seems a bit coarse grained. Even if not done now, would it be a problem on your side if we go in this direction?

help: additional configure options
OPENSSL_LINK_MODE:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea for such things was to set BASEMENT_LIBS to shared when declaring the dependency:

depends:
    - name: libs::openssl
      environment:
          BASEMENT_LIBS: shared

This will override the heuristic for cpackageLibraryType. Of course, this will apply for the dependencies as well.

Actually, I think our openssl recipe is wrong and should pass no-dso in case of static linking. At least buildroot does that and it looks correct to me. Would you mind fixing that with a separate commit while you're at it?

help: overrides the automatically determined link mode
type: choice
choice:
"-static":
"shared":

buildTools: [target-toolchain]
buildToolsWeak: [perl]
buildVars: [CC, AR, RANLIB, ARCH, AUTOCONF_HOST]
buildVars: [CC, AR, RANLIB, ARCH, AUTOCONF_HOST, OPENSSL_ADDITIONAL_OPTIONS,
OPENSSL_LINK_MODE]
buildScript: |
mkdir -p install build
pushd build

SHARED_ONLY="false"
case $(cpackageLibraryType) in
static)
SHARED_STATIC=( "-static" "zlib" )
;;
shared)
SHARED_STATIC=( "shared" "zlib" )
SHARED_ONLY="true"
;;
both)
SHARED_STATIC=( "shared" "zlib" )
;;
esac
if [ ! -z "${OPENSSL_LINK_MODE:-}" ]; then
SHARED_STATIC=("${OPENSSL_LINK_MODE}" "zlib")
else
case $(cpackageLibraryType) in
static)
SHARED_STATIC=( "-static" "zlib" )
;;
shared)
SHARED_STATIC=( "shared" "zlib" )
SHARED_ONLY="true"
;;
both)
SHARED_STATIC=( "shared" "zlib" )
;;
esac
fi

# refer: https://github.com/openssl/openssl/blob/master/Configurations/10-main.conf
case "$ARCH" in
Expand Down Expand Up @@ -80,6 +95,7 @@ buildScript: |
--libdir=lib \
"${SHARED_STATIC[@]}" \
"threads" \
${OPENSSL_ADDITIONAL_OPTIONS:-} \
"-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" \
Expand All @@ -105,10 +121,24 @@ multiPackage:
provideTools:
openssl: "usr/bin"

# using openssl plugins within the host-tool requires a shared variant
pluginable:
environment:
OPENSSL_LINK_MODE: "shared"
packageScript: |
installPackageTgt "$1/install/"
provideTools:
openssl:
path: "usr/bin"
libs: [ "usr/lib", "usr/lib/engines" ]

dev:
# Static library builds need to explicitly link with libz but the
# pkgconfig file is not referenced. Fix that up.
packageScript: |
if [[ ${OPENSSL_LINK_MODE:-} == *"shared"* ]]; then
INSTALL_SHARED="true"
fi
installPackageDev "$1/install/"
sed -i -e '/^Libs:.*-lz/{
s/-lz//
Expand All @@ -117,5 +147,9 @@ multiPackage:
provideDeps: [ "*-dev" ]

tgt:
packageScript: installPackageLib "$1/install/"
packageScript: |
if [[ ${OPENSSL_LINK_MODE:-} == *"shared"* ]]; then
INSTALL_SHARED="true"
fi
installPackageLib "$1/install/"
provideDeps: [ "*-tgt" ]

This file was deleted.

64 changes: 0 additions & 64 deletions recipes/libs/openssl/0003-Fix-cmake-generator.patch

This file was deleted.

This file was deleted.

Loading