3 3

[alpine-aports] [PATCH] testing/lua-fun: new aport

Muh Muhten
Details
Message ID
<1456478201-4675-1-git-send-email-muh.muhten@gmail.com>
Sender timestamp
1456478201
DKIM signature
missing
Download raw message
Patch: +42 -0
http://rtsisyk.github.io/luafun/
"Lua Fun is a high-performance functional programming library for Lua
designed with LuaJIT's trace compiler in mind."
---
 testing/lua-fun/APKBUILD | 42 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)
 create mode 100644 testing/lua-fun/APKBUILD

diff --git a/testing/lua-fun/APKBUILD b/testing/lua-fun/APKBUILD
new file mode 100644
index 0000000..1db3a7a
--- /dev/null
+++ b/testing/lua-fun/APKBUILD
@@ -0,0 +1,42 @@
+# Contributor: Michael Zuo <muh.muhten@gmail.com>
+# Maintainer: Michael Zuo <muh.muhten@gmail.com>
+pkgname=lua-fun
+pkgver=0.1.3
+_luaversions="5.1 5.2 5.3"
+pkgrel=0
+pkgdesc="Functional programming library"
+# "Lua Fun is a high-performance functional programming library for Lua
+# designed with LuaJIT's trace compiler in mind."
+url="http://rtsisyk.github.io/luafun/"
+arch="noarch"
+license="MIT"
+depends=""
+depends_dev=""
+makedepends=""
+source="$pkgname-$pkgver.tar.gz::https://github.com/rtsisyk/luafun/archive/$pkgver.tar.gz"
+
+for _v in $_luaversions; do
+	subpackages="$subpackages lua$_v-${pkgname#*lua-}:split_${_v/./_}"
+	eval "split_${_v/./_}() { _split $_v; }"
+done
+
+_builddir="$srcdir/luafun-$pkgver"
+build() {
+	:
+}
+
+package() {
+	mkdir -p "$pkgdir"
+}
+
+_split() {
+	install_if="lua$1 $pkgname=$pkgver-r$pkgrel"
+	pkgdesc="$pkgdesc for Lua $1"
+
+	cd "$_builddir"
+	install -Dm644 fun.lua "$subpkgdir/usr/share/lua/$1/fun.lua" || return 1
+}
+
+md5sums="ab774af3d0dea06656039e5fc3ee86ad  lua-fun-0.1.3.tar.gz"
+sha256sums="b17a139e94a150595ffce09e800035f71fe9e0631b54b6fbf193dfe57255e4b7  lua-fun-0.1.3.tar.gz"
+sha512sums="1959c22453a6f431e4f4ee1ca1e6001c126f8857e00b128e5303049fd574150a68b71490503356f11fefcbd0ef7fbac7b0ae7c182a395ad0c92d2047dfac0662  lua-fun-0.1.3.tar.gz"
-- 
2.5.4 (Apple Git-61)



---
Unsubscribe:  alpine-aports+unsubscribe@lists.alpinelinux.org
Help:         alpine-aports+help@lists.alpinelinux.org
---
Muh Muhten
Details
Message ID
<56D53D72.40409@gmail.com>
In-Reply-To
<20160301083638.15741544@vostro.util.wtbts.net> (view parent)
Sender timestamp
1456815474
DKIM signature
missing
Download raw message
On 2016-03-01 1:36 AM, Timo Teras wrote:
> On Fri, 26 Feb 2016 04:16:41 -0500
> Muh Muhten <muh.muhten@gmail.com> wrote:]
>> ---
>> +_split() {
>> +	install_if="lua$1 $pkgname=$pkgver-r$pkgrel"
>> +	pkgdesc="$pkgdesc for Lua $1"
>> +
>> +	cd "$_builddir"
>> +	install -Dm644 fun.lua "$subpkgdir/usr/share/lua/$1/fun.lua"
>> || return 1 +}
>
> It's the same file installed in three separate packages - just to
> separate directory.
>
> I wonder if we should ship this in some common folder. @ncopa Do we
> have any shared lua path that would be usable in all lua versions?
> Or should this be single package that provides all three files and just
> ships symlinks/hardlinks?

Yes, it's unfortunate. Some light inspection (see below) suggests that 
*all* lua libs get installed under versioned dirs. Most of our lua 
packages seemed to work this way. I don't think hardlinks are a viable 
solution, since the versions get split into separate tarballs, which we 
can't practically annotate to indicate hardlinks. symlink is at least 
possible, but it's not clear how to organise.

% for ea in 5.1 jit 5.2 5.3; do lua$ea -e 
"print('lua$ea:\t'..package.path)"; done | sed 's/;/\n\t/g'
lua5.1: ./?.lua
         /usr/local/share/lua/5.1/?.lua
         /usr/local/share/lua/5.1/?/init.lua
         /usr/local/lib/lua/5.1/?.lua
         /usr/local/lib/lua/5.1/?/init.lua
         /usr/share/lua/5.1/?.lua
         /usr/share/lua/5.1/?/init.lua
