;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2015 Federico Beffa ;;; ;;; This file is part of GNU Guix. ;;; ;;; GNU Guix is free software; you can redistribute it and/or modify it ;;; under the terms of the GNU General Public License as published by ;;; the Free Software Foundation; either version 3 of the License, or (at ;;; your option) any later version. ;;; ;;; GNU Guix is distributed in the hope that it will be useful, but ;;; WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;; GNU General Public License for more details. ;;; ;;; You should have received a copy of the GNU General Public License ;;; along with GNU Guix. If not, see . (define-module (test-hackage) #:use-module (guix import cabal) #:use-module (guix import hackage) #:use-module (guix tests) #:use-module (srfi srfi-64) #:use-module (ice-9 match)) (define test-cabal-1 "name: foo version: 1.0.0 homepage: http://test.org synopsis: synopsis description: description license: BSD3 executable cabal build-depends: HTTP >= 4000.2.5 && < 4000.3, mtl >= 2.0 && < 3 ") (define test-cabal-2 "name: foo version: 1.0.0 homepage: http://test.org synopsis: synopsis description: description license: BSD3 executable cabal { build-depends: HTTP >= 4000.2.5 && < 4000.3, mtl >= 2.0 && < 3 } ") ;; A fragment of a real Cabal file with minor modification to check precedence ;; of 'and' over 'or'. (define test-read-cabal-1 "name: test-me library -- Choose which library versions to use. if flag(base4point8) Build-depends: base >= 4.8 && < 5 else if flag(base4) Build-depends: base >= 4 && < 4.8 else if flag(base3) Build-depends: base >= 3 && < 4 else Build-depends: base < 3 if flag(base4point8) || flag(base4) && flag(base3) Build-depends: random Build-depends: containers -- Modules that are always built. Exposed-Modules: Test.QuickCheck.Exception ") (test-begin "hackage") (define (eval-test-with-cabal test-cabal) (mock ((guix import hackage) hackage-fetch (lambda (name-version) (call-with-input-string test-cabal read-cabal))) (match (hackage->guix-package "foo") (('package ('name "ghc-foo") ('version "1.0.0") ('source ('origin ('method 'url-fetch) ('uri ('string-append "http://hackage.haskell.org/package/foo/foo-" 'version ".tar.gz")) ('sha256 ('base32 (? string? hash))))) ('build-sys2013-10-09Synchronize package descriptions with the Womb....Ludovic Courtès 2013-04-21gnu: smalltalk: Update to 3.2.5....Mark H Weaver 2013-04-17gnu: Use synopses from the Womb....Ludovic Courtès 2013-02-09gnu: Add GNU Smalltalk....Nikita Karetnikov runner-current)) 0))