unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Emmanuel Medernach <emmanuel.medernach@gmail.com>
To: help-guix@gnu.org
Subject: Help on writing package definitions
Date: Thu, 23 Apr 2020 08:32:35 +0200	[thread overview]
Message-ID: <CAC_pKx_L0H_ZLex8d1kM0qEsPrtomvKSTijp6bqGhpDSknGV7g@mail.gmail.com> (raw)

[-- 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+)))




             reply	other threads:[~2020-04-23  6:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-23  6:32 Emmanuel Medernach [this message]
2020-04-23 10:00 ` Help on writing package definitions 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

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

  List information: https://guix.gnu.org/

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

  git send-email \
    --in-reply-to=CAC_pKx_L0H_ZLex8d1kM0qEsPrtomvKSTijp6bqGhpDSknGV7g@mail.gmail.com \
    --to=emmanuel.medernach@gmail.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.
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).