GNU bug report logs - #71862
[PATCH] gnu: Add pharo.

Previous Next

Package: guix-patches;

Reported by: Jorge Acereda <jacereda <at> gmail.com>

Date: Sun, 30 Jun 2024 18:55:01 UTC

Severity: normal

Tags: patch

To reply to this bug, email your comments to 71862 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#71862; Package guix-patches. (Sun, 30 Jun 2024 18:55:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jorge Acereda <jacereda <at> gmail.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sun, 30 Jun 2024 18:55:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jorge Acereda <jacereda <at> gmail.com>
To: guix-patches <at> gnu.org
Cc: Jorge Acereda <jacereda <at> gmail.com>
Subject: [PATCH] gnu: Add pharo.
Date: Sun, 30 Jun 2024 20:53:33 +0200
I didn't realize there's already an ongoing issue (69918) by Daniel
Ziltener, but I had a 10.2.1 version floating around and I've updated
it to 0.13.0. I won't have much time to work on this for a while, so
anyone, feel free to grab bits if this isn't in good shape and
resubmit.

To test the VM, download a suitable image and run with:

pharo <image-path> --interactive

Thanks,
  Jorge Acereda


* gnu/packages/patches/pharo-install.patch (pharo): New variable.

Change-Id: I1618103786c6e1a8a5df924d1b1b1dea22db80cd
---
 gnu/packages/patches/pharo-install.patch | 81 ++++++++++++++++++++++++
 gnu/packages/smalltalk.scm               | 67 ++++++++++++++++++++
 2 files changed, 148 insertions(+)
 create mode 100644 gnu/packages/patches/pharo-install.patch

diff --git a/gnu/packages/patches/pharo-install.patch b/gnu/packages/patches/pharo-install.patch
new file mode 100644
index 0000000000..cc9ce44780
--- /dev/null
+++ b/gnu/packages/patches/pharo-install.patch
@@ -0,0 +1,81 @@
+This patch just tweaks the cmake scripts to simplify the packaging.
+Probably not worth contributing.
+
+
+diff --git a/cmake/Linux.cmake b/cmake/Linux.cmake
+index 0b6b9d7c4..cedc1b743 100644
+--- a/cmake/Linux.cmake
++++ b/cmake/Linux.cmake
+@@ -1,4 +1,3 @@
+-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wl,-rpath=.")
+ set(PHARO_BIN_LOCATION "default" CACHE STRING "The default location of the PHARO bin, used by the launch.sh.in")
+
+ if(${PHARO_BIN_LOCATION} STREQUAL "default")
+@@ -60,36 +59,29 @@ endmacro()
+
+
+ macro(configure_installables INSTALL_COMPONENT)
+-    set(CMAKE_INSTALL_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/build/dist")
+-    configure_file(${CMAKE_CURRENT_SOURCE_DIR}/packaging/linux/launch.sh.in
+-        ${CMAKE_CURRENT_BINARY_DIR}/build/packaging/linux/${VM_EXECUTABLE_NAME} @ONLY)
+-    configure_file(${CMAKE_CURRENT_SOURCE_DIR}/packaging/linux/bin/launch.sh.in
+-        ${CMAKE_CURRENT_BINARY_DIR}/build/packaging/linux/bin/${VM_EXECUTABLE_NAME} @ONLY)
+-
+-
+     install(
+-      DIRECTORY "${CMAKE_BINARY_DIR}/build/packaging/linux/"
+-      DESTINATION "./"
++      DIRECTORY "${CMAKE_BINARY_DIR}/build/vm/"
++      DESTINATION "bin"
+       USE_SOURCE_PERMISSIONS
+-      COMPONENT ${INSTALL_COMPONENT})
++      COMPONENT ${INSTALL_COMPONENT}
++      FILES_MATCHING PATTERN pharo)
+     install(
+       DIRECTORY "${CMAKE_BINARY_DIR}/build/vm/"
+       DESTINATION "lib"
+       USE_SOURCE_PERMISSIONS
+-      COMPONENT ${INSTALL_COMPONENT})
+-	install(
+-		DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/build/libffi/install/lib/"
+-		DESTINATION "lib"
+-		USE_SOURCE_PERMISSIONS
+-		COMPONENT ${INSTALL_COMPONENT}
+-		FILES_MATCHING PATTERN ${DYLIB_EXT})
+-
+-
+-	install(
+-	    DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/extracted/vm/include/unix/"
+-	    DESTINATION include/pharovm
+-	    COMPONENT include
+-	    FILES_MATCHING PATTERN *.h)
++      COMPONENT ${INSTALL_COMPONENT}
++      FILES_MATCHING PATTERN *.so)
++    install(
++      DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/build/libffi/install/lib/"
++      DESTINATION "lib"
++      USE_SOURCE_PERMISSIONS
++      COMPONENT ${INSTALL_COMPONENT}
++      FILES_MATCHING PATTERN ${DYLIB_EXT})
++    install(
++        DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/extracted/vm/include/unix/"
++        DESTINATION include/pharovm
++        COMPONENT include
++        FILES_MATCHING PATTERN *.h)
+ endmacro()
+
+ macro(add_required_libs_per_platform)
+diff --git a/macros.cmake b/macros.cmake
+index 811e49687..53bb9133b 100644
+--- a/macros.cmake
++++ b/macros.cmake
+@@ -14,9 +14,6 @@ endmacro()
+
+ # Include a loose-dependency library in the project, but do not link it to the main library
+ macro(addIndependentLibraryWithRPATH NAME)
+-    SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
+-    set(CMAKE_INSTALL_RPATH ${PHARO_LIBRARY_PATH})
+-
+     add_library(${NAME} SHARED ${ARGN})
+     set_target_properties(${NAME} PROPERTIES MACOSX_RPATH ON)
+     set_target_properties(${NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_DIRECTORY})
diff --git a/gnu/packages/smalltalk.scm b/gnu/packages/smalltalk.scm
index 64146813d1..49b93963d6 100644
--- a/gnu/packages/smalltalk.scm
+++ b/gnu/packages/smalltalk.scm
@@ -5,6 +5,7 @@
 ;;; Copyright © 2016 Ludovic Courtès <ludo <at> gnu.org>
 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me <at> tobias.gr>
 ;;; Copyright © 2021 Maxime Devos <maximedevos <at> telenet.be>
