Skip to content

Commit

Permalink
boot
Browse files Browse the repository at this point in the history
  • Loading branch information
leostera committed Jan 13, 2024
0 parents commit 7cf7fc5
Show file tree
Hide file tree
Showing 10 changed files with 2,158 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Build & Test

on:
pull_request:
push:
schedule:
# Prime the caches every Monday
- cron: 0 1 * * MON

permissions: read-all

jobs:
build:
strategy:
fail-fast: false
matrix:
os:
- macos-latest
- ubuntu-latest
ocaml-compiler:
- "5.1"
allow-prerelease-opam:
- true
opam-repositories:
- |-
default: https://github.com/ocaml/opam-repository.git
# include:
# - os: windows-latest
# ocaml-compiler: ocaml-variants.5.1.0+options,ocaml-option-mingw
# allow-prerelease-opam: false
# opam-repositories: |-
# windows-5.0: https://github.com/dra27/opam-repository.git#windows-5.0
# sunset: https://github.com/ocaml-opam/opam-repository-mingw.git#sunset
# default: https://github.com/ocaml/opam-repository.git

runs-on: ${{ matrix.os }}

steps:
- name: Checkout tree
uses: actions/checkout@v4

- name: Set-up OCaml
uses: ocaml/setup-ocaml@v2
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}
allow-prerelease-opam: ${{ matrix.allow-prerelease-opam }}
opam-repositories: ${{ matrix.opam-repositories }}

- run: opam install . --deps-only --with-test

- run: opam exec -- dune build

- run: opam exec -- dune test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_build
Empty file added .ocamlformat
Empty file.
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# libc - raw definitions and bindings to platforms' system libraries

`libc` provides definitions (and in the future bindings) to easily interoperate
with C code (or "C-like" code) on several platforms, and it does this with a
target and architecture aware API.

Platforms included:

* `aarch64-macos-darwin`
* PRs welcome!

## Contributing

Including new platforms, while tedious, is pretty straightforward. We are using Rust's `libc` as a template for what are interesting/useful definitions on each platform.

That way, the easiest way to get started is to find the right platform version
of `libc` for Rust, and translate the definitions.

Common types are currently included in the `types.ml` module, so you can `open
Types` at the top of your new module.

30 changes: 30 additions & 0 deletions dune-project
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
(lang dune 3.12)

(name libc)

(generate_opam_files true)

(source
(github username/reponame))

(authors "Author Name")

(maintainers "Maintainer Name")

(license LICENSE)

(documentation https://url/to/documentation)

(package
(name libc)
(synopsis "A short synopsis")
(description "A longer description")
(depends
(config (>= "0.0.1"))
ocaml
dune
)
(tags
(topics "to describe" your project)))

; See the complete stanza docs at https://dune.readthedocs.io/en/stable/dune-files.html#dune-project
32 changes: 32 additions & 0 deletions libc.opam
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
synopsis: "A short synopsis"
description: "A longer description"
maintainer: ["Maintainer Name"]
authors: ["Author Name"]
license: "LICENSE"
tags: ["topics" "to describe" "your" "project"]
homepage: "https://github.com/username/reponame"
doc: "https://url/to/documentation"
bug-reports: "https://github.com/username/reponame/issues"
depends: [
"config" {>= "0.0.1"}
"ocaml"
"dune" {>= "3.12"}
"odoc" {with-doc}
]
build: [
["dune" "subst"] {dev}
[
"dune"
"build"
"-p"
name
"-j"
jobs
"@install"
"@runtest" {with-test}
"@doc" {with-doc}
]
]
dev-repo: "git+https://github.com/username/reponame.git"
4 changes: 4 additions & 0 deletions libc/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
(library
(public_name libc)
(preprocess
(pps config.ppx)))
4 changes: 4 additions & 0 deletions libc/libc.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
include Libc_aarch64_apple_darwin [@@config
all
( target_os = "darwin",
target_arch = "aarch64" )]
Loading

0 comments on commit 7cf7fc5

Please sign in to comment.