Re: define PATH and PROFILE

2021-01-03 Thread Christophe Pisteur
Le dimanche 03 janvier 2021 à 21:49 +0100, Tobias Geerinckx-Rice a
écrit :
> Hi Christophe,
> 
> Christophe Pisteur 写道:
> > 1) after guix pull, I get the following message:
> > 
> > export PATH="$HOME/.config/guix/current/bin:$PATH"
> > export 
> > INFOPATH="$HOME/.config/guix/current/share/info:$INFOPATH"
> > 
> > I don't quite understand what to type in the terminal.
> 
> Exactly these two lines as printed.  As you copied them into this 
> e-mail.
> 
> > Should I replace
> > $HOME or HOME with the path of my directory, for example: 
> > 
> > export PATH="/home/christophe/.config/guix/current/bin:$PATH"
> > and then:
> > export
> > INFOPATH="/home/christophe/.config/guix/current/share/info:$INFOPAT
> > H"
> 
> Well, if you:
> 
>   $ echo $HOME
>   /home/christophe
> 
> so both are entirely equivalent.
> 
> If you write (or copy/paste) $HOME, the shell will perform your 
> replacement for you, with less chance of mistakes.
> 
> > 2) similar question with this message:
> > 
> > GUIX_PROFILE="/home/christophe/.guix-profile" 
> > . "$GUIX_PROFILE/etc/profile"
> > 
> > Is this two actions (two step in the terminal, the first line 
> > and
> > "enter" then the second line and "enter")?
> 
> Yes, although most terminal emulators do the right thing if you 
> simply copy and paste both lines at once with the mouse.  You 
> might have to hit Enter after that; it depends on the emulator.
> 
> > And does the second line really begin with a dot?
> 
> Yes.  ‘.’ evaluates the contents of a shell script as if you typed 
> it at the prompt.  In bash, it's aliased to ‘source’ but this is 
> not standard, so we say ‘.’.
> 
> It's similar to executing the script (without the dot), but allows 
> the script to change the current shell's environment:
> 
>   $ TEST=nope
>   $ cat ./example
>   TEST=hullo
>   $ echo $TEST
>   nope
>   $ chmod +x ./example
>   $ ./example # <- running
>   $ echo $TEST
>   nope
>   $ . ./example
>   $ echo $TEST # <- sourcing
>   hullo
>   $
> 
> > In both questions (1 et 2), I have tried several options but the
> > terminal does not return any message (neither error nor success
> > message)
> 
> In Unix -- and GNU, being a Unix -- silence is golden.  }:-)
> 
> If something did go wrong you should've got an error message, so 
> it sounds like everything is fine & boring.
> 
> Welcome to Guix, and please don't hesitate to ask questions, 
> newbie or not.
> 
> Kind regards,
> 
> T G-R


Thank you very much for this answer which not only explains to me what
to do, but also allows me to understand what I am doing! 
Thank you!
Christophe


Re: define PATH and PROFILE

2021-01-03 Thread Tobias Geerinckx-Rice

Hi Christophe,

Christophe Pisteur 写道:

1) after guix pull, I get the following message:

export PATH="$HOME/.config/guix/current/bin:$PATH"
export 
INFOPATH="$HOME/.config/guix/current/share/info:$INFOPATH"


I don't quite understand what to type in the terminal.


Exactly these two lines as printed.  As you copied them into this 
e-mail.



Should I replace
$HOME or HOME with the path of my directory, for example: 


export PATH="/home/christophe/.config/guix/current/bin:$PATH"
and then:
export
INFOPATH="/home/christophe/.config/guix/current/share/info:$INFOPATH"


Well, if you:

 $ echo $HOME
 /home/christophe

so both are entirely equivalent.

If you write (or copy/paste) $HOME, the shell will perform your 
replacement for you, with less chance of mistakes.



2) similar question with this message:

GUIX_PROFILE="/home/christophe/.guix-profile" 
. "$GUIX_PROFILE/etc/profile"


Is this two actions (two step in the terminal, the first line 
and

"enter" then the second line and "enter")?


Yes, although most terminal emulators do the right thing if you 
simply copy and paste both lines at once with the mouse.  You 
might have to hit Enter after that; it depends on the emulator.



And does the second line really begin with a dot?


Yes.  ‘.’ evaluates the contents of a shell script as if you typed 
it at the prompt.  In bash, it's aliased to ‘source’ but this is 
not standard, so we say ‘.’.


