commit 8378ab8edb235575f20d615fd1c02771fe07c10b Author: xenia Date: Wed Apr 17 15:40:49 2024 -0400 initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e867f84 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/_build +/result diff --git a/bin/dune b/bin/dune new file mode 100644 index 0000000..853a6a1 --- /dev/null +++ b/bin/dune @@ -0,0 +1,4 @@ +(executable + (public_name bk910x) + (name main) + (libraries eio_main bk910x)) diff --git a/bin/main.ml b/bin/main.ml new file mode 100644 index 0000000..bc700c2 --- /dev/null +++ b/bin/main.ml @@ -0,0 +1,8 @@ +open Eio.Std + +let main out = + Eio.Flow.copy_string "Hello, world!\n" out + +let () = + Eio_main.run @@ fun env -> + main (Eio.Stdenv.stdout env) diff --git a/bk910x.opam b/bk910x.opam new file mode 100644 index 0000000..31a1df0 --- /dev/null +++ b/bk910x.opam @@ -0,0 +1,28 @@ +# This file is generated by dune, edit dune-project instead +opam-version: "2.0" +synopsis: "driver for BK Precision 9103 & 9104 power supplies" +description: "A longer description" +authors: ["xenia "] +license: "Proprietary" +tags: ["meow"] +doc: "https://git.lain.faith/dragon-tools/bk910x" +depends: [ + "ocaml" + "dune" {>= "3.14"} + "odoc" {with-doc} +] +build: [ + ["dune" "subst"] {dev} + [ + "dune" + "build" + "-p" + name + "-j" + jobs + "@install" + "@runtest" {with-test} + "@doc" {with-doc} + ] +] +dev-repo: "https://git.lain.faith/dragon-tools/bk910x.git" diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..83834f8 --- /dev/null +++ b/default.nix @@ -0,0 +1,2 @@ +{ pkgs ? import {} }: +(pkgs.ocamlPackages.callPackage ./nix/package.nix {}).package diff --git a/dune-project b/dune-project new file mode 100644 index 0000000..bd8bca3 --- /dev/null +++ b/dune-project @@ -0,0 +1,24 @@ +(lang dune 3.14) + +(name bk910x) + +(generate_opam_files true) + +(source + (uri "https://git.lain.faith/dragon-tools/bk910x.git")) + +(authors "xenia ") + +; (maintainers "Maintainer Name") + +(license "Proprietary") + +(documentation "https://git.lain.faith/dragon-tools/bk910x") + +(package + (name bk910x) + (synopsis "driver for BK Precision 9103 & 9104 power supplies") + (description "A longer description") + (depends ocaml dune) + (tags + (meow))) diff --git a/lib/dune b/lib/dune new file mode 100644 index 0000000..9b35450 --- /dev/null +++ b/lib/dune @@ -0,0 +1,3 @@ +(library + (name bk910x) + (libraries eio)) diff --git a/nix/package.nix b/nix/package.nix new file mode 100644 index 0000000..f0bcb17 --- /dev/null +++ b/nix/package.nix @@ -0,0 +1,45 @@ +{ + lib, + mkShell, + + buildDunePackage, + eio, + eio_main, + + ocaml, + dune_3, + odoc, + utop +}: + +{ + package = + let + sourceRoot = ../.; + fs = lib.fileset; + sourceFiles = fs.difference + (fs.gitTracked sourceRoot) + (fs.fileFilter (file: file.hasExt "nix") sourceRoot); + sourceSet = fs.toSource { root = sourceRoot; fileset = sourceFiles; }; + in buildDunePackage rec { + pname = "bk910x"; + version = "devel"; + src = sourceSet; + + minimalOCamlVersion = "5.1"; + dontStrip = true; + + propagatedBuildInputs = [ eio eio_main ]; + }; + + shell = mkShell { + nativeBuildInputs = [ + # base + ocaml dune_3 odoc + # shell + utop + # package deps + eio eio_main + ]; + }; +} diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..f0f6a51 --- /dev/null +++ b/shell.nix @@ -0,0 +1,2 @@ +{ pkgs ? import {} }: +(pkgs.ocamlPackages.callPackage ./nix/package.nix {}).shell diff --git a/test/dune b/test/dune new file mode 100644 index 0000000..99caca4 --- /dev/null +++ b/test/dune @@ -0,0 +1,2 @@ +(test + (name test_bk910x)) diff --git a/test/test_bk910x.ml b/test/test_bk910x.ml new file mode 100644 index 0000000..e69de29