guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#41294] [PATCH] gnu: Add libfreenect.


From: 宋文武
Subject: [bug#41294] [PATCH] gnu: Add libfreenect.
Date: Tue, 19 May 2020 21:26:23 +0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)

Ekaitz Zarraga <address@hidden> writes:

> Hi,
> I came up with this. It's just a diff because I'd like to improve something.
>
> There's the same lambda sent to all the packages that need to disable
> sources compilation but I'm not able to create it in a function that I
> send later to all those.
>
> How can I do that? I'm getting `Unknown object` errors.
>
> I tried to create a new function with `define*` with the same body the
> lambda has. Quasiquote the `arguments` and unquote the function there.
> Nothing. There's some kind of weird magic I'm not getting.
>

Hello, I don't know the whole detail too, but to build a package, guix likely:

- Load and eval the package module, to get the package object.  The
  'arguments' field is a list.

- Convert this package object to a derivation, and write it in store as
  a file (/gnu/store/*.drv).  Where 'arguments' being part of the
  builder, serialize as string to the file, it dosen't do complex things
  for procedure bindings, only write their string descriptions...  So
  when the builder file is loaded, you get `Unknown object` errors.


Here, to avoid duplicating the code, you can:

1. Unquote list value into `arguments`. (eg: 'asdf-substitutions' in lisp.scm)

2. Use `(package-arguments libfreenect-examples)` with
`substitute-keyword-arguments` to reuse arguments, but modify
`configure-flags` etc. (eg: qtx11extras)


The build system can use 'imported-modules' to make a set of guile
modules (which can contains useful procedures, etc.) available to the
builder, but thas's overkill to be used here...


>
> diff --git a/gnu/packages/openkinect.scm b/gnu/packages/openkinect.scm
> new file mode 100644
> index 0000000000..1aebb34384
> --- /dev/null
> +++ b/gnu/packages/openkinect.scm
> @@ -0,0 +1,137 @@
> +(define-module (gnu packages openkinect)
> +  #:use-module (guix packages)
> +  #:use-module (guix git-download)
> +  #:use-module (guix build-system cmake)
> +  #:use-module ((guix licenses) #:prefix license:)
> +  #:use-module (gnu packages pkg-config)
> +  #:use-module (gnu packages libusb)
> +  #:use-module (gnu packages python)
> +  #:use-module (gnu packages python-xyz)
> +  #:use-module (gnu packages gl)
> +  #:use-module (gnu packages pkg-config)
> +  #:use-module (gnu packages image-processing))
> +
> +(define-public libfreenect
> +  (let ((version "0.6.1"))
> +    (package
> +      (name "libfreenect")
> +      (version version)
> +      (source (origin
> +                (method git-fetch)
> +                (uri (git-reference
> +                      (url "https://github.com/OpenKinect/libfreenect";)
> +                      (commit (string-append "v" version))))
> +                (sha256
> +                 (base32 
> "0was1va167rqshmpn382h36yyprpfi9cwillb6ylppmnfdrfrhrr"))))
> +      (build-system cmake-build-system)
> +      (arguments
> +       '(#:tests? #f ; Project has not tests
"has not tests" sounds wrong be me, maybe: "package has no tests".

Otherwise, look good to me!





reply via email to

[Prev in Thread] Current Thread [Next in Thread]