aboutsummaryrefslogtreecommitdiff
path: root/tests/ipfs.scm
blob: 3b662b22bd9b00b2cbd6355897c2055fab846195 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2018 Ludovic Courtès <ludo@gnu.org>
;;;
;;; 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 <http://www.gnu.org/licenses/>.

(define-module (test-ipfs)
  #:use-module (guix ipfs)
  #:use-module ((guix utils) #:select (call-with-temporary-directory))
  #:use-module (guix tests)
  #:use-module (web uri)
  #:use-module (srfi srfi-64))

;; Test the (guix ipfs) module.

(define (ipfs-gateway-running?)
  "Return true if the IPFS gateway is running at %IPFS-BASE-URL."
  (let* ((uri    (string->uri (%ipfs-base-url)))
         (socket (socket AF_INET SOCK_STREAM 0)))
    (define connected?
      (catch 'system-error
        (lambda ()
          (format (current-error-port)
                  "probing IPFS gateway at localhost:~a...~%"
                  (uri-port uri))
          (connect socket AF_INET INADDR_LOOPBACK (uri-port uri))
          #t)
        (const #f)))

    (close-port socket)
    connected?))

(unless (ipfs-gateway-running?)
  (test-skip 1))

(test-assert "add-file-tree + restore-file-tree"
  (call-with-temporary-directory
   (lambda (directory)
     (let* ((source  (dirname (search-path %load-path "guix/base32.scm")))
            (target  (string-append directory "/r"))
            (content (pk 'content (add-file-tree source))))
       (restore-file-tree (content-name content) target)
       (file=? source target)))))
with Plain TeX or with LaTeX.")
(license license:lppl)))
+(define-public texlive-figflow
+ (package
+ (name "texlive-figflow")
+ (version (number->string %texlive-revision))
+ (source (texlive-origin
+ name version
+ (list "doc/plain/figflow/" "tex/plain/figflow/")
+ (base32
+ "1vsrsw5rrqjym0flca9537m41vs7wlk8mhl9zmqjfaxgi8jvc9ml")))
+ (outputs '("out" "doc"))
+ (build-system texlive-build-system)
+ (home-page "https://ctan.org/pkg/figflow")
+ (synopsis "Flow text around a figure")
+ (description
+ "This package provides a Plain TeX macro @code{\\figflow} that allows one
+to insert a figure into an area inset into a paragraph. Command arguments are
+width and height of the figure, and the figure (and its caption) itself. The
+package does not work with LaTeX; packages such as @code{wrapfig},
+@code{floatflt} and @code{picins} support the needs of LaTeX users in this
+area.")
+ ;; README states: "You may freely use, modify, and/or distribute this
+ ;; file, without limitation."
+ (license (license:fsf-free "file://doc/plain/figflow/README"))))
+
(define-public texlive-findhyph
(package
(name "texlive-findhyph")