Skip to content

Commit

Permalink
chore: add alternative script
Browse files Browse the repository at this point in the history
  • Loading branch information
aeweda committed Nov 20, 2024
1 parent 97e5334 commit df2ab35
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ jobs:

- name: Compile openssl 1.0.2p from source
run: |
chmod +x ./docker/cross-compilation/openssl.sh
sh ./docker/cross-compilation/openssl.sh linux-aarch64 aarch64-linux-gnu-
chmod +x ./docker/cross-compilation/openssl-macos.sh
sh ./docker/cross-compilation/openssl-macos.sh linux-aarch64 aarch64-linux-gnu-
- name: Building Macos Binary
run: MACOSX_DEPLOYMENT_TARGET=10.14 OPENSSL_STATIC=1 OPENSSL_DIR="/openssl" cargo build --release -p witnet -p witnet_toolkit
Expand Down
47 changes: 47 additions & 0 deletions docker/cross-compilation/openssl-macos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Copyright 2016-2019 Jorge Aparicio, Marco A L Barbosa & bgermann.
#
# https://github.com/rust-embedded/cross/blob/master/docker/openssl.sh
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

set -ex

main() {
local version=1.0.2p
local os=$1 \
triple=$2

td=$(mktemp -d)

pushd $td
wget https://www.openssl.org/source/openssl-$version.tar.gz
tar --strip-components=1 -xzvf openssl-$version.tar.gz
AR=${triple}ar CC=${triple}gcc ./Configure \
--prefix=/openssl \
no-dso \
$os \
-fPIC \
${@:3}
nice make -j$(nproc)
make install

# clean up
apt-get purge --auto-remove -y ${purge_list[@]}

popd

rm -rf $td
rm $0
}

main "${@}"

0 comments on commit df2ab35

Please sign in to comment.