package the project

This commit is contained in:
xenia 2024-04-25 02:26:41 -04:00
parent e727a180ef
commit c8ae9c20d2
5 changed files with 82 additions and 29 deletions

18
README.md Normal file
View File

@ -0,0 +1,18 @@
# ppx\_unicode
this is an opinionated unicode PPX for ocaml
features
- all bare string literals are enforced UTF-8, and normalized using NFC. this is similar to
<https://github.com/dbuenzli/ppx_utf8_lit>, however this PPX aims for a modern implementation
based on `ppxlib` and defaults to enforced and normalized UTF-8 on all strings
- `Uchar.t` literals:
```ocaml
# "å"[@uchar]
- : Uchar.t = <abstr>
```
- `bytes` literals
```ocaml
# "å"[@bytes]
- : bytes = Bytes.of_string "\195\165"
```

View File

@ -1,26 +1,21 @@
(lang dune 3.15)
(name ppx_unicode)
(version 0.0.1)
(generate_opam_files true)
(source
(github username/reponame))
(authors "Author Name")
(maintainers "Maintainer Name")
(license LICENSE)
(documentation https://url/to/documentation)
(package
(name ppx_unicode)
(synopsis "A short synopsis")
(description "A longer description")
(depends 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
(synopsis "opinionated ppx for string literals")
(description "ppx providing enforced and NFC normalized utf-8 on string literals, uchar literals, and bytes literals")
(license "CC-BY-NC-SA-4.0")
(homepage "https://git.lain.faith/haskal/ppx_unicode")
(bug_reports "https://git.lain.faith/haskal/ppx_unicode")
(authors "xenia <xenia@awoo.systems>")
(maintainers "xenia <xenia@awoo.systems>")
(source
(uri "https://git.lain.faith/haskal/ppx_unicode.git"))
(depends ocaml dune
(ppxlib (>= 0.32))
(uunf (>= 15.1))))

38
package.nix Normal file
View File

@ -0,0 +1,38 @@
{
lib,
mkShell,
buildDunePackage,
ppxlib,
uunf,
ocaml,
dune_3,
odoc,
utop,
enableShell ? false
}:
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 = "ppx_unicode";
version = "0.0.1";
src = sourceSet;
minimalOCamlVersion = "5.1";
dontStrip = true;
buildInputs = [ ppxlib uunf ];
propagatedBuildInputs = [ ];
nativeBuildInputs = lib.optionals enableShell [
ocaml dune_3 odoc utop
];
}

View File

@ -5,4 +5,4 @@
(preprocess
(pps ppxlib.metaquot))
(libraries ppxlib uunf)
(kind ppx_deriver))
(kind ppx_rewriter))

View File

@ -1,17 +1,19 @@
# 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"
version: "0.0.1"
synopsis: "opinionated ppx for string literals"
description:
"ppx providing enforced and NFC normalized utf-8 on string literals, uchar literals, and bytes literals"
maintainer: ["xenia <xenia@awoo.systems>"]
authors: ["xenia <xenia@awoo.systems>"]
license: "LGPL-2.0-or-later"
homepage: "https://git.lain.faith/haskal/ppx_unicode"
bug-reports: "https://git.lain.faith/haskal/ppx_unicode"
depends: [
"ocaml"
"dune" {>= "3.15"}
"ppxlib" {>= "0.32"}
"uunf" {>= "15.1"}
"odoc" {with-doc}
]
build: [
@ -28,4 +30,4 @@ build: [
"@doc" {with-doc}
]
]
dev-repo: "git+https://github.com/username/reponame.git"
dev-repo: "https://git.lain.faith/haskal/ppx_unicode.git"