diff options
| author | Pablo Saavedra Rodi?o <psaavedra@igalia.com> | 2020-04-29 12:31:20 +0200 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2020-05-02 11:12:08 -0400 |
| commit | e4d1cbbb0dfe99967ed3b3a83badfd2da3a34214 (patch) | |
| tree | 281f58d0a364045db54c3ae9659b31dbbb64b826 | |
| parent | 157ca6fe949d8ef7bb1a589b20e8e85f014c6b89 (diff) | |
| download | meta-cloud-services-e4d1cbbb0dfe99967ed3b3a83badfd2da3a34214.tar.gz | |
ruby: Add sysroot dir to the ldflags and process all the existing extconf.rb
* add lib path of the sysroot directory [1] to avoid ld errors during
the installation
* ruby_do_compile() find the extconf.rb file in the sources instance of
assume a single file.
[1] https://www.yoctoproject.org/docs/1.8/ref-manual/ref-manual.html#var-STAGING_LIBDIR
Signed-off-by: Pablo Saavedra <psaavedra@igalia.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
| -rw-r--r-- | classes/ruby.bbclass | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/classes/ruby.bbclass b/classes/ruby.bbclass index 15ac9f4..5fb8e6b 100644 --- a/classes/ruby.bbclass +++ b/classes/ruby.bbclass | |||
| @@ -104,23 +104,31 @@ EOF | |||
| 104 | system("perl -p -i -e 's#^arch =.*#arch = ${ruby_arch}#' Makefile") | 104 | system("perl -p -i -e 's#^arch =.*#arch = ${ruby_arch}#' Makefile") |
| 105 | system("perl -p -i -e 's#^LIBPATH =.*#LIBPATH = -L.#' Makefile") | 105 | system("perl -p -i -e 's#^LIBPATH =.*#LIBPATH = -L.#' Makefile") |
| 106 | system("perl -p -i -e 's#^dldflags =.*#dldflags = ${LDFLAGS}#' Makefile") | 106 | system("perl -p -i -e 's#^dldflags =.*#dldflags = ${LDFLAGS}#' Makefile") |
| 107 | system("perl -p -i -e 's#^ldflags =.*#ldflags = -L${STAGING_LIBDIR}#' Makefile") | ||
| 107 | EOF | 108 | EOF |
| 108 | } | 109 | } |
| 109 | 110 | ||
| 110 | ruby_do_compile() { | 111 | ruby_do_compile() { |
| 111 | if [ -f extconf.rb -a ! -f extconf.rb.orig ] ; then | 112 | EXTCONF_FILES=$(find . -name extconf.rb -exec ls {} \;) |
| 112 | grep create_makefile extconf.rb > append2 || (exit 0) | 113 | for e in $EXTCONF_FILES |
| 113 | ruby_gen_extconf_fix | 114 | do |
| 114 | cp extconf.rb extconf.rb.orig | 115 | if [ -f $e -a ! -f $e.orig ] ; then |
| 115 | # Patch extconf.rb for cross compile | 116 | grep create_makefile $e > append2 || continue |
| 116 | cat append >> extconf.rb | 117 | ruby_gen_extconf_fix |
| 117 | fi | 118 | cp $e $e.orig |
| 118 | for gem in ${RUBY_BUILD_GEMS}; do | 119 | # Patch extconf.rb for cross compile |
| 119 | ${RUBY_COMPILE_FLAGS} gem build $gem | 120 | cat append >> $e |
| 120 | done | 121 | fi |
| 121 | if [ -f extconf.rb.orig ] ; then | 122 | done |
| 122 | mv extconf.rb.orig extconf.rb | 123 | for gem in ${RUBY_BUILD_GEMS}; do |
| 123 | fi | 124 | ${RUBY_COMPILE_FLAGS} gem build $gem |
| 125 | done | ||
| 126 | for e in $EXTCONF_FILES | ||
| 127 | do | ||
| 128 | if [ -f $e.orig ] ; then | ||
| 129 | mv $e.orig $e | ||
| 130 | fi | ||
| 131 | done | ||
| 124 | } | 132 | } |
| 125 | 133 | ||
| 126 | 134 | ||
