From 3d8cbdc40ed3f47d37610169ac662753d239f82b Mon Sep 17 00:00:00 2001 From: Kei Kebreau Date: Fri, 16 Feb 2018 14:41:07 -0500 Subject: [PATCH 01/19] gnu: bigloo: Fix source hash. Fixes . * gnu/packages/scheme.scm (bigloo)[source]: Fix hash. --- gnu/packages/scheme.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gnu/packages/scheme.scm b/gnu/packages/scheme.scm index ca885c690c..d5286b312e 100644 --- a/gnu/packages/scheme.scm +++ b/gnu/packages/scheme.scm @@ -207,7 +207,7 @@ (define-public bigloo version ".tar.gz")) (sha256 (base32 - "1xpzxjlq5g8j3jrb908kfaaa0pkynk4rd083hzvb08amhy68sx07")) + "1x7xdgsls277zlf6gcaxs2cj62xj6yvb0qxh0ddmxfamvxba0cf4")) ;; Remove bundled libraries. (modules '((guix build utils))) (snippet From fa7d8ea1a223a78c4a7767bed15327f7cd59e530 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Tue, 13 Feb 2018 01:26:27 +0100 Subject: [PATCH 02/19] gnu: Add colobot. * gnu/packages/games.scm (colobot): New variable. --- gnu/packages/games.scm | 82 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 81 insertions(+), 1 deletion(-) diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm index 5004e72161..6424ede47b 100644 --- a/gnu/packages/games.scm +++ b/gnu/packages/games.scm @@ -32,7 +32,7 @@ ;;; Copyright © 2017 Marius Bakke ;;; Copyright © 2017 Rutger Helling ;;; Copyright © 2017 Roel Janssen -;;; Copyright © 2017 Nicolas Goaziou +;;; Copyright © 2017, 2018 Nicolas Goaziou ;;; ;;; This file is part of GNU Guix. ;;; @@ -5549,3 +5549,83 @@ (define-public badass Github or Gitlab.") (home-page "https://github.com/umayr/badass") (license license:expat)))) + +(define-public colobot + (package + (name "colobot") + (version "0.1.11-alpha") + (source + (origin + (method url-fetch) + (uri (string-append "https://github.com/colobot/colobot/archive/" + "colobot-gold-" version ".tar.gz")) + (sha256 + (base32 + "160rq9fp5vd0qaqr3jvzvzrcxk9cac532y8vx4cvq0a8hgylrbad")))) + (build-system cmake-build-system) + (arguments + `(#:tests? #f ;no test + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'unpack-data + (lambda* (#:key inputs #:allow-other-keys) + (let ((data (assoc-ref inputs "colobot-data"))) + (invoke "tar" "-xvf" data "-Cdata" "--strip-components=1") + #t))) + (add-after 'unpack-data 'install-music + (lambda* (#:key inputs #:allow-other-keys) + ;; Installation process tries to download music files using + ;; "wget" if not already present. Since we are going to install + ;; them, skip "wget" command check. + (substitute* "data/music/CMakeLists.txt" + (("find_program\\(WGET wget\\)") "")) + ;; Effectively install music. + (let ((data (assoc-ref inputs "colobot-music"))) + (invoke "tar" "-xvf" data "-Cdata/music") + #t))) + (add-after 'install 'fix-install-directory + ;; Move binary from "games/" to "bin/". + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (rename-file (string-append out "/games") + (string-append out "/bin")) + #t)))))) + (native-inputs + `(("colobot-data" + ,(origin + (method url-fetch) + (uri (string-append + "https://github.com/colobot/colobot-data/archive/" + "colobot-gold-" version ".tar.gz")) + (sha256 + (base32 + "1pdpsyr41g7xmk03k2g76l214f53ahk04qnkzmsv1fdbbaq7p109")))) + ("colobot-music" + ,(origin + (method url-fetch) + (uri (string-append "https://colobot.info/files/music/" + "colobot-music_ogg_" version ".tar.gz")) + (sha256 + (base32 + "1s86cd36rwkff329mb1ay1wi5qqyi35564ppgr3f4qqz9wj9vs2m")))) + ("gettext" ,gettext-minimal) + ("librsvg" ,librsvg) + ("po4a" ,po4a) + ("python" ,python-wrapper))) + (inputs + `(("boost" ,boost) + ("glew" ,glew) + ("libogg" ,libogg) + ("libpng" ,libpng) + ("libsndfile" ,libsndfile) + ("libvorbis" ,libvorbis) + ("openal" ,openal) + ("physfs" ,physfs) + ("sdl" ,(sdl-union (list sdl2 sdl2-image sdl2-ttf))))) + (synopsis "Educational programming strategy game") + (description "Colobot: Gold Edition is a real-time strategy game, where +you can program your units (bots) in a language called CBOT, which is similar +to C++ and Java. Your mission is to find a new planet to live and survive. +You can save humanity and get programming skills!") + (home-page "https://colobot.info") + (license license:gpl3+))) From 294ae4d7f80a49539f8a01a9440b9eeaf4ae1f96 Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Fri, 16 Feb 2018 21:21:28 +0100 Subject: [PATCH 03/19] gnu: xf86-video-vesa: Update to 2.4.0. * gnu/packages/xorg.scm (xf86-video-vesa): Update to 2.4.0. --- gnu/packages/xorg.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/xorg.scm b/gnu/packages/xorg.scm index 7266dfd19a..f40686eb61 100644 --- a/gnu/packages/xorg.scm +++ b/gnu/packages/xorg.scm @@ -3401,7 +3401,7 @@ (define-public xf86-video-trident (define-public xf86-video-vesa (package (name "xf86-video-vesa") - (version "2.3.4") + (version "2.4.0") (source (origin (method url-fetch) @@ -3411,7 +3411,7 @@ (define-public xf86-video-vesa ".tar.bz2")) (sha256 (base32 - "1haiw8r1z8ihk68d0jqph2wsld13w4qkl86biq46fvyxg7cg9pbv")))) + "1373vsxn6qh00na0s9c09kf09gj78rzi98zq93id8v5zsya3qi5z")))) (build-system gnu-build-system) (inputs `(("xorg-server" ,xorg-server))) (native-inputs `(("pkg-config" ,pkg-config))) From 445929e03868e45a84b386d3703e520b270bd983 Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Fri, 16 Feb 2018 22:08:03 +0100 Subject: [PATCH 04/19] gnu: glpk: Update to 4.65. * gnu/packages/maths.scm (glpk): Update to 4.65. --- gnu/packages/maths.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm index b823efb1ff..3967093170 100644 --- a/gnu/packages/maths.scm +++ b/gnu/packages/maths.scm @@ -339,7 +339,7 @@ (define-public ocaml4.01-gsl (define-public glpk (package (name "glpk") - (version "4.64") + (version "4.65") (source (origin (method url-fetch) @@ -347,7 +347,7 @@ (define-public glpk version ".tar.gz")) (sha256 (base32 - "096cqgjc7vkq6wd8znhcxjbs1s2rym3qf753fqxrrq531vs6g4jk")))) + "040sfaa9jclg2nqdh83w71sv9rc1sznpnfiripjdyr48cady50a2")))) (build-system gnu-build-system) (inputs `(("gmp" ,gmp))) From c8f1a49f0e623401dc14481bbc99ab4c6975ae80 Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Fri, 16 Feb 2018 22:13:38 +0100 Subject: [PATCH 05/19] gnu: git: Update to 2.16.2. * gnu/packages/version-control.scm (git): Update to 2.16.2. --- gnu/packages/version-control.scm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm index 8518fabb78..7c5821e3ee 100644 --- a/gnu/packages/version-control.scm +++ b/gnu/packages/version-control.scm @@ -138,14 +138,14 @@ (define-public git (name "git") ;; XXX When updating Git, check if the special 'git:src' input to cgit needs ;; to be updated as well. - (version "2.16.1") + (version "2.16.2") (source (origin (method url-fetch) (uri (string-append "mirror://kernel.org/software/scm/git/git-" version ".tar.xz")) (sha256 (base32 - "06gay8k29glg4giwphjalcc1fknxw4bmxkmbr3ic3gzxy8vl7bfg")))) + "05y7480f2p7fkncbhf08zz56jbykcp0ia5gl6y3djs0lsa5mfq2m")))) (build-system gnu-build-system) (native-inputs `(("native-perl" ,perl) @@ -158,7 +158,7 @@ (define-public git version ".tar.xz")) (sha256 (base32 - "1ympib7kd818v4wjgfrhxjrmv91n50lgxxg0i9gcqihgy3divrlp")))))) + "01fbmfsqcv7jmyh80yg3fv5jwv78zvxys9b0fd6bdcy89h9ybvj2")))))) (inputs `(("curl" ,curl) ("expat" ,expat) From 4e1efba42be72fe485bb0804ce2f2a03038800c8 Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Sat, 17 Feb 2018 02:15:27 +0100 Subject: [PATCH 06/19] services: xorg: Import (ice-9 rdelim). * gnu/services/xorg.scm (xinitrc): Import (ice-9 rdelim). --- gnu/services/xorg.scm | 1 + 1 file changed, 1 insertion(+) diff --git a/gnu/services/xorg.scm b/gnu/services/xorg.scm index 707dcb1c39..50af2408b1 100644 --- a/gnu/services/xorg.scm +++ b/gnu/services/xorg.scm @@ -318,6 +318,7 @@ (define builder (use-modules (ice-9 match) (ice-9 regex) (ice-9 ftw) + (ice-9 rdelim) (srfi srfi-1) (srfi srfi-26)) From 369eee8763ca34b427860a86c8fe2db0963b52ae Mon Sep 17 00:00:00 2001 From: Ben Woodcroft Date: Sat, 17 Feb 2018 12:44:29 +1000 Subject: [PATCH 07/19] gnu: vsearch: Update to 2.7.1. * gnu/packages/bioinformatics.scm (vsearch): Update to 2.7.1. --- gnu/packages/bioinformatics.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm index 00490dbcbb..86c303f2b1 100644 --- a/gnu/packages/bioinformatics.scm +++ b/gnu/packages/bioinformatics.scm @@ -6370,7 +6370,7 @@ (define-public r-sparql (define-public vsearch (package (name "vsearch") - (version "2.7.0") + (version "2.7.1") (source (origin (method url-fetch) @@ -6380,7 +6380,7 @@ (define-public vsearch (file-name (string-append name "-" version ".tar.gz")) (sha256 (base32 - "0523b8xq5fw60ayl0k5m1fm6yrh1932ljrsz1ys67xnki7p7f1d5")) + "0jlzfgh79fzmb4g7sngzdjjsjyc37icvs1k7vmc2ksxglj6x5i7f")) (patches (search-patches "vsearch-unbundle-cityhash.patch")) (snippet '(begin From 1ecbd859a10d42ead1d2b68342b89ab19952df88 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Sat, 17 Feb 2018 14:01:15 +0100 Subject: [PATCH 08/19] gnu: ghc-mtl: Remove ghc-transformers from inputs. * gnu/packages/haskell.scm (ghc-mtl)[arguments]: Explain why we need to allow a newer version of the transformers package. [inputs]: Remove ghc-transformers. --- gnu/packages/haskell.scm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gnu/packages/haskell.scm b/gnu/packages/haskell.scm index 426939ec5b..1a7e06dd81 100644 --- a/gnu/packages/haskell.scm +++ b/gnu/packages/haskell.scm @@ -1675,10 +1675,11 @@ (define-public ghc-mtl (base32 "1icdbj2rshzn0m1zz5wa7v3xvkf6qw811p4s7jgqwvx1ydwrvrfa")))) (build-system haskell-build-system) + ;; This is an official revision, relaxing the requirement transformers == + ;; 0.4 to transformers >= 0.4 && < 0.6; see + ;; https://hackage.haskell.org/package/mtl-2.2.1/revision/1.cabal (arguments `(#:configure-flags (list "--allow-newer=transformers"))) - (inputs - `(("ghc-transformers" ,ghc-transformers))) (home-page "https://github.com/ekmett/mtl") (synopsis "Monad classes, using functional dependencies") From bb3359ab8e3c20eb91d61509b5ab364d03c9ec3b Mon Sep 17 00:00:00 2001 From: Ben Woodcroft Date: Sun, 18 Feb 2018 00:09:17 +1000 Subject: [PATCH 09/19] gnu: ruby-2.4.3: Update rubygems to 2.7.6. This fixes the security issues described at https://www.ruby-lang.org/en/news/2018/02/17/multiple-vulnerabilities-in- rubygems/ * gnu/packages/patches/ruby-rubygems-276-for-ruby24.patch: New file. * gnu/packages/ruby.scm (ruby-2.4.3)[source]: Use it. * gnu/local.mk (dist_patch_DATA): Add it. --- gnu/local.mk | 1 + .../ruby-rubygems-276-for-ruby24.patch | 605 ++++++++++++++++++ gnu/packages/ruby.scm | 1 + 3 files changed, 607 insertions(+) create mode 100644 gnu/packages/patches/ruby-rubygems-276-for-ruby24.patch diff --git a/gnu/local.mk b/gnu/local.mk index 7fe374208b..735635158f 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1079,6 +1079,7 @@ dist_patch_DATA = \ %D%/packages/patches/rpcbind-CVE-2017-8779.patch \ %D%/packages/patches/rsem-makefile.patch \ %D%/packages/patches/rtags-separate-rct.patch \ + %D%/packages/patches/ruby-rubygems-276-for-ruby24.patch \ %D%/packages/patches/ruby-concurrent-ignore-broken-test.patch \ %D%/packages/patches/ruby-concurrent-test-arm.patch \ %D%/packages/patches/ruby-rack-ignore-failing-test.patch \ diff --git a/gnu/packages/patches/ruby-rubygems-276-for-ruby24.patch b/gnu/packages/patches/ruby-rubygems-276-for-ruby24.patch new file mode 100644 index 0000000000..0d0ed6b204 --- /dev/null +++ b/gnu/packages/patches/ruby-rubygems-276-for-ruby24.patch @@ -0,0 +1,605 @@ +diff --git lib/rubygems.rb lib/rubygems.rb +index 0685bcb3c6..a5a9202e56 100644 +--- ruby-2.4.3/lib/rubygems.rb ++++ ruby-2.4.3/lib/rubygems.rb +@@ -10,7 +10,7 @@ + require 'thread' + + module Gem +- VERSION = "2.6.14" ++ VERSION = "2.6.14.1" + end + + # Must be first since it unloads the prelude from 1.9.2 +diff --git lib/rubygems/commands/owner_command.rb lib/rubygems/commands/owner_command.rb +index 4b99434e87..2ee7f84462 100644 +--- ruby-2.4.3/lib/rubygems/commands/owner_command.rb ++++ ruby-2.4.3/lib/rubygems/commands/owner_command.rb +@@ -62,7 +62,7 @@ def show_owners name + end + + with_response response do |resp| +- owners = YAML.load resp.body ++ owners = Gem::SafeYAML.load resp.body + + say "Owners for gem: #{name}" + owners.each do |owner| +diff --git lib/rubygems/package.rb lib/rubygems/package.rb +index 77811ed5ec..b5a5fe2a26 100644 +--- ruby-2.4.3/lib/rubygems/package.rb ++++ ruby-2.4.3/lib/rubygems/package.rb +@@ -378,7 +378,7 @@ def extract_tar_gz io, destination_dir, pattern = "*" # :nodoc: + File.dirname destination + end + +- FileUtils.mkdir_p mkdir, mkdir_options ++ mkdir_p_safe mkdir, mkdir_options, destination_dir, entry.full_name + + open destination, 'wb' do |out| + out.write entry.read +@@ -416,20 +416,35 @@ def install_location filename, destination_dir # :nodoc: + raise Gem::Package::PathError.new(filename, destination_dir) if + filename.start_with? '/' + +- destination_dir = File.realpath destination_dir if +- File.respond_to? :realpath ++ destination_dir = realpath destination_dir + destination_dir = File.expand_path destination_dir + + destination = File.join destination_dir, filename + destination = File.expand_path destination + + raise Gem::Package::PathError.new(destination, destination_dir) unless +- destination.start_with? destination_dir ++ destination.start_with? destination_dir + '/' + + destination.untaint + destination + end + ++ def mkdir_p_safe mkdir, mkdir_options, destination_dir, file_name ++ destination_dir = realpath File.expand_path(destination_dir) ++ parts = mkdir.split(File::SEPARATOR) ++ parts.reduce do |path, basename| ++ path = realpath path unless path == "" ++ path = File.expand_path(path + File::SEPARATOR + basename) ++ lstat = File.lstat path rescue nil ++ if !lstat || !lstat.directory? ++ unless path.start_with? destination_dir and (FileUtils.mkdir path, mkdir_options rescue false) ++ raise Gem::Package::PathError.new(file_name, destination_dir) ++ end ++ end ++ path ++ end ++ end ++ + ## + # Loads a Gem::Specification from the TarEntry +entry+ + +@@ -603,6 +618,10 @@ def verify_files gem + raise Gem::Package::FormatError.new \ + 'package content (data.tar.gz) is missing', @gem + end ++ ++ if duplicates = @files.group_by {|f| f }.select {|k,v| v.size > 1 }.map(&:first) and duplicates.any? ++ raise Gem::Security::Exception, "duplicate files in the package: (#{duplicates.map(&:inspect).join(', ')})" ++ end + end + + ## +@@ -616,6 +635,16 @@ def verify_gz entry # :nodoc: + raise Gem::Package::FormatError.new(e.message, entry.full_name) + end + ++ if File.respond_to? :realpath ++ def realpath file ++ File.realpath file ++ end ++ else ++ def realpath file ++ file ++ end ++ end ++ + end + + require 'rubygems/package/digest_io' +diff --git lib/rubygems/package/tar_header.rb lib/rubygems/package/tar_header.rb +index c54bd14d57..d557357114 100644 +--- ruby-2.4.3/lib/rubygems/package/tar_header.rb ++++ ruby-2.4.3/lib/rubygems/package/tar_header.rb +@@ -104,25 +104,30 @@ def self.from(stream) + fields = header.unpack UNPACK_FORMAT + + new :name => fields.shift, +- :mode => fields.shift.oct, +- :uid => fields.shift.oct, +- :gid => fields.shift.oct, +- :size => fields.shift.oct, +- :mtime => fields.shift.oct, +- :checksum => fields.shift.oct, ++ :mode => strict_oct(fields.shift), ++ :uid => strict_oct(fields.shift), ++ :gid => strict_oct(fields.shift), ++ :size => strict_oct(fields.shift), ++ :mtime => strict_oct(fields.shift), ++ :checksum => strict_oct(fields.shift), + :typeflag => fields.shift, + :linkname => fields.shift, + :magic => fields.shift, +- :version => fields.shift.oct, ++ :version => strict_oct(fields.shift), + :uname => fields.shift, + :gname => fields.shift, +- :devmajor => fields.shift.oct, +- :devminor => fields.shift.oct, ++ :devmajor => strict_oct(fields.shift), ++ :devminor => strict_oct(fields.shift), + :prefix => fields.shift, + + :empty => empty + end + ++ def self.strict_oct(str) ++ return str.oct if str =~ /\A[0-7]*\z/ ++ raise ArgumentError, "#{str.inspect} is not an octal string" ++ end ++ + ## + # Creates a new TarHeader using +vals+ + +diff --git lib/rubygems/package/tar_writer.rb lib/rubygems/package/tar_writer.rb +index f68b8d4c5e..390f7851a3 100644 +--- ruby-2.4.3/lib/rubygems/package/tar_writer.rb ++++ ruby-2.4.3/lib/rubygems/package/tar_writer.rb +@@ -196,6 +196,8 @@ def add_file_signed name, mode, signer + digest_name == signer.digest_name + end + ++ raise "no #{signer.digest_name} in #{digests.values.compact}" unless signature_digest ++ + if signer.key then + signature = signer.sign signature_digest.digest + +diff --git lib/rubygems/server.rb lib/rubygems/server.rb +index df4eb566d3..a7b5243ba0 100644 +--- ruby-2.4.3/lib/rubygems/server.rb ++++ ruby-2.4.3/lib/rubygems/server.rb +@@ -631,6 +631,18 @@ def root(req, res) + executables = nil if executables.empty? + executables.last["is_last"] = true if executables + ++ # Pre-process spec homepage for safety reasons ++ begin ++ homepage_uri = URI.parse(spec.homepage) ++ if [URI::HTTP, URI::HTTPS].member? homepage_uri.class ++ homepage_uri = spec.homepage ++ else ++ homepage_uri = "." ++ end ++ rescue URI::InvalidURIError ++ homepage_uri = "." ++ end ++ + specs << { + "authors" => spec.authors.sort.join(", "), + "date" => spec.date.to_s, +@@ -640,7 +652,7 @@ def root(req, res) + "only_one_executable" => (executables && executables.size == 1), + "full_name" => spec.full_name, + "has_deps" => !deps.empty?, +- "homepage" => spec.homepage, ++ "homepage" => homepage_uri, + "name" => spec.name, + "rdoc_installed" => Gem::RDoc.new(spec).rdoc_installed?, + "ri_installed" => Gem::RDoc.new(spec).ri_installed?, +diff --git lib/rubygems/specification.rb lib/rubygems/specification.rb +index 40e3a70d47..0a154b9001 100644 +--- ruby-2.4.3/lib/rubygems/specification.rb ++++ ruby-2.4.3/lib/rubygems/specification.rb +@@ -15,6 +15,7 @@ + require 'rubygems/stub_specification' + require 'rubygems/util/list' + require 'stringio' ++require 'uri' + + ## + # The Specification class contains the information for a Gem. Typically +@@ -2813,10 +2814,16 @@ def validate packaging = true + raise Gem::InvalidSpecificationException, "#{lazy} is not a summary" + end + +- if homepage and not homepage.empty? and +- homepage !~ /\A[a-z][a-z\d+.-]*:/i then +- raise Gem::InvalidSpecificationException, +- "\"#{homepage}\" is not a URI" ++ # Make sure a homepage is valid HTTP/HTTPS URI ++ if homepage and not homepage.empty? ++ begin ++ homepage_uri = URI.parse(homepage) ++ unless [URI::HTTP, URI::HTTPS].member? homepage_uri.class ++ raise Gem::InvalidSpecificationException, "\"#{homepage}\" is not a valid HTTP URI" ++ end ++ rescue URI::InvalidURIError ++ raise Gem::InvalidSpecificationException, "\"#{homepage}\" is not a valid HTTP URI" ++ end + end + + # Warnings +diff --git test/rubygems/test_gem_commands_owner_command.rb test/rubygems/test_gem_commands_owner_command.rb +index 44652c1093..53cac4ce87 100644 +--- ruby-2.4.3/test/rubygems/test_gem_commands_owner_command.rb ++++ ruby-2.4.3/test/rubygems/test_gem_commands_owner_command.rb +@@ -43,6 +43,31 @@ def test_show_owners + assert_match %r{- 4}, @ui.output + end + ++ def test_show_owners_dont_load_objects ++ skip "testing a psych-only API" unless defined?(::Psych::DisallowedClass) ++ ++ response = <xsshomepagegem 1 ++ # ++ # ++ # [rdoc] ++ # ++ # ++ # ++ # [www] ++ # ++ # Variant #2 - rdoc installed ++ # ++ # xsshomepagegem 1 ++ # ++ # ++ # \[rdoc\]<\/a> ++ # ++ # ++ # ++ # [www] ++ regex_match = /xsshomepagegem 1<\/b>[\n\s]+(\[rdoc\]<\/span>|\[rdoc\]<\/a>)[\n\s]+\[www\]<\/a>/ ++ assert_match regex_match, @res.body ++ end ++ ++ def test_invalid_homepage ++ data = StringIO.new "GET / HTTP/1.0\r\n\r\n" ++ dir = "#{@gemhome}2" ++ ++ spec = util_spec 'invalidhomepagegem', 1 ++ spec.homepage = "notavalidhomepageurl" ++ ++ specs_dir = File.join dir, 'specifications' ++ FileUtils.mkdir_p specs_dir ++ ++ open File.join(specs_dir, spec.spec_name), 'w' do |io| ++ io.write spec.to_ruby ++ end ++ ++ server = Gem::Server.new dir, process_based_port, false ++ ++ @req.parse data ++ ++ server.root @req, @res ++ ++ assert_equal 200, @res.status ++ assert_match 'invalidhomepagegem 1', @res.body ++ ++ # This verifies that the homepage for this spec is not displayed and is set to ".", because it's not a ++ # valid HTTP/HTTPS URL and could be unsafe in an HTML context. We would prefer to throw an exception here, ++ # but spec.homepage is currently free form and not currently required to be a URL, this behavior may be ++ # validated in future versions of Gem::Specification. ++ # ++ # There are two variant we're checking here, one where rdoc is not present, and one where rdoc is present in the same regex: ++ # ++ # Variant #1 - rdoc not installed ++ # ++ # invalidhomepagegem 1 ++ # ++ # ++ # [rdoc] ++ # ++ # ++ # ++ # [www] ++ # ++ # Variant #2 - rdoc installed ++ # ++ # invalidhomepagegem 1 ++ # ++ # ++ # \[rdoc\]<\/a> ++ # ++ # ++ # ++ # [www] ++ regex_match = /invalidhomepagegem 1<\/b>[\n\s]+(\[rdoc\]<\/span>|\[rdoc\]<\/a>)[\n\s]+\[www\]<\/a>/ ++ assert_match regex_match, @res.body ++ end ++ ++ def test_valid_homepage_http ++ data = StringIO.new "GET / HTTP/1.0\r\n\r\n" ++ dir = "#{@gemhome}2" ++ ++ spec = util_spec 'validhomepagegemhttp', 1 ++ spec.homepage = "http://rubygems.org" ++ ++ specs_dir = File.join dir, 'specifications' ++ FileUtils.mkdir_p specs_dir ++ ++ open File.join(specs_dir, spec.spec_name), 'w' do |io| ++ io.write spec.to_ruby ++ end ++ ++ server = Gem::Server.new dir, process_based_port, false ++ ++ @req.parse data ++ ++ server.root @req, @res ++ ++ assert_equal 200, @res.status ++ assert_match 'validhomepagegemhttp 1', @res.body ++ ++ regex_match = /validhomepagegemhttp 1<\/b>[\n\s]+(\[rdoc\]<\/span>|\[rdoc\]<\/a>)[\n\s]+\[www\]<\/a>/ ++ assert_match regex_match, @res.body ++ end ++ ++ def test_valid_homepage_https ++ data = StringIO.new "GET / HTTP/1.0\r\n\r\n" ++ dir = "#{@gemhome}2" ++ ++ spec = util_spec 'validhomepagegemhttps', 1 ++ spec.homepage = "https://rubygems.org" ++ ++ specs_dir = File.join dir, 'specifications' ++ FileUtils.mkdir_p specs_dir ++ ++ open File.join(specs_dir, spec.spec_name), 'w' do |io| ++ io.write spec.to_ruby ++ end ++ ++ server = Gem::Server.new dir, process_based_port, false ++ ++ @req.parse data ++ ++ server.root @req, @res ++ ++ assert_equal 200, @res.status ++ assert_match 'validhomepagegemhttps 1', @res.body ++ ++ regex_match = /validhomepagegemhttps 1<\/b>[\n\s]+(\[rdoc\]<\/span>|\[rdoc\]<\/a>)[\n\s]+\[www\]<\/a>/ ++ assert_match regex_match, @res.body ++ end ++ + def test_specs + data = StringIO.new "GET /specs.#{Gem.marshal_version} HTTP/1.0\r\n\r\n" + @req.parse data +diff --git test/rubygems/test_gem_specification.rb test/rubygems/test_gem_specification.rb +index 0fcc11e78f..1c68826fb3 100644 +--- ruby-2.4.3/test/rubygems/test_gem_specification.rb ++++ ruby-2.4.3/test/rubygems/test_gem_specification.rb +@@ -2890,7 +2890,22 @@ def test_validate_homepage + @a1.validate + end + +- assert_equal '"over at my cool site" is not a URI', e.message ++ assert_equal '"over at my cool site" is not a valid HTTP URI', e.message ++ ++ @a1.homepage = 'ftp://rubygems.org' ++ ++ e = assert_raises Gem::InvalidSpecificationException do ++ @a1.validate ++ end ++ ++ assert_equal '"ftp://rubygems.org" is not a valid HTTP URI', e.message ++ ++ @a1.homepage = 'http://rubygems.org' ++ assert_equal true, @a1.validate ++ ++ @a1.homepage = 'https://rubygems.org' ++ assert_equal true, @a1.validate ++ + end + end + diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm index 00b24b26f4..90e3e4fcf7 100644 --- a/gnu/packages/ruby.scm +++ b/gnu/packages/ruby.scm @@ -117,6 +117,7 @@ (define-public ruby-2.4.3 (sha256 (base32 "0l9bv67dgsphk42lmiskhrnh47hbyj6rfg2rcjx22xivpx07srr3")) + (patches (search-patches "ruby-rubygems-276-for-ruby24.patch")) (modules '((guix build utils))) (snippet `(begin ;; Remove bundled libffi From 3e6b398a48aacf15f605cff4d3f492505dc134a5 Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Sat, 17 Feb 2018 00:04:16 +0100 Subject: [PATCH 10/19] gnu: girara: Increase test timeouts. Fixes build failures on Hydra. Reported by Mark H Weaver in . * gnu/packages/gtk.scm (girara)[arguments]: Set CK_DEFAULT_TIMEOUT before running tests. --- gnu/packages/gtk.scm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gnu/packages/gtk.scm b/gnu/packages/gtk.scm index 86dff08e40..c05d0734ef 100644 --- a/gnu/packages/gtk.scm +++ b/gnu/packages/gtk.scm @@ -1267,6 +1267,11 @@ (define-public girara (let ((xorg-server (assoc-ref inputs "xorg-server")) (display ":1")) (setenv "DISPLAY" display) + + ;; On busy machines, tests may take longer than + ;; the default of four seconds. + (setenv "CK_DEFAULT_TIMEOUT" "20") + ;; Don't fail due to missing '/etc/machine-id'. (setenv "DBUS_FATAL_WARNINGS" "0") (zero? (system (string-append xorg-server "/bin/Xvfb " From f0eba502a1ee564bb3b8ce6032548ec343ed49ba Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Sat, 17 Feb 2018 00:08:04 +0100 Subject: [PATCH 11/19] gnu: zathura: Increase test timeouts. * gnu/packages/pdf.scm (zathura): Export CK_DEFAULT_TIMEOUT before running tests. --- gnu/packages/pdf.scm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gnu/packages/pdf.scm b/gnu/packages/pdf.scm index 9730e6150c..aba7b974a8 100644 --- a/gnu/packages/pdf.scm +++ b/gnu/packages/pdf.scm @@ -521,6 +521,11 @@ (define-public zathura (let ((xorg-server (assoc-ref inputs "xorg-server")) (display ":1")) (setenv "DISPLAY" display) + + ;; On busy machines, tests may take longer than + ;; the default of four seconds. + (setenv "CK_DEFAULT_TIMEOUT" "20") + ;; Don't fail due to missing '/etc/machine-id'. (setenv "DBUS_FATAL_WARNINGS" "0") (zero? (system (string-append xorg-server "/bin/Xvfb " From 2416665ecbc931f9ed6da8d905b89da09e42ef24 Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Sat, 17 Feb 2018 00:10:08 +0100 Subject: [PATCH 12/19] gnu: zathura, girara: Use the test-only xorg variant for tests. * gnu/packages/gtk.scm (girara)[native-inputs]: Replace XORG-SERVER with XORG-SERVER-1.19.3. [arguments]: Add #:disallowed-references. * gnu/packages/pdf.scm (zathura)[native-inputs, arguments]: Likewise. --- gnu/packages/gtk.scm | 3 ++- gnu/packages/pdf.scm | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/gnu/packages/gtk.scm b/gnu/packages/gtk.scm index c05d0734ef..8b2b357c90 100644 --- a/gnu/packages/gtk.scm +++ b/gnu/packages/gtk.scm @@ -1251,7 +1251,7 @@ (define-public girara ("check" ,check) ("gettext" ,gettext-minimal) ("glib:bin" ,glib "bin") - ("xorg-server" ,xorg-server))) + ("xorg-server" ,xorg-server-1.19.3))) ;; Listed in 'Requires.private' of 'girara.pc'. (propagated-inputs `(("gtk+" ,gtk+))) (arguments @@ -1259,6 +1259,7 @@ (define-public girara `(,(string-append "PREFIX=" (assoc-ref %outputs "out")) "COLOR=0" "CC=gcc") #:test-target "test" + #:disallowed-references (,xorg-server-1.19.3) #:phases (modify-phases %standard-phases (delete 'configure) (add-before 'check 'start-xserver diff --git a/gnu/packages/pdf.scm b/gnu/packages/pdf.scm index aba7b974a8..2a447a9d89 100644 --- a/gnu/packages/pdf.scm +++ b/gnu/packages/pdf.scm @@ -498,7 +498,7 @@ (define-public zathura ;; For tests. ("check" ,check) - ("xorg-server" ,xorg-server))) + ("xorg-server" ,xorg-server-1.19.3))) (inputs `(("sqlite" ,sqlite))) ;; Listed in 'Requires.private' of 'zathura.pc'. (propagated-inputs `(("cairo" ,cairo) @@ -513,6 +513,7 @@ (define-public zathura `(,(string-append "PREFIX=" (assoc-ref %outputs "out")) "CC=gcc" "COLOR=0") #:test-target "test" + #:disallowed-references (,xorg-server-1.19.3) #:phases (modify-phases %standard-phases (delete 'configure) (add-before 'check 'start-xserver From 3971dcbf0e39d868a2e360c9b4e6ca2ffcf135e8 Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Sat, 17 Feb 2018 00:53:12 +0100 Subject: [PATCH 13/19] gnu: zathura: Don't propagate girara in dependent packages. * gnu/packages/pdf.scm (zathura-cb, zathura-ps, zathura-djvu, zathura-pdf-mupdf, zathura-pdf-poppler)[propagated-inputs]: Remove GIRARA. --- gnu/packages/pdf.scm | 5 ----- 1 file changed, 5 deletions(-) diff --git a/gnu/packages/pdf.scm b/gnu/packages/pdf.scm index 2a447a9d89..9d554abf0e 100644 --- a/gnu/packages/pdf.scm +++ b/gnu/packages/pdf.scm @@ -335,7 +335,6 @@ (define-public zathura-cb (base32 "0r4viisycj39kaz4281cmkr7n9w5q96dmlf7nf45n8zq8qy2npw3")))) (native-inputs `(("pkg-config" ,pkg-config))) - (propagated-inputs `(("girara" ,girara))) (inputs `(("libarchive" ,libarchive) ("zathura" ,zathura))) (build-system gnu-build-system) @@ -365,7 +364,6 @@ (define-public zathura-ps (base32 "1x4knqja8pw2a5cb3y2209nr3iddj1z8nwasy48v5nprj61fdxqj")))) (native-inputs `(("pkg-config" ,pkg-config))) - (propagated-inputs `(("girara" ,girara))) (inputs `(("libspectre" ,libspectre) ("zathura" ,zathura))) (build-system gnu-build-system) @@ -395,7 +393,6 @@ (define-public zathura-djvu (base32 "1sbfdsyp50qc85xc4458sn4w1rv1qbygdwmcr5kjlfpsmdq98vhd")))) (native-inputs `(("pkg-config" ,pkg-config))) - (propagated-inputs `(("girara" ,girara))) (inputs `(("djvulibre" ,djvulibre) ("zathura" ,zathura))) @@ -426,7 +423,6 @@ (define-public zathura-pdf-mupdf (base32 "0xkajc3is7ncmb2fmymbzfgrran2bz12i7zsm1vvxhxds728h7ck")))) (native-inputs `(("pkg-config" ,pkg-config))) - (propagated-inputs `(("girara" ,girara))) (inputs `(("jbig2dec" ,jbig2dec) ("libjpeg" ,libjpeg) @@ -460,7 +456,6 @@ (define-public zathura-pdf-poppler (base32 "1m55m7s7f8ng8a7lmcw9z4n5zv7xk4vp9n6fp9j84z6rk2imf7a2")))) (native-inputs `(("pkg-config" ,pkg-config))) - (propagated-inputs `(("girara" ,girara))) (inputs `(("poppler" ,poppler) ("zathura" ,zathura))) From 3ce4e265ddefc1f4d5a22ea110e8e6448d55b3a9 Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Sat, 17 Feb 2018 15:56:01 +0100 Subject: [PATCH 14/19] gnu: btrfs-progs: Fix bash completions. This is a follow-up to commit 9a1c4a981bdd7eeca76aaf73a57d6841918821c2. Bash completions must have the same name as the executable. * gnu/packages/linux.scm (btrfs-progs)[arguments]: Rename "btrfs-completion" script to "btrfs". --- gnu/packages/linux.scm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index bc1c658519..b99c17212a 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -3245,10 +3245,12 @@ (define-public btrfs-progs (lambda _ (zero? (system* "make" "static")))) (add-after 'install 'install-bash-completion (lambda* (#:key outputs #:allow-other-keys) - (install-file "btrfs-completion" - (string-append (assoc-ref outputs "out") - "/etc/bash_completion.d")) - #t)) + (let* ((out (assoc-ref outputs "out")) + (bashcomp (string-append out "/etc/bash_completion.d"))) + (mkdir-p bashcomp) + (copy-file "btrfs-completion" + (string-append bashcomp "/btrfs")) + #t))) (add-after 'install 'install-static (let ((staticbin (string-append (assoc-ref %outputs "static") "/bin"))) From a39aa6839464ce7233d441e1cd807bc8eca1d622 Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Sat, 17 Feb 2018 21:05:18 +0200 Subject: [PATCH 15/19] gnu: libffcall: Update to 2.1. * gnu/packages/libffcall.scm (libffcall): Update to 2.1. --- gnu/packages/libffcall.scm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gnu/packages/libffcall.scm b/gnu/packages/libffcall.scm index 84fd1a833f..3a231f30a0 100644 --- a/gnu/packages/libffcall.scm +++ b/gnu/packages/libffcall.scm @@ -1,7 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2015 Joshua S. Grant ;;; Copyright © 2015 Mark H Weaver -;;; Copyright © 2017 Efraim Flashner +;;; Copyright © 2017, 2018 Efraim Flashner ;;; ;;; This file is part of GNU Guix. ;;; @@ -27,7 +27,7 @@ (define-module (gnu packages libffcall) (define-public libffcall (package (name "libffcall") - (version "2.0") + (version "2.1") (source (origin (method url-fetch) @@ -35,7 +35,7 @@ (define-public libffcall "mirror://gnu/libffcall/libffcall-" version ".tar.gz")) (sha256 (base32 - "0v0rh3vawb8z5q40fs3kr2f9zp06n2fq4rr2ww4562nr96sd5aj1")))) + "0iwcad6w78jp84vd6xaz5fwqm84n3cb42bdf5m5cj5xzpa5zp4d0")))) (build-system gnu-build-system) (arguments `(#:parallel-build? #f)) (synopsis "Foreign function calls from interpreters") From f5f916792c7069a22d95c5b7c68bcf3bbb86e451 Mon Sep 17 00:00:00 2001 From: Oleg Pykhalov Date: Sat, 17 Feb 2018 12:05:26 +0300 Subject: [PATCH 16/19] bash completion: Complete files names after 'guix package -m'. * etc/completion/bash/guix (_guix_is_dash_m): New function. (_guix_complete): Add this. --- etc/completion/bash/guix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/etc/completion/bash/guix b/etc/completion/bash/guix index 6b84193dbe..70430c5c95 100644 --- a/etc/completion/bash/guix +++ b/etc/completion/bash/guix @@ -106,6 +106,15 @@ _guix_is_dash_L () esac } } +_guix_is_dash_m () +{ + [ "${COMP_WORDS[$COMP_CWORD - 1]}" = "-m" ] \ + || { case "${COMP_WORDS[$COMP_CWORD]}" in + --manifest=*) true;; + *) false;; + esac } +} + _guix_complete_file () { # Let Readline complete file names. @@ -149,7 +158,7 @@ _guix_complete () *) if _guix_is_command "package" then - if _guix_is_dash_L + if _guix_is_dash_L || _guix_is_dash_m then _guix_complete_file elif _guix_is_removing From 8d89921474bb827c6311e5352c5d92bee22cb96e Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Sat, 17 Feb 2018 16:17:03 +0100 Subject: [PATCH 17/19] gnu: Add emacs-esxml. * gnu/packages/emacs.scm (emacs-esxml): New variable. --- gnu/packages/emacs.scm | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm index 3fd41e1d44..8bc9ad93f5 100644 --- a/gnu/packages/emacs.scm +++ b/gnu/packages/emacs.scm @@ -7097,6 +7097,29 @@ (define-public emacs-scratch-el formatting rules for that language.") (license license:bsd-2)))) +(define-public emacs-esxml + (package + (name "emacs-esxml") + (version "0.3.4") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/tali713/esxml.git") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "00vv8a75wdklygdyr4km9mc2ismxak69c45jmcny41xl44rp9x8m")))) + (build-system emacs-build-system) + (home-page "https://github.com/tali713/esxml/") + (synopsis "SXML for EmacsLisp") + (description "This is XML/XHTML done with S-Expressions in EmacsLisp. +Simply, this is the easiest way to write HTML or XML in Lisp. This library +uses the native form of XML representation as used by many libraries already +included within Emacs. See @code{esxml-to-xml} for a concise description of +the format.") + (license license:gpl3+))) + (define-public epipe (package (name "epipe") From 5f78ce490eb4a86369ea843fa366d76d2fdce2b8 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Sat, 17 Feb 2018 16:17:19 +0100 Subject: [PATCH 18/19] gnu: Add emacs-nov-el. * gnu/packages/emacs.scm (emacs-nov-el): New variable. --- gnu/packages/emacs.scm | 49 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm index 8bc9ad93f5..88fab2ed56 100644 --- a/gnu/packages/emacs.scm +++ b/gnu/packages/emacs.scm @@ -7120,6 +7120,55 @@ (define-public emacs-esxml the format.") (license license:gpl3+))) +(define-public emacs-nov-el + (package + (name "emacs-nov-el") + (version "0.2.2") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/wasamasa/nov.el.git") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "03s0qjvwk1f7y3i4wh2p5y3z4hdv00adgz8za3vphzc0q8i1kjzb")))) + (build-system emacs-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (add-after 'unpack 'embed-path-to-unzip + (lambda _ + (substitute* "nov.el" + (("\\(executable-find \"unzip\"\\)") + (string-append "\"" (which "unzip") "\""))) + #t))))) + (propagated-inputs + `(("emacs-dash" ,emacs-dash) + ("emacs-esxml" ,emacs-esxml))) + (inputs + `(("unzip" ,unzip))) + (home-page "https://github.com/wasamasa/nov.el/") + (synopsis "Major mode for reading EPUBs in Emacs") + (description "@code{nov.el} provides a major mode for reading EPUB +documents. + +Features: + +@itemize +@item Basic navigation (jump to TOC, previous/next chapter) +@item Remembering and restoring the last read position +@item Jump to next chapter when scrolling beyond end +@item Renders EPUB2 (@code{.ncx}) and EPUB3 (@code{