From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:c151::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id AMPoCEihGGTm7QAASxT56A (envelope-from ) for ; Mon, 20 Mar 2023 19:09:12 +0100 Received: from aspmx2.migadu.com ([2001:41d0:2:c151::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id SPndCEihGGQh5AAAauVa8A (envelope-from ) for ; Mon, 20 Mar 2023 19:09:12 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx2.migadu.com (Postfix) with ESMTPS id D433D36F2C for ; Mon, 20 Mar 2023 19:09:11 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1peJHP-0004oK-B7; Mon, 20 Mar 2023 13:26:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1peJHA-0004dX-D3 for guix-patches@gnu.org; Mon, 20 Mar 2023 13:26:29 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1peJHA-0005WK-4d for guix-patches@gnu.org; Mon, 20 Mar 2023 13:26:28 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1peJHA-00044c-03 for guix-patches@gnu.org; Mon, 20 Mar 2023 13:26:28 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#62196] [PATCH 164/223] gnu: Add ruby-importmap-rails. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 20 Mar 2023 17:26:27 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62196 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 62196@debbugs.gnu.org Cc: Maxim Cournoyer Received: via spool by 62196-submit@debbugs.gnu.org id=B62196.167933315314970 (code B ref 62196); Mon, 20 Mar 2023 17:26:27 +0000 Received: (at 62196) by debbugs.gnu.org; 20 Mar 2023 17:25:53 +0000 Received: from localhost ([127.0.0.1]:56169 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1peJGa-0003tI-MP for submit@debbugs.gnu.org; Mon, 20 Mar 2023 13:25:53 -0400 Received: from mail-qt1-f179.google.com ([209.85.160.179]:36786) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1peJFg-0003cF-4n for 62196@debbugs.gnu.org; Mon, 20 Mar 2023 13:24:56 -0400 Received: by mail-qt1-f179.google.com with SMTP id hf2so9822820qtb.3 for <62196@debbugs.gnu.org>; Mon, 20 Mar 2023 10:24:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679333095; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Pi7kva4ROhEwOFpZyI8JqjC7BXvmZrvce05+fxYB1Yg=; b=PnUaerSSQ+GHGWhFuMDJYmGaLhj2K6/aD51QL5ElNGx5wuPrVBuTPE6QCAk+bGpt4d RFob0F+eyQxwGl2l/RpJZWcEiddRU0H2zvNEzktZ0rUUr0gGfUjJcPXKCm1WCY6BGhyk Y0z3Nrl9L7srq6YpAHuG2MkBPyjK6bH1xlYcbtmNtcOpx3YA7bx/W9RcqSLRMHlyd5TO 52dQHk8z8cYHeM7XAAw7JJBLVdGtv/6yAkDUhdOStNeAit/uTqmKqgpn5ozaD+1zULeW m5C4DyMS6/wymhkC4rw7Z/VoEByAOWuOJRX5U3JpnVlCB3/WSF+IgkiGjiXVE2b2sA92 Kwjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679333095; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Pi7kva4ROhEwOFpZyI8JqjC7BXvmZrvce05+fxYB1Yg=; b=iL2ZivgSwqmj7SlgBeBbfWIlRIyEj0H0Qx8Mk7jwd+sv01MJZ7gtudz0oV9gzgF8D0 yzbyuRog7SwxuYzL/AYM6Z6/DXkDXHXW00CP8rIWbgHDGCYiCeaCLE0fGNKjQsYCGtDD 9BdjWpM5mTTX0jX2rvesBXwDYygzlufSQ5naNNqQxTF3ouuP3QjUzf47nM3+H1Gghzh2 8XCR0N/eKGdYttSHzaH0zwsby60c1+LHexL3+NPFOul45RqirespxgIDkF9bjw2508Xm JSoNW0FKemLwNuiLHOrcKpYra8wrRzONEV/Y/a/jHVY+pykJzrVzYD0dK+8odIogYJrL Yqig== X-Gm-Message-State: AO0yUKW/VSnusimrJjmJSLdXdCpOYgI8/ZRJQ1uTQWGsk5Asl6Xi6GKr CiHwmVTi8GmV08FBoik7qeNqFA3fxmw= X-Google-Smtp-Source: AK7set+W+AKJm0xTk+yGpnDjhKuc1u3ArwIfqUsUWPj3LC9OJMyaSg8dUMfL7U7eA09wsh6xYmHY2A== X-Received: by 2002:ac8:5f09:0:b0:3bd:6c0:9c8e with SMTP id x9-20020ac85f09000000b003bd06c09c8emr20448142qta.2.1679333095528; Mon, 20 Mar 2023 10:24:55 -0700 (PDT) Received: from localhost.localdomain (dsl-10-128-46.b2b2c.ca. [72.10.128.46]) by smtp.gmail.com with ESMTPSA id i7-20020a378607000000b007422eee8058sm7769352qkd.125.2023.03.20.10.24.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Mar 2023 10:24:55 -0700 (PDT) From: Maxim Cournoyer Date: Mon, 20 Mar 2023 13:22:50 -0400 Message-Id: <20230320172349.12752-63-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230320172349.12752-1-maxim.cournoyer@gmail.com> References: <20230320172349.12752-1-maxim.cournoyer@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1679335752; a=rsa-sha256; cv=none; b=DeRA4PKZtMC4dbuYm878itPvWYKO5lDbKh6Ki4qUgGAA28OsTl4gllxGJar55Tz5wPCjtZ 06HAnMTARkqw9r5l2fXJDWlQXkacASfaY948zuiD1+3+LZgq+nW862fMcDPdrxMMgt7fyq NPMo9eU82Yvs0qhyazhjmtCQlq7iM4VHvKWfLZz0yPjptgKdssvEkI5xHtQSaKZ3PyikbL IBMKz0BTgqCsjvl0vCu9L9LVdG9BU647qelInQ3N7IIVVb9GSYAF7+Put/fWOq8XTkw7Jp Qm0T6IwdYNCybcKMohC9qsq8puRW7kw9d1/dd/cQyJ5930U22REEgo2I1mWoUg== ARC-Authentication-Results: i=1; aspmx2.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=PnUaerSS; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx2.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1679335752; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=Pi7kva4ROhEwOFpZyI8JqjC7BXvmZrvce05+fxYB1Yg=; b=I4hHdfMdbDmir0XAebfyxeXOkAnC4gA3B2pCFOD7ddvl8A9ji9OSoXdD6wr1K21bT3OYve CksWhmRNWuFnXMsuPpnjE2peoNYHUqisIlwwS785+rjijGX/IE0VA0+e9QUmjt8X9gFcfr LlPzeb/MkDTu4uNahQ81sDLoGX69Wz0swKsP+neeO1qXPkL+1RHEO5mzZl5hM+Pc31M38m w14YWDaYoXfq10SRNyxkdvjkukBjtXufC8PZ4NKn7CAAxqXSWsDDQbbf/ifsPoCaUe5TNM FYkAdn4YXeO167n3oGhEMbshw2bElRM1yhNqxZDYpcsyXIZnrYKXklmYhEaOkA== X-Migadu-Spam-Score: 6.25 X-Spam-Score: 6.25 X-Migadu-Queue-Id: D433D36F2C Authentication-Results: aspmx2.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=PnUaerSS; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx2.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Scanner: scn1.migadu.com X-TUID: WeMfCb5XjESE * gnu/packages/rails.scm (ruby-importmap-rails-bootstrap): New private variable. (ruby-importmap-rails): New variable. --- gnu/packages/rails.scm | 73 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/gnu/packages/rails.scm b/gnu/packages/rails.scm index 802c4b9dec..4abecb8409 100644 --- a/gnu/packages/rails.scm +++ b/gnu/packages/rails.scm @@ -26,6 +26,7 @@ (define-module (gnu packages rails) #:use-module (guix download) #:use-module (guix git-download) #:use-module (guix packages) + #:use-module (guix utils) #:use-module (gnu packages base) #:use-module (gnu packages databases) #:use-module (gnu packages node) @@ -795,6 +796,78 @@ (define-public ruby-bootsnap (home-page "https://github.com/Shopify/bootsnap") (license license:expat))) +;;; A private variant used to bootstrap railties. +(define ruby-importmap-rails-bootstrap + (package + (name "ruby-importmap-rails-bootstrap") + (version "1.1.5") + (source (origin + (method git-fetch) ;for tests + (uri (git-reference + (url "https://github.com/rails/importmap-rails") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1d8pqqqrvsnm8rpr7qkpcxpscif61xymi509v1c62laadvhcmklg")))) + (build-system ruby-build-system) + (arguments (list #:tests? #f)) ;avoid all extra dependencies + ;; Leave out ruby-railties, for bootstrapping purposes. + (propagated-inputs (list ruby-actionpack)) + (synopsis "Tool to manage modern JavaScript in Rails") + (description "Import maps can import JavaScript modules using logical +names that map to versioned/digested files -- directly from the browser. It +makes it possible to build modern JavaScript applications using JavaScript +libraries made for ES modules (ESM) without the need for transpiling or +bundling, which removes the need for Webpack, Yarn, npm, or any other part of +the JavaScript toolchain. All that is needed is the asset pipeline that is +already included in Rails.") + (home-page "https://github.com/rails/importmap-rails") + (license license:expat))) + +(define-public ruby-importmap-rails + (package/inherit ruby-importmap-rails-bootstrap + (name "ruby-importmap-rails") + (arguments + (list #:phases + #~(modify-phases %standard-phases + (add-after 'extract-gemspec 'relax-requirements + (lambda _ + (delete-file "gemfiles/rails_7_propshaft.gemfile.lock") + (substitute* "gemfiles/rails_7_propshaft.gemfile" + ;; Remove appraisal, and add tzinfo-data, which needs to + ;; be in the Gemfile to become available. + ((".*appraisal.*") + "gem 'tzinfo-data'\n") + ;; This gem is for managing *installation* of + ;; webdrivers... we do not want that. + ((".*gem \"webdrivers\".*") "")))) + (add-before 'check 'set-BUNDLE_GEMFILE + (lambda _ + ;; The default Gemfile is for Rails 6. + (setenv "BUNDLE_GEMFILE" + "gemfiles/rails_7_propshaft.gemfile"))) + (add-before 'check 'disable-problematic-tests + (lambda _ + ;; The integration tests require networking; disable them. + (delete-file "test/npm_integration_test.rb") + (delete-file "test/packager_integration_test.rb")))))) + (native-inputs + (list ruby-byebug + ruby-capybara + ruby-propshaft + ruby-rails + ruby-rexml + ruby-selenium-webdriver + ruby-sqlite3 + ruby-stimulus-rails + ruby-turbo-rails + ruby-tzinfo + ruby-tzinfo-data)) + (propagated-inputs + (list ruby-actionpack + ruby-railties)))) + (define-public ruby-marcel (package (name "ruby-marcel") -- 2.39.1