meson: Make gzip and tar optional
authorPeter Eisentraut <[email protected]>
Thu, 21 Dec 2023 07:40:32 +0000 (08:40 +0100)
committerPeter Eisentraut <[email protected]>
Thu, 21 Dec 2023 09:10:06 +0000 (10:10 +0100)
They are only used for some tests.  The tests are already set to skip
as appropriate if they are not available.

Discussion: https://www.postgresql.org/message-id/flat/ZQzp_VMJcerM1Cs_%40paquier.xyz

contrib/basebackup_to_shell/meson.build
meson.build
src/bin/pg_basebackup/meson.build
src/bin/pg_dump/meson.build
src/bin/pg_verifybackup/meson.build

index a5488c30239f644ed4db13afd0afc1636b434888..331ee1c9be2261e2e0cd4f5ec8404e4e8b6546ca 100644 (file)
@@ -24,7 +24,7 @@ tests += {
     'tests': [
       't/001_basic.pl',
     ],
-    'env': {'GZIP_PROGRAM': gzip.path(),
-            'TAR': tar.path()},
+    'env': {'GZIP_PROGRAM': gzip.found() ? gzip.path() : '',
+            'TAR': tar.found() ? tar.path() : '' },
   },
 }
index 3162d0343bd0a44f6c16c1ded7cefe09f3182612..4e98cbefe4ec76dd927f30468b82895ddfdfe3d5 100644 (file)
@@ -333,8 +333,8 @@ flex = find_program(get_option('FLEX'), native: true, version: '>= 2.5.35')
 bison = find_program(get_option('BISON'), native: true, version: '>= 2.3')
 sed = find_program(get_option('SED'), 'sed', native: true, required: false)
 prove = find_program(get_option('PROVE'), native: true, required: false)
-tar = find_program(get_option('TAR'), native: true)
-gzip = find_program(get_option('GZIP'), native: true)
+tar = find_program(get_option('TAR'), native: true, required: false)
+gzip = find_program(get_option('GZIP'), native: true, required: false)
 program_lz4 = find_program(get_option('LZ4'), native: true, required: false)
 openssl = find_program(get_option('OPENSSL'), native: true, required: false)
 program_zstd = find_program(get_option('ZSTD'), native: true, required: false)
index c426173db3a0f499785cb5c92d246b182ec60925..5445903a5bc3e8c9adbd1810f8a85b35d5970190 100644 (file)
@@ -80,8 +80,8 @@ tests += {
   'sd': meson.current_source_dir(),
   'bd': meson.current_build_dir(),
   'tap': {
-    'env': {'GZIP_PROGRAM': gzip.path(),
-            'TAR': tar.path(),
+    'env': {'GZIP_PROGRAM': gzip.found() ? gzip.path() : '',
+            'TAR': tar.found() ? tar.path() : '',
             'LZ4': program_lz4.found() ? program_lz4.path() : '',
     },
     'tests': [
index b6603e26a501b48e4a6ec0432d6ecb9a4c1520bb..77d162cad485a44963b427cb8c21b1cdd28a35ce 100644 (file)
@@ -90,7 +90,7 @@ tests += {
   'bd': meson.current_build_dir(),
   'tap': {
     'env': {
-      'GZIP_PROGRAM': gzip.path(),
+      'GZIP_PROGRAM': gzip.found() ? gzip.path() : '',
       'LZ4': program_lz4.found() ? program_lz4.path() : '',
       'ZSTD': program_zstd.found() ? program_zstd.path() : '',
       'with_icu': icu.found() ? 'yes' : 'no',
index 58f780d1a63ac7b1166aa74e216b8283370e7c77..8049011566edc263e532ace90249ac88992d6b9f 100644 (file)
@@ -22,8 +22,8 @@ tests += {
   'sd': meson.current_source_dir(),
   'bd': meson.current_build_dir(),
   'tap': {
-    'env': {'GZIP_PROGRAM': gzip.path(),
-            'TAR': tar.path(),
+    'env': {'GZIP_PROGRAM': gzip.found() ? gzip.path() : '',
+            'TAR': tar.found() ? tar.path() : '',
             'LZ4': program_lz4.found() ? program_lz4.path() : '',
             'ZSTD': program_zstd.found() ? program_zstd.path() : ''},
     'tests': [