+;;; Copyright © 2024 Jorge Acereda <jacereda <at> gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -27,23 +28,89 @@ (define-module (gnu packages smalltalk)
   #:use-module (guix download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
+  #:use-module (guix gexp)
   #:use-module (gnu packages)
   #:use-module (gnu packages assembly)
   #:use-module (gnu packages audio)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages base)
+  #:use-module (gnu packages bash)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages fontutils)
   #:use-module (gnu packages gl)
   #:use-module (gnu packages glib)
+  #:use-module (gnu packages gtk)
+  #: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 sdl)
+  #:use-module (gnu packages tls)
+  #:use-module (gnu packages version-control)
+  #:use-module (gnu packages xdisorg)
   #:use-module (gnu packages xorg))

+(define-public pharo
+  (package
+    (name "pharo")
+    (version "10.3.0-ce15171")
+    (synopsis "Clean and innovative Smalltalk-inspired environment")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://files.pharo.org/vm/pharo-spur64-headless/"
+             "Linux-x86_64/source/PharoVM-" version
+             "-Linux-x86_64-c-src.tar.gz"))
+       (sha256
+        (base32 "07pkxn0pl3mkbjcfskw94xc8vs74l5lmbslj57xlq6vpz1207ab0"))
+       (patches (search-patches "./pharo-install.patch"))))
+    (build-system cmake-build-system)
+    (inputs (list bash-minimal
+                  cairo
+                  freetype
+                  libffi
+                  libgit2
+                  libpng
+                  openssl
+                  pixman
+                  sdl2))
+    (home-page "https://pharo.org")
+    (arguments
+     (list
+      #:configure-flags #~(list "-DGENERATED_SOURCE_DIR=."
+                                "-DALWAYS_INTERACTIVE=ON"
+                                "-DBUILD_IS_RELEASE=ON"
+                                "-DGENERATE_SOURCES=OFF"
+                                "-DBUILD_BUNDLE=OFF"
+                                "-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON"
+                                (string-append "-DCMAKE_BUILD_RPATH="
+                                               #$output "/lib")
+                                (string-append "-DPHARO_BIN_LOCATION="
+                                               #$output "/bin")
+                                (string-append "-DPHARO_LIBRARY_PATH="
+                                               #$output "/lib"))
+      #:phases #~(modify-phases %standard-phases
+                   (add-after 'install 'wrapper
+                     (lambda* (#:key inputs outputs #:allow-other-keys)
+                       (wrap-program (string-append (assoc-ref outputs "out")
+                                                    "/bin/pharo")
+                         `("LD_LIBRARY_PATH" ":" prefix
+                           ,(map (lambda (name)
+                                   (string-append (assoc-ref inputs name)
+                                                  "/lib"))
+                                 '("sdl2" "libgit2" "freetype" "cairo"
+                                   "pixman")))))))
+      #:tests? #f))
+    (description
+     "Pharo's goal is to deliver a clean, innovative, free open-source
+Smalltalk-inspired environment.  By providing a stable and small core
+system, excellent dev tools, and maintained releases, Pharo is an
+attractive platform to build and deploy mission critical applications.")
+    (license license:expat)))
+
 (define-public smalltalk
   (package
     (name "smalltalk")

base-commit: f3689976da3d23b0a73cf1733da04add5e1035ee
prerequisite-patch-id: 5fde795662902a8e1c89f32da3570827179fa814
--
2.45.2




Information forwarded to guix-patches <at> gnu.org:
bug#71862; Package guix-patches. (Sun, 30 Jun 2024 18:57:02 GMT) Full text and rfc822 format available.

Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jorge Acereda <jacereda <at> gmail.com>
To: guix-patches <at> gnu.org
Subject: Re: [PATCH] gnu: Add pharo.
Date: Sun, 30 Jun 2024 21:06:11 +0200
On Sun, Jun 30, 2024 at 8:54 PM Jorge Acereda <jacereda <at> gmail.com> wrote:
> I had a 10.2.1 version floating around and I've updated it to 0.13.0
I mean 10.3.0.




This bug report was last modified 109 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.