Subject: [alpine-aports] [PATCH] testing/jg-iruby: new aport

From: Kyle King <[email-masked]>
Date: Thu, 16 Jun 2016 14:05:40 -0700

This package installs the iruby kernel for the Jupyter Gallery
alpine client here:

> https://github.com/jupyter-gallery/jupyter-docker

Details
---
 testing/jg-iruby/APKBUILD | 64 +++++++++++++++++++++++++++++++++++++++++++++++
 testing/jg-iruby/pryrc    |  7 ++++++
 2 files changed, 71 insertions(+)
 create mode 100644 testing/jg-iruby/APKBUILD
 create mode 100644 testing/jg-iruby/pryrc

diff --git a/testing/jg-iruby/APKBUILD b/testing/jg-iruby/APKBUILD
new file mode 100644
index 0000000..b5443e3
--- /dev/null
+++ b/testing/jg-iruby/APKBUILD
@@ -0,0 +1,64 @@
+# Maintainer: Jupyter Gallery Team <[email-masked]>
+pkgname=jg-iruby
+pkgver=0.1.0
+pkgrel=0
+pkgdesc="Ruby kernel for the Jupyter Gallery alpine client"
+url="https://github.com/jupyter-gallery/alpine-testing"
+arch="x86_64"
+license="MIT"
+depends="ruby ruby-dev ruby-irb ruby-bigdecimal ruby-io-console ruby-json ruby-minitest ruby-rake ruby-rdoc libffi-dev"
+depends_dev=""
+makedepends="$depends_dev"
+install=""
+subpackages=""
+source="iruby-master.tar.gz::https://github.com/SciRuby/iruby/tarball/master"
+
+# this is to document the iruby version for this apk release
+_iruby_commit_id="7ac5c60"
+_builddir="$srcdir/SciRuby-iruby-$_iruby_commit_id"
+
+build() {
+	cd "$_builddir"
+	git init 
+	git add *
+	gem build iruby.gemspec
+}
+
+package() {
+	cd "$_builddir"
+	local gemdir="$(ruby -rubygems -e 'puts Gem.default_dir')"
+
+	# install iruby 
+	gem install -N -i "$pkgdir/$gemdir" -l iruby
+	
+	# install ruby-2 default gems that don't have apks
+	gem install -N -i "$pkgdir/$gemdir" psych test-unit 
+
+	# additional iruby dependencies
+	gem install -N -i "$pkgdir/$gemdir" iruby ffi-rzmq pry erector iruby-dependencies
+
+	# patch pry to work with more on alpine instead of less
+	sed -i "/^gem/i ENV['PAGER'] = 'more'" "$pkgdir/$gemdir"/bin/pry
+
+	# add executables to /usr/bin
+	mkdir -p "$pkgdir/usr/bin"
+
+	local path; for path in "$pkgdir/$gemdir"/bin/*; do
+		if [ -f "$path" ]; then
+			local file="$(basename $path)"
+			ln -s "$gemdir/bin/$file" "$pkgdir/usr/bin/$file"
+		fi
+	done
+
+	# configure ruby memory usage in pry
+	mkdir "$pkgdir"/root
+	cp "$startdir"/pryrc "$pkgdir"/root/.pryrc
+
+	# cleanup
+	cd "$pkgdir/$gemdir"
+	rm -rf cache build_info doc
+}
+
+md5sums="9e3308d3a7855dda2ea9f9760d3c4799  iruby-master.tar.gz"
+sha256sums="024617b3c337903c5271b23005f0e91304f41d06479fa8caa64465a97b97c28b  iruby-master.tar.gz"
+sha512sums="890084d82705ce53fb5f312e6159d5db9558b42b25238f254efafeee0ca522788150f11dad2a1d114aa365d67def0c5d913ed1ee6498246023952e1c6ef698e6  iruby-master.tar.gz"
diff --git a/testing/jg-iruby/pryrc b/testing/jg-iruby/pryrc
new file mode 100644
index 0000000..5e07378
--- /dev/null
+++ b/testing/jg-iruby/pryrc
@@ -0,0 +1,7 @@
+ENV['RUBY_GC_HEAP_GROWTH_FACTOR']='1.1' 
+ENV['RUBY_GC_MALLOC_LIMIT_GROWTH_FACTOR']='1.1' 
+ENV['RUBY_GC_OLDMALLOC_LIMIT_GROWH_FACTOR']='1.1' 
+ENV['RUBY_GC_OLDMALLOC_LIMIT']='16000100' 
+ENV['RUBY_GC_OLDMALLOC_LIMIT_MAX']='16000100' 
+ENV['RUBY_GC_MALLOC_LIMIT']='4000100' 
+ENV['RUBY_GC_MALLOC_LIMIT_MAX']='16000100'
-- 
2.8.3

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---

---

From: Bartłomiej Piotrowski <[email-masked]>
Date: Thu, 07 Jul 2016 11:07:23 +0200

On 2016-06-16 23:05, Kyle King wrote:
>  testing/jg-iruby/APKBUILD | 64 
> +++++++++++++++++++++++++++++++++++++++++++++++
> +depends="ruby ruby-dev ruby-irb ruby-bigdecimal ruby-io-console
> ruby-json ruby-minitest ruby-rake ruby-rdoc libffi-dev"
> +depends_dev=""

Hi,

thank you for your patch. Unfortunately it has some issues:

1. It doesn't use git tag. Also I see that current release is v0.2.9.
2. You shouldn't use git init for build. Any reason for this?
3. Using gem install for packaging doesn't seem good.

In 3.4 we decided to drop packaging gems as it is too troublesome. I 
guess the same applies for your package.

Cheers,
Bartłomiej

---