summary refs log tree commit diff
path: root/gnu/packages/pascal.scm
diff options
context:
space:
mode:
authorEfraim Flashner <efraim@flashner.co.il>2023-12-15 15:38:24 +0200
committerEfraim Flashner <efraim@flashner.co.il>2023-12-16 18:05:58 +0200
commit2b501ed7305da10005fddec8a9538b48b14ba04b (patch)
treef21412a329cf1024ff72be134c78d4edfcace4b6 /gnu/packages/pascal.scm
parent1954a1e33de4bb4be7f91393fd4842b37f6a4f52 (diff)
downloadguix-2b501ed7305da10005fddec8a9538b48b14ba04b.tar.gz
gnu: fpc: Add support for powerpc-linux.
* gnu/packages/pascal.scm (fpc-bootstrap-powerpc): New variable.
(fpc)[arguments]: Add cases for powerpc-linux.
[native-inputs]: Add case for fpc-binary for powerpc-linux.

Change-Id: I0d4d9dda9d4c8f70ff20031ab94f1dc439df88e2
Diffstat (limited to 'gnu/packages/pascal.scm')
-rw-r--r--gnu/packages/pascal.scm31
1 files changed, 21 insertions, 10 deletions
diff --git a/gnu/packages/pascal.scm b/gnu/packages/pascal.scm
index c6ae1bf3dd..89a1734e38 100644
--- a/gnu/packages/pascal.scm
+++ b/gnu/packages/pascal.scm
@@ -56,6 +56,15 @@
      (base32
       "0n4r85dsr86zlk7r4hbd4nj14sda6rwgdgzxg4gj4q981fn80agn"))))
 
+(define fpc-bootstrap-powerpc
+  (origin
+    (method url-fetch)
+    (uri (string-append "mirror://sourceforge/freepascal/Linux/"
+                        %fpc-version "/fpc-" %fpc-version ".powerpc-linux.tar"))
+    (sha256
+     (base32
+      "1zhdypm99bzs5706g4nxwajiadv82jwd87cr300lrivy1rzj5h4a"))))
+
 (define fpc-bootstrap-x86_64
   (origin
     (method url-fetch)
@@ -92,7 +101,7 @@
                   (rename-file "install-man" "install/man")
                   (delete-file "fpcsrc/tests/utils/dosbox/exitcode.exe")))))
     (build-system gnu-build-system)
-    (supported-systems '("i686-linux" "x86_64-linux"))
+    (supported-systems '("i686-linux" "x86_64-linux" "powerpc-linux"))
     (inputs
      (list expat glibc ncurses zlib))
     (native-inputs
@@ -101,7 +110,7 @@
                                  (%current-system))
                        ("i686-linux" fpc-bootstrap-i386)
                        ;;("powerpc64le-linux" fpc-bootstrap-ppc64le)
-                       ;;("powerpc-linux" fpc-bootstrap-ppc)
+                       ("powerpc-linux" fpc-bootstrap-powerpc)
                        ("x86_64-linux" fpc-bootstrap-x86_64)
                        ;; XXX: Wrong, but innocuous so long
                        ;; `supported-systems' is kept in sync.
@@ -111,11 +120,11 @@
        #:phases
        (let ((fpc-bootstrap-path
               (string-append (getcwd) "/" ,name "-" ,version "/fpc-bin"))
-             (arch ,(match (or (%current-target-system)
-                               (%current-system))
-                     ("i686-linux" "i386")
-                     ("x86_64-linux" "x86_64")
-                     (_ "unknown"))))
+             (arch ,(cond
+                      ((target-x86-32?) "i386")
+                      ((target-ppc32?) "powerpc")
+                      ((target-x86-64?) "x86_64")
+                      (else "unknown"))))
          (modify-phases %standard-phases
            (add-after 'unpack 'unpack-bin
              (lambda* (#:key inputs #:allow-other-keys)
@@ -199,9 +208,11 @@
              (lambda* (#:key outputs #:allow-other-keys)
                (let* ((out (assoc-ref outputs "out"))
                      ;; This is the suffix of the ppc[arch] binary.
-                     (suffix (if (string= arch "x86_64")
-                                 "x64"
-                                 "386"))
+                     (suffix ,(cond
+                                ((target-x86-32?) "386")
+                                ((target-ppc32?) "ppc")
+                                ((target-x86-64?) "x64")
+                                (else "")))
                      (ppc (string-append "ppc" suffix)))
                  (invoke "make" "install" "NOGDB=1"
                          (string-append "INSTALL_PREFIX=" out))