From owner-svn-ports-head@freebsd.org Sat Feb 27 10:55:43 2021 Return-Path: Delivered-To: svn-ports-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4A1B0562C47; Sat, 27 Feb 2021 10:55:43 +0000 (UTC) (envelope-from vanilla@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dnk2l1dmgz4jVr; Sat, 27 Feb 2021 10:55:43 +0000 (UTC) (envelope-from vanilla@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2074F1C99B; Sat, 27 Feb 2021 10:55:43 +0000 (UTC) (envelope-from vanilla@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 11RAtgV4065384; Sat, 27 Feb 2021 10:55:42 GMT (envelope-from vanilla@FreeBSD.org) Received: (from vanilla@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 11RAtgDB065381; Sat, 27 Feb 2021 10:55:42 GMT (envelope-from vanilla@FreeBSD.org) Message-Id: <202102271055.11RAtgDB065381@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vanilla set sender to vanilla@FreeBSD.org using -f From: "Vanilla I. Shu" Date: Sat, 27 Feb 2021 10:55:42 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r566688 - in head/devel/elixir-bson: . files X-SVN-Group: ports-head X-SVN-Commit-Author: vanilla X-SVN-Commit-Paths: in head/devel/elixir-bson: . files X-SVN-Commit-Revision: 566688 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Feb 2021 10:55:43 -0000 Author: vanilla Date: Sat Feb 27 10:55:41 2021 New Revision: 566688 URL: https://svnweb.freebsd.org/changeset/ports/566688 Log: Fix building with latest elixir. Added: head/devel/elixir-bson/files/patch-lib_bson__decoder.ex (contents, props changed) head/devel/elixir-bson/files/patch-lib_bson__encoder.ex (contents, props changed) Modified: head/devel/elixir-bson/Makefile head/devel/elixir-bson/files/patch-mix.exs Modified: head/devel/elixir-bson/Makefile ============================================================================== --- head/devel/elixir-bson/Makefile Sat Feb 27 10:54:58 2021 (r566687) +++ head/devel/elixir-bson/Makefile Sat Feb 27 10:55:41 2021 (r566688) @@ -2,14 +2,13 @@ PORTNAME= elixir-bson PORTVERSION= 0.4.4 +PORTREVISION= 1 CATEGORIES= devel MAINTAINER= vanilla@FreeBSD.org COMMENT= BSON implementation in Elixir LICENSE= MIT - -IGNORE= does not build with Elixir 1.6 USES= elixir USE_GITHUB= yes Added: head/devel/elixir-bson/files/patch-lib_bson__decoder.ex ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/elixir-bson/files/patch-lib_bson__decoder.ex Sat Feb 27 10:55:41 2021 (r566688) @@ -0,0 +1,29 @@ +--- lib/bson_decoder.ex.orig 2021-02-27 04:49:09 UTC ++++ lib/bson_decoder.ex +@@ -51,7 +51,7 @@ defmodule Bson.Decoder do + + ``` + """ +- def elist_to_hashdict(elist), do: elist |> Enum.reduce %HashDict{}, fn({k, v}, h) -> HashDict.put(h, k, v) end ++ def elist_to_hashdict(elist), do: elist |> Enum.reduce(%HashDict{}, fn({k, v}, h) -> HashDict.put(h, k, v) end) + + @doc """ + Transform an elist to a Keyword +@@ -62,7 +62,7 @@ defmodule Bson.Decoder do + + ``` + """ +- def elist_to_keyword(elist), do: elist |> Enum.map fn({k, v}) -> {String.to_atom(k), v} end ++ def elist_to_keyword(elist), do: elist |> Enum.map(fn({k, v}) -> {String.to_atom(k), v} end) + + @doc """ + Identity function +@@ -91,7 +91,7 @@ defmodule Bson.Decoder do + ...> %{a: "r"}, + ...> %{a: ""}, + ...> %{a: 1, b: 5} +- ...> ] |> Enum.all? fn(term) -> assert term == term |> Bson.encode |> Bson.decode end ++ ...> ] |> Enum.all?(fn(term) -> assert term == term |> Bson.encode |> Bson.decode end) + true + + iex> term = %{ Added: head/devel/elixir-bson/files/patch-lib_bson__encoder.ex ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/elixir-bson/files/patch-lib_bson__encoder.ex Sat Feb 27 10:55:41 2021 (r566688) @@ -0,0 +1,170 @@ +--- lib/bson_encoder.ex.orig 2021-02-27 04:48:02 UTC ++++ lib/bson_encoder.ex +@@ -1,32 +1,33 @@ +-defmodule Bson.Encoder do +- defprotocol Protocol do +- @moduledoc """ +- `Bson.Encoder.Protocol` protocol defines Bson encoding according to Elxir terms and some Bson predefined structs (see `Bson`). ++defprotocol Bson.Encoder.Protocol do ++ @moduledoc """ ++ `Bson.Encoder.Protocol` protocol defines Bson encoding according to Elxir terms and some Bson predefined structs (see `Bson`). + +- List of the protocol implementations: ++ List of the protocol implementations: + +- * `Map` - Encodes a map into a document +- * `HasDict` - Encodes a HashDict into a document +- * `Keyword` - Encodes a Keyword into a document +- * `List` - Encodes a list of key-alue pairs into a document otherwize encode list into array +- * `Integer` - Encodes integer in 32 or 64 bits +- * `Float` - Encodes float in 64 bits +- * `Atom` - Encodes special atom (`false`, `true`, `nil`, +- `:nan`, `:+inf`, `:-inf`, `MIN_KEY` and `MAX_KEY`) in appropriate format +- others in special type Symbol +- * `BitString` - as binary string +- * `Bson.Regex' - see specs +- * `Bson.ObjectId' - see specs +- * `Bson.JS' - see specs +- * `Bson.Bin' - see specs +- * `Bson.Timestamp ' - see specs +- """ ++ * `Map` - Encodes a map into a document ++ * `HasDict` - Encodes a HashDict into a document ++ * `Keyword` - Encodes a Keyword into a document ++ * `List` - Encodes a list of key-alue pairs into a document otherwize encode list into array ++ * `Integer` - Encodes integer in 32 or 64 bits ++ * `Float` - Encodes float in 64 bits ++ * `Atom` - Encodes special atom (`false`, `true`, `nil`, ++ `:nan`, `:+inf`, `:-inf`, `MIN_KEY` and `MAX_KEY`) in appropriate format ++ others in special type Symbol ++ * `BitString` - as binary string ++ * `Bson.Regex' - see specs ++ * `Bson.ObjectId' - see specs ++ * `Bson.JS' - see specs ++ * `Bson.Bin' - see specs ++ * `Bson.Timestamp ' - see specs ++ """ + +- @doc """ +- Returns a binary representing a term in Bson format +- """ +- def encode(term) +- end ++ @doc """ ++ Returns a binary representing a term in Bson format ++ """ ++ def encode(term) ++end ++ ++defmodule Bson.Encoder do + defmodule Error do + @moduledoc """ + Container for error messages +@@ -56,7 +57,7 @@ defmodule Bson.Encoder do + end + end + +- defimpl Protocol, for: Integer do ++ defimpl Bson.Encoder.Protocol, for: Integer do + @doc """ + iex> Bson.Encoder.Protocol.encode(2) + {<<16>>, <<2, 0, 0, 0>>} +@@ -73,7 +74,7 @@ defmodule Bson.Encoder do + def encode(i), do: %Error{what: [Integer], term: i} + end + +- defimpl Protocol, for: Float do ++ defimpl Bson.Encoder.Protocol, for: Float do + @doc """ + iex> Bson.Encoder.Protocol.encode(1.1) + {<<1>>, <<154, 153, 153, 153, 153, 153, 241, 63>>} +@@ -81,7 +82,7 @@ defmodule Bson.Encoder do + def encode(f), do: {<<0x01>>, <<(f)::size(64)-float-little>>} + end + +- defimpl Protocol, for: Atom do ++ defimpl Bson.Encoder.Protocol, for: Atom do + @doc """ + iex> Bson.Encoder.Protocol.encode(true) + {<<8>>, <<1>>} +@@ -114,7 +115,7 @@ defmodule Bson.Encoder do + def encode(atom), do: {<<0x0e>>, (atom |> Atom.to_string |> Bson.Encoder.wrap_string)} + end + +- defimpl Protocol, for: Bson.UTC do ++ defimpl Bson.Encoder.Protocol, for: Bson.UTC do + @doc """ + iex> Bson.Encoder.Protocol.encode(Bson.UTC.from_now({1390, 324703, 518471})) + {<<9>>, <<30, 97, 207, 181, 67, 1, 0, 0>>} +@@ -123,7 +124,7 @@ defmodule Bson.Encoder do + def encode(utc), do: %Error{what: [Bson.UTC], term: utc} + end + +- defimpl Protocol, for: Bson.Regex do ++ defimpl Bson.Encoder.Protocol, for: Bson.Regex do + @doc """ + iex> Bson.Encoder.Protocol.encode(%Bson.Regex{pattern: "p", opts: "i"}) + {<<11>>, ["p", <<0>>, "i", <<0>>]} +@@ -132,7 +133,7 @@ defmodule Bson.Encoder do + def encode(regex), do: %Error{what: [Bson.Regex], term: regex} + end + +- defimpl Protocol, for: Bson.ObjectId do ++ defimpl Bson.Encoder.Protocol, for: Bson.ObjectId do + @doc """ + iex> Bson.Encoder.Protocol.encode(%Bson.ObjectId{oid: <<0xFF>>}) + {<<0x07>>, <<255>>} +@@ -144,7 +145,7 @@ defmodule Bson.Encoder do + def encode(oid), do: %Error{what: [Bson.ObjectId], term: oid} + end + +- defimpl Protocol, for: Bson.JS do ++ defimpl Bson.Encoder.Protocol, for: Bson.JS do + @doc """ + iex> Bson.Encoder.Protocol.encode(%Bson.JS{code: "1+1;"}) + {<<13>>, [<<5, 0, 0, 0>>, "1+1;", <<0>>]} +@@ -166,7 +167,7 @@ defmodule Bson.Encoder do + defp js_ctx(jsctx), do: <<(byte_size(jsctx)+4)::32-little-signed, jsctx::binary>> + end + +- defimpl Protocol, for: Bson.Bin do ++ defimpl Bson.Encoder.Protocol, for: Bson.Bin do + @doc """ + iex> Bson.Encoder.Protocol.encode(%Bson.Bin{bin: "e", subtype: Bson.Bin.subtyx(:user)}) + {<<5>>,[<<1, 0, 0, 0>>, 128, "e"]} +@@ -178,7 +179,7 @@ defmodule Bson.Encoder do + def encode(bin, subtype), do: %Error{what: [Bson.Bin], term: {bin, subtype}} + end + +- defimpl Protocol, for: Bson.Timestamp do ++ defimpl Bson.Encoder.Protocol, for: Bson.Timestamp do + @doc """ + iex> Bson.Encoder.Protocol.encode(%Bson.Timestamp{inc: 1, ts: 2}) + {<<17>>,<<1, 0, 0, 0, 2, 0, 0, 0>>} +@@ -190,7 +191,7 @@ defmodule Bson.Encoder do + def encode(ts), do: %Error{what: [Bson.Timestamp], term: ts} + end + +- defimpl Protocol, for: BitString do ++ defimpl Bson.Encoder.Protocol, for: BitString do + @doc """ + iex> Bson.Encoder.Protocol.encode("a") + {<<2>>, [<<2, 0, 0, 0>>, "a", <<0>>]} +@@ -199,7 +200,7 @@ defmodule Bson.Encoder do + def encode(bits), do: %Error{what: [BitString], term: bits} + end + +- defimpl Protocol, for: List do ++ defimpl Bson.Encoder.Protocol, for: List do + @doc """ + iex> Bson.Encoder.Protocol.encode([]) + {<<4>>,<<5, 0, 0, 0, 0>>} +@@ -241,7 +242,7 @@ defmodule Bson.Encoder do + end + end + +- defimpl Protocol, for: [Map, HashDict, Keyword] do ++ defimpl Bson.Encoder.Protocol, for: [Map, HashDict, Keyword] do + @doc """ + # Map + iex> Bson.Encoder.Protocol.encode(%{}) Modified: head/devel/elixir-bson/files/patch-mix.exs ============================================================================== --- head/devel/elixir-bson/files/patch-mix.exs Sat Feb 27 10:54:58 2021 (r566687) +++ head/devel/elixir-bson/files/patch-mix.exs Sat Feb 27 10:55:41 2021 (r566688) @@ -1,6 +1,6 @@ ---- mix.exs.orig 2015-09-26 08:10:10 UTC +--- mix.exs.orig 2015-09-18 11:00:09 UTC +++ mix.exs -@@ -5,7 +5,6 @@ defmodule Bson.Mixfile do +@@ -5,11 +5,10 @@ defmodule Bson.Mixfile do [ app: :bson, name: "bson", version: "0.4.3", @@ -8,3 +8,8 @@ description: "BSON implementation for Elixir", source_url: "https://github.com/checkiz/elixir-bson", deps: deps(Mix.env), +- package: package, ++ package: package(), + docs: &docs/0 ] + end +