public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-lang/gleam/files/, dev-lang/gleam/
@ 2024-08-03 12:38 Matthew Smith
  0 siblings, 0 replies; only message in thread
From: Matthew Smith @ 2024-08-03 12:38 UTC (permalink / raw
  To: gentoo-commits

commit:     2483436fff7aef54fd15e6f16cf4f137187dca6d
Author:     Matthew Smith <matthew <AT> gentoo <DOT> org>
AuthorDate: Sat Aug  3 12:34:29 2024 +0000
Commit:     Matthew Smith <matthew <AT> gentoo <DOT> org>
CommitDate: Sat Aug  3 12:34:29 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2483436f

dev-lang/gleam: add 1.4.0

Signed-off-by: Matthew Smith <matthew <AT> gentoo.org>

 dev-lang/gleam/Manifest                            |  2 ++
 .../gleam/files/gleam-1.4.0-rust178-compat.patch   | 28 +++++++++++++++++
 dev-lang/gleam/gleam-1.4.0.ebuild                  | 35 ++++++++++++++++++++++
 3 files changed, 65 insertions(+)

diff --git a/dev-lang/gleam/Manifest b/dev-lang/gleam/Manifest
index 9367b0aa35be..8749eb7bc10f 100644
--- a/dev-lang/gleam/Manifest
+++ b/dev-lang/gleam/Manifest
@@ -1,2 +1,4 @@
 DIST gleam-1.1.0-crates.tar.xz 28586380 BLAKE2B edecdff51966a0091bc915d7e3d4f8d1530f62dd4cb6b2b5d235e0512103c614df028351e61b6793bc56a79f469567a95224cbae3dee7b4932df23d21a5f3c5f SHA512 221675cab2b1ca6e61bbe1a87976640d25e741de4578a8d7ed5be3e552d784596bac1905af2ea06d1b3c5c6efb1ec189aa682d3e9e3f6462fd09d8b31af9603d
 DIST gleam-1.1.0.tar.gz 882622 BLAKE2B 7f3ff5ce346e3f1b8d7a13723ea649f5b6e325a563cd3f4e4c0b227f3d9e4643e1e9cd403dbe9c5e8c93e47c2ae6fe1f137250c0155f8b4acbe324fdcf9efc91 SHA512 265867096b758ab554f0b4228d95b40a30d5796499b29775465d8dc3cc3ad37cf517cf979f33d906229dd33e424708e40a13ea6cf9932b54c573cd2335788695
+DIST gleam-1.4.0-crates.tar.xz 42395452 BLAKE2B 36733afeda26214d4d5078824fe46a7c531b73875fd265727f1e363d799accd0b4e4401798e81ef4c60dba6401e00a5df63ed54fa424d4b7a395ee07a0124676 SHA512 5996bf3e4b11d95c05de9fe02e0f2ea8ca195931098e897ee74cb96515b81cadf7e46bd566d895d79d83ac71058a05a75b2f4a60da6ff9c6e0ad9dd0332daf3a
+DIST gleam-1.4.0.tar.gz 1024520 BLAKE2B 279e454795ff4c29278e7e397b83c5e813645182f12aa2aef1879c87bfcc4e92e47e63ce67fcca0a7673439078fb316f0677e722e0252d87cb010b86a406450a SHA512 8d07726ca0ec02dc83e508e6d44124caa06ce6c8aa61e4cdf1b9443bf9997f2608959c1cd459113b717397c131e874edb1cd313cb1a09b5bdafcfd283f4eb0d5

diff --git a/dev-lang/gleam/files/gleam-1.4.0-rust178-compat.patch b/dev-lang/gleam/files/gleam-1.4.0-rust178-compat.patch
new file mode 100644
index 000000000000..3e3ab1dc1937
--- /dev/null
+++ b/dev-lang/gleam/files/gleam-1.4.0-rust178-compat.patch
@@ -0,0 +1,28 @@
+From b2301ad49894fa7a6edc89a3b2128be274bd2996 Mon Sep 17 00:00:00 2001
+From: Philipp Herzog <ph@flyingcircus.io>
+Date: Sat, 3 Aug 2024 11:10:37 +0200
+Subject: [PATCH] Store formatted variables in a variable
+
+This fixes compilation errors when compiling with slightly less recent
+rust compilers, e.g. 1.78.0 and 1.77.1.
+
+The performance overhead of formatting the string here is neglegible in
+any case since the string is only discarded if there are zero or one
+variables, in which case the extra call to `join` is very cheap.
+
+Upstream: https://github.com/gleam-lang/gleam/pull/3484
+--- a/compiler-core/src/language_server/code_action.rs
++++ b/compiler-core/src/language_server/code_action.rs
+@@ -344,10 +344,11 @@ impl<'ast> ast::visit::Visit<'ast> for LetAssertToCase<'_> {
+         self.visit_typed_pattern(&assignment.pattern);
+         let variables = std::mem::take(&mut self.pattern_variables);
+ 
++        let formatted_all = format!("#({})", variables.join(", "));
+         let assigned = match variables.len() {
+             0 => "_",
+             1 => variables.first().expect("Variables is length one"),
+-            _ => &format!("#({})", variables.join(", ")),
++            _ => &formatted_all,
+         };
+ 
+         let edit = TextEdit {

diff --git a/dev-lang/gleam/gleam-1.4.0.ebuild b/dev-lang/gleam/gleam-1.4.0.ebuild
new file mode 100644
index 000000000000..3a3df1a23182
--- /dev/null
+++ b/dev-lang/gleam/gleam-1.4.0.ebuild
@@ -0,0 +1,35 @@
+# Copyright 2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cargo optfeature
+
+DESCRIPTION="A friendly language for building type-safe, scalable systems!"
+HOMEPAGE="https://gleam.run https://github.com/gleam-lang/gleam"
+SRC_URI="
+	https://github.com/gleam-lang/${PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
+	https://dev.gentoo.org/~matthew/distfiles/${P}-crates.tar.xz
+"
+
+LICENSE="0BSD Apache-2.0 Apache-2.0-with-LLVM-exceptions BSD Boost-1.0 CC0-1.0 ISC MIT MPL-2.0 Unicode-DFS-2016 Unlicense ZLIB openssl"
+SLOT="0"
+KEYWORDS="~amd64"
+
+RDEPEND="dev-lang/erlang:*"
+
+PATCHES=( "${FILESDIR}"/${PN}-1.4.0-rust178-compat.patch )
+
+# rust does not use *FLAGS from make.conf, silence portage warning
+# update with proper path to binaries this crate installs, omit leading /
+QA_FLAGS_IGNORED="usr/bin/${PN}"
+
+src_install() {
+	dodoc CHANGELOG.md
+	cargo_src_install --path compiler-cli
+}
+
+pkg_postinst() {
+	optfeature "erlang package support" dev-util/rebar:3
+	optfeature "javascript runtime" net-libs/nodejs
+}


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2024-08-03 12:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-03 12:38 [gentoo-commits] repo/gentoo:master commit in: dev-lang/gleam/files/, dev-lang/gleam/ Matthew Smith

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox