unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* Problem: a makeinfo running in build stages cannot output epub3?
@ 2024-05-12  4:17 Yuval Langer
  0 siblings, 0 replies; only message in thread
From: Yuval Langer @ 2024-05-12  4:17 UTC (permalink / raw)
  To: help-guix

[-- Attachment #1: Type: text/plain, Size: 649 bytes --]

Hello,

I am writing package definitions for a certain Texinfo document, the
r7rs-small.  Each package would create another file format, so:

r7rs-small-info, r7rs-small-pdf, r7rs-small-epub, etc.

I am having problems generating epub because the native-input texinfo
package does not accept the `--epub3` (or `--epub`) flag.  I have
tried adding the perl-archive-zip package as well, but that did not
work.

Attached is the script with the package definitions.

p.s., if you have any criticism regarding the structure of the package
definition and the (lack of?) wisdom in defining different packages
using a single procedure, please provide them.

[-- Attachment #2: texinfo-documents.scm --]
[-- Type: text/x-scheme, Size: 4382 bytes --]

;;; Kakafarm's Guix Channel
;;; Copyright © 2023-2024 Yuval Langer <yuval.langer@gmail.com>
;;;
;;; This file is part of Kakafarm's Guix Channel.
;;;
;;; Kakafarm's Guix Channel 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.
;;;
;;; Kakafarm's Guix Channel 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 Kakafarm's Guix Channel.  If not, see
;;; <http://www.gnu.org/licenses/>.

(define-module (kakafarm packages texinfo-documents)
  #:use-module (gnu packages base)
  #:use-module (gnu packages bash)
  #:use-module (gnu packages perl-compression)
  #:use-module (gnu packages tex)
  #:use-module (gnu packages texinfo)

  #:use-module (guix build-system copy)
  #:use-module (guix gexp)
  #:use-module (guix git-download)
  #:use-module ((guix licenses)
                #:select (non-copyleft))
  #:use-module (guix packages))

(define-public (r7rs-small-texinfo target-format)
  (let ((commit "38a703976ea6353e32b52a5187dbdaf77fb2f050")
        (revision "3"))
    (package
      (name (string-append "r7rs-small-" target-format))
      (version (git-version "0.1.0" revision commit))
      (home-page "https://codeberg.org/Zipheir/r7rs-small-texinfo/")
      (source
       (origin
         (uri (git-reference
               (url home-page)
               (commit commit)))
         (method git-fetch)
         (file-name (git-file-name name version))
         (sha256
          (base32 "1fr02fyhiwd364jkfy1n5w31pq3kx1rl5w634421g05702yb47x3"))))
      (native-inputs (list bash
                           coreutils
                           perl-archive-zip
                           texinfo
                           texlive-scheme-small
                           texlive-texinfo))
      (inputs '())
      (build-system copy-build-system)
      (arguments
       (list
        #:install-plan #~`((,(string-append "r7rs-small."
                                            #$target-format) ,(string-append
                                                               "share/"
                                                               #$target-format
                                                               "/")))
        #:phases #~(modify-phases %standard-phases
                     (add-after 'unpack 'compile-the-files
                       (lambda _
                         (let* ((source-directory-path (string-append (getcwd)
                                                        "/doc/r7rs-small"))
                                (target-directory-path (string-append #$output
                                                        "/share/"
                                                        #$target-format)))
                           (chdir source-directory-path)
                           (system* "bash" "build.sh"
                                    #$target-format)
                           (mkdir-p target-directory-path)
                           (copy-file (string-append "r7rs-small."
                                                     #$target-format)
                                      (string-append target-directory-path
                                                     "/r7rs-small."
                                                     #$target-format))))))))
      (synopsis (string-append
                 "R7RS Small standard of the Scheme programming language in "
                 target-format " format"))
      (description (string-append
                    "Revised^7 Report of the Algorithmic Language Scheme adapted to Texinfo format.

This package installs the  "
                    target-format " version of the document."))
      (license (non-copyleft "file://COPYING")))))

(define-public r7rs-small-info
  (r7rs-small-texinfo "info"))

(define-public r7rs-small-pdf
  (r7rs-small-texinfo "pdf"))

(define-public r7rs-small-html
  (r7rs-small-texinfo "html"))

(define-public r7rs-small-epub
  (r7rs-small-texinfo "epub"))

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-05-13 18:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-12  4:17 Problem: a makeinfo running in build stages cannot output epub3? Yuval Langer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).