gnu: Add p2c.

* gnu/packages/pascal.scm (p2c): New variable.
This commit is contained in:
Danny Milosavljevic 2020-08-29 21:43:08 +02:00
parent ac710de16e
commit 6d69886d73
No known key found for this signature in database
GPG key ID: E71A35542C30BAA5

View file

@ -20,6 +20,7 @@ (define-module (gnu packages pascal)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix packages)
#:use-module (guix download)
#:use-module (guix utils)
#:use-module (guix build-system gnu)
#:use-module (gnu packages)
#:use-module (gnu packages base)
@ -28,6 +29,7 @@ (define-module (gnu packages pascal)
#:use-module (gnu packages compression)
#:use-module (gnu packages gcc)
#:use-module (gnu packages ncurses)
#:use-module (gnu packages perl)
#:use-module (gnu packages xml)
#:use-module (ice-9 match))
@ -213,3 +215,52 @@ (define-public fpc
;; or later. For more licensing details, see the appropriate files in
;; the install/doc directory of the source distribution.
(license license:gpl2+)))
(define-public p2c
(package
(name "p2c")
(version "2.01")
(source (origin
(method url-fetch)
(uri (string-append "https://alum.mit.edu/www/toms/p2c/p2c-"
version ".tar.gz"))
(sha256
(base32
"03x72lv6jrvikbrpz4kfq1xp61l2jw5ki6capib71lxs65zndajn"))))
(build-system gnu-build-system)
(arguments
`(#:make-flags
(let ((out (assoc-ref %outputs "out")))
(list (string-append "CC=" ,(cc-for-target))
(string-append "HOMEDIR=" out "/lib/p2c")
(string-append "INCDIR=" out "/include/p2c")
(string-append "BINDIR=" out "/bin")
(string-append "LIBDIR=" out "/lib")
(string-append "MANDIR=" out "/share/man/man1")
"MANFILE=p2c.man.inst"))
#:test-target "test"
#:phases
(modify-phases %standard-phases
(delete 'configure)
(add-before 'build 'mkdir
(lambda* (#:key outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out")))
(mkdir-p (string-append out "/share/man"))
(mkdir-p (string-append out "/lib"))
(mkdir-p (string-append out "/bin"))
(mkdir-p (string-append out "/include")))
#t))
(add-before 'build 'chdir
(lambda* (#:key make-flags #:allow-other-keys)
(chdir "src")
#t)))))
(native-inputs
`(("perl" ,perl)
("which" ,which)))
(synopsis "p2c converts Pascal programs to C programs--which you can then
compile using gcc")
(description "This package provides @command{p2c}, a program to convert
Pascal source code to C source code, and @command{p2cc}, a compiler for
Pascal programs.")
(home-page "http://users.fred.net/tds/lab/p2c/")
(license license:gpl2+)))