[DRE-commits] [ruby-psych] 01/01: Provide mechanism to bootstrap package in new architectures
Miguel Landaeta
nomadium at moszumanska.debian.org
Sat Jul 29 13:08:26 UTC 2017
This is an automated email from the git hooks/post-receive script.
nomadium pushed a commit to branch master
in repository ruby-psych.
commit a8bd968b7ae354a6e618b4030899a487ec4f5738
Author: Miguel Landaeta <nomadium at debian.org>
Date: Sat Jul 29 14:06:39 2017 +0100
Provide mechanism to bootstrap package in new architectures
---
debian/bootstrap-psych-jar | 54 ++++++++++++++++++++++++++++++++++++++++++++++
debian/changelog | 7 ++++++
debian/rules | 17 ++++++++++++---
3 files changed, 75 insertions(+), 3 deletions(-)
diff --git a/debian/bootstrap-psych-jar b/debian/bootstrap-psych-jar
new file mode 100644
index 0000000..7943423
--- /dev/null
+++ b/debian/bootstrap-psych-jar
@@ -0,0 +1,54 @@
+#!/bin/sh
+set -e
+
+# This script builds Psych java extension.
+# I just copied the commands emitted by Rake.
+# Should be useful when you are trying to build this package for the
+# first time in a new archiecture. Not ideal, but for subsequent package
+# builds since ruby-psych build depends on itself indirectly through jruby,
+# the script will not be needed and the psych jar will be pulled from
+# the previous release available in the archive.
+
+BOOTSTRAP_PATH=tmp/bootstrap/java/psych
+JRE=/usr/lib/jvm/default-java/jre
+CLASSPATH=
+MAVEN_REPO=/usr/share/maven-repo
+EXT_JAVA_SRC=ext/java
+EXT_JAVA_CLASSES=org/jruby/ext/psych
+
+for jar in resources rt sunrsasign jsse jce charsets jfr; do
+ CLASSPATH="${CLASSPATH}:${JRE}/lib/${jar}.jar"
+done
+
+CLASSPATH="${CLASSPATH}:${JRE}/classes"
+CLASSPATH="${CLASSPATH}:/usr/share/jruby/lib/jruby.jar"
+CLASSPATH="${CLASSPATH}:${MAVEN_REPO}/org/yaml/snakeyaml/1.x/snakeyaml-1.x.jar"
+
+mkdir -p "${BOOTSTRAP_PATH}"
+
+javac -extdirs "${JRE}/lib/ext:/usr/java/packages/lib/ext" \
+ -target 1.7 \
+ -source 1.7 \
+ -Xlint:unchecked \
+ -cp "${CLASSPATH}" \
+ -d "${BOOTSTRAP_PATH}" \
+ "${EXT_JAVA_SRC}/PsychEmitter.java" \
+ "${EXT_JAVA_SRC}/PsychLibrary.java" \
+ "${EXT_JAVA_SRC}/PsychParser.java" \
+ "${EXT_JAVA_SRC}/PsychToRuby.java" \
+ "${EXT_JAVA_SRC}/PsychYamlTree.java"
+
+jar cf "${BOOTSTRAP_PATH}/psych.jar" \
+ -C "${BOOTSTRAP_PATH}" "${EXT_JAVA_CLASSES}/PsychEmitter\$1.class" \
+ -C "${BOOTSTRAP_PATH}" "${EXT_JAVA_CLASSES}/PsychEmitter.class" \
+ -C "${BOOTSTRAP_PATH}" "${EXT_JAVA_CLASSES}/PsychLibrary\$1.class" \
+ -C "${BOOTSTRAP_PATH}" "${EXT_JAVA_CLASSES}/PsychLibrary\$YAMLEncoding.class" \
+ -C "${BOOTSTRAP_PATH}" "${EXT_JAVA_CLASSES}/PsychLibrary.class" \
+ -C "${BOOTSTRAP_PATH}" "${EXT_JAVA_CLASSES}/PsychParser\$1.class" \
+ -C "${BOOTSTRAP_PATH}" "${EXT_JAVA_CLASSES}/PsychParser.class" \
+ -C "${BOOTSTRAP_PATH}" "${EXT_JAVA_CLASSES}/PsychToRuby\$ClassLoader.class" \
+ -C "${BOOTSTRAP_PATH}" "${EXT_JAVA_CLASSES}/PsychToRuby\$ToRuby.class" \
+ -C "${BOOTSTRAP_PATH}" "${EXT_JAVA_CLASSES}/PsychToRuby.class" \
+ -C "${BOOTSTRAP_PATH}" "${EXT_JAVA_CLASSES}/PsychYamlTree.class"
+
+install -c "${BOOTSTRAP_PATH}/psych.jar" lib/psych.jar
diff --git a/debian/changelog b/debian/changelog
index e35b400..c68e4b8 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+ruby-psych (2.2.4-3) UNRELEASED; urgency=medium
+
+ * Fix FTBFS introduced by the dependency loop caused by the dependency on
+ jruby (psych is a default stdlib gem).
+
+ -- Miguel Landaeta <nomadium at debian.org> Sat, 29 Jul 2017 14:01:15 +0100
+
ruby-psych (2.2.4-2) unstable; urgency=medium
* Upload to unstable.
diff --git a/debian/rules b/debian/rules
index da3b15d..bf7979d 100755
--- a/debian/rules
+++ b/debian/rules
@@ -5,9 +5,20 @@ export GEM2DEB_TEST_RUNNER = --check-dependencies
%:
dh $@ --buildsystem=ruby --with ruby
+EXTRA_DEB_BUILD_OPTIONS := bootstrap
+bootstrap-psych-jar:
+ ./debian/bootstrap-psych-jar
+ ls -ld lib/psych.jar
+
+ifeq (,$(findstring bootstrap,$(EXTRA_DEB_BUILD_OPTIONS)))
override_dh_auto_build:
dh_auto_build
jruby -S rake compile
+else
+override_dh_auto_build: bootstrap-psych-jar
+ dh_auto_build
+ RUBYLIB=$$RUBYLIB:$$PWD/lib jruby -S rake compile
+endif
override_dh_auto_install:
dh_auto_install
@@ -18,9 +29,9 @@ override_dh_auto_test:
# ignore failures with jruby, unfortunately upstream is failing in
# similar way and this is expected.
# (e.g. https://travis-ci.org/ruby/psych/jobs/208654321)
- -jruby -S rake test
+ RUBYLIB=$$RUBYLIB:$$PWD/lib jruby -S rake test || true
override_dh_auto_clean:
dh_auto_clean
- jruby -S rake clean
- -rm -r ./pkg/ ./lib/psych.jar
+ -jruby -S rake clean
+ -rm -r ./pkg/ ./lib/psych.jar ./tmp/
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-psych.git
More information about the Pkg-ruby-extras-commits
mailing list