[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Help defining a trivial package.
From: |
Timothy Sample |
Subject: |
Re: Help defining a trivial package. |
Date: |
Sun, 25 Aug 2019 08:17:37 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) |
Hi Pierre,
"Pierre-Henry F." <address@hidden> writes:
> Would someone help defining a trivial package?
Sure!
> Here is an attempt at defining the package (incomplete, does not work) in
> blog.scm:
>
> (define-module (blog)
> #:use-module (guix packages)
> #:use-module (guix download)
> #:use-module (guix build-system trivial)
> #:use-module (guix licenses)
> #:use-module (gnu packages python))
>
> (define-public blog
> (package
> (name "blog")
> (version "3")
> (source
> (origin
> (method url-fetch)
> (uri (string-append "/home/phf/programs/blog/release_" version
> ".tar.lz"))
> (sha256
> (base32
> "1y819b53ksyas6asldysr0r8p73n5i8ipbpmbgjrfx8qz8cy2zsx"))))
> (build-system trivial-build-system)
> (arguments
> '(#:builder #~(begin
> (mkdir #$output)
> (chdir #$output)
> ...
> )))
> (inputs `(("python" ,python)))
> (synopsis "Guix 'hello world' to learn about Guix")
> (license gpl3+)))
>
> Here is the line that I use to try to build and debug along the way:
>
> $ guix build --keep-failed --verbosity=2 --file=./blog.scm
>
As a note for the future, it would be helpful to include the error
message that you saw when things went wrong. Here, I’m assuming that
Guix said:
guix build: error: #<unspecified>: not something we can build
Running “guix build --file=X” causes Guix to build the last expression
evaluated in the file “X”. In your case, the last expression that gets
evaluated is the “define-public” form, which returns an unspecified
value.
While testing, you can put “blog” at the bottom of the file, causing
Guix to build your defined “blog” package.
Hope that helps!
-- Tim