aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/mes.scm
diff options
context:
space:
mode:
authorJan Nieuwenhuizen <janneke@gnu.org>2017-05-14 11:35:05 +0200
committerLudovic Courtès <ludo@gnu.org>2017-05-14 15:49:50 +0200
commit4be014128e1c422f37b56f9a6b3420b4e85c4302 (patch)
treeca9b2cf88ce703e74bcee3683838049c377ae830 /gnu/packages/mes.scm
parentc65d05b5ac6da768ffae1038f02a810f79dca83c (diff)
downloadguix-4be014128e1c422f37b56f9a6b3420b4e85c4302.tar.gz
guix-4be014128e1c422f37b56f9a6b3420b4e85c4302.zip
gnu: Add Nyacc.
* gnu/packages/mes.scm (nyacc): New variable. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'gnu/packages/mes.scm')
-rw-r--r--gnu/packages/mes.scm23
1 files changed, 23 insertions, 0 deletions
diff --git a/gnu/packages/mes.scm b/gnu/packages/mes.scm
index aaa00f78a6..84d6f8ff78 100644
--- a/gnu/packages/mes.scm
+++ b/gnu/packages/mes.scm
@@ -26,10 +26,33 @@
#:use-module (gnu packages package-management)
#:use-module (gnu packages perl)
#:use-module (guix build-system gnu)
+ #:use-module (guix download)
#:use-module (guix git-download)
#:use-module (guix licenses)
#:use-module (guix packages))
+(define-public nyacc
+ (package
+ (name "nyacc")
+ (version "0.78.3")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "mirror://savannah/nyacc/"
+ name "-" version ".tar.gz"))
+ (sha256
+ (base32
+ "0xrnl2hl9rpl50n8cihvclcd951zj640fj5kpi3d6ihwcqjcdi0a"))))
+ (build-system gnu-build-system)
+ (native-inputs
+ `(("guile" ,guile-2.2)))
+ (synopsis "LALR(1) Parser Generator in Guile")
+ (description
+ "NYACC is an LALR(1) parser generator implemented in Guile.
+The syntax and nomenclature should be considered not stable. It comes with
+extensive examples, including parsers for the Javascript and C99 languages.")
+ (home-page "https://savannah.nongnu.org/projects/nyacc")
+ (license (list gpl3+ lgpl3+))))
+
(define-public mes
(let ((commit "a437c173b9da1949ad966fd50dd4f26e522a910a")
(revision "0")
e (run-nfs-server-test) "Run a test of an OS running a service of NFS-SERVICE-TYPE." (define os (marionette-operating-system %nfs-os #:requirements '(nscd) #:imported-modules '((gnu services herd) (guix combinators)))) (define test (with-imported-modules '((gnu build marionette)) #~(begin (use-modules (gnu build marionette) (srfi srfi-64)) (define marionette (make-marionette (list #$(virtual-machine os)))) (test-runner-current (system-test-runner #$output)) (test-begin "nfs-daemon") (marionette-eval '(begin (current-output-port (open-file "/dev/console" "w0")) (chmod "/export" #o777) (with-output-to-file "/export/hello" (lambda () (display "hello world"))) (chmod "/export/hello" #o777)) marionette) (test-assert "nscd PID file is created" (marionette-eval '(begin (use-modules (gnu services herd)) (start-service 'nscd)) marionette)) (test-assert "nscd is listening on its socket" (wait-for-unix-socket "/var/run/nscd/socket" marionette)) (test-assert "network is up" (marionette-eval '(begin (use-modules (gnu services herd)) (start-service 'networking)) marionette)) ;; Wait for the NFS services to be up and running. (test-assert "nfs services are running" (and (marionette-eval '(begin (use-modules (gnu services herd)) (start-service 'nfs)) marionette) (wait-for-file "/var/run/rpc.statd.pid" marionette))) (test-assert "nfs share is advertised" (marionette-eval '(zero? (system* (string-append #$nfs-utils "/sbin/showmount") "-e" "nfs-server")) marionette)) (test-assert "nfs share mounted" (marionette-eval '(begin (and (zero? (system* (string-append #$nfs-utils "/sbin/mount.nfs4") "nfs-server:/" "/remote" "-v")) (file-exists? "/remote/hello"))) marionette)) (test-end)))) (gexp->derivation "nfs-server-test" test)) (define %test-nfs-server (system-test (name "nfs-server") (description "Test that an NFS server can be started and exported directories can be mounted.") (value (run-nfs-server-test)))) (define (run-nfs-full-test) "Run a test of an OS mounting its root file system via NFS." (define nfs-root-server-os (let ((os (simple-operating-system))) (marionette-operating-system (operating-system (inherit os) (services (cons* (service static-networking-service-type (list (static-networking (addresses (list (network-address (device "ens5") (value "10.0.2.15/24"))))))) (simple-service 'export activation-service-type #~(begin (mkdir-p "/export") (chmod "/export" #o777))) (service nfs-service-type (nfs-configuration (nfsd-port 2049) (nfs-versions '("4.2")) (exports '(("/export" "*(rw,insecure,no_subtree_check,\ crossmnt,fsid=root,no_root_squash,insecure,async)"))))) (modify-services (operating-system-user-services os) (syslog-service-type config => (syslog-configuration (inherit config) (config-file (plain-file "syslog.conf" "*.* /dev/console\n")))))))) #:requirements '(nscd) #:imported-modules '((gnu services herd) (guix combinators))))) (define nfs-root-client-os (marionette-operating-system (simple-operating-system (service static-networking-service-type (list (static-networking (addresses (list (network-address (device "ens5") (value "10.0.2.16/24"))))))) (service nfs-service-type (nfs-configuration (nfsd-port 2049) (nfs-versions '("4.2")))) (simple-service 'export activation-service-type #~(begin (mkdir-p "/export") (chmod "/export" #o777)))) #:requirements '(nscd) #:imported-modules '((gnu services herd) (guix combinators)))) (define test (with-imported-modules '((gnu build marionette)) #~(begin (use-modules (gnu build marionette) (srfi srfi-64)) (test-runner-current (system-test-runner #$output)) (test-begin "start-nfs-boot-test") ;;; Start up NFS server host. (mkdir "/tmp/server") (define server-marionette (make-marionette (cons* #$(virtual-machine (operating-system nfs-root-server-os) (volatile? #f)) '("-device" "e1000,netdev=n1,mac=52:54:00:12:34:56" "-netdev" "socket,id=n1,listen=:1234")) #:socket-directory "/tmp/server")) ;;; Wait for the NFS services to be up and running. (test-assert "nfs services are running" (wait-for-file "/var/run/rpc.statd.pid" server-marionette)) (test-assert "NFS port is ready" (wait-for-tcp-port 2049 server-marionette)) ;;; Start up NFS client host. (mkdir "/tmp/client") (define client-marionette (make-marionette (cons* #$(virtual-machine (operating-system nfs-root-client-os) (volatile? #f)) '("-device" "e1000,netdev=n2,mac=52:54:00:12:34:57" "-netdev" "socket,id=n2,connect=127.0.0.1:1234")) #:socket-directory "/tmp/client")) (test-assert "NFS port is ready" (wait-for-tcp-port 2049 client-marionette)) (marionette-eval '(begin (use-modules (rnrs io ports)) (current-output-port (open-file "/dev/console" "w0")) (and (system* (string-append #$nfs-utils "/sbin/mount.nfs") "10.0.2.15:/export" "/export" "-v") (let ((content (call-with-input-file "/proc/mounts" get-string-all))) (call-with-output-file "/export/mounts" (lambda (port) (display content port)))))) client-marionette) ;;; Check whether NFS client host communicated with NFS server host. (test-assert "nfs client deposited file" (wait-for-file "/export/mounts" server-marionette)) (marionette-eval '(begin (current-output-port (open-file "/dev/console" "w0")) (call-with-input-file "/export/mounts" display)) server-marionette) (test-end)))) (gexp->derivation "nfs-full-test" test)) (define %test-nfs-full (system-test (name "nfs-full") (description "Test that an NFS server can be started and the exported directory can be used by another machine.") (value (run-nfs-full-test))))