Skip to content

Commit

Permalink
Generate OpenSSL configs on the fly if they are not present, making `…
Browse files Browse the repository at this point in the history
…meson setup` "just work"
  • Loading branch information
nazar-pc committed Aug 11, 2021
1 parent 16c267f commit d7ead00
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
6 changes: 5 additions & 1 deletion subprojects/packagefiles/openssl/generator.sh
Expand Up @@ -5,7 +5,11 @@ cd "$(dirname "${BASH_SOURCE[0]}")"

# Node.js version should bundle OpenSSL of matching version to one specified in wrap file
node_version=v16.5.0
openssl_version=$(grep 'directory = ' ../../openssl.wrap | grep -oE '[0-9]+\.[0-9]+\.[0-9]+[a-z]')
openssl_version="$OPENSSL_VERSION"

if [ -z "$openssl_version" ]; then
openssl_version=$(grep 'directory = ' ../../openssl.wrap | grep -oE '[0-9]+\.[0-9]+\.[0-9]+[a-z]')
fi

rm -rf node
git clone --depth 1 --branch $node_version https://github.com/nodejs/node.git
Expand Down
11 changes: 11 additions & 0 deletions subprojects/packagefiles/openssl/meson.build
Expand Up @@ -10,6 +10,17 @@ project(
],
)

# Make sure to generate configs in case they are not already
fs = import('fs')
if not fs.exists('generated-config')
message("Generating OpenSSL configs...")
run_command(
'generator.sh',
check: true,
env: ['OPENSSL_VERSION=' + meson.project_version()],
)
endif

include_directories = [
'include',
'crypto',
Expand Down
4 changes: 0 additions & 4 deletions tools/sanity_checks.py
Expand Up @@ -95,10 +95,6 @@ def test_releases(self):
self.assertTrue(Path(patch_path, 'LICENSE.build').is_file())
self.check_files(name, patch_path)

generator = Path(patch_path, 'generator.sh')
if generator.exists():
subprocess.check_call([generator])

# Make sure it has the same deps/progs provided
progs = []
deps = []
Expand Down

0 comments on commit d7ead00

Please sign in to comment.