gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnunet-scheme] 74/324: build: add autotools scripts


From: gnunet
Subject: [gnunet-scheme] 74/324: build: add autotools scripts
Date: Tue, 21 Sep 2021 13:21:54 +0200

This is an automated email from the git hooks/post-receive script.

maxime-devos pushed a commit to branch master
in repository gnunet-scheme.

commit a30e94b0092f963d7d4f218d2d841e2bd2c3704b
Author: Maxime Devos <maximedevos@telenet.be>
AuthorDate: Sat Feb 6 17:17:07 2021 +0100

    build: add autotools scripts
    
    TODO: make guix dependency optional
---
 Makefile.am  | 88 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 README.org   | 12 +++++++++
 configure.ac | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++
 guix.scm     | 18 ++++++++++---
 4 files changed, 190 insertions(+), 3 deletions(-)

diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..4e5b1b6
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,88 @@
+## Process this file with automake to produce Makefile.in
+# Copyright (C) 2000-2012 Free Software Foundation, Inc.
+# Copyright (C) 2020 Maxime Devos
+#
+# Author (GnuTLS): Nikos Mavrogiannopoulos
+# Author (scheme-GNUnet): Maxime Devos
+#
+# This file was part of scheme-GNUnet.
+#
+# scheme-GNUnet 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.
+#
+# scheme-GNUnet 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 scheme-GNUnet.  If not, see <http://www.gnu.org/licenses/>.
+
+# This file is partially based upon guile/Makefile.am in GnuTLS.
+# Not all scheme-GNUnet code is licensed as GPL, some is licensed as AGPL.
+
+ACLOCAL_AMFLAGS = -I m4
+AM_CPPFLAGS = -I$(top_srcdir)/include
+SUFFIXES = .scm .go
+
+# Scheme code that works
+modules = \
+  gnu/gnunet/scripts/download-store.scm \
+  gnu/gnunet/scripts/publish-store.scm \
+  gnu/gnunet/scripts/guix-stuff.scm \
+  \
+  gnu/gnunet/message/protocols.scm \
+  gnu/gnunet/message/envelope.scm \
+  \
+  gnu/gnunet/concurrency/update.scm \
+  \
+  gnu/gnunet/util/mq-enum.scm \
+  gnu/gnunet/util/mq-handler.scm \
+  gnu/gnunet/util/mq.scm \
+  \
+  gnu/gnunet/utils/bv-slice.scm \
+  gnu/gnunet/utils/hat-let.scm \
+  gnu/gnunet/utils/netstruct.scm
+
+dist_guilesite_DATA = $(modules)
+
+# Scheme code compilation
+if HAVE_GUILD
+nodist_guilesiteccache_DATA = $(modules:%.scm=%.go)
+
+# Unset 'GUILE_LOAD_COMPILED_PATH' so we can be sure that any .go file that we
+# load comes from the build directory.
+# XXX: Use the C locale for when Guile lacks
+# 
<https://git.sv.gnu.org/cgit/guile.git/commit/?h=stable-2.0&id=e2c6bf3866d1186c60bacfbd4fe5037087ee5e3f>.
+%.go: %.scm
+       $(AM_V_GUILEC)$(MKDIR_P) "`dirname "$@"`" ;                     \
+       $(AM_V_P) && out=1 || out=- ;                                   \
+       unset GUILE_LOAD_COMPILED_PATH ; LC_ALL=C                       \
+       builddir="$(top_builddir)"                                      \
+       GUILE_AUTO_COMPILE=0                                            \
+       $(GUILD) compile --target="$(host)"                             \
+         -L "$(top_srcdir)"                                            \
+         -Wformat -Wunbound-variable -Warity-mismatch                  \
+         -o "$@" "$<" >&$$out
+endif
+
+TEST_EXTENSIONS = .scm
+TESTS =
+
+# Scheme tests
+# FIXME ./pre-inst-env & ./test-env
+SCM_LOG_DRIVER = \
+  $(GUILE) -L $(top_srcdir) -C $(top_builddir) \
+    -e main $(top_srcdir)/build-aux/test-driver.scm
+
+SCM_TESTS = \
+  tests/envelope.scm \
+  tests/message-handler.scm \
+  tests/update.scm
+
+SCM_TESTS_ENVIRONMENT = \
+  GUILE_AUTO_COMPILE=0 \
+  GUILE_WARN_DEPRECATED=detailed
+TESTS += $(SCM_TESTS)
diff --git a/README.org b/README.org
index 6309f1d..4c220f4 100644
--- a/README.org
+++ b/README.org
@@ -9,6 +9,18 @@
   TODO: ask upstream of use of name is acceptable
   TODO: more bindings, less duplication
   TODO: document directory & meta data format
