From patchwork Mon Jul 25 12:16:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philip McGrath X-Patchwork-Id: 40933 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 41BDA27BBEA; Mon, 25 Jul 2022 13:19:51 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED 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 A80FC27BBE9 for ; Mon, 25 Jul 2022 13:19:50 +0100 (BST) Received: from localhost ([::1]:49114 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oFx3t-0000Hu-NL for patchwork@mira.cbaines.net; Mon, 25 Jul 2022 08:19:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47778) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oFx3A-0008MR-Bp for guix-patches@gnu.org; Mon, 25 Jul 2022 08:19:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:59708) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oFx39-0005Oh-SY for guix-patches@gnu.org; Mon, 25 Jul 2022 08:19:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oFx39-0002yB-ON for guix-patches@gnu.org; Mon, 25 Jul 2022 08:19:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#56759] [PATCH 15/20] gnu: Add ruby-anystyle. Resent-From: Philip McGrath Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 25 Jul 2022 12:19:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56759 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 56759@debbugs.gnu.org Cc: Philip McGrath Received: via spool by 56759-submit@debbugs.gnu.org id=B56759.165875151911299 (code B ref 56759); Mon, 25 Jul 2022 12:19:03 +0000 Received: (at 56759) by debbugs.gnu.org; 25 Jul 2022 12:18:39 +0000 Received: from localhost ([127.0.0.1]:49440 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oFx2k-0002w3-CT for submit@debbugs.gnu.org; Mon, 25 Jul 2022 08:18:38 -0400 Received: from mail-qk1-f180.google.com ([209.85.222.180]:44548) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oFx2W-0002v3-2D for 56759@debbugs.gnu.org; Mon, 25 Jul 2022 08:18:25 -0400 Received: by mail-qk1-f180.google.com with SMTP id b25so8405425qka.11 for <56759@debbugs.gnu.org>; Mon, 25 Jul 2022 05:18:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=philipmcgrath.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=p7CbS7TTJuMyZYk1TA2sESgQ7y6tjc89kLkM+qtGXDI=; b=VF6yR4zJhqnh/BrQY0utMyXxBpU5OmCw/neF7ukDMxoVxJ9XSy56I1jJ/fEcSVFY16 8iBq3qUqySjI+yREmAawto5gvLwOurYfMUGg1hBIAwnTzg7JoNJZpabn209vEAGZElIA Jykp6VP/C4kEJ01zr0xM8Us6cl5Te77vTDO8tELCn8q05Tahfs5KF8WHrzZKQl5DruLm EyBguqPGNp7c88VP1+mcSI5/f0Sp6dunE42ESPw56DKtk5J2i+9H/cv1Eqd+VIT+KgT1 VANRfOinYukF32ZdkGbJXXHMn8GsAmFeYGbdTsSAB28Nh+OEnTNMyYPP+6z9KfK9BJZz NgKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=p7CbS7TTJuMyZYk1TA2sESgQ7y6tjc89kLkM+qtGXDI=; b=qbIXTBYz0vWRrd1Ak6YjP3jfwahZ5cT5Gw60XAgGZYxURQKw98xEklsFfC3ZkMNFHb ACws18g3ngfeKn0q5r2p4riZ+IUl1KSwPCZePLS6Tzxf21psEkaGBc4lUwIHEmNz3V35 pC/X7fBETbysH5TBKYsZTZ7zgWC0cswBa8R1+tuifVW1eoRYcm8UkZtJa/L5Xoo1ygam 0cOOjutCwUIEeP78uXHAzcSbOyajQ/PMg0ew4sgDaqDTQGYV2hMA+qtmbfUBtghL9AX5 HeEfM4Abeslzr8Rx4+Khjy34GIGpKrSqAjzmyDaBxEXvCvIyHXWfBVBTUo02mhYvVVck 47Qg== X-Gm-Message-State: AJIora8QQoh8QCdMmjMZ/2F0aLNcMRjf0x8wZoeaYtBqYC6KeMv2uJLp tz+G7pTj3HH1yo2SzzKQyG2HI2yd4G8oM+pD X-Google-Smtp-Source: AGRyM1s5GsgiQ8/DMHfzqvPJ+JRzkari2YT3+xc9i7pXiRGYe6qrzW892GoLGC3rw0w/FevQyFAx8g== X-Received: by 2002:ae9:f307:0:b0:6b5:bf6c:bd23 with SMTP id p7-20020ae9f307000000b006b5bf6cbd23mr8821043qkg.168.1658751498437; Mon, 25 Jul 2022 05:18:18 -0700 (PDT) Received: from localhost (c-73-125-98-51.hsd1.fl.comcast.net. [73.125.98.51]) by smtp.gmail.com with UTF8SMTPSA id x27-20020a05620a0b5b00b006b5e43466ebsm8703020qkg.59.2022.07.25.05.18.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 25 Jul 2022 05:18:18 -0700 (PDT) From: Philip McGrath Date: Mon, 25 Jul 2022 08:16:30 -0400 Message-Id: <6dea4f2c9c4e4cf182f48bac204e3f4c8a10967b.1658750358.git.philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: References: 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" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/ruby.scm (ruby-anystyle): New variable. --- gnu/packages/ruby.scm | 71 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm index 4efc3d5a41..90f269e247 100644 --- a/gnu/packages/ruby.scm +++ b/gnu/packages/ruby.scm @@ -13478,3 +13478,74 @@ (define-public ruby-anystyle-data (description "This gem provides parser dictionary data for AnyStyle.") (license license:bsd-2))) + +(define-public ruby-anystyle + (let ((commit "50f1dd547d28ab4b830e45d70e840cb1898a37b0") + (revision "1")) + ;; Releases point to specific commits, but recent releases haven't been + ;; tagged in Git. Meanwhile, the rubygems archive lacks tests. + (package + (name "ruby-anystyle") + (version (git-version "1.3.14" revision commit)) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/inukshuk/anystyle") + (commit commit))) + (sha256 + (base32 + "0f4qcrywl1kl6qysn24lj3yp85ln4i7za7b7ld2fglyzwcggxwb0")) + (snippet + ;; There is an optional dependency on + ;; , which + ;; seems like it was intended to be free software, but + ;; doesn't have a clear license statement. Maybe someone can + ;; do more sleuthing, or else find a replacement? See also + ;; . For + ;; now, patch it out, but leave a pointer to follow up. + #~(begin + (use-modules (guix build utils)) + (substitute* "Gemfile" + (("gem 'language_detector', github: '[^']*'" orig) + (string-append "# " orig " # unclear license"))) + (substitute* "spec/anystyle/parser_spec.rb" + (("language: 'en'," orig) + (string-append "# " orig " # no lanugage_detector"))))) + (file-name (git-file-name name version)))) + (build-system ruby-build-system) + (propagated-inputs + (list ruby-anystyle-data + ruby-bibtex-ruby + ruby-namae + ruby-wapiti)) + (native-inputs + (list ruby-byebug + ruby-citeproc + ruby-edtf + ruby-rspec + ruby-unicode-scripts)) + (arguments + (list + #:test-target "spec" + #:phases + #~(modify-phases %standard-phases + (add-after 'extract-gemspec 'avoid-bundler + (lambda args + (substitute* "Rakefile" + (("require 'bundler" orig) + (string-append "# " orig " # patched for Guix")) + (("Bundler\\.setup" orig) + (string-append "true # " orig " # patched for Guix"))))) + (add-after 'replace-git-ls-files 'replace-another-git-ls-files + (lambda args + (substitute* "anystyle.gemspec" + (("`git ls-files spec`") + "`find spec -type f | sort`"))))))) + (home-page "https://anystyle.io") + (synopsis "Fast and smart citation reference parsing (Ruby library)") + (description + "AnyStyle is a very fast and smart parser for academic reference lists +and bibliographies. AnyStyle uses powerful machine learning heuristics based +on Conditional Random Fields and aims to make it easy to train the model with +data that is relevant to your parsing needs.") + (license license:bsd-2))))