Hi Guix,

I'm trying create package with Guix. Initially I choose a simple package (ipcalc) but after success I'll create complex package (thanks Andreas and Ludo for you advice). So, I'd like help for it :)

My steps (I'm used GuixSD) based Ludo and Andreas talk:
1. Clone Guix repository: git clone git://git.savannah.gnu.org/guix.git
2. Create ipcalc.scm file (in attach) based in gnu/packages/indent.scm and update it: cd guix; cp gnu/packages/indent.scm gnu/packages/ipcalc.scm; emacs gnu/packages/ipcalc.scm
3. Add ipcalc to gnu-system.am file:
...
gnu/packages/ipcalc.scm                       \
...
4. Download package: guix download http://url.package.tar.gz
5. Update hash to ipcalc.scm file: emacs gnu/packages/ipcalc.scm
6. Build package: ./pre-inst-env.in guix build ipcalc -K

But there's errors, running with normal user (last lines):
guix build: error: ipcalc: unknown package

Running with sudo (last lines):
./pre-inst-env.in: line 32: cd: @abs_top_srcdir@: No such file or directory ./pre-inst-env.in: line 33: cd: @abs_top_builddir@: No such file or directory
Backtrace:
In ice-9/psyntax.scm:
 989: 19 [scan ((define-module (guix ui) #:use-module ...)) () ...]
 279: 18 [scan ((#(syntax-object let # ...) (#) (# #) ...)) () ...]
In ice-9/eval.scm:
 411: 17 [eval # ()]
In ice-9/boot-9.scm:
2951: 16 [define-module* (guix ui) #:filename ...]
2926: 15 [resolve-imports (((guix utils)) ((guix store)) ((guix config)) ...)]
2864: 14 [resolve-interface (guix utils) #:select ...]
2789: 13 [#<procedure 247b960 at ice-9/boot-9.scm:2777:4 (name #:optional autoload version #:key ensure)> # ...]
3065: 12 [try-module-autoload (guix utils) #f]
2401: 11 [save-module-excursion #<procedure 25866c0 at ice-9/boot-9.scm:3066:17 ()>]
3085: 10 [#<procedure 25866c0 at ice-9/boot-9.scm:3066:17 ()>]
In unknown file:
   ?: 9 [primitive-load-path "guix/utils" ...]
In ice-9/eval.scm:
505: 8 [#<procedure 23c67c0 at ice-9/eval.scm:499:4 (exp)> (define-module # # ...)]
In ice-9/psyntax.scm:
1106: 7 [expand-top-sequence ((define-module (guix utils) #:use-module ...)) () ...]
 989: 6 [scan ((define-module (guix utils) #:use-module ...)) () ...]
 279: 5 [scan ((#(syntax-object let # ...) (#) (# #) ...)) () ...]
In ice-9/eval.scm:
 411: 4 [eval # ()]
In ice-9/boot-9.scm:
2951: 3 [define-module* (guix utils) #:filename ...]
2926: 2 [resolve-imports (((guix config)) ((srfi srfi-1)) ((srfi srfi-9)) ...)]
2867: 1 [resolve-interface (guix config) #:select ...]
In unknown file:
?: 0 [scm-error misc-error #f "~A ~S" ("no code for module" (guix config)) #f]

ERROR: In procedure scm-error:
ERROR: no code for module (guix config)


Help me, thanks.

--
Daniel Pimentel (d4n1)
GnuPG (0B1A1914)
FSF (13054)
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2013 Andreas Enge <[email protected]>
;;; Copyright © 2014 Mark H Weaver <[email protected]>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (gnu packages ipcalc)
  #:use-module (gnu packages)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix packages)
  #:use-module (guix download)
  #:use-module (guix build-system gnu)

(define-public ipcalc
  (package
   (name "ipcalc")
   (version "0.41")
   (source (origin
            (method url-fetch)
            (uri (string-append 
"mirror://http://jodies.de/ipcalc-archive/ipcalc-"; version
                                ".tar.gz"))
            (sha256 (base32 
                     "12if9sm8h2ac0pgwkw835cgyqjxm6h27k4kfn2vfas9krrqwbafx"))))
   (build-system gnu-build-system)
   (arguments
    `(#:phases (alist-cons-after
                'unpack 'fix-docdir
                (lambda _
                  ;; Although indent uses a modern autoconf in which docdir
                  ;; defaults to PREFIX/share/doc, the doc/Makefile.am
                  ;; overrides this to be in PREFIX/doc.  Fix this.
                  (substitute* "doc/Makefile.in"
                    (("^docdir = .*$") "docdir = @docdir@\n")))
                %standard-phases)))
   (synopsis "IP Calculator")
   (description
    "Ipcalc takes an IP address and netmask and calculates the resulting 
broadcast, network, Cisco wildcard mask, and host range..")
   (license gpl2)
   (home-page "http://jodies.de/ipcalc/";)))

Reply via email to