diff mbox series

[bug#69918] gnu: smalltalk: add pharo-vm 10.1.1.

Message ID 163fe58d525795ccdb3f24960655f036@lyrion.ch
State New
Headers show
Series [bug#69918] gnu: smalltalk: add pharo-vm 10.1.1. | expand

Commit Message

Daniel Ziltener March 20, 2024, 3:36 p.m. UTC
---
 gnu/packages/smalltalk.scm | 66 +++++++++++++++++++++++++++++++++++++-
 1 file changed, 65 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/gnu/packages/smalltalk.scm b/gnu/packages/smalltalk.scm
index 64146813d1..60e0cc5778 100644
--- a/gnu/packages/smalltalk.scm
+++ b/gnu/packages/smalltalk.scm
@@ -5,6 +5,7 @@ 
 ;;; Copyright © 2016 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
+;;; Copyright © 2024 Daniel Ziltener <dziltener@lyrion.ch>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -36,13 +37,16 @@  (define-module (gnu packages smalltalk)
   #:use-module (gnu packages fontutils)
   #:use-module (gnu packages gl)
   #:use-module (gnu packages glib)
+  #:use-module (gnu packages image)
   #:use-module (gnu packages libffi)
   #:use-module (gnu packages libsigsegv)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages multiprecision)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages pulseaudio)
-  #:use-module (gnu packages xorg))
+  #:use-module (gnu packages version-control)
+  #:use-module (gnu packages xorg)
+  #:use-module (gnu packages xdisorg))
 
 (define-public smalltalk
   (package
@@ -184,3 +188,63 @@  (define-public squeak-vm
 interactively extensible Web sites.")
     (home-page "http://squeakvm.org/")
     (license license:x11)))
+
+(define-public pharo-vm
+  (package
+   (name "pharo-vm")
+   (version "10.1.1")
+   (source
+    (origin
+     (method url-fetch)
+     (uri (string-append "http://files.pharo.org/vm/pharo-spur64-headless/Linux-x86_64/source/PharoVM-" version "-32b2be5-Linux-x86_64-c-src.tar.gz"))
+     (sha256
+      (base32
+       "1hbkvfrw57sz5nw48z64789yjcry9l1am4hmkndy9dd6i06n2c2n"))))
+   (build-system cmake-build-system)
+   (arguments
+    (list
+     #:configure-flags
+      #~(list
+         (string-append "-DPHARO_LIBRARY_PATH="
+                        (assoc-ref %outputs "out") "/lib")
+         "-DGENERATED_SOURCE_DIR=."
+         "-DALWAYS_INTERACTIVE=on"
+         "-DBUILD_IS_RELEASE=on"
+         "-DGENERATE_SOURCES=off"
+         "-DBUILD_BUNDLE=off")
+      #:phases
+      #~(modify-phases %standard-phases
+          (delete 'check)
+          (delete 'validate-runpath)
+          (add-after 'install 'really-install
+            (lambda _
+              (let ((bin (string-append #$output "/bin"))
+                    (lib (string-append #$output "/lib")))
+                (mkdir-p bin)
+                (mkdir-p lib)
+                (copy-recursively "./build/vm/pharo"
+                                  (string-append bin "/pharo"))
+                (for-each (lambda (file)
+                            (let ((inode (string-append "./build/vm/" file)))
+                              (copy-recursively
+                               inode
+                               (string-append lib "/" file))))
+                          (with-directory-excursion
+                              "./build/vm"
+                            (find-files "."
+                                        (lambda (file stat)
+                                          (string-contains file ".so")))))
+                (wrap-program (string-append bin "/pharo")
+                  `("LD_LIBRARY_PATH" prefix (,lib)))))))))
+   (inputs
+    (list libffi
+          libgit2
+          cairo
+          freetype
+          pixman
+          libpng
+          util-linux))
+   (synopsis "This is the VM used by Pharo")
+   (home-page "https://www.pharo.org")
+   (description "This is the VM used by Pharo.")
+   (license license:expat)))