[gimp] pdb: fix previous commit to work with old and new meson (+ typo fix).



commit d4df5d0fc7309a495d019ca60d8e350f18ff1a9e
Author: Jehan <jehan girinstud io>
Date:   Sun Nov 14 12:49:30 2021 +0100

    pdb: fix previous commit to work with old and new meson (+ typo fix).
    
    The `env` option is new (from meson 0.57.0), yet we depend on meson
    0.50.0 and bumping the meson requirement is not a possibility (we have
    bad experience when we did this for babl).
    
    Instead, implement the new option usage and a workaround which would
    work also with older meson.
    
    I could have implemented only the workaround, but it's also nice to
    write down the better syntax so that when we actually bump meson
    requirement, getting rid of the workaround will just be a matter of
    hitting delete and done. Though it also means we must keep both if/else
    blocks in sync, so it has its drawbacks.
    See the discussion in !506.

 pdb/meson.build | 133 +++++++++++++++++++++++++++++++++++++-------------------
 1 file changed, 89 insertions(+), 44 deletions(-)
---
diff --git a/pdb/meson.build b/pdb/meson.build
index 8c95ed95d7..9ed44cb901 100644
--- a/pdb/meson.build
+++ b/pdb/meson.build
@@ -106,47 +106,92 @@ groups_pl = custom_target('groups.pl',
   capture: true,
 )
 
-enums_pl = custom_target('enums.pl',
-  input : [ 'enumgen.pl', 'enums-external.pl', enum_headers, ],
-  output: [ 'enums.pl', ],
-  evn: perl_env,
-  command: [
-    perl, '@INPUT0@',
-    enum_headers,
-  ],
-)
-
-
-## TODO remove that ?
-
-pdbgen = custom_target('stamp-pdbgen',
-  input : [
-    files(
-      'pdbgen.pl',
-
-      'app.pl',
-      'lib.pl',
-      'pdb.pl',
-      'stddefs.pdb',
-      'util.pl',
-    ),
-    enums_pl,
-    groups_pl,
-    pdb_sources,
-  ],
-  output: [ 'stamp-pdbgen', ],
-  env: perl_env,
-  command: [
-    perl, '@INPUT0@',
-    'app', 'lib',
-  ],
-)
-
-stamp_enumcode = custom_target('stamp-enum-code',
-  input : [ 'enumcode.pl', ],
-  output: [ 'stamp-enum-code', ],
-  env: perl_env,
-  command: [
-    perl, '@INPUT0@',
-  ],
-)
+if meson.version().version_compare('>=0.57.0')
+  enums_pl = custom_target('enums.pl',
+    input : [ 'enumgen.pl', 'enums-external.pl', enum_headers, ],
+    output: [ 'enums.pl', ],
+    env: perl_env,
+    command: [
+      perl, '@INPUT0@',
+      enum_headers,
+    ],
+  )
+
+  ## TODO remove that ?
+
+  pdbgen = custom_target('stamp-pdbgen',
+    input : [
+      files(
+        'pdbgen.pl',
+
+        'app.pl',
+        'lib.pl',
+        'pdb.pl',
+        'stddefs.pdb',
+        'util.pl',
+      ),
+      enums_pl,
+      groups_pl,
+      pdb_sources,
+    ],
+    output: [ 'stamp-pdbgen', ],
+    env: perl_env,
+    command: [
+      perl, '@INPUT0@',
+      'app', 'lib',
+    ],
+  )
+
+  stamp_enumcode = custom_target('stamp-enum-code',
+    input : [ 'enumcode.pl', ],
+    output: [ 'stamp-enum-code', ],
+    env: perl_env,
+    command: [
+      perl, '@INPUT0@',
+    ],
+  )
+else
+  # TODO: remove this workaround when we bump meson requirement to >= 0.57.0
+  # See MR !506.
+  # In the meantime, make sure the 2 if/else blocks are well synced.
+  env = find_program('env')
+
+  enums_pl = custom_target('enums.pl',
+    input : [ 'enumgen.pl', 'enums-external.pl', enum_headers, ],
+    output: [ 'enums.pl', ],
+    command: [
+      env, perl_env, perl, '@INPUT0@',
+      enum_headers,
+    ],
+  )
+
+  pdbgen = custom_target('stamp-pdbgen',
+    input : [
+      files(
+        'pdbgen.pl',
+
+        'app.pl',
+        'lib.pl',
+        'pdb.pl',
+        'stddefs.pdb',
+        'util.pl',
+      ),
+      enums_pl,
+      groups_pl,
+      pdb_sources,
+    ],
+    output: [ 'stamp-pdbgen', ],
+    command: [
+      env, perl_env, perl, '@INPUT0@',
+      'app', 'lib',
+    ],
+  )
+
+  stamp_enumcode = custom_target('stamp-enum-code',
+    input : [ 'enumcode.pl', ],
+    output: [ 'stamp-enum-code', ],
+    command: [
+      env, perl_env, perl, '@INPUT0@',
+    ],
+  )
+endif


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]