unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* Help on writing package definitions
@ 2020-04-23  6:32 Emmanuel Medernach
  2020-04-23 10:00 ` zimoun
  2020-04-23 16:44 ` Leo Famulari
  0 siblings, 2 replies; 9+ messages in thread
From: Emmanuel Medernach @ 2020-04-23  6:32 UTC (permalink / raw)
  To: help-guix

[-- Attachment #1: Type: text/plain, Size: 944 bytes --]

Hello Guixers !

I am new to Guix and try to write package definitions to automate and make
some installation reproducible.

I have few questions:

- Why not export the license record type from license.scm ? Some project
has its own license and I cannot create it.

- I have errors when I try to build with guix that I don't have when I
build manually. I have a package (asiofi) which depends on another one
(libfabric) but the build does not find it. Here is my current file
attached and the command I use:

# guix build -K --load-path=/home/emederna/src/packages -e '(@ (CBM)
asiofi)'
...
CMake Error at test/CMakeLists.txt:9 (add_executable):
  Target "afi_msg_bw" links to target "OFI::libfabric" but the target was
not
  found.  Perhaps a find_package() call is missing for an IMPORTED target,
or
  an ALIAS target is missing?

Manually the compilation works fine, what am I missing ?

Thanks in advance

Best regards,

Emmanuel Medernach

[-- Attachment #2: CBM.scm --]
[-- Type: text/x-scheme, Size: 2743 bytes --]


(define-module (CBM)

  #:use-module  (guix packages)
  #:use-module  (guix download)
  #:use-module  (guix build-system cmake)
  #:use-module  (guix build-system gnu)

  #:use-module  (gnu packages autotools)
  #:use-module  (gnu packages commencement) ;; gcc-toolchain

  #:use-module  (gnu packages boost)
  #:use-module  (gnu packages sqlite)

  #:use-module  ((guix licenses) #:prefix license:))


(define-public libfabric
  (package
    (name "libfabric")
    (version "1.9.1")
    (source
     (origin
       (method url-fetch)
       (uri (string-append
             "https://github.com/ofiwg/libfabric/archive/v"
             version
             ".tar.gz"))
       (sha256
        (base32
         "0sic649kg9jhljqhffgyc5pihpysc8gjg0hc924rs5wxv5qxypvn"))))
    (build-system gnu-build-system)
    (inputs
     `(("autoconf" ,autoconf) ;; autogen autoreconf
       ("automake" ,automake) ;; aclocal
       ("libtool" ,libtool) 
       ))

    (home-page "https://github.com/ofiwg/libfabric")
    (synopsis "Open Fabrics Interfaces")
    (description "Framework focused on exporting fabric communication services to applications.")
    (license license:bsd-2)))

(define-public asiofi
  (package
    (name "asiofi")
    (version "0.4.1")
    (source
     (origin
       (method url-fetch)
       (uri (string-append
             "https://github.com/FairRootGroup/asiofi/archive/v"
             version
             ".tar.gz"))
       (sha256
        (base32
         "0q88k7kffpa66327gnd7wwzrhqnhmqxpgyqa68aqs7l28f4iq9sn"))))
    (build-system cmake-build-system)
    (inputs
     `(("gcc-toolchain" ,gcc-toolchain)
       ("libfabric" ,libfabric)
       ("boost" ,boost)))
    (arguments
     `(;; #:configure-flags
       ;; (list
       ;; 	;; find_package uses <PackageName>_ROOT variables.
       ;; 	;; For compatibility, CMake is ignoring the variable.
       ;; 	(string-append "-DOFI_ROOT="
       ;; 		       (assoc-ref %build-inputs "libfabric")
       ;; 		       ))
       
       #:phases       
       (modify-phases
	%standard-phases
	(add-after
	 'unpack 'use-system-libraries
	 (lambda _
	   (substitute*
	    "cmake/asiofiLib.cmake"
	    (("### PUBLIC") "cmake_policy(SET CMP0074 NEW)"))
	   #t))
	(add-before
	 'configure 'OFI
	 (lambda _
	   (let ((libfabric-path (assoc-ref %build-inputs "libfabric")))
	     (let* ((var (getenv "PKG_CONFIG_PATH"))
	     	    (result (string-append 
			     (if var (string-append var ":") "")
			     libfabric-path
			     "/lib/pkgconfig")))
	       (setenv "PKG_CONFIG_PATH" result))))))))

    (home-page "https://github.com/FairRootGroup/asiofi")
    (synopsis "C++ Boost.Asio language bindings for OFI libfabric")
    (description "")
    (license license:lgpl2.1+)))




^ permalink raw reply	[flat|nested] 9+ messages in thread
* Re: Help on writing package definitions
@ 2020-04-23  9:41 Vincent Legoll
  2020-04-23 12:09 ` Emmanuel Medernach
  0 siblings, 1 reply; 9+ messages in thread
From: Vincent Legoll @ 2020-04-23  9:41 UTC (permalink / raw)
  To: emmanuel.medernach, help-guix

Hello Emmanuel,

really nice to see you here !

A few smallish comments on your code (I'll try to build it later)

You mixed tabs & spaces for indentation.

Looks like the second lambda does not return #t, if I'm not mistaken
the return value will be setenv's which is unspecified.

I'll try to be more helpful in my next reply ;-)

And sorry if my answer broke the threading, I just subscribed...

-- 
Vincent Legoll

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

end of thread, other threads:[~2020-04-23 17:12 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-23  6:32 Help on writing package definitions Emmanuel Medernach
2020-04-23 10:00 ` zimoun
2020-04-23 12:21   ` Emmanuel Medernach
2020-04-23 14:17     ` zimoun
2020-04-23 16:44 ` Leo Famulari
2020-04-23 17:11   ` zimoun
  -- strict thread matches above, loose matches on Subject: below --
2020-04-23  9:41 Vincent Legoll
2020-04-23 12:09 ` Emmanuel Medernach
2020-04-23 12:17   ` Vincent Legoll

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).