luajit: ./?.lua
         /usr/share/luajit-2.0.4/?.lua
         /usr/local/share/lua/5.1/?.lua
         /usr/local/share/lua/5.1/?/init.lua
         /usr/share/lua/5.1/?.lua
         /usr/share/lua/5.1/?/init.lua
lua5.2: /usr/local/share/lua/5.2/?.lua
         /usr/local/share/lua/5.2/?/init.lua
         /usr/share/lua/5.2/?.lua
         /usr/share/lua/5.2/?/init.lua
         /usr/local/lib/lua/5.2/?.lua
         /usr/local/lib/lua/5.2/?/init.lua
         ./?.lua
         /usr/lib/lua/5.2/?.lua
         /usr/lib/lua/5.2/?/init.lua
         ./?.lua
lua5.3: /usr/local/share/lua/5.3/?.lua
         /usr/local/share/lua/5.3/?/init.lua
         /usr/local/lib/lua/5.3/?.lua
         /usr/local/lib/lua/5.3/?/init.lua
         /usr/share/lua/5.3/?.lua
         /usr/share/lua/5.3/?/init.lua
         /usr/lib/lua/5.3/?.lua
         /usr/lib/lua/5.3/?/init.lua
         ./?.lua
         ./?/init.lua



---
Unsubscribe:  alpine-aports+unsubscribe@lists.alpinelinux.org
Help:         alpine-aports+help@lists.alpinelinux.org
---
Timo Teras
Details
Message ID
<20160301083638.15741544@vostro.util.wtbts.net>
In-Reply-To
<1456478201-4675-1-git-send-email-muh.muhten@gmail.com> (view parent)
Sender timestamp
1456814198
DKIM signature
missing
Download raw message
On Fri, 26 Feb 2016 04:16:41 -0500
Muh Muhten <muh.muhten@gmail.com> wrote:

> http://rtsisyk.github.io/luafun/
> "Lua Fun is a high-performance functional programming library for Lua
> designed with LuaJIT's trace compiler in mind."

Looks good... but see below.

> ---
> +_split() {
> +	install_if="lua$1 $pkgname=$pkgver-r$pkgrel"
> +	pkgdesc="$pkgdesc for Lua $1"
> +
> +	cd "$_builddir"
> +	install -Dm644 fun.lua "$subpkgdir/usr/share/lua/$1/fun.lua"
> || return 1 +}

It's the same file installed in three separate packages - just to
separate directory.

I wonder if we should ship this in some common folder. @ncopa Do we
have any shared lua path that would be usable in all lua versions?
Or should this be single package that provides all three files and just
ships symlinks/hardlinks?


---
Unsubscribe:  alpine-aports+unsubscribe@lists.alpinelinux.org
Help:         alpine-aports+help@lists.alpinelinux.org
---
Natanael Copa
Details
Message ID
<20160405225239.6540664c@ncopa-desktop.alpinelinux.org>
In-Reply-To
<56D53D72.40409@gmail.com> (view parent)
Sender timestamp
1459889559
DKIM signature
missing
Download raw message
Sorry for late answer

On Tue, 1 Mar 2016 01:57:54 -0500
Muh Muhten <muh.muhten@gmail.com> wrote:

> On 2016-03-01 1:36 AM, Timo Teras wrote:
> > On Fri, 26 Feb 2016 04:16:41 -0500
> > Muh Muhten <muh.muhten@gmail.com> wrote:]  
> >> ---
> >> +_split() {
> >> +	install_if="lua$1 $pkgname=$pkgver-r$pkgrel"
> >> +	pkgdesc="$pkgdesc for Lua $1"
> >> +
> >> +	cd "$_builddir"
> >> +	install -Dm644 fun.lua "$subpkgdir/usr/share/lua/$1/fun.lua"
> >> || return 1 +}  
> >
> > It's the same file installed in three separate packages - just to
> > separate directory.
> >
> > I wonder if we should ship this in some common folder. @ncopa Do we
> > have any shared lua path that would be usable in all lua versions?

I have a shared /usr/share/lua/common dir for lua-penlight. Then the
lua5.[123]-penlight packages have symlinks to this common dir.

> > Or should this be single package that provides all three files and just
> > ships symlinks/hardlinks?

I think it depends on how big the file is and how likely it is that you
will have it installed for more than one lua version at the same time.

penlight is relatively big (450kb) so in that case the extra package
overhead for a lua-penlight-shared package is worth it.

> Yes, it's unfortunate. Some light inspection (see below) suggests that 
> *all* lua libs get installed under versioned dirs. Most of our lua 
> packages seemed to work this way. I don't think hardlinks are a viable 
> solution, since the versions get split into separate tarballs, which we 
> can't practically annotate to indicate hardlinks. symlink is at least 
> possible, but it's not clear how to organise.

lua-fun seems to be a single file, 32k, so I don't think its worth the
extra effort to ship a -shared package for it.

I just pushed it as it was submitted.

Thanks!

-nc


---
Unsubscribe:  alpine-aports+unsubscribe@lists.alpinelinux.org
Help:         alpine-aports+help@lists.alpinelinux.org
---