unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Writing recipe for Crypto++, and getting build errors
@ 2016-09-21 15:24 Adonay Felipe Nogueira
  2016-09-22  1:18 ` Ben Woodcroft
  0 siblings, 1 reply; 15+ messages in thread
From: Adonay Felipe Nogueira @ 2016-09-21 15:24 UTC (permalink / raw)
  To: guix-devel


[-- Attachment #1.1: Type: text/plain, Size: 4401 bytes --]

Note: I'm not a programmer, the only thing I can understand is basic
Guile Scheme and basic Bash scripting. So, I'm not really fit to make
changes in the Crypto++'s source files by myself.

I'm writing a recipe for Crypto++ and other packages. I'm not a
programmer, but I decided to try to contribute to Guix by making the
first steps on porting Tahoe-LAFS and related dependencies.

In attachment is the set of recipes I'm writing. The examples given
assume $GUIX_PACKAGE_PATH referring to directories where the
user-supplied recipes can be found.

Doing:

$ guix build --fallback "cryptopp"

... outputs:

# Begin of output
starting phase `build'
make: *** No rule to make target 'dynamic'.  Stop.
phase `build' failed after 0.2 seconds
builder for
`/gnu/store/k863vf0ab6hkdhbm7zgmbfs1c3wdqpqs-cryptopp-5.6.4.drv' failed
with exit code 1
@
build-failed /gnu/store/k863vf0ab6hkdhbm7zgmbfs1c3wdqpqs-cryptopp-5.6.4.drv - 1 builder for `/gnu/store/k863vf0ab6hkdhbm7zgmbfs1c3wdqpqs-cryptopp-5.6.4.drv' failed with exit code 1
guix build: error: build failed: build of
`/gnu/store/k863vf0ab6hkdhbm7zgmbfs1c3wdqpqs-cryptopp-5.6.4.drv' failed
# End of output

However, I did some tests by doing:

$ guix build --fallback --keep-failed "cryptopp"
$ cd "[Failed build path]"
$ sudo --user="[User owner of failed build path]" guix environment
--pure "cryptopp"
$ make "dynamic"

And it **does** start building. If instead of `make "dynamic"`, one does
`make -dnpw "dynamic"` (both in the recipe itself and in the series of
commands given earlier), one can see that:

* The build phase in `guix build` doesn't find the GNUmakefile.

* Attempting the series of commands given earlier, `make` **does** find
the GNUmakefile file.

Besides, someone at #guix suggested me to look at what the NixOS project
did with their Crypto++ package, and it seems they are using it
normally, without removing the dependency on `ldconfig`.

## Additional subject: Absence of `ldconfig`

Seeing the GNUmakefile, it seems to expect some commands to be available
in the environment, so I tried finding those and seeing if the
environment sees them from the profile.

If I remake the environment given before **without** the `--pure`
option, specially if one is using Guix on other distribution, doing:

$ which ar ranlib cp mv egrep chmod mkdir ln ldconfig uname gcc g++ cut
which

... outputs:

# Begin of output
/gnu/store/4bs2xiv9mr0p8vfy046b4jaqn0958wk4-profile/bin/ar
/gnu/store/4bs2xiv9mr0p8vfy046b4jaqn0958wk4-profile/bin/ranlib
/gnu/store/4bs2xiv9mr0p8vfy046b4jaqn0958wk4-profile/bin/cp
/gnu/store/4bs2xiv9mr0p8vfy046b4jaqn0958wk4-profile/bin/mv
/gnu/store/4bs2xiv9mr0p8vfy046b4jaqn0958wk4-profile/bin/egrep
/gnu/store/4bs2xiv9mr0p8vfy046b4jaqn0958wk4-profile/bin/chmod
/gnu/store/4bs2xiv9mr0p8vfy046b4jaqn0958wk4-profile/bin/mkdir
/gnu/store/4bs2xiv9mr0p8vfy046b4jaqn0958wk4-profile/bin/ln
/sbin/ldconfig
/gnu/store/4bs2xiv9mr0p8vfy046b4jaqn0958wk4-profile/bin/uname
/gnu/store/4bs2xiv9mr0p8vfy046b4jaqn0958wk4-profile/bin/gcc
/gnu/store/4bs2xiv9mr0p8vfy046b4jaqn0958wk4-profile/bin/g++
/gnu/store/4bs2xiv9mr0p8vfy046b4jaqn0958wk4-profile/bin/cut
/usr/bin/which
# End of output

