all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Pierre-Henry F." <contact@phfrohring.com>
To: "help-guix\\@gnu.org" <help-guix@gnu.org>
Subject: Help defining a trivial package.
Date: Fri, 23 Aug 2019 19:42:56 +0000	[thread overview]
Message-ID: <bTBKn8S-ww9thTM-ZmWx7SRJYaa807c5LAenENohKLQtf11L7jd-aGti4rpYnEnYUGhE8UhoMP5-mjtQceD97oEOkHuXfyfZ2j_v63v6aaA=@phfrohring.com> (raw)

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

             reply	other threads:[~2019-08-23 19:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-23 19:42 Pierre-Henry F. [this message]
2019-08-25 12:17 ` Help defining a trivial package 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='bTBKn8S-ww9thTM-ZmWx7SRJYaa807c5LAenENohKLQtf11L7jd-aGti4rpYnEnYUGhE8UhoMP5-mjtQceD97oEOkHuXfyfZ2j_v63v6aaA=@phfrohring.com' \
    --to=contact@phfrohring.com \
    --cc=help-guix@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.