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

2023-05-25 Thread Rodrigo Morales
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] 


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

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  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'.



Re: Identifying cause of local package build

2023-05-25 Thread Eugen Stan

Hi,

I would also check the size of /tmp partition.
I build of iced-tea / openjdk was failing because it was running out of 
disk on /tmp.


guix-daemon builds packages in /tmp .
Some packages need a lot of disk to build.
In my case I had to increase /tmp to 7.5 GB until the build passed.
This was visible in the error log and the same issues was happening on 
substitute servers (build was failing with this issue).


Regards,
Eugen

On 25.05.2023 21:31, Simon Tournier wrote:

Hi,

On mer., 24 mai 2023 at 20:56, Skyler Ferris via  wrote:


the packages in my system configuration into a manifest and ran `guix weather`
against it, and it said that only 85% of packages have substitutes available.
I had assumed that substitutes should be available


Yeah, some process requires some improvements.  Hopefully, the CI and
tooling is improving daily. :-)


Cheers,
simon




--
Eugen Stan

+40770 941 271  / https://www.netdava.com
begin:vcard
fn:Eugen Stan
n:Stan;Eugen
email;internet:eugen.s...@netdava.com
tel;cell:+40720898747
x-mozilla-html:FALSE
url:https://www.netdava.com
version:2.1
end:vcard



Re: Identifying cause of local package build

2023-05-25 Thread Simon Tournier
Hi,

On mer., 24 mai 2023 at 20:56, Skyler Ferris via  wrote:

> the packages in my system configuration into a manifest and ran `guix weather`
> against it, and it said that only 85% of packages have substitutes available.
> I had assumed that substitutes should be available

Yeah, some process requires some improvements.  Hopefully, the CI and
tooling is improving daily. :-)


Cheers,
simon




Re: to save my Guix System installation

2023-05-25 Thread pelzflorian (Florian Pelz)
"pelzflorian (Florian Pelz)"  writes:
> sudo mount /dev/sdx1 /mnt

P.S. Note that the path to the other disk will not be sdx.  Adjust this
to the name of the other disk.  Needless to say, it is very important
the mount command does not fail.

Regards,
Florian



Re: to save my Guix System installation

2023-05-25 Thread pelzflorian (Florian Pelz)
Hi all,

Maxim Cournoyer  writes:
> For moving Guix itself, you could copy its root file system
> using 'cp -a', or opt to reinstall from your config.scm as already
> mentioned up-thread.

I strongly suggest the reinstall option.  Copying all with “cp -a”
works, but is a waste.

sudo mount /dev/sdx1 /mnt
sudo cp -a /etc/config.scm /mnt/
sudo cp -a /home /mnt/
sync

is a simple means of backup.  Reinstall can be done with

sudo mount /dev/sdx1 /mnt
sudo cp -a /mnt/etc/config.scm /etc/config.scm
sudo cp -a /mnt/home /

Then adjust the file-systems field in /etc/config.scm and reconfigure.

> Sadly, for the complex part (the bootloader
> configuration), I'll leave it to someone more knowledgeable than myself
> to provide concrete answers, but I believe you'll want to read on
> something called multi-boot.  There's a GRUB example here [0].

I believe configuring GRUB for dual boot is difficult.  It would be
simpler if the computer already offers boot selection e.g. when pressing
the DEL key at startup.  That would allow choosing between multiple EFI
installations.

I think GRUB multi-boot is a boot protocol that cannot easily be
configured in Guix.  Other distros use GRUB menu-entries with chainload
for dual booting.

Regards,
Florian



Re: Error when tab-completing Guix-subcommand in Emacs' Eshell

2023-05-25 Thread Mekeor Melire

2023-05-25 09:03 mek...@posteo.de:


Hello Guix! :)


Hello Mekeor!

When I open Emacs ("emacs -q"), run Eshell (M-x eshell RET) and 
type "guix " followed by TAB, why do I get the following error 
message?


This happens because Eshell does not run the external program 
"guix" but the emacs-lisp function "guix" from the emacs-guix 
package that is broken, as far as I know. As described at (info 
"(eshell) Built-ins"), you can try typing "*guix" instead. (Or 
uninstall emacs-guix.)


I hope that helps!



Error when tab-completing Guix-subcommand in Emacs' Eshell

2023-05-25 Thread Mekeor Melire

Hello Guix! :)

When I open Emacs ("emacs -q"), run Eshell (M-x eshell RET) and 
type "guix " followed by TAB, why do I get the following error 
message?


--8<---cut here---start->8---
Starting Guix REPL ... [5 times]
guix-geiser-eval: Error in evaluating guile expression: 
ice-9/boot-9.scm:1685:16: In procedure raise-exception:
/home/user/.config/guix/current/share/guile/site/3.0/guix/scripts/deploy.scm:176:7: 
Unknown # object: "#~"


Entering a new prompt.  Type `,bt' for a backtrace or `,q' to 
continue.

scheme@(emacs-guix) [1]>
--8<---cut here---end--->8---



Re: Guix on mobile phones

2023-05-25 Thread Csepp


Felix Lechner  writes:

> Hi Csepp,
>
> On Wed, May 24, 2023 at 4:40 AM Csepp  wrote:
>>
>> Either the upgrade should fail until all substitutes become available or
>> it should do a partial upgrade.
>
> Do Guix System or Guix Home offer such an adaptive resolver? I'd love
> to have it!
>
> Kind regards
> Felix

As far as I know they do not.