commit:     a47be33c8409b81e5116794952bf194d5710d15b
Author:     Tony Lee <rufq99 <AT> gmail <DOT> com>
AuthorDate: Fri Nov 19 10:57:47 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Mar 26 22:38:27 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a47be33c

gstreamer-meson.eclass: fix symlink issue for WORKDIR

Fixes symlink issue with a variety of gstreamer plugin packages.

Bug: https://bugs.gentoo.org/820416
Bug: https://bugs.gentoo.org/816702
Closes: https://bugs.gentoo.org/805020
Closes: https://github.com/gentoo/gentoo/pull/22967
Signed-off-by: Sam James <sam <AT> gentoo.org>

 eclass/gstreamer-meson.eclass | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/eclass/gstreamer-meson.eclass b/eclass/gstreamer-meson.eclass
index 490e71e9b97b..bae35c7edcea 100644
--- a/eclass/gstreamer-meson.eclass
+++ b/eclass/gstreamer-meson.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: gstreamer-meson.eclass
@@ -383,12 +383,20 @@ gstreamer_multilib_src_compile() {
        if [[ "${PN}" == "${GST_ORG_MODULE}" ]]; then
                eninja
        else
-               local plugin_dir plugin
+               local plugin_dir plugin build_dir
 
                for plugin_dir in ${GST_PLUGINS_BUILD_DIR} ; do
                        plugin=$(_gstreamer_get_target_filename 
$(gstreamer_get_plugin_dir ${plugin_dir}))
+                       # Read full link of build directory. Outputs symlink's 
true link.
+                       # We want to get the full file path so it can be 
removed later.
+                       # Working around ninja issues w/ symlinks (e.g. 
PORTAGE_TMPDIR as a symlink)
+
+                       # https://github.com/ninja-build/ninja/issues/1251
+                       # https://github.com/ninja-build/ninja/issues/1330
+                       build_dir=$(readlink -f ${BUILD_DIR})
+
                        plugin_path="${plugin%%:*}"
-                       eninja "${plugin_path/"${BUILD_DIR}/"}"
+                       eninja "${plugin_path/"${build_dir}/"/}"
                done
        fi
 }

Reply via email to