From 38b371a3510a2f4cc59fd0636f29defddb2c8edd Mon Sep 17 00:00:00 2001 From: Nicolas Vigier Date: Wed, 25 Jan 2023 18:21:54 +0100 Subject: [PATCH] Bug 40755: Use openssl-1.0.2 for building libdmg-hfsplus outside containers libdmg-hfsplus fails to build with openssl1.1: https://github.com/planetbeing/libdmg-hfsplus/issues/14 --- projects/libdmg-hfsplus/build | 5 ++++- projects/libdmg-hfsplus/config | 9 +++++++++ projects/openssl-1.0.2/build | 15 +++++++++++++++ projects/openssl-1.0.2/config | 11 +++++++++++ tools/signing/gatekeeper-bundling.sh | 2 +- 5 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 projects/openssl-1.0.2/build create mode 100644 projects/openssl-1.0.2/config diff --git a/projects/libdmg-hfsplus/build b/projects/libdmg-hfsplus/build index e2527c7c..736986b4 100644 --- a/projects/libdmg-hfsplus/build +++ b/projects/libdmg-hfsplus/build @@ -4,13 +4,16 @@ distdir=/var/tmp/dist/[% project %] mkdir -p /var/tmp/dist tar -C /var/tmp/dist -xf [% c('input_files_by_name/cmake') %] tar -C /var/tmp/dist -xf [% c('input_files_by_name/ninja') %] +[% IF c("container/global_disable") -%] + tar -C /var/tmp/dist -xf [% c('input_files_by_name/openssl-1.0.2') %] +[% END -%] export PATH="/var/tmp/dist/ninja:/var/tmp/dist/cmake/bin:$PATH" mkdir /var/tmp/build tar -C /var/tmp/build -xf [% project %]-[% c('version') %].tar.gz cd /var/tmp/build/[% project %]-[% c('version') %] patch -p1 < "$rootdir/libdmg.patch" -cmake . -GNinja -DCMAKE_BUILD_TYPE=Release +cmake . -GNinja -DCMAKE_BUILD_TYPE=Release [% c("var/cmake_opts") %] ninja -j[% c("num_procs") %] -v mkdir $distdir diff --git a/projects/libdmg-hfsplus/config b/projects/libdmg-hfsplus/config index cd178052..e8d98c52 100644 --- a/projects/libdmg-hfsplus/config +++ b/projects/libdmg-hfsplus/config @@ -10,6 +10,12 @@ var: - build-essential - zlib1g-dev - libbz2-dev +targets: + no_containers: + var: + cmake_opts: | + -DOPENSSL_USE_STATIC_LIBS=1 \ + -DOPENSSL_ROOT_DIR=/var/tmp/dist/openssl input_files: - project: container-image - name: cmake @@ -17,3 +23,6 @@ input_files: - name: ninja project: ninja - filename: libdmg.patch + - name: openssl-1.0.2 + project: openssl-1.0.2 + enable: '[% c("container/global_disable") %]' diff --git a/projects/openssl-1.0.2/build b/projects/openssl-1.0.2/build new file mode 100644 index 00000000..97e89433 --- /dev/null +++ b/projects/openssl-1.0.2/build @@ -0,0 +1,15 @@ +#!/bin/bash +[% c("var/set_default_env") -%] +distdir=/var/tmp/dist/openssl +mkdir -p /var/tmp/build +tar -C /var/tmp/build -xf openssl-[% c('version') %].tar.gz +cd /var/tmp/build/openssl-[% c('version') %] +export SOURCE_DATE_EPOCH='[% c("timestamp") %]' +./Configure --prefix="$distdir" -shared enable-ec_nistp_64_gcc_128 linux-x86_64 +make -j[% c("num_procs") %] +make -j[% c("num_procs") %] install +cd /var/tmp/dist +[% c('tar', { + tar_src => [ 'openssl' ], + tar_args => '-czf ' _ dest_dir _ '/' _ c('filename'), + }) %] diff --git a/projects/openssl-1.0.2/config b/projects/openssl-1.0.2/config new file mode 100644 index 00000000..eda9a2ff --- /dev/null +++ b/projects/openssl-1.0.2/config @@ -0,0 +1,11 @@ +# vim: filetype=yaml sw=2 +# +# We need openssl-1.0.2 for building libdmg-hfsplus: +# https://github.com/planetbeing/libdmg-hfsplus/issues/14 +# +version: 1.0.2u +filename: '[% project %]-[% c("version") %]-[% c("var/build_id") %].tar.gz' + +input_files: + - URL: 'https://www.openssl.org/source/openssl-[% c("version") %].tar.gz' + sha256sum: ecd0c6ffb493dd06707d38b14bb4d8c2288bb7033735606569d8f90f89669d16 diff --git a/tools/signing/gatekeeper-bundling.sh b/tools/signing/gatekeeper-bundling.sh index 041dd242..c0e72c1d 100755 --- a/tools/signing/gatekeeper-bundling.sh +++ b/tools/signing/gatekeeper-bundling.sh @@ -39,7 +39,7 @@ test -f $faketime_path || \ exit_error "$faketime_path is missing" test -d $macos_stapled_dir || \ exit_error "The stapled macos zip files should be placed in directory $macos_stapled_dir" -libdmg_file="$script_dir/../../out/libdmg-hfsplus/libdmg-hfsplus-2ee327795680-aa3810.tar.gz" +libdmg_file="$script_dir/../../out/libdmg-hfsplus/libdmg-hfsplus-2ee327795680-555a7e.tar.gz" test -f "$libdmg_file" || \ exit_error "$libdmg_file is missing." \ "You can build it with:" \