Squashed 'import-layers/meta-openembedded/' content from commit 247b126

Change-Id: I40827e9ce5fba63f1cca2a0be44976ae8383b4c0
git-subtree-dir: import-layers/meta-openembedded
git-subtree-split: 247b1267bbe95719cd4877d2d3cfbaf2a2f4865a
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/import-layers/meta-openembedded/meta-ruby/COPYING.MIT b/import-layers/meta-openembedded/meta-ruby/COPYING.MIT
new file mode 100644
index 0000000..fb950dc
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-ruby/COPYING.MIT
@@ -0,0 +1,17 @@
+Permission is hereby granted, free of charge, to any person obtaining a copy 
+of this software and associated documentation files (the "Software"), to deal 
+in the Software without restriction, including without limitation the rights 
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 
+copies of the Software, and to permit persons to whom the Software is 
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in 
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 
+THE SOFTWARE.
diff --git a/import-layers/meta-openembedded/meta-ruby/README b/import-layers/meta-openembedded/meta-ruby/README
new file mode 100644
index 0000000..17fdde9
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-ruby/README
@@ -0,0 +1,17 @@
+This layer depends on:
+
+URI: git://github.com/openembedded/oe-core.git
+branch: krogoth
+revision: HEAD
+
+URI: git://github.com/openembedded/meta-oe.git
+branch: krogoth
+revision: HEAD
+
+Send pull requests to openembedded-devel@lists.openembedded.org with '[meta-ruby][krogoth]' in the subject'
+
+When sending single patches, please using something like:
+'git send-email -M -1 --to openembedded-devel@lists.openembedded.org --subject-prefix=meta-ruby][krogoth][PATCH'
+
+krogoth Branch Maintainer:
+Armin Kuster <akuster808@gmail.com>
diff --git a/import-layers/meta-openembedded/meta-ruby/classes/ruby.bbclass b/import-layers/meta-openembedded/meta-ruby/classes/ruby.bbclass
new file mode 100644
index 0000000..ef844f2
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-ruby/classes/ruby.bbclass
@@ -0,0 +1,131 @@
+BPV ?= "${PV}"
+
+DEPENDS += " \
+    ruby-native \
+"
+RDEPENDS_${PN} += " \
+    ruby \
+"
+
+def get_rubyversion(p):
+    import re
+    from os.path import isfile
+    import subprocess
+    found_version = "SOMETHING FAILED!"
+
+    cmd = "%s/ruby" % p
+
+    if not isfile(cmd):
+       return found_version
+
+    version = subprocess.Popen([cmd, "--version"], stdout=subprocess.PIPE).communicate()[0]
+    
+    r = re.compile("ruby ([0-9]+\.[0-9]+\.[0-9]+)*")
+    m = r.match(version)
+    if m:
+        found_version = m.group(1)
+
+    return found_version
+
+def get_rubygemslocation(p):
+    import re
+    from os.path import isfile
+    import subprocess
+    found_loc = "SOMETHING FAILED!"
+
+    cmd = "%s/gem" % p
+
+    if not isfile(cmd):
+       return found_loc
+
+    loc = subprocess.Popen([cmd, "env"], stdout=subprocess.PIPE).communicate()[0]
+
+    r = re.compile(".*\- (/usr.*/ruby/gems/.*)")
+    for line in loc.split('\n'):
+        m = r.match(line)
+        if m:
+            found_loc = m.group(1)
+            break
+
+    return found_loc
+
+def get_rubygemsversion(p):
+    import re
+    from os.path import isfile
+    import subprocess
+    found_version = "SOMETHING FAILED!"
+
+    cmd = "%s/gem" % p
+
+    if not isfile(cmd):
+       return found_version
+
+    version = subprocess.Popen([cmd, "env", "gemdir"], stdout=subprocess.PIPE).communicate()[0]
+    
+    r = re.compile(".*([0-9]+\.[0-9]+\.[0-9]+)$")
+    m = r.match(version)
+    if m:
+        found_version = m.group(1)
+
+    return found_version
+
+RUBY_VERSION ?= "${@get_rubyversion("${STAGING_BINDIR_NATIVE}")}"
+RUBY_GEM_DIRECTORY ?= "${@get_rubygemslocation("${STAGING_BINDIR_NATIVE}")}"
+RUBY_GEM_VERSION ?= "${@get_rubygemsversion("${STAGING_BINDIR_NATIVE}")}"
+
+export GEM_HOME = "${STAGING_DIR_NATIVE}/usr/lib/ruby/gems/${RUBY_GEM_VERSION}"
+
+RUBY_BUILD_GEMS ?= "${BPN}.gemspec"
+RUBY_INSTALL_GEMS ?= "${BPN}-${BPV}.gem"
+
+RUBY_COMPILE_FLAGS ?= 'LANG="en_US.UTF-8" LC_ALL="en_US.UTF-8"'
+
+ruby_do_compile() {
+	for gem in ${RUBY_BUILD_GEMS}; do
+		${RUBY_COMPILE_FLAGS} gem build $gem
+	done
+}
+
+
+ruby_do_install() {
+	for gem in ${RUBY_INSTALL_GEMS}; do
+		gem install --ignore-dependencies --local --env-shebang --install-dir ${D}/${libdir}/ruby/gems/${RUBY_GEM_VERSION}/ $gem
+	done
+
+	# create symlink from the gems bin directory to /usr/bin
+	for i in ${D}/${libdir}/ruby/gems/${RUBY_GEM_VERSION}/bin/*; do
+		if [ -e "$i" ]; then
+			if [ ! -d ${D}/${bindir} ]; then mkdir -p ${D}/${bindir}; fi
+			b=`basename $i`
+			ln -sf ${libdir}/ruby/gems/${RUBY_GEM_VERSION}/bin/$b ${D}/${bindir}/$b
+		fi
+	done
+}
+
+EXPORT_FUNCTIONS do_compile do_install
+
+PACKAGES = "${PN}-dbg ${PN} ${PN}-doc ${PN}-dev"
+
+FILES_${PN}-dbg += " \
+        ${libdir}/ruby/gems/${RUBY_GEM_VERSION}/gems/*/*/.debug \
+        ${libdir}/ruby/gems/${RUBY_GEM_VERSION}/gems/*/*/*/.debug \
+        ${libdir}/ruby/gems/${RUBY_GEM_VERSION}/gems/*/*/*/*/.debug \
+        ${libdir}/ruby/gems/${RUBY_GEM_VERSION}/gems/*/*/*/*/*/.debug \
+        ${libdir}/ruby/gems/${RUBY_GEM_VERSION}/extensions/*/*/.debug \
+        ${libdir}/ruby/gems/${RUBY_GEM_VERSION}/extensions/*/*/*/.debug \
+        ${libdir}/ruby/gems/${RUBY_GEM_VERSION}/extensions/*/*/*/*/.debug \
+        ${libdir}/ruby/gems/${RUBY_GEM_VERSION}/extensions/*/*/*/*/*/.debug \
+        "
+
+FILES_${PN} += " \
+        ${libdir}/ruby/gems/${RUBY_GEM_VERSION}/gems \
+        ${libdir}/ruby/gems/${RUBY_GEM_VERSION}/cache \
+        ${libdir}/ruby/gems/${RUBY_GEM_VERSION}/bin \
+        ${libdir}/ruby/gems/${RUBY_GEM_VERSION}/specifications \
+        ${libdir}/ruby/gems/${RUBY_GEM_VERSION}/build_info \
+        ${libdir}/ruby/gems/${RUBY_GEM_VERSION}/extensions \
+        "
+
+FILES_${PN}-doc += " \
+        ${libdir}/ruby/gems/${RUBY_GEM_VERSION}/doc \
+        "
diff --git a/import-layers/meta-openembedded/meta-ruby/conf/layer.conf b/import-layers/meta-openembedded/meta-ruby/conf/layer.conf
new file mode 100644
index 0000000..b526a5d
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-ruby/conf/layer.conf
@@ -0,0 +1,15 @@
+# We have a conf and classes directory, append to BBPATH 
+BBPATH .= ":${LAYERDIR}"
+
+# We have a recipes directory, add to BBFILES
+BBFILES += "${LAYERDIR}/recipes-*/*/*.bb ${LAYERDIR}/recipes-*/*/*.bbappend"
+
+BBFILE_COLLECTIONS += "ruby-layer"
+BBFILE_PATTERN_ruby-layer := "^${LAYERDIR}/"
+BBFILE_PRIORITY_ruby-layer = "7"
+
+# This should only be incremented on significant changes that will
+# cause compatibility issues with other layers
+LAYERVERSION_ruby-layer = "1"
+
+LAYERDEPENDS_ruby-layer = "core openembedded-layer"
diff --git a/import-layers/meta-openembedded/meta-ruby/recipes-devtools/ruby/bundler_git.bb b/import-layers/meta-openembedded/meta-ruby/recipes-devtools/ruby/bundler_git.bb
new file mode 100644
index 0000000..31e72e5
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-ruby/recipes-devtools/ruby/bundler_git.bb
@@ -0,0 +1,31 @@
+SUMMARY = "Makes sure Ruby applications run the same code on every machine."
+DESCRIPTION = "Bundler makes sure Ruby applications run the same code \
+on every machine. It does this by managing the gems that the \
+application depends on. Given a list of gems, it can automatically \
+download and install those gems, as well as any other gems needed by \
+the gems that are listed. Before installing gems, it checks the \
+versions of every gem to make sure that they are compatible, and can \
+all be loaded at the same time. After the gems have been installed, \
+Bundler can help you update some or all of them when new versions \
+become available. Finally, it records the exact versions that have \
+been installed, so that others can install the exact same gems."
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE.md;md5=196bb963e601609817d7e9ac9a64a867"
+
+SRCREV = "06dc8472b9142fd6aaefff780d6d252c20dc2a04"
+
+BRANCH = "1-9-stable"
+PV = "1.9.4"
+
+S = "${WORKDIR}/git"
+
+SRC_URI = " \
+    git://github.com/bundler/bundler.git;branch=${BRANCH} \
+    "
+
+inherit ruby
+
+RDEPENDS_${PN} = "git"
+
+BBCLASSEXTEND = "native"