From 975c1891ae516cfadd83ddb8301eee08c14b6d8f Mon Sep 17 00:00:00 2001 From: Bruno Lopes Date: Thu, 14 Mar 2024 20:12:47 -0300 Subject: [PATCH] data: Generate .env files at build time These files has been generated by the installer scripts for historical reasons. Now that we have full-blown local builds and the upcoming MS Store version, this pervasive pratice can't continue since it creates disparity between builds. --- data/environ/{default.env => default.env.in} | 2 ++ data/environ/meson.build | 31 ++++++++++++++++++-- data/environ/pygimp.env | 1 + 3 files changed, 31 insertions(+), 3 deletions(-) rename data/environ/{default.env => default.env.in} (85%) create mode 100644 data/environ/pygimp.env diff --git a/data/environ/default.env b/data/environ/default.env.in similarity index 85% rename from data/environ/default.env rename to data/environ/default.env.in index 6b8a67ea8b..4277fb6178 100644 --- a/data/environ/default.env +++ b/data/environ/default.env.in @@ -1,2 +1,4 @@ # Example entry in files like these # FOOPATH=/path/to/foo/stuff + +@BIN_PATH@ \ No newline at end of file diff --git a/data/environ/meson.build b/data/environ/meson.build index 9829cb3e1e..61f31d3bd0 100644 --- a/data/environ/meson.build +++ b/data/environ/meson.build @@ -1,5 +1,30 @@ -install_data( - 'default.env', - 'python.env', +environ_config = configuration_data() + +if platform_windows + environ_config.set('BIN_PATH', 'PATH=${gimp_installation_dir}\\bin') +else + environ_config.set('BIN_PATH', '') +endif + +configure_file( + input : 'default.env.in', + output: 'default.env', + configuration: environ_config, + install: true, install_dir: gimpplugindir / 'environ', ) + + +if not meson.is_cross_build() and python.found() + install_data( + 'python.env', + install_dir: gimpplugindir / 'environ', + ) +endif + +if platform_windows and not meson.is_cross_build() and python.found() + install_data( + 'pygimp.env', + install_dir: gimpplugindir / 'environ', + ) +endif \ No newline at end of file diff --git a/data/environ/pygimp.env b/data/environ/pygimp.env new file mode 100644 index 0000000000..e8bd2353fa --- /dev/null +++ b/data/environ/pygimp.env @@ -0,0 +1 @@ +__COMPAT_LAYER=HIGHDPIAWARE