It's similar to executing the script (without the dot), but allows 
the script to change the current shell's environment:


 $ TEST=nope
 $ cat ./example
 TEST=hullo
 $ echo $TEST
 nope
 $ chmod +x ./example
 $ ./example # <- running
 $ echo $TEST
 nope
 $ . ./example
 $ echo $TEST # <- sourcing
 hullo
 $


In both questions (1 et 2), I have tried several options but the
terminal does not return any message (neither error nor success
message)


In Unix -- and GNU, being a Unix -- silence is golden.  }:-)

If something did go wrong you should've got an error message, so 
it sounds like everything is fine & boring.


Welcome to Guix, and please don't hesitate to ask questions, 
newbie or not.


Kind regards,

T G-R


signature.asc
Description: PGP signature


define PATH and PROFILE

2021-01-03 Thread Christophe Pisteur
Hello,

sorry for the newbie question.

1) after guix pull, I get the following message:

export PATH="$HOME/.config/guix/current/bin:$PATH"
export INFOPATH="$HOME/.config/guix/current/share/info:$INFOPATH"

I don't quite understand what to type in the terminal. Should I replace
$HOME or HOME with the path of my directory, for example: 

export PATH="/home/christophe/.config/guix/current/bin:$PATH"
and then:
export
INFOPATH="/home/christophe/.config/guix/current/share/info:$INFOPATH"

2) similar question with this message:

GUIX_PROFILE="/home/christophe/.guix-profile" 
. "$GUIX_PROFILE/etc/profile"

Is this two actions (two step in the terminal, the first line and
"enter" then the second line and "enter")? 
And does the second line really begin with a dot? 

In both questions (1 et 2), I have tried several options but the
terminal does not return any message (neither error nor success
message)

Again, sorry for the newbie question.


PS: I use guix system with the installer 1.2. 



Re: GNU Guix 1.2.0 released

2021-01-03 Thread Roy Lemmon
Leo Famulari  writes:

> On Mon, Nov 23, 2020 at 04:07:25PM +0100, Ludovic Courtès wrote:
>> We are pleased to announce the release of GNU Guix 1.2.0, which also
>> marks the eighth anniversary of Guix today.
>
> Hooray!
>
>> This release corresponds to 10,248 commits over 6.5 months by 201 people.
>> It includes many new features, user interface and performance
>> improvements, as well as many bug fixes—see below for a list of changes.
>
> That's amazing! Great job everyone.

Very good.




Re: EXWM: file or program not found, ls

2021-01-03 Thread Olivier Rojon

Hej,

my login shell is bash, and I have edited it. Yet, adding the lines you 
have provided did not really help the issue.


I have now written an .xsession file which looks like this:

--8<---cut here---start->8---
 #!/usr/bin/env bash
. /etc/profile &
. ~/.bashrc &
exec exwm
--8<---cut here---end--->8---

Unfortunately, this did not do the trick.


There's two things I suspect to be a possible culprit which I am about 
to change:


- I had manually defined PATH in .bashrc, which I believe might have 
overriden other attempts at defining it (even though it contains :$PATH 
at the end)


- I did what is sometimes advised when you install a package, that you 
should add the following lines to your shell:


--8<---cut here---start->8---
GUIX_PROFILE="/home/hapster/.guix-profile"
. "$GUIX_PROFILE/etc/profile"
--8<---cut here---end--->8---

However, I had not added an "export" in front of "GUIX_PROFILE", which 
might be part of the problem.



But as you can see, I am kind of struggling to find the cause of the 
problem. ;-)



On 02.01.21 15:17, Pierre Neidhardt wrote:

Hi Olivier,

What's your login shell?  If it's Bash, did you edit ~/.bashrc by any chance?

The default file contains this snippet:

--8<---cut here---start->8---
if [[ $- != *i* ]]
then
 # We are being invoked from a non-interactive shell.  If this
 # is an SSH session (as in "ssh host command"), source
 # /etc/profile so we get PATH and other essential variables.
 [[ -n "$SSH_CLIENT" ]] && source /etc/profile

 # Don't do anything else.
 return
fi

# Source the system-wide file.
source /etc/bashrc
--8<---cut here---end--->8---

You need to source /etc/profile if you want the environment variables
like PATH to be set properly.

You can do this from ~/.bashrc as is done in the snippet, or from other
files such ~/.profile or ~/.xinitrc.

