Hi Tobias,
On 14/12/19 2:37 am, Tobias Geerinckx-Rice wrote:
Michael Zucchi 写道:
I'm not really sure where to put it or how to compile each part (it just
file-systems.scm if possible. linux.scm is already a bloated grab-bag.
For now, you can test each package at a time by adding the variable
(e.g ‘jfs_fsck/static’) as the last line of your current .scm file.
This will make the file ‘evaluate to jfs_fsck/static’, so you can:
$ guix build -f thefile.scm
You'll have to change that last line every time you want to change the
package being built.
Ok cool. Yeah I was doing that for testing but it seemed clunky.
You'll need a Guix git checkout to get much further. If you haven't
yet done so, read ‘Building from Git’ in the manual and bootstrap
yourself some Guix.
Actually before I downloaded the binary I tried that (and creating
slackware packages of the many dependencies), but although everything
compiled ok it just crashed with an obtuse stack trace whenever I tried
doing anything. Maybe I missed something along the way, but I can't
remember the details now. It was a frustrating introduction.
No doubt it will be easier within a guix environment.
build jfsutils, not jfs_fsck/static) and I used the slackware patches,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Typo that should be the other way 'round?
Oh I just meant that the .scm file only compiles one part of the
package, but that's covered by your directions above (to add the desired
name to the end of the file) - which I was doing anyway while developing it.
Are you sure that LDFLAGS=-static is needed when using
static-package? Here's my aborted static version:
++(define-public jfsutils/static
++ (static-package
++ (package
++ (inherit jfsutils)
++ (name "jfsutils-static")
++ (inputs
++ `(("util-linux" ,util-linux)
++ ("util-linux:static" ,util-linux "static"))))))
I got my patches from Debian, but they do the same job. There were
others[0] but they weren't vital or relevant to Guix.
Looks like you're right. While I was writing the description I didn't
know about 'outputs' of packages or the 'static' output of util-linux
and it wasn't building a static binary by default, so the -static flag
was to force it - and expose the missing build requirement.
Incidentally the e2fsprogs in linux.scm doesn't make the /static build
public, does it matter?
Also, should it be '(inputs' or '(native-inputs', since it's static it
has no runtime dependencies? Is that what they're for?
;; COPYING is gpl3, the headers are gpl2+?
That's interesting. Where'd you find gpl2+?
I just wasn't sure as the headers in all the .c files are gpl2+ and
COPYING is gpl3 - but nothing in the archive (or home page - that i
could find) actually refers to that file or any specific version. But on
reflection gpl3 should be correct based on COPYING.
Ok well thanks for all the pointers.
I'm currently distracted with some other stuff (all sort of hacking and
other things) but when I get back to it I guess i'll get a guix
bootstrapped, add the functions, and then keep poking towards the goal
of a system image. I've already noticed gnu/build/file-systems.scm
needs some additions for example. I don't particularly like lisps -
last time i touched any was writing gnome-doc.el about 20 years ago! -
so I should also brush up on scheme and familiarise myself with the
guile repl.
Cheers,
Z