mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
gnu: fpc: Fix build.
The bootstrap binaries (!) were probably too old. * gnu/packages/pascal.scm: Add missing copyright line. (%fpc-version, %fpc-release-date): New variables. (fpc-bootstrap-i386-3.0.4): Add a FIXME for a proper bootstrap. Rename to... (fpc-bootstrap-i386): ... this and update to 3.2.2. Use %fpc-version. (fpc-bootstrap-x86_64-3.0.4): Rename to... (fpc-bootstrap-x86_64): ... this and update to 3.2.2. Use %fpc-version. (fpc): Remove trailing #t. [version]: Use %fcp-version. [inputs]: Adjust accordingly. [phases]: Remove hard coded version and release strings.
This commit is contained in:
parent
ab0cf06244
commit
79ca578182
1 changed files with 33 additions and 30 deletions
|
@ -1,6 +1,8 @@
|
||||||
;;; GNU Guix --- Functional package management for GNU
|
;;; GNU Guix --- Functional package management for GNU
|
||||||
|
;;; Copyright © 2017 David Hashe <david.hashe@dhashe.com>
|
||||||
;;; Copyright © 2017 Kei Kebreau <address@hidden>
|
;;; Copyright © 2017 Kei Kebreau <address@hidden>
|
||||||
;;; Copyright © 2020 Eric Bavier <bavier@posteo.net>
|
;;; Copyright © 2020 Eric Bavier <bavier@posteo.net>
|
||||||
|
;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
|
||||||
;;;
|
;;;
|
||||||
;;; This file is part of GNU Guix.
|
;;; This file is part of GNU Guix.
|
||||||
;;;
|
;;;
|
||||||
|
@ -34,28 +36,32 @@
|
||||||
#:use-module (gnu packages xml)
|
#:use-module (gnu packages xml)
|
||||||
#:use-module (ice-9 match))
|
#:use-module (ice-9 match))
|
||||||
|
|
||||||
(define fpc-bootstrap-i386-3.0.4
|
(define %fpc-version "3.2.2")
|
||||||
(origin
|
(define %fpc-release-date "2021/05/19")
|
||||||
(method url-fetch)
|
|
||||||
(uri
|
|
||||||
"mirror://sourceforge/freepascal/Linux/3.0.4/fpc-3.0.4.i386-linux.tar")
|
|
||||||
(sha256
|
|
||||||
(base32
|
|
||||||
"05xfgxa6vb0y2ryfsgn21m2kwaxhci6l2zxa3akvlnqminjsjvda"))))
|
|
||||||
|
|
||||||
(define fpc-bootstrap-x86_64-3.0.4
|
;;; FIXME: Bootstrap properly; these are prebuilt binaries.
|
||||||
|
(define fpc-bootstrap-i386
|
||||||
(origin
|
(origin
|
||||||
(method url-fetch)
|
(method url-fetch)
|
||||||
(uri
|
(uri (string-append "mirror://sourceforge/freepascal/Linux/"
|
||||||
"mirror://sourceforge/freepascal/Linux/3.0.4/fpc-3.0.4.x86_64-linux.tar")
|
%fpc-version "/fpc-" %fpc-version ".i386-linux.tar"))
|
||||||
(sha256
|
(sha256
|
||||||
(base32
|
(base32
|
||||||
"0xzxh689iyjfmkqkhcqg9plrjmdx82hbyywyyc7jm0n92fpmp5ky"))))
|
"0n4r85dsr86zlk7r4hbd4nj14sda6rwgdgzxg4gj4q981fn80agn"))))
|
||||||
|
|
||||||
|
(define fpc-bootstrap-x86_64
|
||||||
|
(origin
|
||||||
|
(method url-fetch)
|
||||||
|
(uri (string-append "mirror://sourceforge/freepascal/Linux/"
|
||||||
|
%fpc-version "/fpc-" %fpc-version ".x86_64-linux.tar"))
|
||||||
|
(sha256
|
||||||
|
(base32
|
||||||
|
"10qywczzz4qlcmmzxb7axnvwniq76ky130vd8iv6ljskll4c7njs"))))
|
||||||
|
|
||||||
(define-public fpc
|
(define-public fpc
|
||||||
(package
|
(package
|
||||||
(name "fpc")
|
(name "fpc")
|
||||||
(version "3.2.2") ; Update release date below!
|
(version %fpc-version)
|
||||||
(source (origin
|
(source (origin
|
||||||
(method url-fetch)
|
(method url-fetch)
|
||||||
(uri (string-append "mirror://sourceforge/freepascal/Source/"
|
(uri (string-append "mirror://sourceforge/freepascal/Source/"
|
||||||
|
@ -76,8 +82,7 @@
|
||||||
(mkdir-p "install")
|
(mkdir-p "install")
|
||||||
(rename-file "install-doc" "install/doc")
|
(rename-file "install-doc" "install/doc")
|
||||||
(rename-file "install-man" "install/man")
|
(rename-file "install-man" "install/man")
|
||||||
(delete-file "fpcsrc/tests/utils/dosbox/exitcode.exe")
|
(delete-file "fpcsrc/tests/utils/dosbox/exitcode.exe")))))
|
||||||
#t))))
|
|
||||||
(build-system gnu-build-system)
|
(build-system gnu-build-system)
|
||||||
(supported-systems '("i686-linux" "x86_64-linux"))
|
(supported-systems '("i686-linux" "x86_64-linux"))
|
||||||
(inputs
|
(inputs
|
||||||
|
@ -91,11 +96,11 @@
|
||||||
`(("fpc-binary"
|
`(("fpc-binary"
|
||||||
,(match (or (%current-target-system)
|
,(match (or (%current-target-system)
|
||||||
(%current-system))
|
(%current-system))
|
||||||
("i686-linux" fpc-bootstrap-i386-3.0.4)
|
("i686-linux" fpc-bootstrap-i386)
|
||||||
;("powerpc64le-linux" fpc-bootstrap-ppc64le-3.0.4)
|
;("powerpc64le-linux" fpc-bootstrap-ppc64le)
|
||||||
;("powerpc-linux" fpc-bootstrap-ppc-3.0.4)
|
;("powerpc-linux" fpc-bootstrap-ppc)
|
||||||
("x86_64-linux" fpc-bootstrap-x86_64-3.0.4)
|
("x86_64-linux" fpc-bootstrap-x86_64)
|
||||||
(_ fpc-bootstrap-x86_64-3.0.4)))))
|
(arch (error "fpc arch not yet supported in guix" arch))))))
|
||||||
(arguments
|
(arguments
|
||||||
`(#:tests? #f ; no tests available
|
`(#:tests? #f ; no tests available
|
||||||
#:phases
|
#:phases
|
||||||
|
@ -115,7 +120,7 @@
|
||||||
(add-after 'unpack-bin 'install-bin
|
(add-after 'unpack-bin 'install-bin
|
||||||
(lambda* (#:key inputs #:allow-other-keys)
|
(lambda* (#:key inputs #:allow-other-keys)
|
||||||
(with-directory-excursion
|
(with-directory-excursion
|
||||||
(string-append fpc-bootstrap-path "/fpc-3.0.4."
|
(string-append fpc-bootstrap-path "/fpc-" ,version "."
|
||||||
arch "-linux")
|
arch "-linux")
|
||||||
(let ((binary-tarball
|
(let ((binary-tarball
|
||||||
(string-append "binary." arch "-linux.tar"))
|
(string-append "binary." arch "-linux.tar"))
|
||||||
|
@ -131,8 +136,7 @@
|
||||||
(add-after 'patch-source-shebangs 'patch-inline-shebangs
|
(add-after 'patch-source-shebangs 'patch-inline-shebangs
|
||||||
(lambda _
|
(lambda _
|
||||||
(substitute* "fpcsrc/compiler/cscript.pas"
|
(substitute* "fpcsrc/compiler/cscript.pas"
|
||||||
(("#!/bin/sh") (string-append "#!" (which "sh"))))
|
(("#!/bin/sh") (string-append "#!" (which "sh"))))))
|
||||||
#t))
|
|
||||||
(add-before 'build 'patch-release-date
|
(add-before 'build 'patch-release-date
|
||||||
(lambda _ ; reproducibility
|
(lambda _ ; reproducibility
|
||||||
(substitute* (list "fpcdocs/prog.tex"
|
(substitute* (list "fpcdocs/prog.tex"
|
||||||
|
@ -143,8 +147,8 @@
|
||||||
"fpcsrc/utils/fpcm/fpcmmain.pp"
|
"fpcsrc/utils/fpcm/fpcmmain.pp"
|
||||||
"fpcsrc/utils/fpcreslipo/fpcreslipo.pp"
|
"fpcsrc/utils/fpcreslipo/fpcreslipo.pp"
|
||||||
"fpcsrc/compiler/version.pas")
|
"fpcsrc/compiler/version.pas")
|
||||||
(("\\{\\$I(NCLUDE)? %DATE%\\}") "'2020/06/19'"))
|
(("\\{\\$I(NCLUDE)? %DATE%\\}")
|
||||||
#t))
|
(format #f "'~a'" ,%fpc-release-date)))))
|
||||||
(replace 'configure
|
(replace 'configure
|
||||||
(lambda* (#:key inputs outputs #:allow-other-keys)
|
(lambda* (#:key inputs outputs #:allow-other-keys)
|
||||||
(substitute* "fpcsrc/compiler/systems/t_linux.pas"
|
(substitute* "fpcsrc/compiler/systems/t_linux.pas"
|
||||||
|
@ -165,8 +169,7 @@
|
||||||
"if (isdll) then")))
|
"if (isdll) then")))
|
||||||
(substitute* "fpcsrc/compiler/options.pas"
|
(substitute* "fpcsrc/compiler/options.pas"
|
||||||
(("exepath\\+'../etc/'")
|
(("exepath\\+'../etc/'")
|
||||||
(string-append "'" (assoc-ref outputs "out") "/etc'")))
|
(string-append "'" (assoc-ref outputs "out") "/etc'")))))
|
||||||
#t))
|
|
||||||
(replace 'build
|
(replace 'build
|
||||||
(lambda* (#:key inputs #:allow-other-keys)
|
(lambda* (#:key inputs #:allow-other-keys)
|
||||||
(let* ((fpc-bin (string-append fpc-bootstrap-path "/bin"))
|
(let* ((fpc-bin (string-append fpc-bootstrap-path "/bin"))
|
||||||
|
@ -177,7 +180,7 @@
|
||||||
(setenv "PATH"
|
(setenv "PATH"
|
||||||
(string-append (getenv "PATH") ":"
|
(string-append (getenv "PATH") ":"
|
||||||
fpc-bootstrap-path
|
fpc-bootstrap-path
|
||||||
"/lib/fpc/3.0.4"))
|
"/lib/fpc/" ,version))
|
||||||
(setenv "FPC" fpc)
|
(setenv "FPC" fpc)
|
||||||
;; Specify target operating system using "-T" option
|
;; Specify target operating system using "-T" option
|
||||||
(invoke fpcmake (string-append "-T" arch "-linux"))
|
(invoke fpcmake (string-append "-T" arch "-linux"))
|
||||||
|
@ -212,8 +215,8 @@
|
||||||
(glibc (assoc-ref inputs "glibc")))
|
(glibc (assoc-ref inputs "glibc")))
|
||||||
(wrap-program fpc
|
(wrap-program fpc
|
||||||
`("PATH" ":" prefix (,(string-append ld "/bin")))
|
`("PATH" ":" prefix (,(string-append ld "/bin")))
|
||||||
`("LIBRARY_PATH" ":" prefix (,(string-append glibc "/lib"))))
|
`("LIBRARY_PATH" ":" prefix
|
||||||
#t)))))))
|
(,(string-append glibc "/lib")))))))))))
|
||||||
;; fpc invokes gcc, so make sure LIBRARY_PATH et.al are set.
|
;; fpc invokes gcc, so make sure LIBRARY_PATH et.al are set.
|
||||||
;(native-search-paths (package-native-search-paths gcc))
|
;(native-search-paths (package-native-search-paths gcc))
|
||||||
(home-page "https://www.freepascal.org")
|
(home-page "https://www.freepascal.org")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue