all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Help defining a trivial package.
@ 2019-08-23 19:42 Pierre-Henry F.
  2019-08-25 12:17 ` Timothy Sample
  0 siblings, 1 reply; 7+ messages in thread
From: Pierre-Henry F. @ 2019-08-23 19:42 UTC (permalink / raw)
  To: help-guix\@gnu.org

Hello!

Would someone help defining a trivial package?

Essentially:

    …/releases$ tree

    .

    ├── release_1.tar.lz

    ├── release_2.tar.lz

    └── release_3.tar.lz

    …/release_3$ tree

    .

    ├── bin

    │   └── program

    └── src

        └── hello_world.py

    …/release_3$ cat ./bin/program

    #! /usr/bin/env bash

    script_path="${BASH_SOURCE[0]}"

    script_dir="$(dirname $script_path)"

    python3 "$script_dir/../src/hello_world.py"

    …/release_3$ ./bin/program

    Hello world!

Defining this package would mean:

  1. download the release_3.tar.lz

  2. uncompress release_3.tar.lz

  3. add ~…/release_3/bin~ to the path

     - where ~…~ is the path in the store

-----------------------------------------

expected conclusion:

  $ which program

  …/release_3/bin/program

  $ program

  Hello World!

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

Thank you for your answers !

Pierre-Henry

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

end of thread, other threads:[~2019-09-04 17:34 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-23 19:42 Help defining a trivial package Pierre-Henry F.
2019-08-25 12:17 ` Timothy Sample
2019-08-29 11:23   ` Pierre-Henry F.
2019-08-29 15:26     ` Timothy Sample
     [not found]       ` <Al-P-mUDUQnoUvF4kgNS_NeITvHjEDEvxG8Gmk9aMiXX2FTUfL0lbZAq5h4m54GIGNXPwM271CzLWwt5sgOt1JI6Z1wxqxSwWmpnPHu7I5A=@phfrohring.com>
2019-09-03  1:58         ` Timothy Sample
2019-09-04 11:21           ` Pierre-Henry F.
2019-09-04 17:34             ` Timothy Sample

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.