From patchwork Mon Mar 20 17:22:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 48341 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id A80A616F3F; Mon, 20 Mar 2023 17:30:39 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 0FF2D16F1D for ; Mon, 20 Mar 2023 17:30:36 +0000 (GMT) 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 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+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * 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")