diff --git a/dune-project b/dune-project index 3d2898c..9cd64c9 100644 --- a/dune-project +++ b/dune-project @@ -52,8 +52,6 @@ This package uses 0install's solver algorithm with opam packages using the CUDF interface. ") (depends - fmt - cmdliner cudf (ocaml (>= 4.08.0)) 0install-solver)) diff --git a/lib-cudf/dune b/lib-cudf/dune index b4bd1b8..2566cff 100644 --- a/lib-cudf/dune +++ b/lib-cudf/dune @@ -1,4 +1,4 @@ (library (name opam_0install_cudf) (public_name opam-0install-cudf) - (libraries cudf 0install-solver fmt)) + (libraries cudf 0install-solver)) diff --git a/lib-cudf/model.ml b/lib-cudf/model.ml index 8dc601d..e2435a9 100644 --- a/lib-cudf/model.ml +++ b/lib-cudf/model.ml @@ -39,18 +39,22 @@ module Make (Context : S.CONTEXT) = struct | Dummy (* Used for diagnostics *) let rec pp_version f = function - | RealImpl impl -> Fmt.int f impl.pkg.Cudf.version - | Reject pkg -> Fmt.int f (snd pkg) - | VirtualImpl (_i, deps) -> Fmt.string f (String.concat "&" (List.map (fun d -> Fmt.to_to_string pp_role d.drole) deps)) - | Dummy -> Fmt.string f "(no version)" + | RealImpl impl -> Format.pp_print_int f impl.pkg.Cudf.version + | Reject pkg -> Format.pp_print_int f (snd pkg) + | VirtualImpl (_i, deps) -> + Format.pp_print_string f + (String.concat "&" (List.map (fun d -> Format.asprintf "%a" pp_role d.drole) deps)) + | Dummy -> Format.pp_print_string f "(no version)" and pp_impl f = function - | RealImpl impl -> Fmt.pf f "%s.%d" impl.pkg.Cudf.package impl.pkg.Cudf.version - | Reject pkg -> Fmt.pf f "%s.%d" (fst pkg) (snd pkg) + | RealImpl impl -> Format.fprintf f "%s.%d" impl.pkg.Cudf.package impl.pkg.Cudf.version + | Reject pkg -> Format.fprintf f "%s.%d" (fst pkg) (snd pkg) | VirtualImpl _ as x -> pp_version f x - | Dummy -> Fmt.string f "(no solution found)" + | Dummy -> Format.pp_print_string f "(no solution found)" and pp_role f = function - | Real t -> Fmt.string f t.name - | Virtual (_, impls) -> Fmt.pf f "%a" Fmt.(list ~sep:(unit "|") pp_impl) impls + | Real t -> Format.pp_print_string f t.name + | Virtual (_, impls) -> + Format.pp_print_string f + (String.concat "|" (List.map (Format.asprintf "%a" pp_impl) impls)) let pp_impl_long = pp_impl @@ -244,10 +248,10 @@ module Make (Context : S.CONTEXT) = struct let string_of_restriction = function | { kind = `Prevent; expr = [] } -> "conflict with all versions" - | { kind = `Prevent; expr } -> Fmt.strf "not(%s)" (string_of_version_formula expr) + | { kind = `Prevent; expr } -> Format.asprintf "not(%s)" (string_of_version_formula expr) | { kind = `Ensure; expr } -> string_of_version_formula expr - let describe_problem _impl = Fmt.to_to_string Context.pp_rejection + let describe_problem _impl = Format.asprintf "%a" Context.pp_rejection let version = function | RealImpl impl -> Some (impl.pkg.Cudf.package, impl.pkg.Cudf.version) diff --git a/lib-cudf/opam_0install_cudf.ml b/lib-cudf/opam_0install_cudf.ml index 31d751e..d43d3b0 100644 --- a/lib-cudf/opam_0install_cudf.ml +++ b/lib-cudf/opam_0install_cudf.ml @@ -50,7 +50,7 @@ module Context = struct | Some (`Lt, v) -> "<"^string_of_int v let pp_rejection f = function - | UserConstraint (name, c) -> Fmt.pf f "Rejected by user-specified constraint %s%s" name (print_constr c) + | UserConstraint (name, c) -> Format.fprintf f "Rejected by user-specified constraint %s%s" name (print_constr c) end module Input = Model.Make(Context) diff --git a/lib-cudf/s.ml b/lib-cudf/s.ml index 700e24b..ddc7982 100644 --- a/lib-cudf/s.ml +++ b/lib-cudf/s.ml @@ -5,7 +5,7 @@ module type CONTEXT = sig (** A reason why a package can't be used as input to the solver. e.g. it is for a different platform, or conflicts with a user-provided constraint. *) - val pp_rejection : rejection Fmt.t + val pp_rejection : Format.formatter -> rejection -> unit val candidates : t -> Cudf_types.pkgname -> (Cudf_types.version * (Cudf.package, rejection) result) list (** [candidates t name] is the list of available versions of [name], in order diff --git a/opam-0install-cudf.opam b/opam-0install-cudf.opam index e411a2f..1a0cc07 100644 --- a/opam-0install-cudf.opam +++ b/opam-0install-cudf.opam @@ -21,8 +21,6 @@ doc: "https://ocaml-opam.github.io/opam-0install-solver/" bug-reports: "https://github.com/ocaml-opam/opam-0install-solver/issues" depends: [ "dune" {>= "2.0"} - "fmt" - "cmdliner" "cudf" "ocaml" {>= "4.08.0"} "0install-solver"