Skip to content

Commit

Permalink
Get rid of pkg-config + new package definitions
Browse files Browse the repository at this point in the history
For mirage/mirage#969
Along with:
mirage-platform: 0612bdbfe1eeb004ad923991178256feb780d14c
ocaml-freestanding: c5bf86ce29872b65a12ac42b9104f15f063d644e

Instead of using pkg-config, cflags and libs are fetched from files in
the library folder.
  • Loading branch information
TheLortex committed Feb 14, 2019
1 parent 8775c09 commit 030a300
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 48 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -4,3 +4,4 @@ setup.data
setup.log
.*.swp
/*.install
.merlin
File renamed without changes.
8 changes: 0 additions & 8 deletions lib_impl/freestanding/cflags.sh

This file was deleted.

6 changes: 4 additions & 2 deletions lib_impl/freestanding/dune
Expand Up @@ -4,11 +4,13 @@
(libraries lwt cstruct mirage-solo5 ocaml-freestanding)
(implements mirage-entropy)
(c_names entropy_cpu_stubs)
(c_flags (:include cflags.sexp) -O3 -std=c99 -Wall -Wpedantic
(c_flags (:include cflags.sexp) (:include custom_flags) -O3 -std=c99 -Wall -Wpedantic
)
)

(rule (copy# ../entropy_cpu_stubs.c entropy_cpu_stubs.c))
(rule (copy# ../entropy.ml entropy.ml))

(rule (with-stdout-to cflags.sexp (run ./cflags.sh)))
(rule (with-stdout-to cflags.sexp (run ../cflags.sh)))

(rule (copy %{lib:ocaml-freestanding:cflags} custom_flags))
4 changes: 2 additions & 2 deletions lib_impl/unix/dune
Expand Up @@ -5,10 +5,10 @@
(implements mirage-entropy)
(c_names entropy_cpu_stubs)
(c_flags (:include cflags.sexp) -O3 -std=c99 -Wall -Wpedantic
)
)
)

(rule (copy# ../entropy_cpu_stubs.c entropy_cpu_stubs.c))
(rule (copy# ../entropy.ml entropy.ml))

(rule (with-stdout-to cflags.sexp (run ./cflags.sh)))
(rule (with-stdout-to cflags.sexp (run ../cflags.sh)))
8 changes: 0 additions & 8 deletions lib_impl/xen/cflags.sh

This file was deleted.

8 changes: 5 additions & 3 deletions lib_impl/xen/dune
Expand Up @@ -4,11 +4,13 @@
(libraries lwt cstruct mirage-xen)
(implements mirage-entropy)
(c_names entropy_cpu_stubs)
(c_flags (:include cflags.sexp) -O3 -std=c99 -Wall -Wpedantic
)
(c_flags (:include cflags.sexp) (:include custom_flags) -O3 -std=c99 -Wall -Wpedantic
)
)

(rule (copy# ../entropy_cpu_stubs.c entropy_cpu_stubs.c))
(rule (copy# ../entropy.ml entropy.ml))

(rule (with-stdout-to cflags.sexp (run ./cflags.sh)))
(rule (with-stdout-to cflags.sexp (run ../cflags.sh)))

(rule (copy %{lib:mirage-xen-posix:posix-cflags} custom_flags))
9 changes: 3 additions & 6 deletions mirage-entropy-freestanding.opam
Expand Up @@ -10,22 +10,19 @@ license: "BSD2"

build: [ "dune" "build" "-p" "mirage-entropy-freestanding"]
depends: [
"dune" {build}
"dune" {build & >= "1.7"}
"ocaml" {>= "4.04.2"}
"cstruct"
"cstruct" {>= "1.4.0"}
"ocaml-freestanding"
"mirage-entropy"
"mirage-solo5"
"lwt"
]
conflicts: [
"cstruct" {<"1.4.0"}
]
tags: [ "org:mirage"]
available: [
arch = "arm" | arch = "x86_32" | arch = "x86_64" | arch = "arm64"
]
synopsis: "Entropy source for MirageOS unikernels"
synopsis: "Mirage entropy implementation for freestanding"
description: """
mirage-entropy implements various entropy sources for MirageOS unikernels:
- timer based ones (see [whirlwind RNG paper](https://www.ieee-security.org/TC/SP2014/papers/Not-So-RandomNumbersinVirtualizedLinuxandtheWhirlwindRNG.pdf))
Expand Down
9 changes: 3 additions & 6 deletions mirage-entropy-unix.opam
Expand Up @@ -10,21 +10,18 @@ license: "BSD2"

build: [ "dune" "build" "-p" "mirage-entropy-unix"]
depends: [
"dune" {build}
"dune" {build & >= "1.7"}
"ocaml" {>= "4.04.2"}
"cstruct"
"cstruct" {>= "1.4.0"}
"lwt"
"mirage-entropy"
"mirage-unix"
]
conflicts: [
"cstruct" {<"1.4.0"}
]
tags: [ "org:mirage"]
available: [
arch = "arm" | arch = "x86_32" | arch = "x86_64" | arch = "arm64"
]
synopsis: "Entropy source for MirageOS unikernels"
synopsis: "Mirage entropy implementation for Unix"
description: """
mirage-entropy implements various entropy sources for MirageOS unikernels:
- timer based ones (see [whirlwind RNG paper](https://www.ieee-security.org/TC/SP2014/papers/Not-So-RandomNumbersinVirtualizedLinuxandtheWhirlwindRNG.pdf))
Expand Down
12 changes: 4 additions & 8 deletions mirage-entropy-xen.opam
Expand Up @@ -10,22 +10,18 @@ license: "BSD2"

build: [ "dune" "build" "-p" "mirage-entropy-xen"]
depends: [
"dune" {build}
"dune" {build & >= "1.7"}
"ocaml" {>= "4.04.2"}
"cstruct"
"mirage-xen"
"cstruct" {>= "1.4.0"}
"mirage-xen" {>= "2.2.0"}
"mirage-entropy"
"lwt"
]
conflicts: [
"cstruct" {<"1.4.0"}
"mirage-xen" {<"2.2.0"}
]
tags: [ "org:mirage"]
available: [
arch = "arm" | arch = "x86_32" | arch = "x86_64" | arch = "arm64"
]
synopsis: "Entropy source for MirageOS unikernels"
synopsis: "Mirage entropy implementation for Xen"
description: """
mirage-entropy implements various entropy sources for MirageOS unikernels:
- timer based ones (see [whirlwind RNG paper](https://www.ieee-security.org/TC/SP2014/papers/Not-So-RandomNumbersinVirtualizedLinuxandtheWhirlwindRNG.pdf))
Expand Down
7 changes: 2 additions & 5 deletions mirage-entropy.opam
Expand Up @@ -10,14 +10,11 @@ license: "BSD2"

build: [ "dune" "build" "-p" "mirage-entropy"]
depends: [
"dune" {build}
"dune" {build & >= "1.7"}
"ocaml" {>= "4.04.2"}
"cstruct"
"cstruct" {>="1.4.0"}
"lwt"
]
conflicts: [
"cstruct" {<"1.4.0"}
]
tags: [ "org:mirage"]
available: [
arch = "arm" | arch = "x86_32" | arch = "x86_64" | arch = "arm64"
Expand Down

0 comments on commit 030a300

Please sign in to comment.