+* How to build & install
+  #+BEGIN_SRC shell
+    # When using Guix
+    # (XXX make dependency on Guix itself optional)
+    guix environment -l guix.scm
+
+    autoreconf -vif
+    ./configure
+    make
+    make check
+  #+END_SRC
+  TODO install
 * things that work
   TODO: test suite for download & publish.
   TODO (elsewhere): GNUnet service definitions for Guix in container
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..8561569
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,75 @@
+dnl Process this file with autoconf to produce a configure script.
+# Copyright (C) 2000-2012, 2016, 2019 Free Software Foundation, Inc.
+# Copyright (C) 2020, 2021 Maxime Devos
+#
+# Author (GnuTLS): Nikos Mavrogiannopoulos, Simon Josefsson
+# Author (scheme-GNUnet): Maxime Devos
+#
+# This file is part of scheme-gnunet
+#
+# scheme-GNUnet 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.
+#
+# scheme-GNUnet 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 scheme-GNUnet.  If not, see <http://www.gnu.org/licenses/>.
+
+# This file is partially based upon the Autoconf script of GnuTLS.
+# Not all scheme-GNUnet code is licensed as GPL, some is licensed as AGPL.
+
+AC_PREREQ([2.61])
+AC_INIT([scheme-gnunet], [0], [])
+AC_CONFIG_AUX_DIR([build-aux])
+AC_CONFIG_MACRO_DIRS([m4])
+
+AM_INIT_AUTOMAKE([foreign subdir-objects])
+
+AC_MSG_RESULT([***
+*** Checking for compilation programs...
+])
+dnl Checks for programs.
+#PKG_PROG_PKG_CONFIG
+
+dnl GNU Guile support
+AC_MSG_CHECKING([whether building the Scheme implementation])
+AC_ARG_ENABLE(guile,
+        AS_HELP_STRING([--enable-guile], [build GNU Guile implementation]),
+                [opt_guile_impl=$enableval], [opt_guile_impl=yes])
+AC_MSG_RESULT($opt_guile_bindings)
+
+AC_ARG_WITH([guile-site-dir], AS_HELP_STRING([--with-guile-site-dir=DIR],
+    [guile site directory for scheme-gnunet, default is guile system 
settings]),
+    [guilesitedir="${withval}"], [guilesitedir='$(GUILE_SITE)'])
+AC_ARG_WITH([guile-site-ccache-dir], 
AS_HELP_STRING([--with-guile-site-ccache-dir=DIR],
+    [guile ccache directory for scheme-gnunet, default is guile system 
settings]),
+    [guilesiteccachedir="${withval}"], 
[guilesiteccachedir='$(GUILE_SITE_CCACHE)'])
+AC_SUBST([guilesitedir])
+AC_SUBST([guilesiteccachedir])
+
+if test "$opt_guile_impl" = "yes"; then
+   AC_MSG_RESULT([***
+*** Detecting GNU Guile...
+])
+
+   dnl Check for 'guild', which can be used to compile Scheme code
+   dnl on Guile 2.x and 3.x.
+   AC_PATH_PROG([GUILD], [guild])
+   AC_SUBST([GUILD])
+
+   dnl TODO check if 2.x works
+   GUILE_PKG([3.0 2.2 2.0])
+   GUILE_PROGS
+   GUILE_SITE_DIR
+   GUILE_FLAGS
+fi
+
+AM_CONDITIONAL([HAVE_GUILE], [test "$opt_guile_bindings" = "yes"])
+AM_CONDITIONAL([HAVE_GUILD], [test "x$GUILD" != "x"])
+
+AC_OUTPUT([Makefile])
diff --git a/guix.scm b/guix.scm
index db93cb2..7623bfd 100644
--- a/guix.scm
+++ b/guix.scm
@@ -17,19 +17,31 @@
 ;;   SPDX-License-Identifier: AGPL-3.0-or-later
 
 (use-modules (gnu packages guile)
+            (gnu packages guile-xyz)
+            (gnu packages autotools)
+            (gnu packages gettext)
+            (gnu packages pkg-config)
             (guix packages)
-            (guix build-system guile)
+            (guix build-system gnu)
             ((guix licenses) #:prefix license:))
+
 (define-public scheme-gnunet
   (package
    (name "scheme-gnunet")
    (version "0.0")
    (source #f)
-   (build-system guile-build-system)
+   (build-system gnu-build-system)
    (propagated-inputs `(("guile-zlib" . ,guile-zlib)
                        ("guile-bytestructures" . ,guile-bytestructures)
+                       ("guile-fibers" . ,guile-fibers)
                        ("guile-json" . ,guile-json-4)))
-   (native-inputs `(("guile" . ,guile-3.0)))
+   (native-inputs `(("guile" ,guile-3.0)
+                   ("automake" ,automake)
+                    ;; Gettext brings 'AC_LIB_LINKFLAGS_FROM_LIBS'.
+                   ("gettext" ,gettext-minimal)
+                   ("pkg-config" ,pkg-config)
+                   ("autoconf" ,autoconf-wrapper)))
+   (inputs `(("guile" ,guile-3.0)))
    (synopsis "partial Scheme port of GNUnet")
    (license license:agpl3+)
    (description #f)

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]