XDG library path support for OCaml via Eio capabilities
linux macos ocaml xdg

relax constraint, add headers

+17 -1
.gitignore
···
-
_build
+
# OCaml build artifacts
+
_build/
+
*.install
+
*.merlin
+
+
# Third-party sources (fetch locally with opam source)
+
third_party/
+
+
# Editor and OS files
+
.DS_Store
+
*.swp
+
*~
+
.vscode/
+
.idea/
+
+
# Opam local switch
+
_opam/
+2 -2
dune-project
···
(authors "Anil Madhavapeddy")
(homepage "https://tangled.sh/@anil.recoil.org/xdge")
(maintainers "Anil Madhavapeddy <anil@recoil.org>")
-
(bug_reports "https://tangled.sh/@anil.recoil.org/xgde/issues")
+
(bug_reports "https://tangled.sh/@anil.recoil.org/xdge/issues")
(maintenance_intent "(latest)")
(package
···
(ocaml (>= 5.1.0))
(eio (>= 1.1))
(cmdliner (>= 1.2.0))
-
(fmt (>= 0.11.0))
+
fmt
xdg
(eio_main :with-test)
(odoc :with-doc)
+5
lib/xdge.ml
···
+
(*---------------------------------------------------------------------------
+
Copyright (c) 2025 Anil Madhavapeddy <anil@recoil.org>. All rights reserved.
+
SPDX-License-Identifier: ISC
+
---------------------------------------------------------------------------*)
+
type source = Default | Env of string | Cmdline
type t = {
+5
lib/xdge.mli
···
+
(*---------------------------------------------------------------------------
+
Copyright (c) 2025 Anil Madhavapeddy <anil@recoil.org>. All rights reserved.
+
SPDX-License-Identifier: ISC
+
---------------------------------------------------------------------------*)
+
(** XDG Base Directory Specification support with Eio capabilities
This library provides an OCaml implementation of the XDG Base Directory
+5
test/test_paths.ml
···
+
(*---------------------------------------------------------------------------
+
Copyright (c) 2025 Anil Madhavapeddy <anil@recoil.org>. All rights reserved.
+
SPDX-License-Identifier: ISC
+
---------------------------------------------------------------------------*)
+
let test_path_validation () =
Printf.printf "Testing XDG path validation...\n";
(* Test absolute path validation for environment variables *)
+4
test/test_paths.mli
···
+
(*---------------------------------------------------------------------------
+
Copyright (c) 2025 Anil Madhavapeddy <anil@recoil.org>. All rights reserved.
+
SPDX-License-Identifier: ISC
+
---------------------------------------------------------------------------*)
+5
test/xdg_example.ml
···
+
(*---------------------------------------------------------------------------
+
Copyright (c) 2025 Anil Madhavapeddy <anil@recoil.org>. All rights reserved.
+
SPDX-License-Identifier: ISC
+
---------------------------------------------------------------------------*)
+
let run (xdg, cfg) =
Fmt.pr "%a@.%a@.@.%a@.%a@."
Fmt.(styled `Bold string)
+4
test/xdg_example.mli
···
+
(*---------------------------------------------------------------------------
+
Copyright (c) 2025 Anil Madhavapeddy <anil@recoil.org>. All rights reserved.
+
SPDX-License-Identifier: ISC
+
---------------------------------------------------------------------------*)
+1 -1
xdge.opam
···
authors: ["Anil Madhavapeddy"]
license: "ISC"
homepage: "https://tangled.sh/@anil.recoil.org/xdge"
-
bug-reports: "https://tangled.sh/@anil.recoil.org/xgde/issues"
+
bug-reports: "https://tangled.sh/@anil.recoil.org/xdge/issues"
depends: [
"dune" {>= "3.20"}
"ocaml" {>= "5.1.0"}