[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: About packaging documentation
From: |
Zelphir Kaltstahl |
Subject: |
Re: About packaging documentation |
Date: |
Wed, 17 Mar 2021 21:43:39 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 |
Hi Ricardo!
On 3/16/21 11:03 PM, Ricardo Wurmus wrote:
> Hi Zelphir,
>
>> Hello Ricardo!
>>
>> On 3/15/21 4:43 PM, Ricardo Wurmus wrote:
>>> Hi Zelphir,
>>>
>>>> https://guix.gnu.org/cookbook/en/html_node/Packaging-Tutorial.html
>>>> is a good
>>>> start. It has even got cookbook in the name. Definitely the right idea to
>>>> complement the general documentation. I am aware of its existence.
>>>> Unfortunately, I could not get the basic approach of the "Hello World
>>>> package"
>>>> working for my package, even though it is pure guile, no other library
>>>> required
>>>> and no FFI or anything. I would have preferred not having to go through
>>>> all the
>>>> autotools stuff, and to have this simple way working for my package.
>>>> Perhaps I
>>>> did something slightly wrong. I do not know. Someone mentioned on the
>>>> guile user
>>>> mailing list, that this is all that should be needed for a pure guile
>>>> package.
>>>> Perhaps it can be updated?
>>> Could you share the code you’re trying to package? Perhaps it will
>>> become clearer to us what you would like to see changed in the cookbook
>>> — and perhaps it will become clearer to you how packaging for Guix works.
>> Yes, I'll link it:
>>
>> https://notabug.org/ZelphirKaltstahl/guile-fslib/commit/eacdbb5ee9e30413392908d9e3988e30e9411aa7
>> <https://notabug.org/ZelphirKaltstahl/guile-fslib/commit/eacdbb5ee9e30413392908d9e3988e30e9411aa7>
>>
>> Or:
>>
>> https://notabug.org/ZelphirKaltstahl/guile-fslib/src/0.2.0
> Excellent.
>
> Here’s the package (I dumped this in (gnu packages guile-xyz)):
>
> --8<---------------cut here---------------start------------->8---
> (define-public guile-fslib
> (package
> (name "guile-fslib")
> (version "0.2.0")
> (source
> (origin
> (method git-fetch)
> (uri (git-reference
> (url "https://notabug.org/ZelphirKaltstahl/guile-fslib/")
> (commit version)))
> (file-name (git-file-name name version))
> (sha256
> (base32
> "118d84p443w7hrslv8hjyhgws631ia08mggiyklkmk0b9plfdsvz"))))
> (build-system guile-build-system)
> (inputs
> `(("guile" ,guile-3.0)))
> (home-page "https://notabug.org/ZelphirKaltstahl/guile-fslib")
> (synopsis "File system utilities")
> (description
> "This package contains like super cool file system utilities and stuff.
> It's really good and so easy to install!")
> (license license:agpl3+)))
> --8<---------------cut here---------------end--------------->8---
>
> I only gave it a quick test like this:
>
> --8<---------------cut here---------------start------------->8---
> $ ./pre-inst-env guix environment --ad-hoc guile guile-fslib -- guile
> […]
> GNU Guile 3.0.5
> Copyright (C) 1995-2021 Free Software Foundation, Inc.
>
> Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
> This program is free software, and you are welcome to redistribute it
> under certain conditions; type `,show c' for details.
>
> Enter `,help' for help.
> scheme@(guile-user)> ,use (file-system)
> scheme@(guile-user)> file-size-in-bytes
> $1 = #<procedure file-size-in-bytes (path)>
> scheme@(guile-user)>
> --8<---------------cut here---------------end--------------->8---
>
> Seems to work.
>
> And this is what was installed:
>
> --8<---------------cut here---------------start------------->8---
> /gnu/store/2k3x0j6mvypjagam39dx89fd5yan7a3y-guile-fslib-0.2.0
> /gnu/store/2k3x0j6mvypjagam39dx89fd5yan7a3y-guile-fslib-0.2.0/lib
> /gnu/store/2k3x0j6mvypjagam39dx89fd5yan7a3y-guile-fslib-0.2.0/lib/guile
> /gnu/store/2k3x0j6mvypjagam39dx89fd5yan7a3y-guile-fslib-0.2.0/lib/guile/3.0
> /gnu/store/2k3x0j6mvypjagam39dx89fd5yan7a3y-guile-fslib-0.2.0/lib/guile/3.0/site-ccache
> /gnu/store/2k3x0j6mvypjagam39dx89fd5yan7a3y-guile-fslib-0.2.0/lib/guile/3.0/site-ccache/logging.go
> /gnu/store/2k3x0j6mvypjagam39dx89fd5yan7a3y-guile-fslib-0.2.0/lib/guile/3.0/site-ccache/test
> /gnu/store/2k3x0j6mvypjagam39dx89fd5yan7a3y-guile-fslib-0.2.0/lib/guile/3.0/site-ccache/test/test-fslib.go
> /gnu/store/2k3x0j6mvypjagam39dx89fd5yan7a3y-guile-fslib-0.2.0/lib/guile/3.0/site-ccache/test/test-list-utils.go
> /gnu/store/2k3x0j6mvypjagam39dx89fd5yan7a3y-guile-fslib-0.2.0/lib/guile/3.0/site-ccache/test/test-string-utils.go
> /gnu/store/2k3x0j6mvypjagam39dx89fd5yan7a3y-guile-fslib-0.2.0/lib/guile/3.0/site-ccache/fslib.go
> /gnu/store/2k3x0j6mvypjagam39dx89fd5yan7a3y-guile-fslib-0.2.0/lib/guile/3.0/site-ccache/file-reader.go
> /gnu/store/2k3x0j6mvypjagam39dx89fd5yan7a3y-guile-fslib-0.2.0/lib/guile/3.0/site-ccache/list-utils.go
> /gnu/store/2k3x0j6mvypjagam39dx89fd5yan7a3y-guile-fslib-0.2.0/lib/guile/3.0/site-ccache/file-system.go
> /gnu/store/2k3x0j6mvypjagam39dx89fd5yan7a3y-guile-fslib-0.2.0/lib/guile/3.0/site-ccache/string-utils.go
> /gnu/store/2k3x0j6mvypjagam39dx89fd5yan7a3y-guile-fslib-0.2.0/share
> /gnu/store/2k3x0j6mvypjagam39dx89fd5yan7a3y-guile-fslib-0.2.0/share/guile
> /gnu/store/2k3x0j6mvypjagam39dx89fd5yan7a3y-guile-fslib-0.2.0/share/guile/site
> /gnu/store/2k3x0j6mvypjagam39dx89fd5yan7a3y-guile-fslib-0.2.0/share/guile/site/3.0
> /gnu/store/2k3x0j6mvypjagam39dx89fd5yan7a3y-guile-fslib-0.2.0/share/guile/site/3.0/file-system.scm
> /gnu/store/2k3x0j6mvypjagam39dx89fd5yan7a3y-guile-fslib-0.2.0/share/guile/site/3.0/file-reader.scm
> /gnu/store/2k3x0j6mvypjagam39dx89fd5yan7a3y-guile-fslib-0.2.0/share/guile/site/3.0/test
> /gnu/store/2k3x0j6mvypjagam39dx89fd5yan7a3y-guile-fslib-0.2.0/share/guile/site/3.0/test/test-string-utils.scm
> /gnu/store/2k3x0j6mvypjagam39dx89fd5yan7a3y-guile-fslib-0.2.0/share/guile/site/3.0/test/test-fslib.scm
> /gnu/store/2k3x0j6mvypjagam39dx89fd5yan7a3y-guile-fslib-0.2.0/share/guile/site/3.0/test/test-list-utils.scm
> /gnu/store/2k3x0j6mvypjagam39dx89fd5yan7a3y-guile-fslib-0.2.0/share/guile/site/3.0/string-utils.scm
> /gnu/store/2k3x0j6mvypjagam39dx89fd5yan7a3y-guile-fslib-0.2.0/share/guile/site/3.0/fslib.scm
> /gnu/store/2k3x0j6mvypjagam39dx89fd5yan7a3y-guile-fslib-0.2.0/share/guile/site/3.0/list-utils.scm
> /gnu/store/2k3x0j6mvypjagam39dx89fd5yan7a3y-guile-fslib-0.2.0/share/guile/site/3.0/logging.scm
> /gnu/store/2k3x0j6mvypjagam39dx89fd5yan7a3y-guile-fslib-0.2.0/share/doc
> /gnu/store/2k3x0j6mvypjagam39dx89fd5yan7a3y-guile-fslib-0.2.0/share/doc/guile-fslib-0.2.0
> /gnu/store/2k3x0j6mvypjagam39dx89fd5yan7a3y-guile-fslib-0.2.0/share/doc/guile-fslib-0.2.0/todo.org
> /gnu/store/2k3x0j6mvypjagam39dx89fd5yan7a3y-guile-fslib-0.2.0/share/doc/guile-fslib-0.2.0/LICENSE
> /gnu/store/2k3x0j6mvypjagam39dx89fd5yan7a3y-guile-fslib-0.2.0/share/doc/guile-fslib-0.2.0/README.md
> --8<---------------cut here---------------end--------------->8---
>
> One thing to note is that Guix didn’t run the tests, because it doesn’t
> know how to (there’s no generic way to run tests for Guile packages, so
> the build system doesn’t try).
>
> This can be changed by adding an “arguments” field to the package
> definition that adds a phase to run the tests.
>
Thank you for taking the time and having a look at this. I will have to look
into what mistakes I made following the cookbook and how to add tests using the
arguments field. Once I know more, I will get back to you or ask more questions
on the mailing list.
Best regards,
Zelphir
--
repositories: https://notabug.org/ZelphirKaltstahl