From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kei Kebreau Subject: Re: [PATCH] gnu: Add fpc. (version 2) Date: Fri, 27 Jan 2017 01:00:11 -0500 Message-ID: <87a8adxct0.fsf@openmailbox.org> References: <87poj9xwzp.fsf@openmailbox.org> <87lgtxxial.fsf@openmailbox.org> <87efzpxfxh.fsf@openmailbox.org> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50333) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cWzaH-0001cA-Ks for guix-devel@gnu.org; Fri, 27 Jan 2017 01:00:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cWzaE-0003eV-Ag for guix-devel@gnu.org; Fri, 27 Jan 2017 01:00:29 -0500 Received: from lb1.openmailbox.org ([5.79.108.160]:43943) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cWzaD-0003eJ-VM for guix-devel@gnu.org; Fri, 27 Jan 2017 01:00:26 -0500 In-Reply-To: <87efzpxfxh.fsf@openmailbox.org> (Kei Kebreau's message of "Thu, 26 Jan 2017 23:52:42 -0500") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: guix-devel@gnu.org --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain Kei Kebreau writes: > Kei Kebreau writes: > >> Kei Kebreau writes: >> >>> This is a patch that adds a package for the Free Pascal Compiler. >>> Can someone verify that this builds reproducibly on an i386 machine? >> >> This update allows the compiler to find its configuration file. > > My apologies, the former upload was missing the crucial changes in the > configure phase. Please use this patch instead. Third time's a charm! Forgot a slash in one of the regex substitutions. I can confirm that this compiles Pascal programs successfully. --=-=-= Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename=0001-gnu-Add-fpc.patch Content-Transfer-Encoding: quoted-printable From=20e5f92d59faecf2be251375f01df0a1601f4990d4 Mon Sep 17 00:00:00 2001 From: Kei Kebreau Date: Fri, 27 Jan 2017 00:18:45 -0500 Subject: [PATCH] gnu: Add fpc. * gnu/packages/pascal.scm: New file. * gnu/packages/patches/fpc-reproducibility.scm: New file. * gnu/local.mk (GNU_SYSTEM_MODULES): Add pascal.scm. (dist_patch_DATA): Register patch. =2D-- gnu/local.mk | 4 +- gnu/packages/pascal.scm | 176 +++++++++++++++++++++= ++++ gnu/packages/patches/fpc-reproducibility.patch | 39 ++++++ 3 files changed, 218 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/pascal.scm create mode 100644 gnu/packages/patches/fpc-reproducibility.patch diff --git a/gnu/local.mk b/gnu/local.mk index 59fc1a82c..fb24f32fb 100644 =2D-- a/gnu/local.mk +++ b/gnu/local.mk @@ -4,7 +4,7 @@ # Copyright =C2=A9 2016 Mathieu Lirzin # Copyright =C2=A9 2013, 2014, 2015, 2016 Mark H Weaver # Copyright =C2=A9 2016 Chris Marusich =2D# Copyright =C2=A9 2016 Kei Kebreau +# Copyright =C2=A9 2016, 2017 Kei Kebreau # Copyright =C2=A9 2016 Rene Saavedra # Copyright =C2=A9 2016 Adonay "adfeno" Felipe Nogueira # Copyright =C2=A9 2016, 2017 Ricardo Wurmus @@ -290,6 +290,7 @@ GNU_SYSTEM_MODULES =3D \ %D%/packages/ots.scm \ %D%/packages/package-management.scm \ %D%/packages/parallel.scm \ + %D%/packages/pascal.scm \ %D%/packages/password-utils.scm \ %D%/packages/patchutils.scm \ %D%/packages/pciutils.scm \ @@ -554,6 +555,7 @@ dist_patch_DATA =3D \ %D%/packages/patches/fltk-shared-lib-defines.patch \ %D%/packages/patches/fltk-xfont-on-demand.patch \ %D%/packages/patches/fontforge-svg-modtime.patch \ + %D%/packages/patches/fpc-reproducibility.patch \ %D%/packages/patches/freeimage-CVE-2015-0852.patch \ %D%/packages/patches/freeimage-CVE-2016-5684.patch \ %D%/packages/patches/gawk-shell.patch \ diff --git a/gnu/packages/pascal.scm b/gnu/packages/pascal.scm new file mode 100644 index 000000000..0e7b9f3ab =2D-- /dev/null +++ b/gnu/packages/pascal.scm @@ -0,0 +1,176 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright =C2=A9 2017 Kei Kebreau +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu packages pascal) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix packages) + #:use-module (guix download) + #:use-module (guix build-system gnu) + #:use-module (gnu packages) + #:use-module (gnu packages base) + #:use-module (gnu packages bootstrap) + #:use-module (gnu packages compression) + #:use-module (gnu packages ncurses) + #:use-module (gnu packages xml)) + +(define fpc-bootstrap-x86_64-3.0.0 + (origin + (method url-fetch) + (uri + "mirror://sourceforge/freepascal/Linux/3.0.0/fpc-3.0.0.x86_64-linux.t= ar") + (sha256 + (base32 + "1m2xx3nda45cb3zidbjgdr8kddd19zk0khvp7xxdlclszkqscln9")))) + +(define fpc-bootstrap-i386-3.0.0 + (origin + (method url-fetch) + (uri + "mirror://sourceforge/freepascal/Linux/3.0.0/fpc-3.0.0.i386-linux.tar= ") + (sha256 + (base32 + "0h3f1dgs1zsx7vvk9kg67anjvgw5sslfbmjblif7ishbcp3k3g5k")))) + +(define-public fpc + (let ((arch (if (string-prefix? "x86_64" (or (%current-target-system) + (%current-system))) + "x86_64" + "i386"))) + (package + (name "fpc") + (version "3.0.0") + (source (origin + (method url-fetch) + (uri (string-append "mirror://sourceforge/freepascal/Sourc= e/" + version "/fpcbuild-" version ".tar.gz"= )) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 + (base32 + "1v40bjp0kvsi8y0mndqvvhnsqjfssl2w6wpfww51j4rxblfkp4fm")) + (patches (search-patches "fpc-reproducibility.patch")))) + (build-system gnu-build-system) + (supported-systems '("i686-linux" "x86_64-linux")) + (inputs + `(("expat" ,expat) + ("ncurses" ,ncurses) + ("zlib" ,zlib))) + (native-inputs + ;; FPC is built with FPC, so we need bootstrap binaries. + `(("fpc-binary" + ,(if (string=3D arch "x86_64") + fpc-bootstrap-x86_64-3.0.0 + fpc-bootstrap-i386-3.0.0)))) + (arguments + `(#:tests? #f ; no tests available + #:phases + (let ((fpc-bootstrap-path + (string-append (getcwd) "/" ,name "-" ,version "/fpc-bin")= )) + (modify-phases %standard-phases + (add-after 'unpack 'unpack-bin + (lambda* (#:key inputs #:allow-other-keys) + (mkdir-p fpc-bootstrap-path) + (with-directory-excursion fpc-bootstrap-path + (copy-file (assoc-ref inputs "fpc-binary") + "fpc-bin.tar") + (zero? (system* "tar" "xvf" "fpc-bin.tar"))))) + (add-after 'unpack-bin 'install-bin + (lambda* (#:key inputs #:allow-other-keys) + (with-directory-excursion + (string-append fpc-bootstrap-path "/fpc-" ,version "." + ,arch "-linux") + (let ((binary-tarball + (string-append "binary." ,arch "-linux.tar")) + (compiler-tarball + (string-append "base." ,arch "-linux.tar.gz")) + (fpcmake-tarball + (string-append "utils-fpcm." ,arch "-linux.tar.g= z"))) + (and + ;; Only the base compiler and fpcmake are needed. + (zero? (system* "tar" "xvf" binary-tarball + compiler-tarball + fpcmake-tarball)) + (zero? (system* "tar" "xvf" compiler-tarball "-C..")) + (zero? (system* "tar" "xvf" fpcmake-tarball "-C.."))= ))))) + (replace 'configure + (lambda* (#:key inputs outputs #:allow-other-keys) + (substitute* "fpcsrc/compiler/systems/t_linux.pas" + ;; Point to the current glibc dynamic linker. + (("/lib/ld-linux.so.2") + (string-append (assoc-ref inputs "libc") + ,(glibc-dynamic-linker))) + (("/lib64/ld-linux-x86-64.so.2") + (string-append (assoc-ref inputs "libc") + ,(glibc-dynamic-linker))) + ;; Add glibc to ld's search path. + (("if \\(isdll\\) then") + (string-append + "Add('SEARCH_DIR(\"" + (assoc-ref inputs "libc") "/lib" + "\")');\n" + "if (isdll) then"))) + (substitute* "fpcsrc/compiler/options.pas" + (("exepath\\+'../etc/'") + (string-append "'" (assoc-ref outputs "out") "/etc'"))) + #t)) + (replace 'build + (lambda* (#:key inputs #:allow-other-keys) + (let* ((fpc-bin (string-append fpc-bootstrap-path "/bin")) + (fpc (string-append fpc-bin "/fpc")) + (fpcmake (string-append fpc-bin "/fpcmake"))) + ;; The fpc binary needs to run the ppc[arch] binary (wh= ich + ;; does the actual compiling) in this directory. + (setenv "PATH" + (string-append (getenv "PATH") ":" + fpc-bootstrap-path + "/lib/fpc/" ,version)) + (setenv "FPC" fpc) + (and + ;; Specify target operating system using "-T" option + (zero? (system* fpcmake + (string-append "-T" ,arch "-linux"))) + (zero? (system* "make" "build" "NOGDB=3D1")))))) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + ;; This is the suffix of the ppc[arch] binary. + (suffix (if (string=3D ,arch "x86_64") + "x64" + "386")) + (ppc (string-append "ppc" suffix))) + (system* "make" "install" "NOGDB=3D1" + (string-append "INSTALL_PREFIX=3D" out)) + ;; Add a symlink to the ppc[arch] binary so fpc works. + (symlink (string-append out "/lib/fpc/" ,version "/" pp= c) + (string-append out "/bin/" ppc)) + ;; Install the example configuration file. + (mkdir (string-append out "/etc")) + (zero? + (system* + (string-append out "/lib/fpc/" ,version "/samplecfg") + (string-append out "/lib/fpc/" ,version) + (string-append out "/etc")))))))))) + (home-page "http://www.freepascal.org") + (synopsis "The Free Pascal Compiler") + (description + "Free Pascal is a professional Object Pascal compiler. It supports= the +Turbo Pascal 7.0, Delphi, and Mac Pascal dialects. Free Pascal also suppo= rts +many useful extensions to the Pascal programming language.") + ;; The majority of the software included is licensed under the GPLv2 + ;; or later. For more licensing details, see the appropriate files = in + ;; the install/doc directory of the source distribution. + (license license:gpl2+)))) diff --git a/gnu/packages/patches/fpc-reproducibility.patch b/gnu/packages/= patches/fpc-reproducibility.patch new file mode 100644 index 000000000..133c1d7e8 =2D-- /dev/null +++ b/gnu/packages/patches/fpc-reproducibility.patch @@ -0,0 +1,39 @@ +Remove/patch metadata timestamps for reproducibility. + +diff -ur fpcbuild-3.0.0.old/fpcsrc/packages/fpmkunit/src/fpmkunit.pp fpcbu= ild-3.0.0/fpcsrc/packages/fpmkunit/src/fpmkunit.pp +--- fpcbuild-3.0.0.old/fpcsrc/packages/fpmkunit/src/fpmkunit.pp 2015-11-04= 16:17:00.000000000 -0500 ++++ fpcbuild-3.0.0/fpcsrc/packages/fpmkunit/src/fpmkunit.pp 2017-01-26 16:= 25:29.327339282 -0500 +@@ -3779,7 +3779,7 @@ + Values[KeyName]:=3DName; + Values[KeyVersion]:=3DVersion; + // TODO Generate checksum based on PPUs +- InstalledChecksum:=3DDateTimeToFileDate(Now); ++ InstalledChecksum:=3D0; + Values[KeyChecksum]:=3DIntToStr(InstalledChecksum); + Values[KeyCPU]:=3DCPUToString(ACPU); + Values[KeyOS]:=3DOSToString(AOS); +diff -ur fpcbuild-3.0.0.old/fpcsrc/utils/fpcmkcfg/fpcmkcfg.pp fpcbuild-3.0= .0/fpcsrc/utils/fpcmkcfg/fpcmkcfg.pp +--- fpcbuild-3.0.0.old/fpcsrc/utils/fpcmkcfg/fpcmkcfg.pp 2013-06-01 18:27:= 16.000000000 -0400 ++++ fpcbuild-3.0.0/fpcsrc/utils/fpcmkcfg/fpcmkcfg.pp 2017-01-26 16:24:22.9= 49044903 -0500 +@@ -234,8 +234,8 @@ + TemplateParser.Values['FPCTARGETOS'] :=3D BuildOSTarget; + TemplateParser.Values['FPCBIN'] :=3D 'fpc'; + TemplateParser.Values['PWD'] :=3D GetCurrentDir; +- TemplateParser.Values['BUILDDATE'] :=3D DateToStr(Date); +- TemplateParser.Values['BUILDTIME'] :=3D TimeToStr(Time); ++ TemplateParser.Values['BUILDDATE'] :=3D ''; ++ TemplateParser.Values['BUILDTIME'] :=3D ''; +=20 + TemplateParser.Values['LOCALREPOSITORY'] :=3D GetDefaultLocalRepository; + TemplateParser.Values['LOCALBASEPATH'] :=3D GetDefaultLocalBasepath; +diff -ur fpcbuild-3.0.0.old/install/man/Makefile fpcbuild-3.0.0/install/ma= n/Makefile +--- fpcbuild-3.0.0.old/install/man/Makefile 2011-06-19 14:40:37.000000000 = -0400 ++++ fpcbuild-3.0.0/install/man/Makefile 2017-01-26 16:25:55.024227566 -0500 +@@ -31,5 +31,5 @@ + $(GINSTALL) -d -m 755 $(INSTALL_MANDIR)/man5 + $(GINSTALL) -c -m 644 man1/*.1 $(INSTALL_MANDIR)/man1 + $(GINSTALL) -c -m 644 man5/*.5 $(INSTALL_MANDIR)/man5 +- find man1/*.1 -exec gzip -9f $(INSTALL_MANDIR)/'{}' \; +- find man5/*.5 -exec gzip -9f $(INSTALL_MANDIR)/'{}' \; ++ find man1/*.1 -exec gzip -9fn $(INSTALL_MANDIR)/'{}' \; ++ find man5/*.5 -exec gzip -9fn $(INSTALL_MANDIR)/'{}' \; =2D-=20 2.11.0 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEg7ZwOtzKO2lLzi2m5qXuPBlGeg0FAliK4esACgkQ5qXuPBlG eg077xAAjzs3qZhxXut7osqWR/q3Q1r1Gc0HNsQSdZZIGRT30ArWHaEdopYqlxw5 hZ+tiVbxSV5M10iRxjIj0eNNwR/HBl7tKABdR171E1H/J3kyairdWiRlDJk+SnAf 9RKfjlwy1ukrdqdto2zgTHq4fgeM4vxPzkYPE/dZdbgOf2p7eP6Ll5RGGbp5D60j nWckvuVYqNTyH7Gtc4gam9/stYZZvrLE6sNKSMQZ8f2INJy+CblJR/Gd1KnL/G3E i68zn3pttIzxoJbOkgT0dYV3cZw/AH+c813Dms0Sb4oHjnbu5wIJGiSvfxOQ/89v CSSI2eJD00p5Z7FTWmSWmiCRy0hXOtXzWYorrOpERptuhClW4gC4ORO5McEg9TxZ JsmYdorKKL+fwJs9BBfQ98BGUJLXIIg6UUHfSno1TRky2t7r4DgV5sYFMYZhS8/P 6waoa/fTo0t74rFHGBvKioYrvrsJ3tLYoJkxgrW/U7WSkESv1QZBaefRYD3Kfa2Y CSXDg9YmSoPMCAH8CPreVhhZSv94+sv7Ls8U4P8/RqOiXLAFH62ht7h00eq3gOf6 zI81KCO+odSjsgV2V5CDrwhe4DT7mSgl/y0uscxqcb6iNFyi5MueWX9MAz7lGpMr yDsauVbYB2ZI73soiYntyPfhOr6ww7sgy0+9Dn9PTnhyWPVCFTY= =HyUN -----END PGP SIGNATURE----- --==-=-=--