guix as a hypervisor

2021-12-10 Thread Adam Kandur via
Hi guix!
What is the best way to run a vm on a guix host which will be available to 
other members of a local network?



Re: Regarding implementing sof-firmware in GUIX.

2021-12-10 Thread Ry Pemberton via
Is there anything I could do to help? I have little to no experience with these 
kinds of things but maybe this is a fine jumping off point.

And thank you for the correction, I wasn't aware it was case sensitive (or a 
meme for that matter).

Thanks!

 Original Message 
On Dec 10, 2021, 2:38 PM, Tobias Geerinckx-Rice wrote:

> Ry, [PSA: It's just ‘[GNU] Guix’, never ‘GUIX’ :-) I'm not sure why the 
> ‘GUIX’ meme appears to be picking up steam again as of late…] Ry Pemberton 
> via 写道: > I have an X1 Carbon (2021) that requires sof-firmware. It is > 
> libre > software, and I believe is included in the linux-libre kernel > since 
> > 5.2. Is there a way to get this firmware working on this laptop > with > 
> GNU GUIX? I tried to start a basic SOF package (attached), but quickly ran 
> into ‘The GNU C library is currently unavailable for this platform.’ Without 
> a cross-libc the build fails, looking for , which AFAICT is provided (only) 
> by libc. I've never cross-compiled firmware before so I don't know any next 
> steps. Of course, this being ostensibly libre software, we could package 
> prebuilt binaries[0] as I'm sure 99% of users actually use. It's not a good 
> option, and hardly Guixy, but not unprecedented. Kind regards, T G-R [0]: 
> https://github.com/thesofproject/sof-bin/

Re: postgresql client packaging recipe

2021-12-10 Thread Tobias Geerinckx-Rice

Tobias Geerinckx-Rice 写道:

Is there a protocol for submitting packaging recipes?


There's no difference! :-)


I might've been missing the spirit of the question here.  Patches 
are the norm because they are easiest to review and commit.


Stand-alone packages/recipes mean busywork for committers, who 
will be less likely to commit your package, or like you.


But in practice, submitting your first package as stand-alone file 
to guix-patches@ or help-guix@ with a descriptive title is 
certainly not taboo.  Someone will surely help you get both your 
package and your git set-up up to snuff.


Kind regards,

T G-R


signature.asc
Description: PGP signature


Re: postgresql client packaging recipe

2021-12-10 Thread Tobias Geerinckx-Rice

Mortimer,

So I wrote a packaging recipe (below) and submitted to nonfree. 
Was told
it might be that no one has gotten around to packaging for main 
yet.


Just FYI, Guix doesn't have sections like Debian.  There is only a 
single guix git repository, containing all packages supported and 
maintained by the Guix project.


Guix deals exclusively in Free software.  Any third-party 
repositories that don't follow the GNU Free Software Distribution 
Guidelines are not affiliated with GNU or Guix, and we can't 
provide support for them here.


I'm not aware of any licence issues with PostgreSQL, however, so 
we cool.



I see
the documentation for submitting patches, but not recipe 
files. Is there a

protocol for submitting packaging recipes?


There's no difference! :-)  Guix packages (=‘recipes’) are added 
to the repository as patches.  That's it.  Same as any other 
addition or fix: packages are just code, after all.


To submit a package upstream to Guix, you'd check out the git 
repository, add your package (‘recipe’) to a file that best suits 
it (here: databases.scm), commit it and send a patch as described 
in that section of the manual.


