help-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Newbie: Define package that downloads multiple files from an open direct


From: Rodrigo Morales
Subject: Newbie: Define package that downloads multiple files from an open directory
Date: Fri, 26 May 2023 05:22:29 +0000

Table of Contents
_________________

1. The context
2. What I know
3. The question
4. Additional information about enquiry


1 The context
=============

  Suppose there's an open directory publicly available on the
  Internet. I want to define a Guix package that downloads multiple
  files from that directory.


2 What I know
=============

  I know how to define a package that downloads a single file.

  Let's consider [this] directory for our experimentation (I chose it
  because it has relatively small files). Suppose I want to download the
  file `blindtext.dtx' and make it available in
  `~/.guix-profile/share'. My package definition would look as it
  follows.

  ,----
  | cat ~/my/git-repos/guix-packages/my/test.scm
  `----

  ,----
  | (define-module (my test)
  |   #:use-module (guix licenses)
  |   #:use-module (guix packages)
  |   #:use-module (guix download)
  |   #:use-module (guix build-system copy))
  |
  | (define-public my-package-1
  |   (package
  |    (name "my-package-1")
  |    (version "1.0")
  |    (home-page "My home-page")
  |    (synopsis "My synopsis")
  |    (description "My description")
  |    (license gpl3+)
  |    (source
  |     (origin
  |      (method url-fetch)
  |      (uri 
"http://tug.ctan.org/tex-archive/macros/latex/contrib/blindtext/blindtext.dtx";)
  |      (sha256
  |       (base32
  |        "10sfm4648v1ywki639jsl5darkcil1is462w0v65xxr75k4l1ywl"))))
  |    (build-system copy-build-system)
  |    (arguments
  |     '(#:install-plan
  |       '(("blindtext.dtx" "share/"))))))
  `----

  I would install that package with the following command.

  ,----
  | guix package --no-substitutes -L ~/my/git-repos/guix-packages -i
my-package-1
  `----

  ,----
  | The following package will be installed:
  |    my-package-1 1.0
  |
  | hint: Consider setting the necessary environment variables by running:
  |
  |      GUIX_PROFILE="/home/rdrg/.guix-profile"
  |      . "$GUIX_PROFILE/etc/profile"
  |
  | Alternately, see `guix package --search-paths -p
  | "/home/rdrg/.guix-profile"'.
  |
  `----

  The file gets created in the following path which is symlinked to the
  following file in `/gnu/store'.

  ,----
  | realpath ~/.guix-profile/share/blindtext.dtx
  `----

  ,----
  | 
/gnu/store/mmqc8wav2jj3m3harisvawl1r881glpv-my-package-1-1.0/share/blindtext.dtx
  `----


[this] <http://tug.ctan.org/tex-archive/macros/latex/contrib/blindtext/>


3 The question
==============

  Let's suppose I want to define a single Guix package that downloads
  the files `blindtext.dtx' and `blindtext.ins' (that is, two files
  instead of one) and makes them available at
  `~/.guix-profile/share'. What would the package definition look like?


4 Additional information about enquiry
======================================

  Please ignore the following three points:

  + the parent directory of
    <http://tug.ctan.org/tex-archive/macros/latex/contrib/blindtext/>
    has a ZIP file which is the compressed version of that directory
  + Guix already has a package for `blindtext' called
    `texlive-latex-blindtext'
  + Guix has some utilities for handling packages from CTAN or Tex Live
    (see <https://issues.guix.gnu.org/60820#3> which mentions
    `simple-texlive-package')

  In other words, consider that the directory we are using for our
  experimentation is an arbitrary directory on the Internet and that
  there's no way of downloading the compressed version of that
  directory. I'm poing this out because I'm more interessted in learning
  how to define a package that downlaods multiple files instead of
  finding a workaround that installs `blindtext'.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]