This indicates that `ldconfig` is absent. Someone in #guix told me that
it was supposed to be provided by 

Additionally, `which` was included in the output (comes from the
"debianutils" package on .deb-based distributions) and is also absent,
and the GNUmakefile seems to expect `which` at some point (although I'm
not sure if the build process reached that), so the absence of `which`
might be good to discuss on other bug report.


Respectfully, Adonay.
-- 
# pt-BR: Brasileiro | en: Brazilian

* pt-BR: Palestra sobre liberdade de software (movimento filosófico político-social, não tecnológico).
  * en: Gives talks about software freedom (philosophical, political and social movement, not technological).
* pt-BR: Voluntário avaliador de liberdade de software (para software pagos ou gratuitos).
  * en: Volunteer evaluator of software freedom (for paid software, or gratis software).
* pt-BR: Presta suporte e consultoria básicos sobre software livre.
  * en: Gives basic support and consulting about free/libre software.

## pt-BR: Sobre mim e contato | en: About me and contact
<https://libreplanet.org/wiki/User:Adfeno>


[-- Attachment #1.2: tahoe-lafs.scm --]
[-- Type: text/x-scheme, Size: 15131 bytes --]

;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2012, 2013, 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2014 Andreas Enge <andreas@enge.fr>
;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
;;; Copyright © 2014, 2015, 2016 Mark H Weaver <mhw@netris.org>
;;; Copyright © 2014 Alex Kost <alezost@gmail.com>
;;; Copyright © 2014, 2015 Manolis Fragkiskos Ragkousis <manolis837@gmail.com>
;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
;;; Copyright © 2016 Adonay "adfeno" Felipe Nogueira <https://libreplanet.org/wiki/User:Adfeno> <adfeno@openmailbox.org>
;;;
;;; 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 (tahoe-lafs)
  #:use-module ((guix licenses)
      #:select (boost1.0 expat gpl2+))
  #:use-module (gnu packages gcc)
  #:use-module (gnu packages python)
  #:use-module (gnu packages zip)
  #:use-module (guix build-system gnu)
  #:use-module (guix build-system python)
  #:use-module (guix download)
  #:use-module (guix packages))

(define-public cryptopp
  ;; TODO: Test reproducibility.
  (package
    (name "cryptopp")
    (version "5.6.4")
    (source
      (origin
        (method url-fetch)
        (uri "http://www.cryptopp.com/cryptopp564.zip")
        (file-name (string-append name "-" version ".zip"))
        (sha256
          (base32
            "1msar24a38rxzq0xgmjf09hzaw2lv6s48vnbbhfrf5awn1vh6hxy"))))
    (build-system gnu-build-system)
    (inputs `(("gcc" ,gcc)
              ("unzip" ,unzip)))
    (arguments `(#:make-flags `(,(string-append "PREFIX="
                                                (assoc-ref %outputs "out")))
                 #:phases (modify-phases %standard-phases
                   (delete `configure) ; FIXME: Configuration is done inside "config.h" file???
                   (replace `build
                     (lambda* _
                       (zero? (system* "make" "dynamic")))))))
    (home-page "http://www.cryptopp.com/")
    (synopsis "Crypto++ Library is a free C++ class library of cryptographic schemes")
    (description "Crypto++ Library is a free C++ class library of cryptographic schemes.
      
      This package was not tested for reproducibility.")
    (license boost1.0)))