Hope that helps!





Re: EXWM: file or program not found, ls

2021-01-03 Thread Pierre Neidhardt
Hi,

You most probably have an issue with your dotfiles.
Some comments below:

Olivier Rojon  writes:

> --8<---cut here---start->8---
>   #!/usr/bin/env bash
> . /etc/profile &
> . ~/.bashrc &
> exec exwm
> --8<---cut here---end--->8---

Remove the trailing `&`.  This syntax is used to start processes in the
background, but here you are sourcing configuration files which should
be done synchronously.

> - I had manually defined PATH in .bashrc, which I believe might have 
> overriden other attempts at defining it (even though it contains :$PATH 
> at the end)

It may have a typo.  Try commenting out any modification done to PATH
and try again.

> - I did what is sometimes advised when you install a package, that you 
> should add the following lines to your shell:
>
> --8<---cut here---start->8---
> GUIX_PROFILE="/home/hapster/.guix-profile"
> . "$GUIX_PROFILE/etc/profile"
> --8<---cut here---end--->8---
>
> However, I had not added an "export" in front of "GUIX_PROFILE", which 
> might be part of the problem.

Nope, it should not matter if the second line was applied properly.

> But as you can see, I am kind of struggling to find the cause of the 
> problem. ;-)

Try creating a new user with no modifications done to the dotfiles.
Then import your dotfiles gradually do see which one triggers the issue.

Cheers!

-- 
Pierre Neidhardt
https://ambrevar.xyz/


signature.asc
Description: PGP signature


Re: Packaging the GNU Modula 2 compiler

2021-01-03 Thread Efraim Flashner
Try wrapping everything in a toolchain, as defined in (gnu packages
commencement). Then you'll have the ld-wrapper you need and everything

(define-public gm2-toolchain
  (make-gcc-toolchain gm2))

or even

