X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=guix-env.scm;h=ec3a8e1f8f2bbc6751b23c47968810d1218359f6;hb=20d82ac39747197d0bd405be6eda05eb9b37cf0c;hp=caa95fca95403364afc54303ee9f986a8179bd2e;hpb=2392da9f844c8d70a438889e344860edff2dd68d;p=oweals%2Fgnunet.git diff --git a/guix-env.scm b/guix-env.scm index caa95fca9..ec3a8e1f8 100644 --- a/guix-env.scm +++ b/guix-env.scm @@ -1,5 +1,5 @@ ;;; This file is part of GNUnet. -;;; Copyright (C) 2016 GNUnet e.V. +;;; Copyright (C) 2016, 2017 GNUnet e.V. ;;; ;;; GNUnet is free software; you can redistribute it and/or modify ;;; it under the terms of the GNU General Public License as published @@ -16,138 +16,88 @@ ;;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ;;; Boston, MA 02110-1301, USA. ;;; -;;; -;;; Author: N. Gillmann -;;; -;;; Parts borrowed here from pubstrate: -;;; Pubstrate 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 Pubstrate. If not, see . -;;; -;;; Parts borrowed here from guile-sdl2: -;;; Guile-sdl2 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 Lesser General Public -;;; License along with guile-sdl2. If not, see -;;; . - ;; Guix package for GNUnet development ;; ;; INSTALL +;; ------- ;; ;; To build and install the package in the user environment, use: ;; -;; .. to be documented +;; guix package --install-from-file=guix-env.scm ;; ;; BUILD ONLY +;; ---------- ;; ;; Precondition for using this file is that you run Guix and have a ;; development setup for this setup, which involves a version of Guile in ;; your PATH. -;; Let us assume you checked out https://gnunet.org/svn/, and you exported -;; a variable named GNUNET_SVN_PATH="/home/alice/src/gnunet/svn/". -;; -;; export GNUNET_SVN_PATH="/home/alice/src/gnunet/svn/" -;; -;; A directory in GUILE_LOAD_PATH is a root, this means that the value of -;; GNUNET_SVN_PATH dictates how we call this Guix module. -;; We now have to append $GNUNET_SVN_PATH to GUILE_LOAD_PATH and are almost -;; ready to go. -;; -;; export GUILE_LOAD_PATH="${GNUNET_SVN_PATH}:/home/alice/.guix-profile/share/guile/site/2.0${GUILE_LOAD_PATH:+:}$GUILE_LOAD_PATH" -;; -;; Now we make use of the function of Guix to build from expressions: ;; -;; guix build --expression="(@ (gnunet guix-env) gnunet-svn)" +;; guix build -f guix-env.scm ;; -;; This will build the public exported value gnunet-svn from this file. -;; See `info guix-build' for more about this magic. +;; We'd like to provide advanced functions such as guix environment specific +;; gnunet-git package and usage of gnunet-gtk-git, but this is subject +;; to tests right now. ;; -;; While this might look complicated, it adds options which will -;; be added later to this file, for example invoking a development -;; environment (guix env) etc... +;; Further versions of GNUnet for Guix can currently be found in +;; https://git.pragmatique.xyz/ng0-packages/log.html, mirrored at +;; https://notabug.org/ng0/ng0-packages -(define-module (gnunet guix-env) - #:use-module (ice-9 popen) - #:use-module (ice-9 match) - #:use-module (ice-9 rdelim) - #:use-module (guix packages) - #:use-module (guix build-system gnu) - #:use-module (guix gexp) - #:use-module ((guix build utils) #:select (with-directory-excursion)) - #:use-module (gnu packages) - #:use-module (gnu packages base) - #:use-module (gnu packages gnunet) - #:use-module (gnu packages file) - #:use-module (gnu packages aidc) - #:use-module (gnu packages autotools) - #:use-module (gnu packages compression) - #:use-module (gnu packages curl) - #:use-module (gnu packages geeqie) - #:use-module (gnu packages gettext) - #:use-module (gnu packages glib) - #:use-module (gnu packages gnome) - #:use-module (gnu packages gnupg) - #:use-module (gnu packages groff) - #:use-module (gnu packages gtk) - #:use-module (gnu packages guile) - #:use-module (gnu packages gstreamer) - #:use-module (gnu packages gnuzilla) - #:use-module (gnu packages libidn) - #:use-module (gnu packages linux) - #:use-module (gnu packages image) - #:use-module (gnu packages libunistring) - #:use-module (gnu packages maths) - #:use-module (gnu packages multiprecision) - #:use-module (gnu packages pkg-config) - #:use-module (gnu packages perl) - #:use-module (gnu packages pulseaudio) - #:use-module (gnu packages python) - #:use-module (gnu packages databases) - #:use-module (gnu packages tls) - #:use-module (gnu packages tex) - #:use-module (gnu packages video) - #:use-module (gnu packages web) - #:use-module (gnu packages xiph) - #:use-module (gnu packages backup) - #:use-module ((guix licenses) #:prefix license:)) +(use-modules + (ice-9 popen) + (ice-9 match) + (ice-9 rdelim) + (guix packages) + (guix build-system gnu) + (guix gexp) + ((guix build utils) #:select (with-directory-excursion)) + (guix git-download) + (gnu packages) + (gnu packages aidc) + (gnu packages autotools) + (gnu packages backup) + (gnu packages base) + (gnu packages compression) + (gnu packages curl) + (gnu packages databases) + (gnu packages file) + (gnu packages gettext) + (gnu packages glib) + (gnu packages gnome) + (gnu packages gnunet) + (gnu packages gnupg) + (gnu packages gnuzilla) + (gnu packages groff) + (gnu packages gstreamer) + (gnu packages gtk) + (gnu packages guile) + (gnu packages image) + (gnu packages image-viewers) + (gnu packages libidn) + (gnu packages libunistring) + (gnu packages linux) + (gnu packages maths) + (gnu packages multiprecision) + (gnu packages perl) + (gnu packages pkg-config) + (gnu packages pulseaudio) + (gnu packages python) + (gnu packages tex) + (gnu packages tls) + (gnu packages video) + (gnu packages web) + (gnu packages xiph) + ((guix licenses) #:prefix license:)) (define %source-dir (dirname (current-filename))) -;; This will be needed when gnunet source moves to git. -;; Taken from https://gitlab.com/dustyweb/pubstrate/blob/master/guix.scm -(define git-file? - (let* ((pipe (with-directory-excursion %source-dir - (open-pipe* OPEN_READ "git" "ls-files"))) - (files (let loop ((lines '())) - (match (read-line pipe) - ((? eof-object?) - (reverse lines)) - (line - (loop (cons line lines)))))) - (status (close-pipe pipe))) - (lambda (file stat) - (match (stat:type stat) - ('directory #t) - ((or 'regular 'symlink) - (any (cut string-suffix? <> file) files)) - (_ #f))))) - -(define-public gnunet-svn +(define gnunet-git (package - (name "gnunet-svn") + (name "gnunet-git") (version (string-append "0.10.1-" "dev")) (source (local-file %source-dir - #:recursive? #t)) - ;;#:select? git-file?)) + #:recursive? #t + #:select? (git-predicate %source-dir))) (build-system gnu-build-system) (inputs `(("glpk" ,glpk) @@ -185,15 +135,20 @@ ("automake" ,automake) ("gnu-gettext" ,gnu-gettext) ("libtool" ,libtool))) + ;; TODO: To make use of out:debug, which carries the symbols, + ;; this file needs to fixed. + (outputs '("out" "debug")) (arguments `(#:configure-flags (list (string-append "--with-nssdir=" %output "/lib") - "--enable-experimental" - ;; These appear to be "broken" on Guix, needs debugging. - ;;"--enable-gcc-hardening" + "--enable-gcc-hardening" "--enable-linker-hardening" + + "--enable-poisoning" + "--enable-sanitizer" + "--enable-experimental" "--enable-logging=verbose" - "--enable-poisoning") + "CFLAGS=-ggdb -O0") ;;#:parallel-tests? #f ; parallel building seems to fail ;;#:tests? #f ; fail: test_gnunet_statistics.py #:phases @@ -209,16 +164,16 @@ (add-after 'patch-bin-sh 'bootstrap (lambda _ (zero? (system* "sh" "bootstrap")))) - (delete 'check) + (delete 'check)))) ;; XXX: https://gnunet.org/bugs/view.php?id=4619 - (add-after 'install 'set-path-for-check - (lambda* (#:key outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (bin (string-append out "/bin")) - (lib (string-append out "/lib"))) - (setenv "GNUNET_PREFIX" lib) - (setenv "PATH" (string-append (getenv "PATH") ":" bin)) - (zero? (system* "make" "check")))))))) + ;; (add-after 'install 'set-path-for-check + ;; (lambda* (#:key outputs #:allow-other-keys) + ;; (let* ((out (assoc-ref outputs "out")) + ;; (bin (string-append out "/bin")) + ;; (lib (string-append out "/lib"))) + ;; (setenv "GNUNET_PREFIX" lib) + ;; (setenv "PATH" (string-append (getenv "PATH") ":" bin)) + ;; (zero? (system* "make" "check")))))))) (synopsis "Secure, decentralized, peer-to-peer networking framework") (description "GNUnet is a framework for secure peer-to-peer networking. The @@ -229,3 +184,5 @@ an application for secure publication of files, it has grown to include all kinds of basic applications for the foundation of a GNU internet.") (license license:gpl3+) (home-page "https://gnunet.org/"))) + +gnunet-git