From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Thompson, David" Subject: Re: [PATCH 2/2] gnu: Add ruby-puma. Date: Wed, 8 Jun 2016 09:13:57 -0400 Message-ID: References: <1465390550-4974-1-git-send-email-donttrustben@gmail.com> <1465390550-4974-3-git-send-email-donttrustben@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60164) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bAdJ2-0007ck-Pw for guix-devel@gnu.org; Wed, 08 Jun 2016 09:14:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bAdJ0-0001DN-B8 for guix-devel@gnu.org; Wed, 08 Jun 2016 09:14:00 -0400 Received: from mail-vk0-x243.google.com ([2607:f8b0:400c:c05::243]:36475) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bAdJ0-0001DJ-5M for guix-devel@gnu.org; Wed, 08 Jun 2016 09:13:58 -0400 Received: by mail-vk0-x243.google.com with SMTP id x7so1222659vkf.3 for ; Wed, 08 Jun 2016 06:13:58 -0700 (PDT) In-Reply-To: <1465390550-4974-3-git-send-email-donttrustben@gmail.com> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Ben Woodcroft Cc: guix-devel On Wed, Jun 8, 2016 at 8:55 AM, Ben Woodcroft wrote: > gnu/packages/ruby.scm (ruby-puma): New variable. > gnu/packages/patches/ruby-puma-ignore-broken-test.patch: New file. > gnu/local.mk (dist_patch_DATA): Add it. > --- > gnu/local.mk | 1 + > .../patches/ruby-puma-ignore-broken-test.patch | 13 +++++++ > gnu/packages/ruby.scm | 41 ++++++++++++++++++++++ > 3 files changed, 55 insertions(+) > create mode 100644 gnu/packages/patches/ruby-puma-ignore-broken-test.patch > > diff --git a/gnu/local.mk b/gnu/local.mk > index ff476be..5ff5075 100644 > --- a/gnu/local.mk > +++ b/gnu/local.mk > @@ -733,6 +733,7 @@ dist_patch_DATA = \ > %D%/packages/patches/rpm-CVE-2014-8118.patch \ > %D%/packages/patches/rsem-makefile.patch \ > %D%/packages/patches/ruby-concurrent-ignore-broken-test.patch \ > + %D%/packages/patches/ruby-puma-ignore-broken-test.patch \ > %D%/packages/patches/ruby-symlinkfix.patch \ > %D%/packages/patches/ruby-tzinfo-data-ignore-broken-test.patch\ > %D%/packages/patches/rush-CVE-2013-6889.patch \ > diff --git a/gnu/packages/patches/ruby-puma-ignore-broken-test.patch b/gnu/packages/patches/ruby-puma-ignore-broken-test.patch > new file mode 100644 > index 0000000..fb653dc > --- /dev/null > +++ b/gnu/packages/patches/ruby-puma-ignore-broken-test.patch > @@ -0,0 +1,13 @@ > +diff --git a/test/test_integration.rb b/test/test_integration.rb > +index d9b189c..6e21180 100644 > +--- a/test/test_integration.rb > ++++ b/test/test_integration.rb > +@@ -115,7 +115,7 @@ class TestIntegration < Test::Unit::TestCase > + assert_kind_of Thread, t.join(1), "server didn't stop" > + end > + > +- def test_phased_restart_via_pumactl > ++ def no_test_phased_restart_via_pumactl > + if Puma.jruby? || Puma.windows? > + assert true > + return > diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm > index d2b49ba..add5a32 100644 > --- a/gnu/packages/ruby.scm > +++ b/gnu/packages/ruby.scm > @@ -3939,6 +3939,47 @@ part of the Prawn PDF generator.") > ;; for details." > (license (list license:gpl2 license:gpl3 license:ruby)))) > > +(define-public ruby-puma > + (package > + (name "ruby-puma") > + (version "3.4.0") > + (source > + (origin > + (method url-fetch) > + ;; Fetch from GitHub because distributed gem does not contain tests. > + (uri (string-append "https://github.com/puma/puma/archive/v" > + version ".tar.gz")) > + (file-name (string-append name "-" version ".tar.gz")) > + (sha256 > + (base32 > + "10svyj2jk949y1dmkxyzipk1ddzl4iz9limrcws1zhpganpvq3j8")) > + ;; Ignore broken test reported upstream. > + ;; https://github.com/puma/puma/issues/995 > + (patches (search-patches "ruby-puma-ignore-broken-test.patch")))) > + (build-system ruby-build-system) > + (arguments > + `(#:phases > + (modify-phases %standard-phases > + (add-before 'build 'fix-gemspec > + (lambda _ > + (substitute* "puma.gemspec" > + (("git ls-files") "find * |sort")) > + #t))))) Food for thought: With the prevalence of "git ls-files" in gemspecs (thanks to Bundler), maybe we should consider adding a phase to ruby-build-system that performs this substitution. > + (native-inputs > + `(("ruby-hoe" ,ruby-hoe) > + ("ruby-rake-compiler" ,ruby-rake-compiler) > + ("ruby-hoe-git" ,ruby-hoe-git) > + ("ruby-rack" ,ruby-rack))) Why are these native inputs? rake-compiler makes sense because it's build-time only, but rack is most definitely a runtime dependency that should be in propagated-inputs. What environment have you been using to test these packages? > + (synopsis "Simple, concurrent HTTP server for Ruby/Rack") > + (description > + "Puma is a simple, fast, threaded, and highly concurrent HTTP 1.1 server > +for Ruby/Rack applications. Puma is intended for use in both development and > +production environments. In order to get the best throughput, it is highly > +recommended that you use a Ruby implementation with real threads like Rubinius > +or JRuby.") > + (home-page "http://puma.io") > + (license license:expat))) > + > (define-public ruby-hoe-git > (package > (name "ruby-hoe-git") > -- > 2.7.4 > >