unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* Creating new package for Guix - newbie's question
@ 2016-06-12 20:08 Rodion Goritskov
  2016-06-12 21:24 ` Matthew Jordan
  0 siblings, 1 reply; 4+ messages in thread
From: Rodion Goritskov @ 2016-06-12 20:08 UTC (permalink / raw)
  To: Help Guix

Hello everybody!

I am GuixSD and Guix newcomer. Installation succeeded, but suddenly I 
found that one of my favorite packages - compton[1], is missing in 
repos.

OK, that is not really a problem - I tried to create this package 
myself. So, I copied template "hello.scm" from documentation, modified 
it according to compton's build process.

Question is - how I can test created package build process?

I tried executing guix package -f <my package file>. It doesn't output 
any errors, but package is not installed or built.

What is the process of testing created package file?

Thank you in advance.

Proud Guix user,
Rodion Goritskov

P.S. Guix and GuixSD are great pieces of software!

[1] - https://github.com/chjj/compton

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Creating new package for Guix - newbie's question
  2016-06-12 20:08 Creating new package for Guix - newbie's question Rodion Goritskov
@ 2016-06-12 21:24 ` Matthew Jordan
  2016-06-13  1:19   ` Leo Famulari
  2016-06-13 13:37   ` d4n1
  0 siblings, 2 replies; 4+ messages in thread
From: Matthew Jordan @ 2016-06-12 21:24 UTC (permalink / raw)
  To: Rodion Goritskov; +Cc: Help Guix

Hi Rodion,

Welcome to Guix!

Here is the fast way;

$ mkdir -p ${HOME}/tmp/packages/gnu/packages
$ export GUIX_PACKAGE_PATH="${HOME}/tmp/packages"

$ mv <package-file>.scm ${HOME}/tmp/packages/gnu/packages
$ guix build <package-name>

If you intend to contribute the package, keep reading.

> OK, that is not really a problem - I tried to create this package 
> myself. So, I copied template "hello.scm" from documentation, modified 
> it according to compton's build process.

See the following sections/chapters in the Guile Reference Manual;

5 Programming Interface (Page 41)
https://www.gnu.org/software/guix/manual/guix.html#Programming-Interface

6.1 Invoking guix build (Page 75)
https://www.gnu.org/software/guix/manual/guix.html#Invoking-guix-build

8 Contributing (Page 170))
https://www.gnu.org/software/guix/manual/guix.html#Contributing

> Question is - how I can test created package build process?
Here is what I do atm for developing packages.

$ guix environment guix --ad-hoc help2man git strace
$ eval `guix environment guix --ad-hoc --search-paths help2man git
strace`

$ unset GUIX_PACKAGE_PATH
$ export GUIX_BUILD_OPTIONS="--keep-failed --verbosity=3"
$ export BUILD_LOG=${HOME}/tmp/logs/pre-guix-build.log
$ mkdir -p $(dirname ${BUILD_LOG})

Inital setup
$ git clone --recurse git://git.savannah.gnu.org/guix.git

Update
$ git pull --recurse-submodules

Build
$ ./bootstrap
$ ./configure --localstate=/var
$ make
$ make check

Runs in the foreground
optional unless editing damon code
$ sudo ./pre-inst-env guix-daemon --build-users-group=guixbuild

Edit/add code under gnu/packages directory.

$ export GUIX_BUILD_OPTIONS="--keep-failed --verbosity=3"
$ ./pre-inst-env guix build hello &>/dev/stdout &>${BUILD_LOG}
$ ./pre-inst-env guix lint hello

-- 
Matthew Jordan
Sent with my mu4e

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Creating new package for Guix - newbie's question
  2016-06-12 21:24 ` Matthew Jordan
@ 2016-06-13  1:19   ` Leo Famulari
  2016-06-13 13:37   ` d4n1
  1 sibling, 0 replies; 4+ messages in thread
From: Leo Famulari @ 2016-06-13  1:19 UTC (permalink / raw)
  To: Matthew Jordan; +Cc: Help Guix

On Sun, Jun 12, 2016 at 05:24:37PM -0400, Matthew Jordan wrote:
> Here is what I do atm for developing packages.

That is a very complete list of things to do :)

> Build
> $ ./bootstrap
> $ ./configure --localstate=/var

That should be --localstatedir=/var

> $ make
> $ make check

It should be enough to bootstrap, configure, and make check from the Git
checkout, and then this...

> $ ./pre-inst-env guix build hello &>/dev/stdout &>${BUILD_LOG}

... should be enough to get you started. Although, you don't need to
create your own build log. It is made available with `guix build
--log-file`.  Making your own log is useful if you want to capture the
log of a failing build.

If you don't have all the dependencies you need to `make` Guix, do `guix
environment guix` to add the dependencies of Guix to your environment.

> $ ./pre-inst-env guix lint hello

Please do this before sending the patch to guix-devel ;)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Creating new package for Guix - newbie's question
  2016-06-12 21:24 ` Matthew Jordan
  2016-06-13  1:19   ` Leo Famulari
@ 2016-06-13 13:37   ` d4n1
  1 sibling, 0 replies; 4+ messages in thread
From: d4n1 @ 2016-06-13 13:37 UTC (permalink / raw)
  To: matthewjordandevops, rodion; +Cc: Help Guix

[-- Attachment #1: Type: text/html, Size: 3342 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-06-13 13:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-12 20:08 Creating new package for Guix - newbie's question Rodion Goritskov
2016-06-12 21:24 ` Matthew Jordan
2016-06-13  1:19   ` Leo Famulari
2016-06-13 13:37   ` d4n1

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).