However…

  (description "This package contains client and administrative 
  programs
for PostgreSQL: these are the interactive terminal client psql 
and programs

for creating and removing users and databases.")


…I'm a bit confused.  What exactly is missing?

λ ls $(guix build postgresql)/*bin
clusterdb  pg_config   pg_test_fsync
createdb   pg_controldata  pg_test_timing
createuser pg_ctl  pg_upgrade
dropdb pg_dump pg_verifybackup
dropuser   pg_dumpall  pg_waldump
ecpg   pg_isready  postgres
initdb pg_receivewal   postmaster
oid2name   pg_recvlogical  psql
pg_archivecleanup  pg_resetwal reindexdb
pg_basebackup  pg_restore  vacuumdb
pgbenchpg_rewind   vacuumlo
pg_checksums   pg_standby

Sorry to be so dense.  I do use PostgreSQL but only know the very 
basics, I haven't even used or heard of most of those commands.


Kind regards,

T G-R


signature.asc
Description: PGP signature


postgresql client packaging recipe

2021-12-10 Thread Mortimer Cladwell
Hi,
Postgresql-client is not available in the main repository (server is!). I
assumed it was due to the complicated license:
https://metadata.ftp-master.debian.org/changelogs//main/p/postgresql-13/postgresql-13_13.4-0+deb11u1_copyright

So I wrote a packaging recipe (below) and submitted to nonfree.  Was told
it might be that no one has gotten around to packaging for main yet.  I see
the documentation for submitting patches, but not recipe files. Is there a
protocol for submitting packaging recipes?

guix build succeeds:

...[many successes]...
phase `delete-info-dir-file' succeeded after 0.0 seconds
starting phase `patch-dot-desktop-files'
phase `patch-dot-desktop-files' succeeded after 0.0 seconds
starting phase `install-license-files'
installing 0 license files from '.'
phase `install-license-files' succeeded after 0.0 seconds
starting phase `reset-gzip-timestamps'
phase `reset-gzip-timestamps' succeeded after 0.0 seconds
starting phase `compress-documentation'
phase `compress-documentation' succeeded after 0.0 seconds
successfully built
/gnu/store/fqmsg116ycbxyvns6wd09cwk2a6nyqis-postgresql-client-13.4.drv
/gnu/store/w9gswswv5qxc84nyq5n7zkicygsb0rrq-postgresql-client-13.4

Tested and functional on Debian.

Thanks
Mortimer


(define-module (gnu packages postgresql-client)
  #:use-module (guix packages)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix download)
  #:use-module (guix build-system gnu)
  #:use-module (gnu packages)
  #:use-module (gnu packages autotools)
  #:use-module (gnu packages guile)
  #:use-module (gnu packages base)
  #:use-module (gnu packages pkg-config)
  #:use-module (gnu packages readline)
  #:use-module (gnu packages texinfo))


(define-public postgresql-client
(package
  (name "postgresql-client")
  (version "13.4")
  (source
 (origin
   (method url-fetch)
   (uri "
http://deb.debian.org/debian/pool/main/p/postgresql-13/postgresql-13_13.4.orig.tar.bz2
")
   (sha256
(base32 "1kf0gcsrl5n25rjlvkh87aywmn28kbwvakm5c7j1qpr4j01y34za"
  (build-system gnu-build-system)
  (arguments `())
  (native-inputs
`(("autoconf" ,autoconf)
  ("automake" ,automake)
  ("pkg-config" ,pkg-config)
  ("texinfo" ,texinfo)))
  (inputs `(("readline" ,readline)
   ("zlib" ,(@ (gnu packages compression) zlib
  (propagated-inputs `())
  (synopsis "Front-end programs for PostgreSQL 13")
  (description "This package contains client and administrative programs
for PostgreSQL: these are the interactive terminal client psql and programs
for creating and removing users and databases.")
  (home-page "https://www.postgresql.org/docs/13/reference-client.html;)
  (license license:gpl3+)))


Re: Regarding implementing sof-firmware in GUIX.

2021-12-10 Thread Tobias Geerinckx-Rice

Ry,

[PSA: It's just ‘[GNU] Guix’, never ‘GUIX’ :-)  I'm not sure why 
the ‘GUIX’ meme appears to be picking up steam again as of late…]


Ry Pemberton via 写道:
I have an X1 Carbon (2021) that requires sof-firmware. It is 
libre
software, and I believe is included in the linux-libre kernel 
since
5.2. Is there a way to get this firmware working on this laptop 
with

GNU GUIX?


I tried to start a basic SOF package (attached), but quickly ran 
into ‘The GNU C library is currently unavailable for this 
platform.’  Without a cross-libc the build fails, looking for 
, which AFAICT is provided (only) by libc.


I've never cross-compiled firmware before so I don't know any next 
steps.


Of course, this being ostensibly libre software, we could package 
prebuilt binaries[0] as I'm sure 99% of users actually use.  It's 
not a good option, and hardly Guixy, but not unprecedented.


Kind regards,

T G-R

[0]: https://github.com/thesofproject/sof-bin/

From c85f4dbdaaf2081b078f02a32ede52de7162e3bf Mon Sep 17 00:00:00 2001
From: Tobias Geerinckx-Rice 
Date: Fri, 10 Dec 2021 23:40:02 +0100
Subject: [PATCH] [WIP] gnu: Add sof.

* gnu/packages/firmware.scm (sof): New public variable.
---
 gnu/packages/firmware.scm | 57 ++-
 1 file changed, 56 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm
index aefc0a8b69..2f264b534e 100644
--- a/gnu/packages/firmware.scm
+++ b/gnu/packages/firmware.scm
@@ -29,6 +29,7 @@ (define-module (gnu packages firmware)
   #:use-module (guix download)
   #:use-module (guix utils)
   #:use-module (guix git-download)
+  #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
   #:use-module (gnu packages)
   #:use-module (gnu packages admin)
@@ -41,7 +42,8 @@ (define-module (gnu packages firmware)
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages perl)
-  #:use-module (gnu packages python))
+  #:use-module (gnu packages python)
+  #:use-module (gnu packages tls))
 
 (define-public ath9k-htc-firmware
   (package
@@ -552,3 +554,56 @@ (define-public arm-trusted-firmware-rk3399
`(("cross32-gcc" ,(cross-gcc "arm-none-eabi"))
  ("cross32-binutils", (cross-binutils "arm-none-eabi"))
  ,@(package-native-inputs base))
+
+(define-public sof
+  (package
+(name "sof")
+(version "1.9.2")
+(source
+ (origin
+   (method git-fetch)
+   (uri (git-reference
+ (url "https://github.com/thesofproject/sof;)
+ (commit (string-append "v" version))
+ ;; XXX Includes an ‘rimage’ submodule, whatever that is.
+ (recursive? #t)))
+   (file-name (git-file-name name version))
+   (sha256
+(base32 "0amia754j2qawpxk19yi18d3vhlj3yraqc41il4ndf5v04p5qhc4"
+(build-system cmake-build-system)
+(arguments
+ `(#:parallel-build? #f
+   #:configure-flags
+   (list "-DINIT_CONFIG=skylake_defconfig" ; XXX?
+ "-DTOOLCHAIN=extensa-elf")))
+(native-inputs
+ (let* ((target "xtensa-elf")
+(xbinutils (cross-binutils target binutils-2.33))
+(xgcc (cross-gcc target #:xbinutils xbinutils))
+(xheaders (cross-kernel-headers target linux-libre-headers
+xgcc xbinutils))
+(xlibc (cross-libc target glibc xgcc xbinutils xheaders)))
+   `(("binutils-cross-xtensa-elf" ,xbinutils)
+ ("gcc-cross-sans-libc-xtensa-elf" ,xgcc)
+ ("glibc-cross-xtensa-elf" ,xlibc)
+ ("openssl" ,openssl)
+ ("python-wrapper" ,python-wrapper
+(home-page "https://thesofproject.github.io;)
+(synopsis "Sound Open Firmware")
+(description
+ "@acronym{SOF, Sound Open Firmware} is an audio @acronym{DSP, digital
+signal processing} firmware infrastructure and @acronym{SDK, software
+development kit}.  It provides a framework where developers interested in audio
+or signal processing on modern DSPs can create, test, and tune:
+
+[XXX Rewrite this for humanoids.]
+
+@enumerate
+@item audio processing pipelines and topologies
+@item audio processing components
+@item DSP infrastructure and drivers
+@item host operating system infrastructure and drivers.
+@end enumerate\n")
+(license (list license:bsd-3
+   license:expat
+   license:isc

base-commit: 3d54f2415672aed64661bed84a043a7f0cee13dd
prerequisite-patch-id: d67a63c338648539cfa7a08c90007d2e7abbb507
-- 
2.34.0



signature.asc
Description: PGP signature


Regarding implementing sof-firmware in GUIX.

2021-12-10 Thread Ry Pemberton via
Hello,
I have an X1 Carbon (2021) that requires sof-firmware. It is libre software, 
and I believe is included in the linux-libre kernel since 5.2. Is there a way 
to get this firmware working on this laptop with GNU GUIX?

https://www.sofproject.org/
https://www.phoronix.com/scan.php?page=news_item=Intel-Sound-Open-Firmware-5.2

Otherwise I fear I'm unable to use this distro as this is the only computer I 
have (I have purchased a libre-firmware wifi usb dongle to offset iwlwifi 
firmware).

Thank you

Re: Loading Common Lisp Libraries with GNU/Guix in a REPL

2021-12-10 Thread Edouard Klein
Hi !

I don't know the "correct" way to do it, but the way I do things is:

Create a manifest.scm or guix.scm file in the directory. Here is an
example manifest.scm file:

#+begin_src scheme
(define-module (osef)
  #:use-module (guix packages)
  #:use-module (gnu packages)
  #:use-module (guix profiles)
  #:use-module (gnu packages lisp)
  #:use-module (gnu packages lisp-xyz)
  #:use-module (gnu packages readline)
  )


(packages->manifest
 (list sbcl sbcl-numcl rlwrap))
#+end_src

Then I run guix shell, which will automatically load this manifest.scm
file.

Then, same as you, I run rlwrap sbcl.

Finally I invoke the following in sbcl:

#+begin_src lisp
(load "~/.emacs.d/elpa/27.2/develop/slime-20211021.507/swank-loader.lisp")  
;; Found using find .emacs.d/ -iname '*swank*'
(swank-loader:init)
(swank:create-server)
#+end_src

This allows my emacs instance, which lives outside the guix shell, to
communicate with the sbcl instance which lives inside. I don't want to
pollute each project with my emacs config, which is done once and for
all for all projects.

To connect: M-x slime-connet, enter, enter.

Then I just (require :numcl) (for example). I did not need to use asdf,
although this may be package-specific. I remember being unable to load a
package once, but I don't rememder which or why (sorry).

So basically, the same as you already do.

If there is a more canonical way, I'd be happy to know :)


Cheers,

Edouard.



jgart  writes:

> On Fri, 10 Dec 2021 05:44:58 -0500 jgart  wrote:
>
> Alternatively, I was able to also load code this way also after running
> the following:
>
> ```
> $ guix shell sbcl sbcl-cl-str rlwrap
>
> CL-USER(2):
> jgart@gac ~ [env] λ rlwrap sbcl
> This is SBCL 2.1.9, an implementation of ANSI Common Lisp.
> More information about SBCL is available at .
>
> SBCL is free software, provided as is, with absolutely no warranty.
> It is mostly in the public domain; some portions are provided under
> BSD-style licenses.  See the CREDITS and COPYING files in the
> distribution for more information.
> CL-USER(1): (asdf:make "str") 
> WARNING: System definition file
> #P"/gnu/store/aljfy13phr526w0iqmqz0cf2cnxkjxlb-sbcl-cl-ppcre-unicode-2.1.1/share/common-lisp/sbcl/cl-ppcre-unicode/cl-ppcre-unicode.asd"
> contains definition for system "cl-ppcre-unicode-test". Please only
> define "cl-ppcre-unicode" and secondary systems with a name starting with
> "cl-ppcre-unicode/" (e.g. "cl-ppcre-unicode/test") in that file.
>
> ;;; Computing Hangul syllable names
> T
> CL-USER(2): (in-package :str)
>
> #
> STR(3): (trim "  rst  ")
>
> "rst"
> STR(4): (join " " '("foo" "bar" "baz"))
>
> "foo bar baz"
> STR(5): (concat "f" "o" "o")
>
> "foo"
> STR(6): (split "+" "foo++bar")
>
> ("foo" "" "bar")
> ```




ffmpeg possibly missing compile option?

2021-12-10 Thread Alexander Asteroth
Dear all,

I'm trying to use vlc and ffmpeg on guix to cut mp4 files. When trying
to play the mp4 files using vlc I encounter errors like:

> Failed to open VDPAU backend libvdpau_nvidia.so: cannot open shared object 
> file: No such file or directory

In [0] it is suggested that missing compile options are the reason for
these kind of errors might be missing compile flags (--enable...) which
are in fact not enabled in the package specification of ffmpeg.

On te ofther hand I tried to install vdpauinfo and it returns:

> $ vdpauinfo 
> display: :0   screen: 0
> Failed to open VDPAU backend libvdpau_nvidia.so: cannot open shared object 
> file: No such file or directory
> Error creating VDPAU device: 1

So it might be caused by missing libraries for my graphicscard.

Any idea? Someone?

Cheers,

Alex



[0] https://forum.videolan.org/viewtopic.php?p=517583



Re: Loading Common Lisp Libraries with GNU/Guix in a REPL

2021-12-10 Thread jgart
On Fri, 10 Dec 2021 05:44:58 -0500 jgart  wrote:

Alternatively, I was able to also load code this way also after running
the following:

```
$ guix shell sbcl sbcl-cl-str rlwrap

CL-USER(2):
jgart@gac ~ [env] λ rlwrap sbcl
This is SBCL 2.1.9, an implementation of ANSI Common Lisp.
More information about SBCL is available at .

SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses.  See the CREDITS and COPYING files in the
distribution for more information.
CL-USER(1): (asdf:make "str") 
WARNING: System definition file
#P"/gnu/store/aljfy13phr526w0iqmqz0cf2cnxkjxlb-sbcl-cl-ppcre-unicode-2.1.1/share/common-lisp/sbcl/cl-ppcre-unicode/cl-ppcre-unicode.asd"
contains definition for system "cl-ppcre-unicode-test". Please only
define "cl-ppcre-unicode" and secondary systems with a name starting with
"cl-ppcre-unicode/" (e.g. "cl-ppcre-unicode/test") in that file.

;;; Computing Hangul syllable names
T
CL-USER(2): (in-package :str)

#
STR(3): (trim "  rst  ")

"rst"
STR(4): (join " " '("foo" "bar" "baz"))

"foo bar baz"
STR(5): (concat "f" "o" "o")

"foo"
STR(6): (split "+" "foo++bar")

("foo" "" "bar")
```



Loading Common Lisp Libraries with GNU/Guix in a REPL

2021-12-10 Thread jgart
Hi Guixers/Lispers,

What is the recommended way to load common lisp libraries that I install
with GNU/Guix on a foreign distro from a repl?

What are the common practices/workflows that the Guix community currently
uses with emacs-slime or sly to load common lisp libraries?

Is there a way of loading my dependencies with Guix the way they can be loaded 
automatically via quicklisp?

I've tried this so far:

```
$ guix shell sbcl sbcl-dexador rlwrap

$ rlwrap sbcl

CL-USER(1): (asdf:load-system :dexador)
WARNING: System definition file
#P"/gnu/store/zwkhqlyijf8bwpm3a70f7ly978w2knqw-sbcl-flexi-streams-1.0.19/share/common-lisp/sbcl/flexi-streams/flexi-streams.asd"
contains definition for system "flexi-streams-test". Please
only define "flexi-streams" and secondary
systems with a name starting with "flexi-streams/"
(e.g. "flexi-streams/test") in that file.  WARNING: System definition file
#P"/gnu/store/98czgrz2fqq2mjzj80i19yly0n6lw2bs-sbcl-trivial-garbage-0.21/share/common-lisp/sbcl/trivial-garbage/trivial-garbage.asd"
contains definition for system "trivial-garbage-tests". Please only
define "trivial-garbage" and secondary systems with a name starting with
"trivial-garbage/" (e.g. "trivial-garbage/test") in that file.

T
CL-USER(2): (dex:get "http://genenetwork.org/api/v_pre1/species;)

"[{\"FullName\":\"Mus
musculus\",\"Id\":1,\"Name\":\"mouse\",\"TaxonomyId\":10090},{\"FullName\":\"Rattus
norvegicus\",\"Id\":2,\"Name\":\"rat\",\"TaxonomyId\":10116},{\"FullName\":\"Arabidopsis
thaliana\",\"Id\":3,\"Name\":\"arabidopsis\",\"TaxonomyId\":3702},{\"FullName\":\"Homo
sapiens\",\"Id\":4,\"Name\":\"human\",\"TaxonomyId\":9606},{\"FullName\":\"Hordeum
vulgare\",\"Id\":5,\"Name\":\"barley\",\"TaxonomyId\":4513},{\"FullName\":\"Drosophila
melanogaster\",\"Id\":6,\"Name\":\"drosophila\",\"TaxonomyId\":7227},{\"FullName\":\"Macaca
mulatta\",\"Id\":7,\"Name\":\"macaque
monkey\",\"TaxonomyId\":9544},{\"FullName\":\"Glycine
max\",\"Id\":8,\"Name\":\"soybean\",\"TaxonomyId\":3847},{\"FullName\":\"Solanum
lycopersicum\",\"Id\":9,\"Name\":\"tomato\",\"TaxonomyId\":4081},{\"FullName\":\"Populus
trichocarpa\",\"Id\":10,\"Name\":\"poplar\",\"TaxonomyId\":3689},{\"FullName\":\"Oryzias
latipes (Japanese medaka)\",\"Id\":11,\"Name\":\"Oryzias
latipes\",\"TaxonomyId\":8090}]
"
200
#
#http://genenetwork.org/api/v_pre1/species>
#
```

`(asdf:load-system :dexador)` feels a bit verbose for loading a library
at a REPL.

Any help on best practices for common lisp workflows using GNU/Guix is
much appreciated.

all best,

jgart



Re: Run .deb or .rpm packages

2021-12-10 Thread Hartmut Goebel

Hi,

Le 8 décembre 2021 14:46:24 GMT-05:00, "André A. 
Gomes"  a écrit :


--8<---cut here---start->8---
$ sudo dpkg -i foo-package.deb
dpkg: error: unable to access the dpkg database directory 
/gnu/store/902w5i1j38r33l6p871dyhng19zj1phk-dpkg-1.20.9/var/lib/dpkg: Read-only 
file system
--8<---cut here---end--->8---

Any ideas?  I don't know much about .deb or .rpm.


Beside Julien's objections: There might be legitimate use of installing 
.deb or .rpm packages and they might even work. E.g. i one wants to 
install free software provided as a .deb only and at the moment does not 
have the time to create a package definition for it.


So, "dpkg" and "rpm" should at least work :-)

Regarding the error show above: One would need to add 
"--localstatedir=/var" to the config flags (not sure whether this would 
build, then, since most probably "make install" will try to create 
"/var/lib/dpkg" which will fail in the build container.


--
Regards
Hartmut Goebel

| Hartmut Goebel  |h.goe...@crazy-compilers.com|
|www.crazy-compilers.com  | compilers which you thought are impossible |