Skip to content

Commit 13a76e3

Browse files
committed
pharo-vm10: Import pharo-vm 10.0.1 as wip/pharo-vm10
This is the branch of the Headless VM used for Pharo. This branch has the modifications required to run Pharo in a true headless environment. The image running on the VM is responsible of handling the UI and the events. The image includes a default implementation of the handling of UI through the use of SDL2. For more details about the whole Pharo VM project refer to our wiki. This is a fork of OpenSmalltalk-vm. We are doing our best to keep compatibility and contribute back, as long as it fits the objective of Pharo community.
1 parent 83757b6 commit 13a76e3

12 files changed

+276
-0
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3126,6 +3126,7 @@ SUBDIR+= phantomjs
31263126
SUBDIR+= phantomjs2
31273127
SUBDIR+= pharo
31283128
SUBDIR+= pharo-vm
3129+
SUBDIR+= pharo-vm10
31293130
SUBDIR+= pharo10
31303131
SUBDIR+= pheanstalk
31313132
SUBDIR+= phonon-backend-xine

pharo-vm10/DESCR

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
This is the branch of the Headless VM used for Pharo. This branch has
2+
the modifications required to run Pharo in a true headless
3+
environment. The image running on the VM is responsible of handling
4+
the UI and the events.
5+
6+
The image includes a default implementation of the handling of UI
7+
through the use of SDL2.
8+
9+
For more details about the whole Pharo VM project refer to our wiki.
10+
11+
This is a fork of OpenSmalltalk-vm. We are doing our best to keep
12+
compatibility and contribute back, as long as it fits the objective of
13+
Pharo community.

pharo-vm10/Makefile

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# $NetBSD$
2+
3+
PHAROVM_VER= 10.0.1
4+
PHAROVM_HASH= f928dd9
5+
6+
DISTNAME= PharoVM-${PHAROVM_VER}-${PHAROVM_HASH}-Linux-x86_64-c-src
7+
PKGNAME= pharo-vm-${PHAROVM_VER}
8+
CATEGORIES= lang
9+
MASTER_SITES= http://files.pharo.org/vm/pharo-spur64-headless/Linux-x86_64/source/
10+
EXTRACT_SUFX= .zip
11+
12+
MAINTAINER= [email protected]
13+
HOMEPAGE= https://pharo.org/
14+
COMMENT= VM used by Pharo
15+
LICENSE= mit
16+
17+
ONLY_FOR_PLATFORM= NetBSD-[0-9]*-x86_64
18+
19+
WRKSRC= ${WRKDIR}/pharo-vm
20+
USE_LANGUAGES= c c++
21+
USE_CMAKE= yes
22+
23+
CMAKE_ARGS+= -DFLAVOUR=CoInterpreter
24+
CMAKE_ARGS+= -DALWAYS_INTERACTIVE=1
25+
CMAKE_ARGS+= -DGENERATE_SOURCES=OFF
26+
CMAKE_ARGS+= -DPHARO_BIN_LOCATION=${PREFIX}/lib/pharo
27+
28+
SUBST_CLASSES+= fix-paths
29+
SUBST_STAGE.fix-paths= pre-build
30+
SUBST_MESSAGE.fix-paths= Fixing absolute paths.
31+
SUBST_FILES.fix-paths= packaging/linux/bin/launch.sh.in
32+
SUBST_SED.fix-paths= -e "s,@pkglibdir@,${PREFIX}/lib,g"
33+
34+
NOT_PAX_MPROTECT_SAFE+= lib/pharo/pharo
35+
36+
INSTALLATION_DIRS= bin lib/pharo
37+
38+
pre-configure:
39+
${CP} ${WRKSRC}/cmake/OpenBSD.cmake ${WRKSRC}/cmake/NetBSD.cmake
40+
41+
do-install:
42+
cd ${WRKSRC}/build/packaging/linux/bin && \
43+
${INSTALL_SCRIPT} pharo ${DESTDIR}${PREFIX}/bin
44+
cd ${WRKSRC}/build/vm/ && \
45+
${INSTALL_PROGRAM} pharo ${DESTDIR}${PREFIX}/lib/pharo
46+
cd ${WRKSRC}/build/vm/ && find . -type f -name "*.so" | while read file; do \
47+
${INSTALL_LIB} $$file ${DESTDIR}${PREFIX}/lib/pharo; \
48+
done
49+
50+
.include "../../devel/SDL2/buildlink3.mk"
51+
.include "../../devel/libffi/buildlink3.mk"
52+
.include "../../devel/libgit2/buildlink3.mk"
53+
.include "../../graphics/cairo/buildlink3.mk"
54+
.include "../../graphics/freetype2/buildlink3.mk"
55+
.include "../../security/openssl/buildlink3.mk"
56+
57+
.include "../../mk/bsd.pkg.mk"

