From 03c65f8f9525dd8aeb8407d29f92c7bd9d4462b0 Mon Sep 17 00:00:00 2001 From: example Date: Sun, 3 Dec 2023 07:58:48 -0600 Subject: [PATCH] added p4.scm --- gnu/packages/p4.scm | 71 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 gnu/packages/p4.scm diff --git a/gnu/packages/p4.scm b/gnu/packages/p4.scm new file mode 100644 index 0000000000..01cae490e2 --- /dev/null +++ b/gnu/packages/p4.scm @@ -0,0 +1,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 -- 2.41.0