]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
build: Add wrapdb support for OpenSSL
authorDaniel Wagner <dwagner@suse.de>
Wed, 15 Dec 2021 12:18:06 +0000 (13:18 +0100)
committerDaniel Wagner <dwagner@suse.de>
Thu, 16 Dec 2021 08:17:22 +0000 (09:17 +0100)
The meson wrapdb library has support for OpenSSL. Introduce a combo
option for full control if the user wants OpenSSL added to nvme-cli or
not. Only if the option is set to 'true' the fallback will be
considered when there is no system version of OpenSSL available.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
meson.build
meson_options.txt
subprojects/openssl.wrap [new file with mode: 0644]

index 7907206515986d4b3a74ca33ea21a3ca703a602d..951d9cce4a6eae4236d8c3167d83fe549bade1aa 100644 (file)
@@ -49,9 +49,18 @@ conf.set('LIBHUGETLBFS', libhugetlbfs.found(), description: 'Is libhugetlbfs req
 # Check for zlib availability
 libz_dep = dependency('zlib', required: true)
 
-# Check for open-ssl availability
-libopenssl = dependency('openssl', version: '>=1.1.0', required: false)
-conf.set('OPENSSL', libopenssl.found(), description: 'Is open-ssl required?')
+# Check for OpenSSL availability
+want_openssl = get_option('openssl')
+if want_openssl != 'false'
+  openssl_dep = dependency('openssl', version: '>=1.1.0',
+                           required: want_openssl == 'true',
+                           fallback : ['openssl', 'openssl_dep'])
+  have_openssl = openssl_dep.found()
+else
+  openssl_dep = []
+  have_openssl = false
+endif
+conf.set('OPENSSL', have_openssl, description: 'Is OpenSSL required?')
 
 # Set the nvme-cli version
 conf.set('NVME_VERSION', '"' + meson.project_version() + '"')
@@ -184,7 +193,7 @@ subdir('Documentation')
 executable(
   'nvme',
   sources,
-  dependencies: [ libnvme_dep, libuuid, json_c, libz_dep, libopenssl ],
+  dependencies: [ libnvme_dep, libuuid, json_c, libz_dep, openssl_dep ],
   include_directories: incdir,
   install: true,
   install_dir: get_option('sbindir')
index 6fdc681792ffedce66d7216e657c0a4d773b8bc0..da97b8144d79ce42ac26bdd8c1cfbb65499ff802 100644 (file)
@@ -4,3 +4,4 @@ option('systemddir', type : 'string', value : 'lib/systemd/', description : 'dir
 option('htmldir', type : 'string', value : '', description : 'directory for HTML documentation')
 
 option('docs', type : 'combo', choices : ['false', 'html', 'man', 'all'], description : 'install documentation')
+option('openssl', type : 'combo', choices : ['auto', 'true', 'false'], description : 'OpenSSL support')
diff --git a/subprojects/openssl.wrap b/subprojects/openssl.wrap
new file mode 100644 (file)
index 0000000..c4c1412
--- /dev/null
@@ -0,0 +1,14 @@
+[wrap-file]
+directory = openssl-1.1.1l
+source_url = https://www.openssl.org/source/openssl-1.1.1l.tar.gz
+source_filename = openssl-1.1.1l.tar.gz
+source_hash = 0b7a3e5e59c34827fe0c3a74b7ec8baef302b98fa80088d7f9153aa16fa76bd1
+patch_filename = openssl_1.1.1l-2_patch.zip
+patch_url = https://wrapdb.mesonbuild.com/v2/openssl_1.1.1l-2/get_patch
+patch_hash = 852521fb016fa2deee8ebf9ffeeee0292c6de86a03c775cf72ac04e86f9f177e
+
+[provide]
+libcrypto = libcrypto_dep
+libssl = libssl_dep
+openssl = openssl_dep
+