summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Peukert2021-02-19 00:15:55 +0100
committerDaniel Peukert2021-02-19 00:15:55 +0100
commitd23a1e4cd1161aeb3a5232fd6924ed6fd2346cec (patch)
tree9d738449898b9de795f481421ffa75384f4884b9
downloadaur-d23a1e4cd1161aeb3a5232fd6924ed6fd2346cec.tar.gz
Add ocaml-luv
-rw-r--r--.SRCINFO24
-rw-r--r--.editorconfig8
-rw-r--r--.gitignore14
-rw-r--r--PKGBUILD54
4 files changed, 100 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..85211d95c43c
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,24 @@
+pkgbase = ocaml-luv
+ pkgdesc = Cross-platform asynchronous I/O and system calls
+ pkgver = 0.5.7
+ pkgrel = 1
+ url = https://github.com/aantron/luv
+ arch = x86_64
+ arch = i686
+ arch = arm
+ arch = armv6h
+ arch = armv7h
+ arch = aarch64
+ license = MIT
+ makedepends = dune>=2.0.0
+ depends = libuv
+ depends = ocaml>=4.02.0
+ depends = ocaml-ctypes>=0.13.0
+ depends = ocaml-result
+ options = !strip
+ source = ocaml-luv-0.5.7-1.tar.gz::https://github.com/aantron/luv/archive/0.5.7.tar.gz
+ source = ocaml-luv-0.5.7-1-no-vendored-libuv-headers.diff::https://github.com/aantron/luv/commit/2b009466670799b79c47f61f8d2f5e6c04448572.diff
+ sha256sums = 09b7785cc64f6de465a50d8af54e4ace4c52b23d929a45f5044e7c9942a2558a
+ sha256sums = 86f2fbad97e40dec16de0ff15d159bbce38a6cecf6eab1533da1b7c4c3aa481d
+
+pkgname = ocaml-luv
diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 000000000000..a467ee9a97a6
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,8 @@
+root = true
+
+[*]
+charset = utf-8
+end_of_line = lf
+insert_final_newline = true
+indent_style = tab
+tab_width = 4
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..82b3c183d5d4
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,14 @@
+# from https://github.com/github/gitignore/blob/master/ArchLinuxPackages.gitignore
+*.tar
+*.tar.*
+*.rpm
+*.jar
+*.exe
+*.msi
+*.zip
+*.tgz
+*.log
+*.log.*
+*.sig
+
+*/
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..ff0549f20db2
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,54 @@
+# Maintainer: Daniel Peukert <daniel@peukert.cc>
+_projectname='luv'
+pkgname="ocaml-$_projectname"
+pkgver='0.5.7'
+pkgrel='1'
+pkgdesc='Cross-platform asynchronous I/O and system calls'
+arch=('x86_64' 'i686' 'arm' 'armv6h' 'armv7h' 'aarch64')
+url="https://github.com/aantron/$_projectname"
+license=('MIT')
+depends=('libuv' 'ocaml>=4.02.0' 'ocaml-ctypes>=0.13.0' 'ocaml-result')
+makedepends=('dune>=2.0.0')
+options=('!strip')
+source=(
+ "$pkgname-$pkgver-$pkgrel.tar.gz::$url/archive/$pkgver.tar.gz"
+ "$pkgname-$pkgver-$pkgrel-no-vendored-libuv-headers.diff::$url/commit/2b009466670799b79c47f61f8d2f5e6c04448572.diff"
+)
+sha256sums=('09b7785cc64f6de465a50d8af54e4ace4c52b23d929a45f5044e7c9942a2558a'
+ '86f2fbad97e40dec16de0ff15d159bbce38a6cecf6eab1533da1b7c4c3aa481d')
+
+_sourcedirectory="$_projectname-$pkgver"
+
+prepare() {
+ cd "$srcdir/$_sourcedirectory/"
+ # https://github.com/aantron/luv/commit/2b009466670799b79c47f61f8d2f5e6c04448572
+ patch --forward -p1 < "$srcdir/$pkgname-$pkgver-$pkgrel-no-vendored-libuv-headers.diff"
+
+ # Remove folder with tests, as we don't run them anyway and they contain additional opam files,
+ # which would otherwise get built
+ rm -rf 'test/'
+}
+
+build() {
+ cd "$srcdir/$_sourcedirectory/"
+ LUV_USE_SYSTEM_LIBUV='yes' dune build --release --verbose
+}
+
+# Ignoring this for now, as I would have to package ocaml-alcotest and its dependencies
+# (about 20 packages) just for this single package, which is not something I want to do
+# check() {
+# cd "$srcdir/$_sourcedirectory/"
+# dune runtest --release --verbose
+# }
+
+package() {
+ cd "$srcdir/$_sourcedirectory/"
+ DESTDIR="$pkgdir" dune install --prefix '/usr' --libdir 'lib/ocaml' --release --verbose
+
+ install -dm755 "$pkgdir/usr/share/doc/$pkgname"
+ mv "$pkgdir/usr/doc/$_projectname/"* "$pkgdir/usr/share/doc/$pkgname/"
+ rm -r "$pkgdir/usr/doc/"
+
+ install -dm755 "$pkgdir/usr/share/licenses/$pkgname"
+ ln -sf "/usr/share/doc/$pkgname/LICENSE.md" "$pkgdir/usr/share/licenses/$pkgname/LICENSE.md"
+}