(define-public python2-attrs
  ;; TODO: Test with Python 3.
  ;; TODO: Test reproducibility.
  (package
    (name "python2-attrs")
    (version "16.2.0")
    (source
      (origin
        (method url-fetch)
        (uri (string-append "https://github.com/hynek/attrs/archive/"
                            version ".tar.gz"))
        (file-name (string-append name "-" version ".tar.gz"))
        (sha256
          (base32
            "1fqzm4vw3qk80i3dign4jsdyxfrzyfgp879rndq1z8py9rlml7cw"))))
    (build-system python-build-system)
    (inputs `(("python2-setuptools" ,python2-setuptools)))
    (arguments `(#:python ,python-2
                 #:tests? #f ; FIXME: Tests require pytest.
                 ))
    (home-page "https://github.com/hynek/attrs")
    (synopsis "Python attributes without boilerplate")
    (description "Python package to ease writing classes by not needing to implement
      object protocols, tuples or namedtuples, and so resulting in higher
      runtime performance.
      
      This package was not tested for reproducibility.")
    (license expat)))

(define-public python2-characteristic
  ;; TODO: Test with Python 3.
  ;; TODO: Test reproducibility.
  (package
    (name "python2-characteristic")
    (version "14.3.0")
    (source
      (origin
        (method url-fetch)
        (uri (string-append "https://github.com/hynek/characteristic/archive/"
                            version ".tar.gz"))
        (file-name (string-append name "-" version ".tar.gz"))
        (sha256
          (base32
            "05p8k68k6bbd02f3xl2n13s4758khgz1impfyg6vfq1c4xci7m26"))))
    (build-system python-build-system)
    (inputs `(("python2-setuptools" ,python2-setuptools)))
    (arguments `(#:python ,python-2
                 #:tests? #f ; FIXME: Tests require pytest.
                 ))
    (home-page "https://github.com/hynek/characteristic")
    (synopsis "Python attributes without boilerplate")
    (description "Python package with class decorators that ease the chores of implementing
      the most common attribute-related object protocols.
      
      Predecessor of attrs.
      
      This package was not tested for reproducibility.")
    (license expat)))

(define-public python2-foolscap
  ;; TODO: Test with Python 3.
  ;; TODO: Test reproducibility.
  (package
    (name "python2-foolscap")
    (version "0.12.3")
    (source
      (origin
        (method url-fetch)
        (uri (string-append "https://github.com/warner/foolscap/archive/foolscap-"
                            version ".tar.gz"))
        (file-name (string-append name "-" version ".tar.gz"))
        (sha256
          (base32
            "0p58sz1rs4g6zh88c41fkbf7ih8glpwn1f6xm4bfd1nvmma49s59"))))
    (build-system python-build-system)
    (inputs `(("python2-pyopenssl" ,python2-pyopenssl)
              ("python2-setuptools" ,python2-setuptools)
              ("python2-twisted-tls" ,python2-twisted-tls)))
    (arguments `(#:python ,python-2))
    (home-page "https://foolscap.lothar.com/")
    (synopsis "Remote object-messaging for Python+Twisted")
    (description "Foolscap is an RPC/RMI (Remote Procedure Call / Remote Method Invocation)
      protocol for use with Twisted, derived/inspired by Twisted's built-in
      Perspective Broker package.
      
      This package was not tested for reproducibility.")
    (license expat)))

(define-public python2-nevow
  ;; TODO: Test with Python 3.
  ;; TODO: Test reproducibility.
  (package
    (name "python2-nevow")
    (version "0.14.2")
    (source
      (origin
        (method url-fetch)
        (uri (string-append "https://github.com/twisted/nevow/archive/nevow-"
                            version ".tar.gz"))
        (file-name (string-append name "-" version ".tar.gz"))
        (sha256
          (base32
            "0in7gdvi7sbxd5ml2qc4lv3lifs2zdwnhgcmpli1q2ba5n5gajkm"))))
    (build-system python-build-system)
    (inputs `(("python2-setuptools" ,python2-setuptools)
              ("python2-twisted" ,python2-twisted)
              ))
    (arguments `(#:python ,python-2))
    (home-page "https://github.com/twisted/nevow")
    (synopsis "Web application construction kit")
    (description "Divmod Nevow is a web application construction kit written in Python. It
      is designed to allow the programmer to express as much of the view logic
      as desired in Python, and includes a pure Python XML expression syntax
      named stan to facilitate this. However it also provides rich support for
      designer-edited templates, using a very small XML attribute language to
      provide bi-directional template manipulation capability.
      
      This package was not tested for reproducibility.")
    (license expat)))

(define-public python2-pycryptopp
  ;; TODO: Test with Python 3.
  ;; TODO: Test reproducibility.
  (package
    (name "python2-pycryptopp")
    (version "0.7.1")
    (source
      (origin
        (method url-fetch)
        (uri (string-append "https://github.com/tahoe-lafs/pycryptopp/archive/pycryptopp-"
                            version ".tar.gz"))
        (file-name (string-append name "-" version ".tar.gz"))
        (sha256
          (base32
            "0ighsdxrqcms0bg63acyqpfmia9c4d2qzx5p8sp994l3wcqdc7ba"))))
    (build-system python-build-system)
    (inputs `(("cryptopp" ,cryptopp)
              ("python2-setuptools" ,python2-setuptools)))
    (arguments `(#:python ,python-2))
    (home-page "https://tahoe-lafs.org/trac/pycryptopp")
    (synopsis "Python bindings to the Crypto++ library")
    (description "Pycryptopp is a collection of Python interfaces to a few good crypto
      algorithms.
      
      This package was not tested for reproducibility.")
    (license gpl2+)))

(define-public python2-pyutil
  ;; TODO: Test with Python 3.
  ;; TODO: Test reproducibility.
  (package
    (name "python2-pyutil")
    (version "2.0.0")
    (source
      (origin
        (method url-fetch)
        (uri (string-append "https://pypi.python.org/packages/source/p/pyutil/pyutil"
                            version ".tar.gz"))
        (sha256
          (base32
            "1fsg9yz5mi2sb0h6c1vvcqchx56i89nbvdb5gfgv1ia3b2w5ra8c"))))
    (build-system python-build-system)
    (inputs `(("python2-setuptools" ,python2-setuptools)))
    (arguments `(#:python ,python-2))
    (home-page "https://tahoe-lafs.org/trac/pyutil")
    (synopsis "A collection of utilities for Python programmers")
    (description "A collection of utilities for Python programmers.
      
      This package was not tested for reproducibility.")
    (license gpl2+)))

(define-public python2-service-identity
  ;; TODO: Test with Python 3.
  ;; TODO: Test reproducibility.
  (package
    (name "python2-service-identity")
    (version "16.0.0")
    (source
      (origin
        (method url-fetch)
        (uri (string-append "https://github.com/pyca/service_identity/archive/"
                            version ".tar.gz"))
        (file-name (string-append name "-" version ".tar.gz"))
        (sha256
          (base32
            "10jkwsc4a4iwrsy0kcdj5rjpavwkd51kf4vb2sr2xj3345llp1qp"))))
    (build-system python-build-system)
    (inputs `(("python2-attrs",python2-attrs)
              ("python2-pyasn1" ,python2-pyasn1)
              ("python2-pyasn1-modules" ,python2-pyasn1-modules)
              ("python2-pyopenssl" ,python2-pyopenssl)
              ("python2-setuptools" ,python2-setuptools)
              ))
    (arguments `(
                 #:tests? #f ; FIXME: Tests require pytest.
                 ))
    (arguments `(#:python ,python-2))
    (home-page "https://github.com/pyca/service_identity")
    (synopsis "Service identity verification for pyOpenSSL")
    (description "Use this package if you use pyOpenSSL and don’t want to be MITMed or
      if you want to verify that a PyCA cryptography certificate is valid for
      a certain hostname.
      
      service_identity aspires to give you all the tools you need for verifying
      whether a certificate is valid for the intended purposes.
      
      In the simplest case, this means host name verification. However,
      service_identity implements RFC 6125 fully and plans to add other relevant
      RFCs too.
      
      This package was not tested for reproducibility.")
    (license expat)))

(define-public python2-twisted-tls
  ;; TODO: Test with Python 3.
  ;; TODO: Test reproducibility.
  (package (inherit python2-twisted)
    (name "python2-twisted-tls")
    (inputs `(("python2-pyopenssl" ,python2-pyopenssl)
              ("python2-service-identity" ,python2-service-identity)
              ("python2-idna" ,python2-idna)
              ,@(package-inputs python2-twisted)))
    (description (string-append (package-description python2-twisted)
                                 " This package was not tested for reproducibility."))))

(define-public python2-zfec
  ;; TODO: Test with Python 3.
  ;; TODO: Test reproducibility.
  (package
    (name "python2-zfec")
    (version "1.4.24")
    (source
      (origin
        (method url-fetch)
        (uri (string-append "https://github.com/tahoe-lafs/zfec/archive/zfec-"
                            version ".tar.gz"))
        (file-name (string-append name "-" version ".tar.gz"))
        (sha256
          (base32
            "13d5z6607jzhljna7ylvxqg37d7hsr91p3x4a799064cic11w5fb"))))
    (build-system python-build-system)
    (inputs `(("python2-setuptools" ,python2-setuptools)
              ("python2-pyutil" ,python2-pyutil)
              ))
    (arguments `(#:python ,python-2))
    (home-page "https://tahoe-lafs.org/trac/zfec")
    (synopsis "Efficient, portable erasure coding tool")
    (description "Generate redundant blocks of information such that if some of the blocks
      are lost then the original data can be recovered from the remaining
      blocks. This package includes command-line tools, C API, Python API,
      and Haskell API.
      
      This package was not tested for reproducibility.")
    (license gpl2+)))

(define-public tahoe-lafs
  ;; TODO: Test with Python 3.
  ;; TODO: Test reproducibility.
  (package
    (name "tahoe-lafs")
    (version "1.11.0")
    (source
      (origin
        (method url-fetch)
        (uri (string-append "https://www.tahoe-lafs.org/downloads/tahoe-lafs-"
                            version ".tar.gz"))
        (sha256
          (base32
            "09jxb4gwa163yd5jf3qd5691slmkqvmvrxwdsppa0nqvyd4w2lhm"))))
    (build-system python-build-system)
    (inputs `(("python2-characteristic" ,python2-characteristic)
              ("python2-foolscap" ,python2-foolscap)
              ("python2-nevow" ,python2-nevow)
              ("python2-pyasn1" ,python2-pyasn1)
              ("python2-pyasn1-modules" ,python2-pyasn1-modules)
              ("python2-pycrypto" ,python2-pycrypto)
              ("python2-pycryptopp" ,python2-pycryptopp)
              ("python2-pyopenssl" ,python2-pyopenssl)
              ("python2-service-identity" ,python2-service-identity)
              ("python2-setuptools" ,python2-setuptools)
              ("python2-simplejson" ,python2-simplejson)
              ("python2-twisted-tls" ,python2-twisted-tls)
              ("python2-zfec" ,python2-zfec)
              ("python2-zope-interface" ,python2-zope-interface)
              ))
    (arguments `(#:python ,python-2))
    (synopsis "Decentralized storage system with provider-independent security")
    (description "Tahoe-LAFS is a decentralized data store. It distributes your filesystem
      across multiple servers, and even if some of the servers fail or are taken
      over by an attacker, the entire filesystem continues to work correctly
      and to preserve your privacy and security.
      
      This package was not tested for reproducibility.")
    (home-page "https://tahoe-lafs.org/")
    (license gpl2+)))

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 213 bytes --]

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

end of thread, other threads:[~2016-10-17 13:22 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-21 15:24 Writing recipe for Crypto++, and getting build errors Adonay Felipe Nogueira
2016-09-22  1:18 ` Ben Woodcroft
2016-09-22  1:22   ` Ben Woodcroft
2016-09-22 14:49     ` Adonay Felipe Nogueira
2016-09-22 22:43       ` Ben Woodcroft
2016-09-30 11:39         ` Adonay Felipe Nogueira
2016-09-26  9:30       ` Ludovic Courtès
2016-09-30 11:35         ` Adonay Felipe Nogueira
2016-09-30 20:10           ` Ludovic Courtès
2016-10-15 20:47             ` Adonay Felipe Nogueira
2016-10-15 20:53               ` Efraim Flashner
2016-10-15 21:47                 ` Adonay Felipe Nogueira
2016-10-17 13:11                   ` Ludovic Courtès
2016-10-17 13:22                     ` Adonay Felipe Nogueira
2016-09-30 11:39         ` Adonay Felipe Nogueira

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

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).