From fb7050472c4b14ea3ec857d022706f929e6f78cd3223f6c6856811a98aecf53f Mon Sep 17 00:00:00 2001 From: Olaf Hering Date: Mon, 4 Apr 2022 15:44:58 +0000 Subject: [PATCH] - Use upstream libvirt.git - Add ocaml-libvirt.patch to build with dune OBS-URL: https://build.opensuse.org/package/show/devel:languages:ocaml/ocaml-libvirt?expand=0&rev=29 --- _service | 9 ++-- ocaml-libvirt-0.6.1.5.tar.xz | 4 +- ocaml-libvirt.changes | 6 +++ ocaml-libvirt.patch | 97 ++++++++++++++++++++++++++++++++++++ ocaml-libvirt.spec | 13 +++-- 5 files changed, 119 insertions(+), 10 deletions(-) create mode 100644 ocaml-libvirt.patch diff --git a/_service b/_service index d25096b..6c306ed 100644 --- a/_service +++ b/_service @@ -1,10 +1,13 @@ ocaml-libvirt - dune + 06c073b25e4c18212b6fd1be77b23431b4612caf git - https://github.com/olafhering/ocaml-libvirt.git - 0.6.1.5 + disable + https://github.com/libvirt/libvirt-ocaml.git + @PARENT_TAG@ + [v]?([^+]+)(.*) + \1 *.tar diff --git a/ocaml-libvirt-0.6.1.5.tar.xz b/ocaml-libvirt-0.6.1.5.tar.xz index 1307841..66edc3f 100644 --- a/ocaml-libvirt-0.6.1.5.tar.xz +++ b/ocaml-libvirt-0.6.1.5.tar.xz @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:76aadd479e050f54c518b010bb8c1e739def3f05e8fb0944975c9ae95312fa73 -size 56432 +oid sha256:2ac5217701ef13184c8ae9037bd0381a38d2cefb6560309bc8b27aae114e2fcc +size 87204 diff --git a/ocaml-libvirt.changes b/ocaml-libvirt.changes index d0de434..bb477cb 100644 --- a/ocaml-libvirt.changes +++ b/ocaml-libvirt.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Apr 4 04:04:04 UTC 2022 - ohering@suse.de + +- Use upstream libvirt.git +- Add ocaml-libvirt.patch to build with dune + ------------------------------------------------------------------- Fri Nov 1 12:34:56 UTC 2019 - ohering@suse.de diff --git a/ocaml-libvirt.patch b/ocaml-libvirt.patch new file mode 100644 index 0000000..30c725b --- /dev/null +++ b/ocaml-libvirt.patch @@ -0,0 +1,97 @@ +--- /dev/null ++++ b/dune-project +@@ -0,0 +1,27 @@ ++(lang dune 1.11) ++ ++(name libvirt) ++ ++(version 0.6.1.5) ++ ++(generate_opam_files true) ++ ++(license "LGPL-2.1-or-later WITH OCaml-LGPL-linking-exception") ++ ++(authors "Richard W.M. Jones ") ++ ++(maintainers "Richard W.M. Jones ") ++ ++(homepage "https://libvirt.org/ocaml/") ++ ++(package ++ (name libvirt) ++ (synopsis "OCaml bindings for libvirt") ++ (description ++ "OCaml bindings for libvirt, allowing you to write OCaml programs and scripts which control virtualisation features.") ++ (depends ++ (dune ++ (>= 1.11)) ++ dune.configurator ++ (ocaml ++ (>= 4.02.0)))) +--- /dev/null ++++ b/examples/dune +@@ -0,0 +1,4 @@ ++(executables ++ (public_names domain_events get_all_domain_stats get_cpu_stats list_domains ++ list_secrets node_info) ++ (libraries libvirt)) +--- /dev/null ++++ b/libvirt/config/discover.ml +@@ -0,0 +1,16 @@ ++module C = Configurator.V1 ++ ++let () = ++C.main ~name:"libvirt" (fun c -> ++ ++let conf = ++ match C.Pkg_config.get c with ++ | None -> C.die "'pkg-config' missing" ++ | Some pc -> ++ match (C.Pkg_config.query pc ~package:"libvirt") with ++ | None -> C.die "'pkg-config libvirt' missing" ++ | Some deps -> deps ++ in ++ ++ C.Flags.write_sexp "c_flags.sexp" conf.cflags; ++ C.Flags.write_sexp "c_library_flags.sexp" conf.libs) +--- /dev/null ++++ b/libvirt/config/dune +@@ -0,0 +1,3 @@ ++(executable ++ (name discover) ++ (libraries dune.configurator)) +--- /dev/null ++++ b/libvirt/dune +@@ -0,0 +1,32 @@ ++(library ++ (name mllibvirt) ++ (public_name libvirt) ++ (synopsis "binding for libvirt") ++ (modules Libvirt Libvirt_version) ++ (wrapped false) ++ (libraries unix) ++ (c_names libvirt_c_common libvirt_c_oneoffs libvirt_generated) ++ (c_flags ++ "-DCAML_NAME_SPACE" ++ (:include c_flags.sexp)) ++ (c_library_flags ++ (:include c_library_flags.sexp))) ++ ++(rule ++ (target libvirt_version.ml) ++ (action ++ (write-file %{target} ++ "let version = \"%{version:libvirt}\"\nlet package = \"libvirt\"\n"))) ++ ++(rule ++ (target libvirt_generated.c) ++ (deps generator.pl) ++ (action ++ (run perl -w generator.pl))) ++ ++(rule ++ (targets c_flags.sexp c_library_flags.sexp) ++ (deps ++ (:discover config/discover.exe)) ++ (action ++ (run %{discover}))) diff --git a/ocaml-libvirt.spec b/ocaml-libvirt.spec index 2261e1e..441d8d1 100644 --- a/ocaml-libvirt.spec +++ b/ocaml-libvirt.spec @@ -1,7 +1,7 @@ # # spec file for package ocaml-libvirt # -# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -21,16 +21,17 @@ Version: 0.6.1.5 Release: 0 %{?ocaml_preserve_bytecode} Summary: OCaml binding for libvirt -License: LGPL-2.0+ +License: LGPL-2.0-or-later Group: Development/Languages/OCaml -Url: http://libvirt.org/ocaml/ +URL: https://opam.ocaml.org/packages/libvirt Source0: %name-%version.tar.xz +Patch0: ocaml-libvirt.patch BuildRequires: ocaml BuildRequires: ocaml-dune -BuildRequires: ocaml-rpm-macros >= 20191101 +BuildRequires: ocaml-rpm-macros >= 20220222 +BuildRequires: perl BuildRequires: ocamlfind(dune.configurator) BuildRequires: ocamlfind(unix) -BuildRequires: perl BuildRequires: pkgconfig(libvirt) %description @@ -66,3 +67,5 @@ dune_test_tolerate_fail='dune_test_tolerate_fail' %_bindir/* %files devel -f %name.files.devel + +%changelog