summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Bebbington2017-11-04 03:13:32 +0000
committerTom Bebbington2017-11-04 03:16:01 +0000
commit724f826465c176437cd6bc2a1a43fca36c08612f (patch)
treeee91894e2a95438a425723d08b24c795c13e3d17
parentd07ceb384bd2d5e2adc7460290943e23181765c3 (diff)
downloadaur-724f826465c176437cd6bc2a1a43fca36c08612f.tar.gz
Skip stripping and automatically fetch latest version number using Github API
-rw-r--r--.SRCINFO9
-rw-r--r--PKGBUILD19
-rw-r--r--print-version.py7
3 files changed, 28 insertions, 7 deletions
diff --git a/.SRCINFO b/.SRCINFO
index b188a227491b..056d8a289f39 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = kode-studio-bin
pkgdesc = Kode Studio is an IDE specifically tailored for Kha.
pkgver = 17.9.1
- pkgrel = 2
+ pkgrel = 3
url = http://kha.tech/download
arch = x86_64
license = MIT
@@ -25,10 +25,13 @@ pkgbase = kode-studio-bin
optdepends = android-studio: Android target IDE
optdepends = codeblocks: Linux target IDE
optdepends = eclipse-java: Java target IDE
- source_x86_64 = https://github.com/Kode/KodeStudio/releases/download/v17.9.1/KodeStudio-linux64.tar.gz
+ options = !strip
+ source_x86_64 = https://github.com/Kode/KodeStudio/releases/download/v${pkgver}/KodeStudio-linux64.tar.gz
source_x86_64 = kode-studio.desktop
- sha256sums_x86_64 = a1ac4a5b9b74a8f5529ed616d6e4401599d1a33a4729eb1bdd7e5062a1b59cb0
+ source_x86_64 = print-version.py
+ sha256sums_x86_64 = SKIP
sha256sums_x86_64 = 085056b38a51192641b9c7daac35515491c1202374369a9b1e19cdf764273c11
+ sha256sums_x86_64 = 516503d1aa701c51cc9a89c31c97f1a01f8007641b667ab326ab5ba7c3e5e46f
pkgname = kode-studio-bin
diff --git a/PKGBUILD b/PKGBUILD
index 6bc183e52557..3365f9cd44cb 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,11 +3,13 @@
pkgname=kode-studio-bin
_pkgname=kode-studio
pkgver=17.9.1
-pkgrel=2
+pkgrel=3
pkgdesc="Kode Studio is an IDE specifically tailored for Kha."
arch=('x86_64')
url="http://kha.tech/download"
license=('MIT')
+builddepends=('curl' 'python')
+options=('!strip')
depends=(fontconfig libxtst gtk2 python cairo alsa-lib gconf nss gcc-libs libnotify libxss gvfs)
optdepends=('haxe: third-party Haxe library support'
'g++: Linux target'
@@ -17,11 +19,20 @@ optdepends=('haxe: third-party Haxe library support'
'android-studio: Android target IDE'
'codeblocks: Linux target IDE'
'eclipse-java: Java target IDE')
-source_x86_64=(https://github.com/Kode/KodeStudio/releases/download/v${pkgver}/KodeStudio-linux64.tar.gz
+source_x86_64=('https://github.com/Kode/KodeStudio/releases/download/v${pkgver}/KodeStudio-linux64.tar.gz'
${_pkgname}.desktop
+ 'print-version.py'
)
-sha256sums_x86_64=('a1ac4a5b9b74a8f5529ed616d6e4401599d1a33a4729eb1bdd7e5062a1b59cb0'
- '085056b38a51192641b9c7daac35515491c1202374369a9b1e19cdf764273c11')
+sha256sums_x86_64=('SKIP'
+ '085056b38a51192641b9c7daac35515491c1202374369a9b1e19cdf764273c11'
+ '516503d1aa701c51cc9a89c31c97f1a01f8007641b667ab326ab5ba7c3e5e46f'
+ )
+
+pkgver() {
+ cd $srcdir
+ curl "https://api.github.com/repos/Kode/KodeStudio/releases" -o releases.json
+ python print-version.py
+}
package() {
install -d "${pkgdir}/usr/share/licenses/${_pkgname}"
install -d "${pkgdir}/opt/${_pkgname}"
diff --git a/print-version.py b/print-version.py
new file mode 100644
index 000000000000..ee1f15f0a9c0
--- /dev/null
+++ b/print-version.py
@@ -0,0 +1,7 @@
+import json
+from pprint import pprint
+
+with open('releases.json') as data_file:
+ data = json.load(data_file)
+
+print(data[0]['tag_name'].split('v')[1]) \ No newline at end of file