summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathon Fernyhough2019-01-06 17:57:01 +0000
committerJonathon Fernyhough2019-01-06 17:57:01 +0000
commit87086a2c7414ec2b46134cd3800cc6762fd91ed0 (patch)
tree6759ed854992f66534ec588a108f8d8927d91cfd
parenta5d11e99904025781a0b9ac02b028d2a4e0289ef (diff)
downloadaur-87086a2c7414ec2b46134cd3800cc6762fd91ed0.tar.gz
Generate Project.toml
-rw-r--r--.SRCINFO6
-rw-r--r--PKGBUILD52
2 files changed, 50 insertions, 8 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 8c7051b7665..96ee2f24b74 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = julia-zmq
pkgdesc = Julia binding to the native API of ØMQ project
pkgver = 1.0.0
- pkgrel = 2
+ pkgrel = 3
url = https://github.com/JuliaInterop/ZMQ.jl
arch = any
license = MIT
@@ -10,9 +10,13 @@ pkgbase = julia-zmq
depends = julia-loadpath
depends = zeromq
source = julia-zmq-1.0.0.tar.gz::https://github.com/JuliaInterop/ZMQ.jl/archive/v1.0.0.tar.gz
+ source = julia-zmq-Deps.toml::https://raw.githubusercontent.com/JuliaRegistries/General/ffed2d514d4e73cf0f8c700d5d33cd5f9dec9ee0/Z/ZMQ/Deps.toml
source = julia-zmq-Package.toml::https://raw.githubusercontent.com/JuliaRegistries/General/ffed2d514d4e73cf0f8c700d5d33cd5f9dec9ee0/Z/ZMQ/Package.toml
+ source = julia-zmq-Versions.toml::https://raw.githubusercontent.com/JuliaRegistries/General/ffed2d514d4e73cf0f8c700d5d33cd5f9dec9ee0/Z/ZMQ/Versions.toml
sha256sums = f8c3cc104b3e8dc7ae09da9787427fb2ca45f3e4b46c98a6c8eace78216b1333
+ sha256sums = d27c36dfdb33f4cfb29f85c57509fa0874bd0f92e8c3d88ef87fcc93f3e32bcc
sha256sums = 6b51aedfcda4ecddeed07880756db0791b33bb158237fdb714ff695f1902f417
+ sha256sums = f2fc26069146b5cfebee4e243023d3793f843eccba6e48c02fa92d5124599da2
pkgname = julia-zmq
diff --git a/PKGBUILD b/PKGBUILD
index 4ed0a136ea7..9e619942d98 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,7 +3,7 @@
pkgname=julia-zmq
_pkgname=ZMQ
pkgver=1.0.0
-pkgrel=2
+pkgrel=3
pkgdesc='Julia binding to the native API of ØMQ project'
arch=(any)
url=https://github.com/JuliaInterop/ZMQ.jl
@@ -12,11 +12,48 @@ depends=(julia julia-compat julia-loadpath zeromq)
_commit=ffed2d514d4e73cf0f8c700d5d33cd5f9dec9ee0
source=($pkgname-$pkgver.tar.gz::https://github.com/JuliaInterop/$_pkgname.jl/archive/v$pkgver.tar.gz
- $pkgname-Package.toml::https://raw.githubusercontent.com/JuliaRegistries/General/$_commit/${_pkgname:0:1}/$_pkgname/Package.toml)
+ $pkgname-Deps.toml::https://raw.githubusercontent.com/JuliaRegistries/General/$_commit/${_pkgname:0:1}/$_pkgname/Deps.toml
+ $pkgname-Package.toml::https://raw.githubusercontent.com/JuliaRegistries/General/$_commit/${_pkgname:0:1}/$_pkgname/Package.toml
+ $pkgname-Versions.toml::https://raw.githubusercontent.com/JuliaRegistries/General/$_commit/${_pkgname:0:1}/$_pkgname/Versions.toml)
sha256sums=('f8c3cc104b3e8dc7ae09da9787427fb2ca45f3e4b46c98a6c8eace78216b1333'
- '6b51aedfcda4ecddeed07880756db0791b33bb158237fdb714ff695f1902f417')
+ 'd27c36dfdb33f4cfb29f85c57509fa0874bd0f92e8c3d88ef87fcc93f3e32bcc'
+ '6b51aedfcda4ecddeed07880756db0791b33bb158237fdb714ff695f1902f417'
+ 'f2fc26069146b5cfebee4e243023d3793f843eccba6e48c02fa92d5124599da2')
+
+_slug() {
+ local uuid=$(grep uuid $pkgname-Package.toml | cut -f3 -d' ')
+ local sha1=$(grep \"$pkgver\" -a1 $pkgname-Versions.toml | tail -n1 | cut -f3 -d' ')
+ julia -e "u = Base.UUID($uuid);
+ s = Base.SHA1(hex2bytes($sha1));
+ println(Base.version_slug(u,s));"
+}
+
+_deps() {
+ julia -e "using Pkg
+
+ alldeps = Pkg.TOML.parsefile(\"$srcdir/$pkgname-Deps.toml\")
+ version = join(split(\"$pkgver\", \".\")[1:2],\".\")
+ deps = Dict{String,Any}()
+
+ for (key, value) in alldeps
+ vers = split(key, \"-\")
+
+ if version == vers[1] || (version > vers[1] && length(vers) == 2 && version <= vers[2])
+ merge!(deps, value)
+ end
+ end
+
+ Pkg.TOML.print(deps)"
+}
prepare() {
+ # Generate a Project.toml from Registry metadata
+ rm -f Project.toml && touch Project.toml
+ cat $pkgname-Package.toml >> Project.toml
+ echo -e "version = \"$pkgver\"" >> Project.toml
+ echo -e "\n[deps]" >> Project.toml
+ echo -e "$(_deps)" | sort >> Project.toml
+
cd $_pkgname.jl-$pkgver
cat >deps/deps.jl <<'EOF'
if isdefined((@static VERSION < v"0.7.0-DEV.484" ? current_module() : @__MODULE__), :Compat)
@@ -40,15 +77,16 @@ EOF
}
package() {
- install -d "$pkgdir"/usr/share/julia/vendor
+ install -d "$pkgdir"/usr/share/julia/{vendor,packages/$_pkgname}
- cp -r $_pkgname.jl-$pkgver "$pkgdir"/usr/share/julia/vendor/$_pkgname
- install -m644 $pkgname-Package.toml "$pkgdir"/usr/share/julia/vendor/$_pkgname/Project.toml
+ cp -r $_pkgname.jl-$pkgver "$pkgdir"/usr/share/julia/vendor/$_pkgname
+ install -m644 Project.toml "$pkgdir"/usr/share/julia/vendor/$_pkgname/Project.toml
+ ln -s ../../vendor/$_pkgname "$pkgdir"/usr/share/julia/packages/$_pkgname/$(_slug)
install -Dm644 $_pkgname.jl-$pkgver/LICENSE.md "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}
check() {
cd $_pkgname.jl-$pkgver
- HOME=$srcdir JULIA_LOAD_PATH=src: julia test/runtests.jl
+ HOME="$srcdir" JULIA_LOAD_PATH=src:$JULIA_LOAD_PATH julia test/runtests.jl
}