diff options
| -rw-r--r-- | classes/rubyv2.bbclass | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/classes/rubyv2.bbclass b/classes/rubyv2.bbclass index 1dfb047..12720c9 100644 --- a/classes/rubyv2.bbclass +++ b/classes/rubyv2.bbclass | |||
| @@ -99,7 +99,7 @@ do_gem_unpack() { | |||
| 99 | gem unpack -V ${GEM_FILE} | 99 | gem unpack -V ${GEM_FILE} |
| 100 | } | 100 | } |
| 101 | 101 | ||
| 102 | DEPENDS:append = " ruby-native ${EXTRA_DEPENDS}" | 102 | DEPENDS:append = " ruby-native chrpath-native ${EXTRA_DEPENDS}" |
| 103 | DEPENDS:append:class-target = " ruby ruby-native ${EXTRA_DEPENDS}" | 103 | DEPENDS:append:class-target = " ruby ruby-native ${EXTRA_DEPENDS}" |
| 104 | 104 | ||
| 105 | python () { | 105 | python () { |
| @@ -235,6 +235,8 @@ rubyv2_do_compile() { | |||
| 235 | } | 235 | } |
| 236 | 236 | ||
| 237 | python do_rubyv2_fix_libs() { | 237 | python do_rubyv2_fix_libs() { |
| 238 | import subprocess | ||
| 239 | |||
| 238 | # as ruby dynloader expects the shared .so files | 240 | # as ruby dynloader expects the shared .so files |
| 239 | # without extension we will create symlinks to the | 241 | # without extension we will create symlinks to the |
| 240 | # properly versioned file | 242 | # properly versioned file |
| @@ -248,6 +250,19 @@ python do_rubyv2_fix_libs() { | |||
| 248 | except: | 250 | except: |
| 249 | pass | 251 | pass |
| 250 | _filename, _ = os.path.splitext(_filename) | 252 | _filename, _ = os.path.splitext(_filename) |
| 253 | |||
| 254 | # Strip native sysroot RPATHs from installed shared objects | ||
| 255 | for root, dirs, files in os.walk(d.expand("${GEM_HOME}")): | ||
| 256 | for f in files: | ||
| 257 | if f.endswith(".so"): | ||
| 258 | fpath = os.path.join(root, f) | ||
| 259 | if os.path.islink(fpath): | ||
| 260 | continue | ||
| 261 | try: | ||
| 262 | subprocess.check_call(["chrpath", "-d", fpath], | ||
| 263 | stderr=subprocess.DEVNULL) | ||
| 264 | except (subprocess.CalledProcessError, FileNotFoundError): | ||
| 265 | pass | ||
| 251 | } | 266 | } |
| 252 | 267 | ||
| 253 | RUBY_INSTALL_EXTRA_FLAGS ?= "" | 268 | RUBY_INSTALL_EXTRA_FLAGS ?= "" |
