Re: How do I define a package?

2018-08-29 Thread Luther Thompson
On Wed, 22 Aug 2018 02:01:26 -0400
Leo Famulari  wrote:
> Looking at some other Guix packages using the scons-build-system, it
> seems like the Sconscripts usually take a 'PREFIX' or 'prefix'
> argument that should contain the output directory in /gnu/store.
> 
> For example:
> 
> --
> (build-system scons-build-system)
> (arguments
>  `(#:tests? #f  ;no tests
>#:scons-flags
>(list (string-append "prefix=" (assoc-ref %outputs "out")))
> --

That fixed it. Thanks!

For other people reading this, the "prefix=" is an arbitrary argument
that the SConstruct has to look for in the ARGUMENTS dict. For example,
I used `ARGUMENTS.get('prefix', '/usr/local')`.

Regards,
Luther



Re: confusion/mdl

2018-08-29 Thread Benjamin Slade
Thanks, that at least gives me a place to start.


On 2018-08-29T09:29:40-0600, Pierre Neidhardt  wrote:


 > > macros.cpp: In function ‘mdl_value_t* mdl_get_atom(const char*, bool, 
 > > mdl_value_t*)’:
 > > macros.cpp:616:27: error: invalid conversion from ‘const char*’ to ‘char*’ 
 > > [-fpermissive]
 > >  char *trailer = strstr(pname, "!-");

 > Well, it looks like macros.cpp is doing something dirty here.
 > I suppose this is an upstream bug (which should be reported).
 > As a workaround, you could try setting appropriate compilation flags.  Look
 > around "-fpermissive" in the gcc manual.

 > (Sorry if this help is a little scarce, I'm very busy these days... :p)

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


-- 
Benjamin Slade - https://babbagefiles.xyz 
  `(pgp_fp: ,(21BA 2AE1 28F6 DF36 110A 0E9C A320 BBE8 2B52 EE19))
'(sent by mu4e on Emacs running under GNU/Linux . https://gnu.org )
   `(Choose Linux ,(Choose Freedom) . https://linux.com )



Re: Guix and Emacs Integration for Polyglot Development

2018-08-29 Thread Jan Nieuwenhuizen
Hi!

Just subscribed to help-guix because of a request on IRC, so hoping that
OP is subscribed here, or someone can notify them.

I have an ugly hack to switch emacs to a profile or environment.  It
parses the /etc/profile script...using MANIFEST or
`--search-paths' would be much nicer...

Anyway, I'm using some named profiles, eg

~/.config/guix/mes

and when starting work on mes i do

M-x guix-switch-profile RET ~/.config/guix/mes RET

similar for other projects I work on.

A real solution would be nice...

HTH, janneke

--8<---cut here---start->8---
(defun guix-switch-profile ( profile)
  "reset Emacs' environment by snarfing PROFILE/etc/profile"

  (defun matches-in-string (regexp string)
"return a list of matches of REGEXP in STRING."
(let ((matches))
  (save-match-data
(string-match "^" "")
(while (string-match regexp string (match-end 0))
  (push (or (match-string 1 string) (match-string 0 string)) matches)))
  matches))

  (interactive "fprofile: ")
  (let* ((output (shell-command-to-string (concat "GUIX_PROFILE= /bin/sh -x " 
profile "/etc/profile")))
 (exports (matches-in-string "^[+] export \\(.*\\)" output)))
(mapcar (lambda (line) (apply #'setenv (split-string line "="))) exports )))
--8<---cut here---end--->8---

-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com