pharo-vm10/PLIST

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
@comment $NetBSD$
2+
bin/pharo
3+
lib/pharo/libB2DPlugin.so
4+
lib/pharo/libBitBltPlugin.so
5+
lib/pharo/libDSAPrims.so
6+
lib/pharo/libFileAttributesPlugin.so
7+
lib/pharo/libFilePlugin.so
8+
lib/pharo/libFloatArrayPlugin.so
9+
lib/pharo/libJPEGReadWriter2Plugin.so
10+
lib/pharo/libJPEGReaderPlugin.so
11+
lib/pharo/libLargeIntegers.so
12+
lib/pharo/libLocalePlugin.so
13+
lib/pharo/libMiscPrimitivePlugin.so
14+
lib/pharo/libPharoVMCore.so
15+
lib/pharo/libSocketPlugin.so
16+
lib/pharo/libSqueakSSL.so
17+
lib/pharo/libSurfacePlugin.so
18+
lib/pharo/libTestLibrary.so
19+
lib/pharo/libUUIDPlugin.so
20+
lib/pharo/libUnixOSProcessPlugin.so
21+
lib/pharo/pharo

pharo-vm10/distinfo

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
$NetBSD$
2+
3+
BLAKE2s (PharoVM-10.0.1-f928dd9-Linux-x86_64-c-src.zip) = cb5a2fd01278f3c54ff0378ab435a385955e4057062e40aa542494cf358bec80
4+
SHA512 (PharoVM-10.0.1-f928dd9-Linux-x86_64-c-src.zip) = cd1b8975bc5f31f2831b0afce8d8829ad2e708bb3e9c21d0e13203aee0c2a8922f1f7416f243d2e21921c1733d5331c996a656af504f2feb47e227e3c543d0f4
5+
Size (PharoVM-10.0.1-f928dd9-Linux-x86_64-c-src.zip) = 4019205 bytes
6+
SHA1 (patch-CMakeLists.txt) = 533049079f0d8db0584c8ba590150436cdc84a95
7+
SHA1 (patch-cmake_importCairo.cmake) = 0e90fbbcdebb4b0aa994be74737fa7d6462e253c
8+
SHA1 (patch-include_pharovm_debug.h) = a806f34f443b0d7907983d0d4f20fc121b7dfb65
9+
SHA1 (patch-packaging_linux_bin_launch.sh.in) = 116b5151e0bd58558a1af3691d1f546437d94eae
10+
SHA1 (patch-plugins.cmake) = b8eb5ad47d505c0b52a7601f86109cf8f6ccae40
11+
SHA1 (patch-plugins_UUIDPlugin_common_UUIDPlugin.c) = ebed390cdfd0817c3d2e5fa5f1642d6a7226d10e
12+
SHA1 (patch-src_debugUnix.c) = 68f2c801cda9ba010134d778f8b32060d2bc9d8a
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
$NetBSD$
2+
3+
- define NETBSD
4+
- backtrace(3) requires libexecinfo
5+
- use uuidgen(2)
6+
7+
--- CMakeLists.txt.orig 2023-03-10 09:04:12.000000000 +0000
8+
+++ CMakeLists.txt
9+
@@ -266,6 +266,9 @@ elseif(UNIX)
10+
elseif(${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD")
11+
set(OPENBSD 1)
12+
set(VM_TARGET_OS "openbsd")
13+
+ elseif(${CMAKE_SYSTEM_NAME} MATCHES "NetBSD")
14+
+ set(NETBSD 1)
15+
+ set(VM_TARGET_OS "netbsd")
16+
else()
17+
set(VM_TARGET_OS "${CMAKE_SYSTEM_NAME}")
18+
endif()
19+
@@ -415,13 +418,14 @@ check_include_files(dlfcn.h HAVE_DLFCN_H
20+
check_library_exists(dl dlopen "" HAVE_LIBDL)
21+
check_library_exists(dyld dlopen "" HAVE_DYLD)
22+
check_struct_has_member("struct tm" tm_gmtoff time.h HAVE_TM_GMTOFF)
23+
+check_library_exists(execinfo backtrace "" HAVE_EXECINFO)
24+
25+
#Required by the UUID Plugin
26+
27+
check_include_files(sys/uuid.h HAVE_SYS_UUID_H)
28+
check_include_files(uuid/uuid.h HAVE_UUID_UUID_H)
29+
check_include_files(uuid.h HAVE_UUID_H)
30+
-check_library_exists(uuid uuidgen "" HAVE_UUIDGEN)
31+
+check_function_exists(uuidgen HAVE_UUIDGEN)
32+
check_library_exists(uuid uuid_generate "" HAVE_UUID_GENERATE)
33+
34+
35+
@@ -499,6 +503,10 @@ set(VM_SOURCES
36+
add_executable(${VM_EXECUTABLE_NAME} ${VM_FRONTEND_APPLICATION_TYPE} ${VM_FRONTEND_SOURCES})
37+
addLibraryWithRPATH(${VM_LIBRARY_NAME} ${VM_SOURCES})
38+
39+
+if(${HAVE_EXECINFO})
40+
+ target_link_libraries(${VM_LIBRARY_NAME} execinfo)
41+
+endif()
42+
+
43+
#
44+
# LibFFI
45+
#
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
$NetBSD$
2+
3+
use system library
4+
5+
--- cmake/importCairo.cmake.orig 2022-12-25 04:16:41.697240255 +0000
6+
+++ cmake/importCairo.cmake
7+
@@ -22,6 +22,8 @@ if (BUILD_BUNDLE)
8+
add_third_party_dependency("cairo-1.17.4")
9+
add_third_party_dependency("libpng-1.6.37")
10+
endif()
11+
+ elseif(NETBSD)
12+
+ # use system library
13+
else() #Linux
14+
If(${CMAKE_SYSTEM_PROCESSOR} MATCHES "armv7l" OR (${CMAKE_SYSTEM_PROCESSOR} MATCHES "aarch64"))
15+
add_third_party_dependency("pixman-0.40.0")
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
$NetBSD$
2+
3+
Need stdarg.h for va_list
4+
5+
--- include/pharovm/debug.h.orig 2023-03-18 09:15:22.487573163 +0000
6+
+++ include/pharovm/debug.h
7+
@@ -49,6 +49,7 @@ void error(char* aMessage);
8+
9+
10+
#include <stdio.h>
11+
+#include <stdarg.h>
12+
13+
int vm_printf(const char * format, ... );
14+
void vm_setVMOutputStream(FILE * stream);
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
$NetBSD$
2+
3+
Add pkglibdir to LD_LIBRARY_PATH
4+
5+
--- packaging/linux/bin/launch.sh.in.orig 2021-08-13 21:08:15.000000000 +0000
6+
+++ packaging/linux/bin/launch.sh.in
7+
@@ -18,8 +18,8 @@ case "$BIN" in
8+
*) PLUGINS="`pwd`/$BIN"
9+
esac
10+
11+
-if [ $(uname -s) = "OpenBSD" ]; then
12+
- LD_LIBRARY_PATH="$PLUGINS:${LD_LIBRARY_PATH}" exec $GDB "$BIN/@VM_EXECUTABLE_NAME@" "$@"
13+
+if [ $(uname -s) = "OpenBSD" -o $(uname -s) = "NetBSD" ]; then
14+
+ LD_LIBRARY_PATH="$PLUGINS:@pkglibdir@:${LD_LIBRARY_PATH}" exec $GDB "$BIN/@VM_EXECUTABLE_NAME@" "$@"
15+
fi
16+
17+
# On some linuxes there multiple versions of the C library. If the image uses
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
$NetBSD$
2+
3+
use uuidgen(2)
4+
5+
--- plugins.cmake.orig 2021-08-13 21:08:15.000000000 +0000
6+
+++ plugins.cmake
7+
@@ -77,7 +77,7 @@ if(NOT OPENBSD)
8+
addLibraryWithRPATH(UUIDPlugin ${UUIDPlugin_SOURCES})
9+
if(WIN)
10+
target_link_libraries(UUIDPlugin PRIVATE "-lole32")
11+
- elseif(UNIX AND NOT OSX)
12+
+ elseif(UNIX AND NOT OSX AND HAVE_UUID_GENENATE)
13+
#find_path(LIB_UUID_INCLUDE_DIR uuid.h PATH_SUFFIXES uuid)
14+
find_library(LIB_UUID_LIBRARY uuid)
15+
message(STATUS "Using uuid library:" ${LIB_UUID_LIBRARY})

0 commit comments

Comments
 (0)