diff --git a/packages/gmp-freestanding/gmp-freestanding.6.0.0-1/descr b/packages/gmp-freestanding/gmp-freestanding.6.0.0-1/descr new file mode 100644 index 00000000000..95679c55eef --- /dev/null +++ b/packages/gmp-freestanding/gmp-freestanding.6.0.0-1/descr @@ -0,0 +1,3 @@ +The GNU Multiple Precision Arithmetic Library + +Freestanding build of GNU GMP. diff --git a/packages/gmp-freestanding/gmp-freestanding.6.0.0-1/files/gmp-freestanding.pc b/packages/gmp-freestanding/gmp-freestanding.6.0.0-1/files/gmp-freestanding.pc new file mode 100644 index 00000000000..0bd650e9326 --- /dev/null +++ b/packages/gmp-freestanding/gmp-freestanding.6.0.0-1/files/gmp-freestanding.pc @@ -0,0 +1,9 @@ +libdir=${pcfiledir}/../gmp-freestanding +includedir=${libdir}/include + +Name: gmp-freestanding +Version: 6.0.0 +URL: https://gmplib.org +Description: The GNU Multiple Precision Arithmetic Library +Cflags: -I${includedir} +Libs: -L${libdir} -lgmp-freestanding diff --git a/packages/gmp-freestanding/gmp-freestanding.6.0.0-1/files/mirage-build.sh b/packages/gmp-freestanding/gmp-freestanding.6.0.0-1/files/mirage-build.sh new file mode 100644 index 00000000000..02655055665 --- /dev/null +++ b/packages/gmp-freestanding/gmp-freestanding.6.0.0-1/files/mirage-build.sh @@ -0,0 +1,37 @@ +#!/bin/sh -ex +if [ -z "$PREFIX" ]; then + PREFIX="`opam config var prefix`/lib/gmp-freestanding" +fi + +PKG_CONFIG_DEPS="ocaml-freestanding" +check_deps () { + pkg-config --print-errors --exists ${PKG_CONFIG_DEPS} +} + +if ! check_deps 2>/dev/null; then + # rely on `opam` if deps are unavailable + export PKG_CONFIG_PATH="`opam config var prefix`/lib/pkgconfig" +fi +check_deps || exit 1 + +# +# ocaml-freestanding does not provide a real cross compiler, so we fake it: +# +# - set CC to stop configure trying to find a host compiler +# - set CPPFLAGS to ocaml-freestanding CFLAGS, this prevents inclusion of +# system headers +# - manually override tests for missing functions +# - manually trim the components (SUBDIRS) of libgmp we build to the subset +# actually used by zarith-freestanding (our sole dependency) +# - set -Werror=implicit-function-declaration at *build* time to catch any +# undefined symbols +# +ac_cv_func_obstack_vprintf=no \ +ac_cv_func_localeconv=no \ +./configure \ + --host=x86_64-unknown-none --enable-fat --disable-shared --with-pic \ + CC=cc "CPPFLAGS=$(pkg-config --cflags ${PKG_CONFIG_DEPS})" + +make SUBDIRS="mpn mpz mpq mpf" \ + PRINTF_OBJECTS= SCANF_OBJECTS= \ + CFLAGS+=-Werror=implicit-function-declaration diff --git a/packages/gmp-freestanding/gmp-freestanding.6.0.0-1/files/mirage-install.sh b/packages/gmp-freestanding/gmp-freestanding.6.0.0-1/files/mirage-install.sh new file mode 100644 index 00000000000..a09b15bfb25 --- /dev/null +++ b/packages/gmp-freestanding/gmp-freestanding.6.0.0-1/files/mirage-install.sh @@ -0,0 +1,14 @@ +#!/bin/sh -ex +if [ -z "$PREFIX" ]; then + PREFIX=`opam config var prefix` +fi +PKG_CONFIG_PATH=${PREFIX}/lib/pkgconfig +LIBDIR=${PREFIX}/lib/gmp-freestanding + +mkdir -p ${PKG_CONFIG_PATH} +cp gmp-freestanding.pc ${PKG_CONFIG_PATH} +mkdir -p ${LIBDIR} +cp .libs/libgmp.a ${LIBDIR}/libgmp-freestanding.a +touch ${LIBDIR}/META +mkdir -p ${LIBDIR}/include +cp gmp.h ${LIBDIR}/include diff --git a/packages/gmp-freestanding/gmp-freestanding.6.0.0-1/opam b/packages/gmp-freestanding/gmp-freestanding.6.0.0-1/opam new file mode 100644 index 00000000000..7c892911f6c --- /dev/null +++ b/packages/gmp-freestanding/gmp-freestanding.6.0.0-1/opam @@ -0,0 +1,18 @@ +opam-version: "1.2" +maintainer: "Martin Lucina " +homepage: "https://gmplib.org/" +license: "GNU LGPL v3 and GNU GPL v2" +authors: "Torbjörn Granlund and contributors" +bug-reports: "mirageos-devel@lists.xenproject.org" + +build: ["sh" "-ex" "./mirage-build.sh"] +install: ["sh" "-ex" "./mirage-install.sh"] +remove: [ + "rm" "-rf" + "%{prefix}%/lib/pkgconfig/gmp-freestanding.pc" + "%{prefix}%/lib/gmp-freestanding" +] +depends: [ + "ocaml-freestanding" + "conf-m4" {build} +] diff --git a/packages/gmp-freestanding/gmp-freestanding.6.0.0-1/url b/packages/gmp-freestanding/gmp-freestanding.6.0.0-1/url new file mode 100644 index 00000000000..730095af15e --- /dev/null +++ b/packages/gmp-freestanding/gmp-freestanding.6.0.0-1/url @@ -0,0 +1,2 @@ +archive: "https://gmplib.org/download/gmp/gmp-6.0.0a.tar.xz" +checksum: "1e6da4e434553d2811437aa42c7f7c76" diff --git a/packages/gmp-freestanding/gmp-freestanding.6.0.0/opam b/packages/gmp-freestanding/gmp-freestanding.6.0.0/opam index 4b377062e74..7c892911f6c 100644 --- a/packages/gmp-freestanding/gmp-freestanding.6.0.0/opam +++ b/packages/gmp-freestanding/gmp-freestanding.6.0.0/opam @@ -14,4 +14,5 @@ remove: [ ] depends: [ "ocaml-freestanding" + "conf-m4" {build} ] diff --git a/packages/gmp-xen/gmp-xen.6.0.0-1/descr b/packages/gmp-xen/gmp-xen.6.0.0-1/descr new file mode 100644 index 00000000000..eaf41b48a2d --- /dev/null +++ b/packages/gmp-xen/gmp-xen.6.0.0-1/descr @@ -0,0 +1 @@ +The GNU Multiple Precision Arithmetic Library diff --git a/packages/gmp-xen/gmp-xen.6.0.0-1/files/gmp-6a.diff b/packages/gmp-xen/gmp-xen.6.0.0-1/files/gmp-6a.diff new file mode 100644 index 00000000000..6c54c67c543 --- /dev/null +++ b/packages/gmp-xen/gmp-xen.6.0.0-1/files/gmp-6a.diff @@ -0,0 +1,20 @@ +--- gmp-6.0.0.orig.orig/config.guess 2014-03-25 14:37:55.000000000 +0000 ++++ gmp-6.0.0.orig/config.guess 2014-09-16 15:46:57.457485087 +0000 +@@ -173,7 +173,7 @@ + ;; + + arm*-*-*) +- cpu_code=`sed -n 's/^CPU part.*\(0x.*\)$/\1/p' /proc/cpuinfo 2>/dev/null` ++ cpu_code=`sed -n 's/^CPU part.*\(0x.*\)$/\1/p' /proc/cpuinfo | head -1 2>/dev/null` + case "$cpu_code" in + 0xa10 | 0xa11 | 0xb11) # v4 strongarm/sa1100 + exact_cpu="armsa1";; +@@ -200,7 +200,7 @@ + 0xc15) exact_cpu="armcortexr5";; # v7r + 0xc23) exact_cpu="armcortexm3";; # v7m + esac +- exact_cpu="${exact_cpu}`sed -n 's;^Features.*\(neon\).*;\1;p' /proc/cpuinfo 2>/dev/null`" ++ exact_cpu="${exact_cpu}`sed -n 's;^Features.*\(neon\).*;\1;p' /proc/cpuinfo | head -1 2>/dev/null`" + ;; + + ia64*-*-*) diff --git a/packages/gmp-xen/gmp-xen.6.0.0-1/files/gmp-xen.pc b/packages/gmp-xen/gmp-xen.6.0.0-1/files/gmp-xen.pc new file mode 100644 index 00000000000..f1c77838b6f --- /dev/null +++ b/packages/gmp-xen/gmp-xen.6.0.0-1/files/gmp-xen.pc @@ -0,0 +1,9 @@ +libdir=${pcfiledir}/../gmp-xen +includedir=${libdir}/include + +Name: gmp-xen +Version: 6.0.0 +URL: https://gmplib.org +Description: The GNU Multiple Precision Arithmetic Library +Cflags: -I${includedir} +Libs: -L${libdir} -lgmp-xen diff --git a/packages/gmp-xen/gmp-xen.6.0.0-1/files/mirage-build.sh b/packages/gmp-xen/gmp-xen.6.0.0-1/files/mirage-build.sh new file mode 100644 index 00000000000..12471bf2078 --- /dev/null +++ b/packages/gmp-xen/gmp-xen.6.0.0-1/files/mirage-build.sh @@ -0,0 +1,31 @@ +#!/bin/sh -ex +if [ -z "$PREFIX" ]; then + PREFIX="`opam config var prefix`/lib/gmp-xen" +fi + +PKG_CONFIG_DEPS="mirage-xen-posix" +check_deps () { + pkg-config --print-errors --exists ${PKG_CONFIG_DEPS} +} + +if ! check_deps 2>/dev/null; then + # rely on `opam` if deps are unavailable + export PKG_CONFIG_PATH="`opam config var prefix`/lib/pkgconfig" +fi +check_deps || exit 1 + +CPPFLAGS="$CPPFLAGS `pkg-config $PKG_CONFIG_DEPS --cflags` -O2 -pedantic -fomit-frame-pointer -fno-builtin -D_FORTIFY_SOURCE=0 -Wmissing-prototypes --std=gnu99" +# Use different --host and --build to trigger cross-compilation mode (don't try to test binaries during configure) +# Set CC to stop it trying to find a separate compiler for HOST. +# Pass CPPFLAGS (not just CFLAGS) to stop it finding the Linux headers (just generates warnings). +# Use -Werror=missing-prototypes because we're not running the tests due to cross-compiling. +HOST="`uname -m`-unknown-none" +BUILD=`./config.guess` +./configure --host="$HOST" --build="$BUILD" --enable-fat CC=gcc --prefix="$PREFIX" --disable-shared CPPFLAGS="$CPPFLAGS" --with-pic +# Because we're cross-compiling, configurate can't tell whether a function +# actually exists and just assumes they all do. For localeconv, this is wrong. +sed -e '/HAVE_LOCALECONV/d' \ + -e '/HAVE_OBSTACK_VPRINTF/d'\ + -i config.status +./config.status +make diff --git a/packages/gmp-xen/gmp-xen.6.0.0-1/files/mirage-install.sh b/packages/gmp-xen/gmp-xen.6.0.0-1/files/mirage-install.sh new file mode 100644 index 00000000000..56b3d7a35bc --- /dev/null +++ b/packages/gmp-xen/gmp-xen.6.0.0-1/files/mirage-install.sh @@ -0,0 +1,13 @@ +#!/bin/sh -ex +if [ -z "$PREFIX" ]; then + PREFIX=`opam config var prefix` +fi +LIBDIR="$PREFIX/lib/gmp-xen" +PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig" +export PKG_CONFIG_PATH + +make install +mkdir -p "$PKG_CONFIG_PATH" +cp gmp-xen.pc "$PKG_CONFIG_PATH/" +mkdir -p "$LIBDIR" +cp .libs/libgmp.a "$LIBDIR/libgmp-xen.a" diff --git a/packages/gmp-xen/gmp-xen.6.0.0-1/opam b/packages/gmp-xen/gmp-xen.6.0.0-1/opam new file mode 100644 index 00000000000..fc95748da80 --- /dev/null +++ b/packages/gmp-xen/gmp-xen.6.0.0-1/opam @@ -0,0 +1,18 @@ +opam-version: "1.2" +maintainer: "Thomas Leonard " +homepage: "https://gmplib.org/" +license: "GNU LGPL v3 and GNU GPL v2" +authors: "Torbjörn Granlund and contributors" + +patches: ["gmp-6a.diff"] +build: ["sh" "-ex" "./mirage-build.sh"] +install: ["sh" "-ex" "./mirage-install.sh"] +remove: [ + "rm" "-rf" + "%{prefix}%/lib/pkgconfig/gmp-xen.pc" + "%{prefix}%/lib/gmp-xen" +] +depends: [ + "mirage-xen-posix" + "conf-m4" {build} +] diff --git a/packages/gmp-xen/gmp-xen.6.0.0-1/url b/packages/gmp-xen/gmp-xen.6.0.0-1/url new file mode 100644 index 00000000000..730095af15e --- /dev/null +++ b/packages/gmp-xen/gmp-xen.6.0.0-1/url @@ -0,0 +1,2 @@ +archive: "https://gmplib.org/download/gmp/gmp-6.0.0a.tar.xz" +checksum: "1e6da4e434553d2811437aa42c7f7c76" diff --git a/packages/gmp-xen/gmp-xen.6.0.0/opam b/packages/gmp-xen/gmp-xen.6.0.0/opam index 72313b24f50..fc95748da80 100644 --- a/packages/gmp-xen/gmp-xen.6.0.0/opam +++ b/packages/gmp-xen/gmp-xen.6.0.0/opam @@ -2,6 +2,7 @@ opam-version: "1.2" maintainer: "Thomas Leonard " homepage: "https://gmplib.org/" license: "GNU LGPL v3 and GNU GPL v2" +authors: "Torbjörn Granlund and contributors" patches: ["gmp-6a.diff"] build: ["sh" "-ex" "./mirage-build.sh"] @@ -13,4 +14,5 @@ remove: [ ] depends: [ "mirage-xen-posix" + "conf-m4" {build} ] diff --git a/packages/solo5-kernel-ukvm/solo5-kernel-ukvm.0.2.2-1/descr b/packages/solo5-kernel-ukvm/solo5-kernel-ukvm.0.2.2-1/descr new file mode 100644 index 00000000000..3bd4e813baf --- /dev/null +++ b/packages/solo5-kernel-ukvm/solo5-kernel-ukvm.0.2.2-1/descr @@ -0,0 +1,5 @@ +Solo5 unikernel base (ukvm target) + +This package provides the Solo5 base layer to run MirageOS unikernels on the +"ukvm" target. ukvm, a specialized unikernel monitor, runs as a Linux process +and uses KVM. diff --git a/packages/solo5-kernel-ukvm/solo5-kernel-ukvm.0.2.2-1/files/solo5-no-asm-msr-index.diff b/packages/solo5-kernel-ukvm/solo5-kernel-ukvm.0.2.2-1/files/solo5-no-asm-msr-index.diff new file mode 100644 index 00000000000..dcacc6cb504 --- /dev/null +++ b/packages/solo5-kernel-ukvm/solo5-kernel-ukvm.0.2.2-1/files/solo5-no-asm-msr-index.diff @@ -0,0 +1,20 @@ +--- a/ukvm/ukvm-core.c ++++ b/ukvm/ukvm-core.c +@@ -36,7 +36,6 @@ + #include + #include + #include +-#include + #include + #include + #include +--- a/ukvm/ukvm-cpu.h ++++ b/ukvm/ukvm-cpu.h +@@ -133,4 +133,7 @@ struct _kvm_segment { + seg.avl = GDT_GET_AVL(gdt_ent); \ + } while (0) + ++#define EFER_LME_BIT 8 /* Long mode enable (R/W) */ ++#define EFER_LME _BITUL(EFER_LME_BIT) ++ + #endif diff --git a/packages/solo5-kernel-ukvm/solo5-kernel-ukvm.0.2.2-1/files/solo5-no-werror.diff b/packages/solo5-kernel-ukvm/solo5-kernel-ukvm.0.2.2-1/files/solo5-no-werror.diff new file mode 100644 index 00000000000..e3b5879c211 --- /dev/null +++ b/packages/solo5-kernel-ukvm/solo5-kernel-ukvm.0.2.2-1/files/solo5-no-werror.diff @@ -0,0 +1,19 @@ +--- a/ukvm/ukvm-configure ++++ b/ukvm/ukvm-configure +@@ -40,7 +40,7 @@ + + UKVM_CC?=cc + UKVM_FLAGS=-D__UKVM_HOST__ \$(UKVM_MODULE_FLAGS) +-UKVM_CFLAGS=-Wall -Werror -std=c99 -O2 -g \$(UKVM_FLAGS) ++UKVM_CFLAGS=-Wall -std=c99 -O2 -g \$(UKVM_FLAGS) + UKVM_OBJS=_build-ukvm/ukvm-core.o \$(UKVM_MODULE_OBJS) + ifdef UKVM_STATIC + UKVM_LDFLAGS=-static +--- a/Makefile.common ++++ b/Makefile.common +@@ -32,4 +32,4 @@ + # Likewise. + LDFLAGS=-nostdlib -z max-page-size=0x1000 -static + # CFLAGS used for building kernel/ and in-tree tests. +-CFLAGS=$(MD_CFLAGS) -isystem $(TOP)/include-host -std=gnu99 -Wall -Wextra -Werror -O2 -g ++CFLAGS=$(MD_CFLAGS) -isystem $(TOP)/include-host -std=gnu99 -Wall -Wextra -O2 -g diff --git a/packages/solo5-kernel-ukvm/solo5-kernel-ukvm.0.2.2-1/opam b/packages/solo5-kernel-ukvm/solo5-kernel-ukvm.0.2.2-1/opam new file mode 100644 index 00000000000..1f69d1a7ced --- /dev/null +++ b/packages/solo5-kernel-ukvm/solo5-kernel-ukvm.0.2.2-1/opam @@ -0,0 +1,25 @@ +opam-version: "1.2" +maintainer: "martin@lucina.net" +authors: [ + "Dan Williams " + "Martin Lucina " + "Ricardo Koller " +] +homepage: "https://github.com/solo5/solo5" +bug-reports: "https://github.com/solo5/solo5/issues" +license: "ISC" +dev-repo: "https://github.com/solo5/solo5.git" +build: [make "ukvm"] +install: [make "opam-ukvm-install" "PREFIX=%{prefix}%"] +remove: [make "opam-ukvm-uninstall" "PREFIX=%{prefix}%"] +depends: "conf-pkg-config" +depexts: [ + [["alpine"] ["linux-headers"]] + [["debian"] ["linux-libc-dev"]] + [["fedora"] ["kernel-headers"]] + [["rhel"] ["kernel-headers"]] + [["ubuntu"] ["linux-libc-dev"]] +] +conflicts: "solo5-kernel-virtio" +available: [ocaml-version >= "4.02.3" & arch = "x86_64" & os = "linux"] +patches: [ "solo5-no-werror.diff" "solo5-no-asm-msr-index.diff" ] diff --git a/packages/solo5-kernel-ukvm/solo5-kernel-ukvm.0.2.2-1/url b/packages/solo5-kernel-ukvm/solo5-kernel-ukvm.0.2.2-1/url new file mode 100644 index 00000000000..f3c6861cb65 --- /dev/null +++ b/packages/solo5-kernel-ukvm/solo5-kernel-ukvm.0.2.2-1/url @@ -0,0 +1,2 @@ +http: "https://github.com/Solo5/solo5/archive/v0.2.2.tar.gz" +checksum: "29e344999bd7476e6e83e9533b8a4dd9" diff --git a/packages/solo5-kernel-virtio/solo5-kernel-virtio.0.2.2-1/descr b/packages/solo5-kernel-virtio/solo5-kernel-virtio.0.2.2-1/descr new file mode 100644 index 00000000000..c103f5873a8 --- /dev/null +++ b/packages/solo5-kernel-virtio/solo5-kernel-virtio.0.2.2-1/descr @@ -0,0 +1,11 @@ +Solo5 unikernel base (virtio target) + +This package provides the Solo5 base layer to run MirageOS unikernels on the +"virtio" target. Unikernels built for the "virtio" target run directly on +existing hypervisors, such as KVM/QEMU and bhyve. + +Additionally, this package installs the "solo5-run-virtio" tool, a wrapper for +launching unikernels on various hypervisors, and the "solo5-mkimage" tool for +building MBR-partitioned disk images with a bootloader and unikernel installed. +The latter includes support for building images suitable for upload to Google +Compute Engine. diff --git a/packages/solo5-kernel-virtio/solo5-kernel-virtio.0.2.2-1/files/solo5-no-werror.diff b/packages/solo5-kernel-virtio/solo5-kernel-virtio.0.2.2-1/files/solo5-no-werror.diff new file mode 100644 index 00000000000..e3b5879c211 --- /dev/null +++ b/packages/solo5-kernel-virtio/solo5-kernel-virtio.0.2.2-1/files/solo5-no-werror.diff @@ -0,0 +1,19 @@ +--- a/ukvm/ukvm-configure ++++ b/ukvm/ukvm-configure +@@ -40,7 +40,7 @@ + + UKVM_CC?=cc + UKVM_FLAGS=-D__UKVM_HOST__ \$(UKVM_MODULE_FLAGS) +-UKVM_CFLAGS=-Wall -Werror -std=c99 -O2 -g \$(UKVM_FLAGS) ++UKVM_CFLAGS=-Wall -std=c99 -O2 -g \$(UKVM_FLAGS) + UKVM_OBJS=_build-ukvm/ukvm-core.o \$(UKVM_MODULE_OBJS) + ifdef UKVM_STATIC + UKVM_LDFLAGS=-static +--- a/Makefile.common ++++ b/Makefile.common +@@ -32,4 +32,4 @@ + # Likewise. + LDFLAGS=-nostdlib -z max-page-size=0x1000 -static + # CFLAGS used for building kernel/ and in-tree tests. +-CFLAGS=$(MD_CFLAGS) -isystem $(TOP)/include-host -std=gnu99 -Wall -Wextra -Werror -O2 -g ++CFLAGS=$(MD_CFLAGS) -isystem $(TOP)/include-host -std=gnu99 -Wall -Wextra -O2 -g diff --git a/packages/solo5-kernel-virtio/solo5-kernel-virtio.0.2.2-1/opam b/packages/solo5-kernel-virtio/solo5-kernel-virtio.0.2.2-1/opam new file mode 100644 index 00000000000..83e9af3058b --- /dev/null +++ b/packages/solo5-kernel-virtio/solo5-kernel-virtio.0.2.2-1/opam @@ -0,0 +1,21 @@ +opam-version: "1.2" +maintainer: "martin@lucina.net" +authors: [ + "Dan Williams " + "Martin Lucina " + "Ricardo Koller " +] +homepage: "https://github.com/solo5/solo5" +bug-reports: "https://github.com/solo5/solo5/issues" +license: "ISC" +dev-repo: "https://github.com/solo5/solo5.git" +build: [make "virtio"] +install: [make "opam-virtio-install" "PREFIX=%{prefix}%"] +remove: [make "opam-virtio-uninstall" "PREFIX=%{prefix}%"] +depends: "conf-pkg-config" +conflicts: "solo5-kernel-ukvm" +available: [ + ocaml-version >= "4.02.3" & (arch = "x86_64" | arch = "amd64") & + os != "darwin" +] +patches: [ "solo5-no-werror.diff" ] diff --git a/packages/solo5-kernel-virtio/solo5-kernel-virtio.0.2.2-1/url b/packages/solo5-kernel-virtio/solo5-kernel-virtio.0.2.2-1/url new file mode 100644 index 00000000000..f3c6861cb65 --- /dev/null +++ b/packages/solo5-kernel-virtio/solo5-kernel-virtio.0.2.2-1/url @@ -0,0 +1,2 @@ +http: "https://github.com/Solo5/solo5/archive/v0.2.2.tar.gz" +checksum: "29e344999bd7476e6e83e9533b8a4dd9" diff --git a/packages/zarith-freestanding/zarith-freestanding.1.6/descr b/packages/zarith-freestanding/zarith-freestanding.1.6/descr new file mode 100644 index 00000000000..0eb288aba3d --- /dev/null +++ b/packages/zarith-freestanding/zarith-freestanding.1.6/descr @@ -0,0 +1,5 @@ +Implements arithmetic and logical operations over arbitrary-precision integers +The Zarith library implements arithmetic and logical operations over +arbitrary-precision integers. It uses GMP to efficiently implement +arithmetic over big integers. Small integers are represented as Caml +unboxed integers, for speed and space economy. diff --git a/packages/zarith-freestanding/zarith-freestanding.1.6/files/config.diff b/packages/zarith-freestanding/zarith-freestanding.1.6/files/config.diff new file mode 100644 index 00000000000..587951fc450 --- /dev/null +++ b/packages/zarith-freestanding/zarith-freestanding.1.6/files/config.diff @@ -0,0 +1,17 @@ +--- a/configure 2016-07-22 21:53:10.872919000 +0200 ++++ b/configure 2016-07-22 21:55:23.788871000 +0200 +@@ -340,12 +340,8 @@ + if test "$gmp" = 'gmp' -o "$gmp" = 'auto'; then + checkinc gmp.h + if test $? -eq 1; then +- checklib gmp +- if test $? -eq 1; then +- gmp='OK' +- cclib="$cclib -lgmp" +- ccdef="-DHAS_GMP $ccdef" +- fi ++ gmp='OK' ++ ccdef="-DHAS_GMP $ccdef" + fi + fi + if test "$gmp" = 'mpir' -o "$gmp" = 'auto'; then diff --git a/packages/zarith-freestanding/zarith-freestanding.1.6/files/mirage-build.sh b/packages/zarith-freestanding/zarith-freestanding.1.6/files/mirage-build.sh new file mode 100644 index 00000000000..44f0b9a54de --- /dev/null +++ b/packages/zarith-freestanding/zarith-freestanding.1.6/files/mirage-build.sh @@ -0,0 +1,17 @@ +#!/bin/sh -eux + +PREFIX=`opam config var prefix` +PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig" +export PKG_CONFIG_PATH + +# WARNING: if you pass invalid cflags here, zarith will silently +# fall back to compiling with the default flags instead! +CFLAGS="$(pkg-config --cflags gmp-freestanding ocaml-freestanding)" \ +LDFLAGS="$(pkg-config --libs gmp-freestanding)" \ +./configure -gmp + +if [ `uname -s` = "FreeBSD" ]; then + gmake +else + make +fi diff --git a/packages/zarith-freestanding/zarith-freestanding.1.6/files/mirage-install.sh b/packages/zarith-freestanding/zarith-freestanding.1.6/files/mirage-install.sh new file mode 100644 index 00000000000..c8f81aafdb7 --- /dev/null +++ b/packages/zarith-freestanding/zarith-freestanding.1.6/files/mirage-install.sh @@ -0,0 +1,12 @@ +#!/bin/sh -eux + +PREFIX=`opam config var prefix` +PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig" +export PKG_CONFIG_PATH + +cp libzarith.a "$PREFIX/lib/zarith/libzarith-freestanding.a" + +# This is a hack to get freestanding_linkopts into the host 'zarith' package. +cat >>"$PREFIX/lib/zarith/META" < "$PREFIX/lib/zarith/META" +rm -f "$PREFIX/lib/zarith/META.tmp" diff --git a/packages/zarith-freestanding/zarith-freestanding.1.6/opam b/packages/zarith-freestanding/zarith-freestanding.1.6/opam new file mode 100644 index 00000000000..d130e6a2290 --- /dev/null +++ b/packages/zarith-freestanding/zarith-freestanding.1.6/opam @@ -0,0 +1,14 @@ +opam-version: "1.2" +authors: "Xavier Leroy" +maintainer: "mirageos-devel" +homepage: "https://forge.ocamlcore.org/projects/zarith" +build: ["sh" "-eux" "./mirage-build.sh"] +install: ["sh" "-eux" "./mirage-install.sh"] +remove: ["sh" "-eux" "./mirage-uninstall.sh"] +depends: [ + "ocaml-freestanding" + "gmp-freestanding" {> "6.0.0"} + "zarith" {= "1.6"} + "ocamlfind" +] +patches: [ "config.diff" ] diff --git a/packages/zarith-freestanding/zarith-freestanding.1.6/url b/packages/zarith-freestanding/zarith-freestanding.1.6/url new file mode 100644 index 00000000000..225e3e4613d --- /dev/null +++ b/packages/zarith-freestanding/zarith-freestanding.1.6/url @@ -0,0 +1,2 @@ +archive: "https://github.com/ocaml/Zarith/archive/release-1.6.tar.gz" +checksum: "6cc3023620048236d2e8d3a21d5f0940" diff --git a/packages/zarith-xen/zarith-xen.1.6/descr b/packages/zarith-xen/zarith-xen.1.6/descr new file mode 100644 index 00000000000..0eb288aba3d --- /dev/null +++ b/packages/zarith-xen/zarith-xen.1.6/descr @@ -0,0 +1,5 @@ +Implements arithmetic and logical operations over arbitrary-precision integers +The Zarith library implements arithmetic and logical operations over +arbitrary-precision integers. It uses GMP to efficiently implement +arithmetic over big integers. Small integers are represented as Caml +unboxed integers, for speed and space economy. diff --git a/packages/zarith-xen/zarith-xen.1.6/files/mirage-install.sh b/packages/zarith-xen/zarith-xen.1.6/files/mirage-install.sh new file mode 100644 index 00000000000..53d421d845a --- /dev/null +++ b/packages/zarith-xen/zarith-xen.1.6/files/mirage-install.sh @@ -0,0 +1,21 @@ +#!/bin/sh -eux + +PREFIX=`opam config var prefix` +PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig" +export PKG_CONFIG_PATH + +LDFLAGS=`pkg-config --libs gmp-xen` +export LDFLAGS + +# WARNING: if you pass invalid cflags here, zarith will silently +# fall back to compiling with the default flags instead! +CFLAGS="`pkg-config --cflags gmp-xen mirage-xen-posix` -O2 -pedantic -fomit-frame-pointer -fno-builtin" +export CFLAGS +./configure +make + +cp libzarith.a "$PREFIX/lib/zarith/libzarith-xen.a" + +cat >>"$PREFIX/lib/zarith/META" < "$PREFIX/lib/zarith/META" +rm -f "$PREFIX/lib/zarith/META.tmp" diff --git a/packages/zarith-xen/zarith-xen.1.6/opam b/packages/zarith-xen/zarith-xen.1.6/opam new file mode 100644 index 00000000000..c0be62aba63 --- /dev/null +++ b/packages/zarith-xen/zarith-xen.1.6/opam @@ -0,0 +1,12 @@ +opam-version: "1.2" +authors: "Xavier Leroy" +maintainer: "mirageos-devel" +homepage: "https://forge.ocamlcore.org/projects/zarith" +install: ["sh" "-eux" "./mirage-install.sh"] +remove: ["sh" "-eux" "./mirage-uninstall.sh"] +depends: [ + "mirage-xen-posix" + "gmp-xen" {> "6.0.0"} + "zarith" {= "1.6"} + "ocamlfind" +] diff --git a/packages/zarith-xen/zarith-xen.1.6/url b/packages/zarith-xen/zarith-xen.1.6/url new file mode 100644 index 00000000000..225e3e4613d --- /dev/null +++ b/packages/zarith-xen/zarith-xen.1.6/url @@ -0,0 +1,2 @@ +archive: "https://github.com/ocaml/Zarith/archive/release-1.6.tar.gz" +checksum: "6cc3023620048236d2e8d3a21d5f0940"