aboutsummaryrefslogtreecommitdiffstats
path: root/0001-main-lua-hashids-upgrade-to-1.0.5.patch
blob: 5fd278dc08fab4b9b241f51dd3d4cb3a7bdfc6e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
From fd9fbcd03ee8e898a0a67da2096c61676ea94e59 Mon Sep 17 00:00:00 2001
From: Carlo Landmeter <clandmeter@gmail.com>
Date: Tue, 2 May 2017 09:48:31 +0200
Subject: [PATCH] main/lua-hashids: upgrade to 1.0.5

---
 main/lua-hashids/APKBUILD         | 57 ++++++++++++++++++++++-----------------
 main/lua-hashids/installdir.patch |  8 ++++++
 2 files changed, 41 insertions(+), 24 deletions(-)
 create mode 100644 main/lua-hashids/installdir.patch

diff --git a/main/lua-hashids/APKBUILD b/main/lua-hashids/APKBUILD
index 91ca0c74e2..039d2d7f68 100644
--- a/main/lua-hashids/APKBUILD
+++ b/main/lua-hashids/APKBUILD
@@ -1,44 +1,53 @@
 # Contributor: Carlo Landmeter <clandmeter@gmail.com>
 # Maintainer: Carlo Landmeter <clandmeter@gmail.com>
 pkgname=lua-hashids
-pkgver=1.0.0
+pkgver=1.0.5
 pkgrel=0
 pkgdesc="A Lua implementation of hashids"
 url="https://github.com/leihog/hashids.lua"
 arch="all"
 license="MIT"
-depends=""
-depends_dev="lua5.1-dev"
-makedepends="$depends_dev"
 install=""
-subpackages=""
-source="hashids.lua-$pkgver.tar.gz::https://github.com/leihog/hashids.lua/archive/v$pkgver.tar.gz"
+source="$pkgname-$pkgver.tar.gz::https://github.com/leihog/hashids.lua/archive/v$pkgver.tar.gz
+	installdir.patch"
 
-_builddir="$srcdir"/hashids.lua-$pkgver
+_luaversions="5.1 5.2 5.3"
+
+for _v in $_luaversions; do
+        makedepends="$makedepends lua$_v-dev"
+        subpackages="$subpackages lua$_v-${pkgname#lua-}:_subpackage"
+done
+
+builddir="$srcdir"/hashids.lua-$pkgver
 
 prepare() {
-        local i
-        cd "$_sdir"
-        for i in $source; do
-                case $i in
-                *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
-                esac
-        done
+	default_prepare
+	local lver; for lver in $_luaversions; do
+		cp -r "$builddir" "$builddir-$lver"
+	done
 }
 
 build() {
-	cd "$_builddir"
-	make || return 1
+	cd "$builddir"
+	local lver; for lver in $_luaversions; do
+		msg "Building for Lua $lver..."
+		make -C "$builddir-$lver"
+	done
 }
 
 package() {
-	cd "$_builddir"
-	install -Dm644 hashids/init.lua \
-		"$pkgdir"/usr/share/lua/5.1/hashids/init.lua || return 1
-	install -Dm755 hashids/clib.so \
-		"$pkgdir"/usr/lib/lua/5.1/hashids/clib.so || return 1
+	mkdir -p "$pkgdir"
+}
+
+_subpackage() {
+	local lver="${subpkgname:3:3}"
+	pkgdesc="$pkgdesc (for Lua $lver)"
+	depends="lua$lver"
+	install_if="$pkgname=$pkgver-r$pkgrel lua$lver"
+
+	cd "$builddir-$lver"
+	make INSTALLDIR="$subpkgdir"/usr/share/lua/$lver/hashids/ install
 }
 
-md5sums="ace60336593b06eb7f7e8a9e37b5a0fd  hashids.lua-1.0.0.tar.gz"
-sha256sums="2a99927bba9c986be544d6c483b953c8f39b56cd5915a154553154c8aab7e3fc  hashids.lua-1.0.0.tar.gz"
-sha512sums="2d9f6928c82f0ce3e70f729f8f366f85bd2482474e841524c894381a125a27d5e209bf2f9a7b9e5d9fd476fd3865aca2be4c9c2118ebe125995fbd3008a1962a  hashids.lua-1.0.0.tar.gz"
+sha512sums="e8c400055984c47a905fdef2facad3fc42a8f645440376ce089b53500e6b9a7d0a0b3dbd098f9453f86e0e037cb74dcf0e383911f498c5184c9d7156ffa23e79  lua-hashids-1.0.5.tar.gz
+3268b00656b0048adacf6e9d46a3b726d5e00ec209098f654d965de562b72b16a95bd44a9ad591e33eebbf323552e049d0181ec6d27c21cb2f4f2ca3861662ad  installdir.patch"
diff --git a/main/lua-hashids/installdir.patch b/main/lua-hashids/installdir.patch
new file mode 100644
index 0000000000..573338d0be
--- /dev/null
+++ b/main/lua-hashids/installdir.patch
@@ -0,0 +1,8 @@
+--- ./Makefile.orig
++++ ./Makefile
+@@ -1,4 +1,4 @@
+-INSTALLDIR=/usr/local/lib/lua/5.2/hashids
++INSTALLDIR := /usr/local/lib/lua/5.2/hashids
+ 
+ UNAME := $(shell uname -s)
+ 
-- 
2.12.2