Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch [directories] to [xdg] to work on Windows #29

Merged
merged 2 commits into from
Feb 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bogue.opam
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ depends: [
"tsdl-ttf" {>= "0.3"}
"ocaml" {>= "4.08.0"}
"tsdl" {>= "0.9.7" & < "0.9.9"}
"directories"
"xdg" {>= "3.4.0"}
"odoc" {with-doc}
]
build: [
Expand Down
2 changes: 1 addition & 1 deletion dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@ Threads when non-blocking reactions are needed.")
(tsdl-ttf (>= 0.3))
(ocaml (>= 4.08.0))
(tsdl (and (>= 0.9.7) (< 0.9.9)))
directories
(xdg (>= 3.4.0))
))
23 changes: 8 additions & 15 deletions lib/b_theme.ml
Original file line number Diff line number Diff line change
Expand Up @@ -95,21 +95,14 @@ let (//) = Filename.concat

(* Some global environment variables *)

module User_dirs = Directories.User_dirs ()
module Project_dirs = Directories.Project_dirs (struct
let qualifier = "org"
let organization = "sanette"
let application = "bogue"
end
)

let home = match User_dirs.home_dir with
| None -> failwith "Can't compute home directory path."
| Some home -> home

let conf = match Project_dirs.config_dir with
| None -> failwith "Can't compute configuration directory path."
| Some config_dir -> config_dir
let xdg = Xdg.create ~env:Sys.getenv_opt ()

let home = Xdg.home_dir xdg

let conf =
let application = "bogue" in
let config_dir = Xdg.config_dir xdg in
config_dir // application

let skip_comment buffer =
let rec loop () =
Expand Down
2 changes: 1 addition & 1 deletion lib/dune
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(library
(name bogue)
(public_name bogue)
(libraries directories str tsdl tsdl-image tsdl-ttf))
(libraries xdg str tsdl tsdl-image tsdl-ttf))

(install
(section share)
Expand Down