aboutsummaryrefslogtreecommitdiffstats
path: root/testing
diff options
context:
space:
mode:
Diffstat (limited to 'testing')
-rw-r--r--testing/shards/APKBUILD49
-rw-r--r--testing/shards/makefile-install.patch52
-rw-r--r--testing/shards/use-git-bare-instead-of-mirror.patch23
3 files changed, 124 insertions, 0 deletions
diff --git a/testing/shards/APKBUILD b/testing/shards/APKBUILD
new file mode 100644
index 0000000000..df1319da5c
--- /dev/null
+++ b/testing/shards/APKBUILD
@@ -0,0 +1,49 @@
+# Contributor: Jakub Jirutka <jakub@jirutka.cz>
+# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
+pkgname=shards
+pkgver=0.7.2
+pkgrel=0
+_minitestver=0.3.6
+pkgdesc="Dependency manager for the Crystal language"
+url="https://github.com/crystal-lang/shards"
+arch="x86_64 aarch64" # limited by crystal aport
+license="Apache-2.0"
+depends="crystal git"
+makedepends="yaml-dev"
+subpackages="$pkgname-doc"
+source="$pkgname-$pkgver.tar.gz::https://github.com/crystal-lang/$pkgname/archive/v$pkgver.tar.gz
+ minitest.cr-$_minitestver.tar.gz::https://github.com/ysbaddaden/minitest.cr/archive/v$_minitestver.tar.gz
+ use-git-bare-instead-of-mirror.patch
+ makefile-install.patch
+ "
+builddir="$srcdir/$pkgname-$pkgver"
+
+export CRYSTAL_CACHE_DIR="$srcdir/.cache"
+
+prepare() {
+ default_prepare
+ cd "$builddir"
+
+ mkdir -p lib
+ ln -s ../../minitest.cr-$_minitestver lib/minitest
+}
+
+build() {
+ cd "$builddir"
+ make release CRFLAGS=""
+}
+
+check() {
+ cd "$builddir"
+ make test_integration
+}
+
+package() {
+ cd "$builddir"
+ make install DESTDIR="$pkgdir" PREFIX=/usr
+}
+
+sha512sums="a99648ae292095278578e47971b556a0da90743db62689a76aae9eab986ad2185ad7adc13c4340f12fce835c5383d8aac93e35258d01fa658e521314eafaf942 shards-0.7.2.tar.gz
+4f802475c6b1be0d1c8844fed1aeba09b8b2b893f413e25115c1687d35348357e9c0076169e38721bedc3cb31ac2463a7c1b243841554f3eca470608a62438a5 minitest.cr-0.3.6.tar.gz
+3cbe18dee98ade451f1fe1eb05c8d305fccdc76b60e007a1d19f0f25db29551e12060184a1bf72be7c43c449e726da2ec7c012832df9e34bf759590e658186ea use-git-bare-instead-of-mirror.patch
+6d5ff4cd2cdf41a4805f17459c614ddc6fbc98df49304067c927e27aaa6c43460409789c7871cfbead27a6d13d3d9b92b80b2aec9a76eefb9b11cf9feb17045b makefile-install.patch"
diff --git a/testing/shards/makefile-install.patch b/testing/shards/makefile-install.patch
new file mode 100644
index 0000000000..953a321176
--- /dev/null
+++ b/testing/shards/makefile-install.patch
@@ -0,0 +1,52 @@
+From 92bca3f71124749e80fb7a41918a90287681785d Mon Sep 17 00:00:00 2001
+From: Jakub Jirutka <jakub@jirutka.cz>
+Date: Wed, 28 Mar 2018 00:42:00 +0200
+Subject: [PATCH] Makefile: Add install rules
+
+Upstream-Issue: https://github.com/crystal-lang/shards/pull/197
+---
+ Makefile | 19 +++++++++++++++++++
+ README.md | 8 +++++---
+ 2 files changed, 24 insertions(+), 3 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 0440a4b..4acf4d3 100644
+--- a/Makefile
++++ b/Makefile
+@@ -4,6 +4,11 @@ VERSION := $(shell cat VERSION)
+ OS := $(shell uname -s | tr '[:upper:]' '[:lower:]')
+ ARCH := $(shell uname -m)
+
++DESTDIR := /
++PREFIX := /usr/local
++BINDIR := $(DESTDIR)$(PREFIX)/bin
++MANDIR := $(DESTDIR)$(PREFIX)/share/man
++
+ ifeq ($(OS),linux)
+ CRFLAGS := --link-flags "-static -L/opt/crystal/embedded/lib"
+ endif
+@@ -12,6 +17,7 @@ ifeq ($(OS),darwin)
+ CRFLAGS := --link-flags "-L."
+ endif
+
++MANPAGES := $(wildcard src/man/*.[1-8])
+ SOURCES := $(wildcard src/*.cr src/**/*.cr)
+ TEMPLATES := $(wildcard src/templates/*.ecr)
+
+@@ -58,3 +64,16 @@ test_unit:
+ test_integration: all
+ $(CRYSTAL) run test/integration/*_test.cr -- --parallel=1
+
++.PHONY: install
++install: install-bin install-man
++
++.PHONY: install-bin
++install-bin: bin/shards
++ mkdir -p $(BINDIR)
++ cp bin/shards $(BINDIR)/
++
++.PHONY: install-man
++install-man:
++ mkdir -p $(MANDIR)/man1 $(MANDIR)/man5
++ cp $(filter %.1,$(MANPAGES)) $(MANDIR)/man1/
++ cp $(filter %.5,$(MANPAGES)) $(MANDIR)/man5/
diff --git a/testing/shards/use-git-bare-instead-of-mirror.patch b/testing/shards/use-git-bare-instead-of-mirror.patch
new file mode 100644
index 0000000000..95082a6f54
--- /dev/null
+++ b/testing/shards/use-git-bare-instead-of-mirror.patch
@@ -0,0 +1,23 @@
+From 3a64a76b495708a7f3bf7969e85b26817e094cc8 Mon Sep 17 00:00:00 2001
+From: Julien Portalier <julien@portalier.com>
+Date: Tue, 12 Dec 2017 10:19:44 +0100
+Subject: [PATCH] Fix: use git --bare instead of --mirror
+
+Patch-Source: https://github.com/crystal-lang/shards/commit/3a64a76b495708a7f3bf7969e85b26817e094cc8
+---
+ src/resolvers/git.cr | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/resolvers/git.cr b/src/resolvers/git.cr
+index bbc1184..b61adb6 100644
+--- a/src/resolvers/git.cr
++++ b/src/resolvers/git.cr
+@@ -177,7 +177,7 @@ module Shards
+ end
+
+ private def clone_repository
+- run "git clone --mirror --quiet -- #{FileUtils.escape git_url} #{dependency.name}",
++ run "git clone --bare --quiet -- #{FileUtils.escape git_url} #{dependency.name}",
+ path: File.dirname(local_path)
+ rescue Error
+ raise Error.new("Failed to clone #{git_url}")