initial commit

This commit is contained in:
xenia 2024-04-17 15:40:49 -04:00
commit 8378ab8edb
11 changed files with 120 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
/_build
/result

4
bin/dune Normal file
View File

@ -0,0 +1,4 @@
(executable
(public_name bk910x)
(name main)
(libraries eio_main bk910x))

8
bin/main.ml Normal file
View File

@ -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)

28
bk910x.opam Normal file
View File

@ -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 <xenia@awoo.systems>"]
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"

2
default.nix Normal file
View File

@ -0,0 +1,2 @@
{ pkgs ? import <nixpkgs> {} }:
(pkgs.ocamlPackages.callPackage ./nix/package.nix {}).package

24
dune-project Normal file
View File

@ -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 <xenia@awoo.systems>")
; (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)))

3
lib/dune Normal file
View File

@ -0,0 +1,3 @@
(library
(name bk910x)
(libraries eio))

45
nix/package.nix Normal file
View File

@ -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
];
};
}

2
shell.nix Normal file
View File

@ -0,0 +1,2 @@
{ pkgs ? import <nixpkgs> {} }:
(pkgs.ocamlPackages.callPackage ./nix/package.nix {}).shell

2
test/dune Normal file
View File

@ -0,0 +1,2 @@
(test
(name test_bk910x))

0
test/test_bk910x.ml Normal file
View File