1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
| | (define-module (gnu packages p4)
#:use-module (guix packages)
#:use-module (guix download)
#:use-module (guix git-download)
#:use-module (guix build-system cmake)
#:use-module (guix licenses)
;; p4c deps
#:use-module (gnu packages commencement) ;gcc
#:use-module (gnu packages base) ;glibc
#:use-module (gnu packages bison)
#:use-module (gnu packages flex)
#:use-module (gnu packages protobuf)
#:use-module (gnu packages multiprecision) ;gmp
#:use-module (gnu packages boost)
#:use-module (gnu packages python)
#:use-module (gnu packages documentation) ;doxygen
#:use-module (gnu packages graphviz)
#:use-module (gnu packages bdw-gc) ;libgc
;; auxiliaries
#:use-module (gnu packages scheme) ;regex
)
(define-public p4c-1.2.3.2
(package
(name "p4c-1.2.3.2")
(version "1.2.3.2")
(home-page "https://github.com/p4lang/p4c")
(synopsis "Reference compiler for the P4 network programming language")
(license asl2.0) ;apache2.0
(description
"p4c is a reference compiler for the P4 programming language. It supports both P4-14 and P4-16. ")
(source (origin
(method git-fetch)
(uri (git-reference
(url (string-append home-page ".git"))
(commit (string-append "v" version))
(recursive? #t)))
(sha256
"18v3m7i0c9cd3zz31a0dgppbpkk873l2fwsf5z0z765cn0gxir0i")))
(build-system cmake-build-system)
(native-inputs `(("bison" ,bison)
("flex" ,flex)
("protobuf" ,protobuf)
("gmp" ,gmp)
("boost" ,boost)
("python" ,python)
("doxygen" ,doxygen)
("graphviz" ,graphviz)
("libgc" ,libgc)
;; backends may have additional dependencies, see https://github.com/p4lang/p4c#dependencies
))
(arguments
`(#:configure-flags (list "-DCFLAGS=-O3"
"-DCMAKE_BUILD_TYPE=Release"
"-DENABLE_TEST_TOOLS=ON"
"-DENABLE_DOCS=ON"
"-DENABLE_MULTITHREAD=ON"
"-DProtobuf_LIBRARIES=/gnu/store"
"-DProtobuf_LIBRARY=/gnu/store"
"-DCMAKE_EXE_LINKER_FLAGS=-lprotobuf"
"-DLINK_DIRECTORIES=/gnu/store")
#:tests? #f))))
(define-public p4c
(package
(inherit p4c-1.2.3.2)
(version "latest-release")
(name "p4c")
(properties '((release-tag-prefix . "v")
(release-tag-version-delimiter . ".")))))
p4c
|