From 668d7683f909cf5349f47e8178f9b9f68d46070c Mon Sep 17 00:00:00 2001 From: Jakub Bogusz Date: Sun, 12 Sep 2021 21:03:21 +0200 Subject: [PATCH] - updated to 1.5.1 - removed obsolete result patch, now it requires ocaml 4.03+ instead of external result library --- ocaml-csexp-result.patch | 92 ---------------------------------------- ocaml-csexp.spec | 42 +++++++++--------- 2 files changed, 23 insertions(+), 111 deletions(-) delete mode 100644 ocaml-csexp-result.patch diff --git a/ocaml-csexp-result.patch b/ocaml-csexp-result.patch deleted file mode 100644 index c1aab55..0000000 --- a/ocaml-csexp-result.patch +++ /dev/null @@ -1,92 +0,0 @@ ---- a/csexp.opam -+++ b/csexp.opam -@@ -32,7 +32,6 @@ bug-reports: "https://github.com/ocaml-d - depends: [ - "dune" {>= "1.11"} - "ocaml" {>= "4.02.3"} -- "result" {>= "1.5"} - ] - dev-repo: "git+https://github.com/ocaml-dune/csexp.git" - build: [ ---- a/src/csexp.ml -+++ b/src/csexp.ml -@@ -102,12 +102,6 @@ end - module Make (Sexp : Sexp) = struct - open Sexp - -- (* This is to keep compatibility with 4.02 without writing [Result.] -- everywhere *) -- type ('a, 'b) result = ('a, 'b) Result.result = -- | Ok of 'a -- | Error of 'b -- - module Parser = struct - exception Parse_error of string - -@@ -370,9 +364,9 @@ module Make (Sexp : Sexp) = struct - - module Monad : Monad - -- val read_string : t -> int -> (string, string) Result.t Monad.t -+ val read_string : t -> int -> (string, string) result Monad.t - -- val read_char : t -> (char, string) Result.t Monad.t -+ val read_char : t -> (char, string) result Monad.t - end - - module Make_parser (Input : Input) = struct ---- a/src/csexp.mli -+++ b/src/csexp.mli -@@ -34,24 +34,24 @@ module type S = sig - [s]. It is an error for [s] to contain a S-expression followed by more - data. In case of error, the offset of the error as well as an error - message is returned. *) -- val parse_string : string -> (sexp, int * string) Result.t -+ val parse_string : string -> (sexp, int * string) result - - (** [parse_string s] parses a sequence of S-expressions encoded in canonical - form in [s] *) -- val parse_string_many : string -> (sexp list, int * string) Result.t -+ val parse_string_many : string -> (sexp list, int * string) result - - (** Read exactly one canonical S-expressions from the given channel. Note that - this function never raises [End_of_file]. Instead, it returns [Error]. *) -- val input : in_channel -> (sexp, string) Result.t -+ val input : in_channel -> (sexp, string) result - - (** Same as [input] but returns [Ok None] if the end of file has already been - reached. If some more characters are available but the end of file is - reached before reading a complete S-expression, this function returns - [Error]. *) -- val input_opt : in_channel -> (sexp option, string) Result.t -+ val input_opt : in_channel -> (sexp option, string) result - - (** Read many S-expressions until the end of input is reached. *) -- val input_many : in_channel -> (sexp list, string) Result.t -+ val input_many : in_channel -> (sexp list, string) result - - (** {2 Serialising} *) - -@@ -353,18 +353,18 @@ module type S = sig - val bind : 'a t -> ('a -> 'b t) -> 'b t - end - -- val read_string : t -> int -> (string, string) Result.t Monad.t -+ val read_string : t -> int -> (string, string) result Monad.t - -- val read_char : t -> (char, string) Result.t Monad.t -+ val read_char : t -> (char, string) result Monad.t - end - [@@deprecated "Use Parser module instead"] - - [@@@warning "-3"] - - module Make_parser (Input : Input) : sig -- val parse : Input.t -> (sexp, string) Result.t Input.Monad.t -+ val parse : Input.t -> (sexp, string) result Input.Monad.t - -- val parse_many : Input.t -> (sexp list, string) Result.t Input.Monad.t -+ val parse_many : Input.t -> (sexp list, string) result Input.Monad.t - end - [@@deprecated "Use Parser module instead"] - end diff --git a/ocaml-csexp.spec b/ocaml-csexp.spec index 04c9109..339b7e7 100644 --- a/ocaml-csexp.spec +++ b/ocaml-csexp.spec @@ -1,6 +1,6 @@ # # Conditional build: -%bcond_without ocaml_opt # skip building native optimized binaries (bytecode is always built) +%bcond_without ocaml_opt # native optimized binaries (bytecode is always built) %bcond_with dune # build with dune, this is off due to circular deps # not yet available on x32 (ocaml 4.02.1), update when upstream will support it @@ -14,20 +14,20 @@ %define module csexp Summary: Parsing and printing of S-expressions in canonical form +Summary(pl.UTF-8): Analiza i wypisywanie S-wyrażeń w postaci kanonicznej Name: ocaml-%{module} -Version: 1.4.0 +Version: 1.5.1 Release: 1 License: MIT +Group: Libraries +#Source0Download: https://github.com/ocaml-dune/csexp/releases Source0: https://github.com/ocaml-dune/csexp/releases/download/%{version}/%{module}-%{version}.tbz -# Source0-md5: d6b5866be24bf8730c127eedca4dc447 +# Source0-md5: 11cf8377dc963ecaf2226df117911676 URL: https://github.com/ocaml-dune/csexp -# Depend on Stdlib.Result instead of ocaml-result. -Patch0: %{name}-result.patch -BuildRequires: ocaml >= 4.02.3 +BuildRequires: ocaml >= 1:4.03.0 %if %{with dune} BuildRequires: ocaml-dune >= 1.11 BuildRequires: ocaml-odoc -BuildRequires: ocaml-result-devel >= 1.5 %endif BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) @@ -36,22 +36,27 @@ This project provides minimal support for parsing and printing S-expressions in canonical form, which is a very simple and canonical binary encoding of S-expressions. +%description -l pl.UTF-8 +Ten projekt zapewnia minimalną obsługę analizy i wypisywania S-wyrażeń +w postaci kanonicznej, będącej bardzo prostym i kanonicznym kodowaniem +binarnym S-wyrażeń. + %package devel -Summary: Development files for %{name} +Summary: Development files for csexp library +Summary(pl.UTF-8): Pliki programistyczne biblioteki csexp +Group: Development/Libraries Requires: %{name} = %{version}-%{release} -%if %{with dune} -Requires: ocaml-result-devel -%endif %description devel -The %{name}-devel package contains libraries and signature files for -developing applications that use %{name}. +This package contains libraries and signature files for developing +applications that use OCaml csexp library. + +%description devel -l pl.UTF-8 +Ten pakiet zawiera biblioteki i pliki sygnatur do tworzenia aplikacji +wykorzystujących bibliotekę OCamla csexp. %prep %setup -q -n %{module}-%{version} -%if %{without dune} -%patch0 -p1 -%endif %build %if %{with dune} @@ -138,9 +143,8 @@ rm -rf $RPM_BUILD_ROOT %files %defattr(644,root,root,755) -%doc README.md -%doc LICENSE.md -%dir %{_libdir}/ocaml/%{module}/ +%doc LICENSE.md README.md +%dir %{_libdir}/ocaml/%{module} %{_libdir}/ocaml/%{module}/META %{_libdir}/ocaml/%{module}/*.cma %{_libdir}/ocaml/%{module}/*.cmi -- 2.43.0