(define-public gm2-toolchain
  (package
(inherit (make-gcc-toolchain gm2))
(synopsis (package-synopsis gm2))
(description (package-description gm2

-- 
Efraim Flashner  אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted


signature.asc
Description: PGP signature


Packaging the GNU Modula 2 compiler

2021-01-03 Thread Holger Peters
I have trouble building the GNU Modula 2 compiler
[[https://www.nongnu.org/gm2/][GNU Modula 2 compiler]]. And I think I
could use some help with that.

tl;dr: After packaging the GNU Modula 2 compiler  with guix I get an
error about: '/usr/bin/ld: cannot find crt1.o: No such file or
directory'


The information on building it is a bit sparse. Here is what I could
gather.

 * I managed to get a successful build of `gm2', that would compile
   modula files to *.o files. However, I wasn't able to link to an
   executable due to multilib issues (see below).
 * It seems there are no (recent) source releases for GNU Modula 2,
   the expecation is to get the releases from the git repository.
 * GNU Modula 2 is a gcc-based compiler.
 * The latest stable release of gm2 is based on gcc-10.
   [[https://www.nongnu.org/gm2/building.html][Source]]
 * Build guidelines are available under   
   [[https://www.nongnu.org/gm2/building_on_gcc_10.html][Building GNU
Modula-2 grafted on the
   gcc-10 branch]].

As per the docs, these are the recommended configuration steps. You'll
see that my guix package definition below differs in detail.

#+BEGIN_SRC sh
  git clone http://floppsie.comp.glam.ac.uk/gm2 gm2-floppsie
  cd gm2-floppsie
  git checkout gm2-10
  ./contrib/download_prerequisites
  cd ../..

  sudo apt-get install gcc-multilib libmpfr-dev libgmp-dev libmpc-dev
flex

  mkdir build-gcc-10
  cd build-gcc-10
  CXXFLAGS=-g BOOT_CFLAGS=-g CFLAGS=-g \
../gm2-floppsie/configure \
--prefix=$HOME/opt \
--libexecdir=$HOME/opt/lib \
--enable-threads=posix \
--enable-clocale=gnu --enable-languages=c,c++,m2 \
--disable-multilib --disable-bootstrap --enable-checking
#+END_SRC


* Questions

** Linking Issue / Multilib

There is a /multilib/ configuration flag (disable/enable) and for the
apt-based distros it seems GM2 devs recommend the installation of
gcc-multilib. Since I don't find a multilib package in guix, I think
the approach might be a little different for guix. What needs to be
done here?

I did leave /--disable-multilib/ in the configure flags in my build
recipe below. Then when compiling a source file like this
[[https://www.nongnu.org/gm2/example_usage.html][Source]]

#+BEGIN_SRC modula-2
  MODULE hello;

  FROM StrIO IMPORT WriteString, WriteLn ;

  BEGIN
 WriteString('hello world') ; WriteLn
  END hello.
#+END_SRC


I get the following error (`gm2 -v -g hello.mod'):

#+BEGIN_SRC text
  /usr/bin/ld: cannot find crt1.o: No such file or directory
  /usr/bin/ld: cannot find crti.o: No such file or directory
  collect2: error: ld returned 1 exit status
#+END_SRC

(Full verbose log in attached file `out.log').

** /usr/bin/ld

Shouldn't I expect - in the error message - to see a reference to ld as
provided by guix?

** Outputs

This is a bit of a follow-up question. I had more success building GM2
with the GCC bootstrapping enabled. I think the build outputs should
be restricted when going down that path. How do I make sure that the
`gcc' executables aren't propagated into the PATH when installing gm2.

* Build recipe

This is what I camee up with so far. I realize this isn't a /polished/
patch yet, my focus is to get it to build.

#+BEGIN_SRC scheme
  (define-module (yas packages gm2)
#:use-module (gnu packages gcc)
#:use-module (gnu packages flex)
#:use-module (gnu packages bison)
#:use-module (gnu packages python)
#:use-module (guix search-paths)
#:use-module (guix git-download)
#:use-module (guix utils)
#:use-module (guix packages)
#:use-module (guix build-system gnu)
#:use-module (srfi srfi-1)
#:use-module (srfi srfi-26)
#:use-module (ice-9 regex))


  (define %generic-search-paths
;; This is the language-neutral search path for GCC.  Entries in
$CPATH are
;; not considered "system headers", which means GCC can raise
warnings for
;; issues in those headers.  'CPATH' is the only one that works for
;; front-ends not in the C family.
(list (search-path-specification
   (variable "CPATH")
   (files '("include")))
  (search-path-specification
   (variable "LIBRARY_PATH")
   (files '("lib" "lib64")


  (define-public gm2
(let ((revision "3")
  (commit "5f55e3e8a7bd2142eff043479c4059242e81e2ea")
  (git-url "http://floppsie.comp.glam.ac.uk/gm2";)
  (name "gm2")
  (version "gm2-10"))
  (package (inherit gcc-10)
   (name name)
   (version version)
   (source (origin
 (method git-fetch)
 (uri (git-reference
   (url git-url)
   (commit commit)))
 (file-name (git-file-name name version))
 (sha256 (base32
"0cc46bkv198j7hn1ihczf6p4fpby3cnp57rml679rna2cmhzhp4x"
   (native-search-paths %generic-search-paths)
   (properties (alist-delete 'hidden? (p

Re: Anyone using Nix on Guix System?

2021-01-03 Thread Pierre Neidhardt
Hi!

While I haven't used it in a few months, here is what I did to set it
up:

--8<---cut here---start->8---
(operating-system
  (inherit %bababa/os)
  (packages (cons* nix
   ...))
  (services (cons*
 (service nix-service-type)
 ...
 ))
  )
--8<---cut here---end--->8---

Then, as per the manual:

--8<---cut here---start->8---
• Add a Nix channel and update it.  See Nix Package Manager
  Guide (https://nixos.org/nix/manual/).

• Create a symlink to your profile and activate Nix profile:

  $ ln -s "/nix/var/nix/profiles/per-user/$USER/profile" ~/.nix-profile
  $ source /run/current-system/profile/etc/profile.d/nix.sh
--8<---cut here---end--->8---

Hope that helps!

-- 
Pierre Neidhardt
https://ambrevar.xyz/


signature.asc
Description: PGP signature


Anyone using Nix on Guix System?

2021-01-03 Thread Yasuaki Kudo
Happy New Year!

I tried to use Nix on my Guix System by following instructions I found on the 
Internet (I added both nix package and nix service in my system 
configuration.scm file.)

I then followed standard Nix installation instructions like adding a Nix 
channel, etc - only to find no package available after issuing nix-env -qa (I 
hope am correctly recalling...)

If anyone has a working configuration for Nix on Guix System for daily use, 
would you please share?

I thought using Nix on Guix System would be an excellent way to augment missing 
packages in Guix! 😄

Cheers,
Yasi