summary refs log tree commit diff
path: root/pkgs/development/pharo/vm
diff options
context:
space:
mode:
authorDamien Cassou <damien.cassou@gmail.com>2014-08-05 15:37:56 +0200
committerRob Vermaas <rob.vermaas@gmail.com>2014-08-06 13:53:33 +0200
commit8efdaa0aa2486942f3bfe888a0cd13b67130b147 (patch)
tree02138bece8856aa5d8cbfde7daa486e710faf6e5 /pkgs/development/pharo/vm
parentb6e2a52b7255814891df1ea42a603f5c6db8ed1d (diff)
downloadnixpkgs-8efdaa0aa2486942f3bfe888a0cd13b67130b147.tar
nixpkgs-8efdaa0aa2486942f3bfe888a0cd13b67130b147.tar.gz
nixpkgs-8efdaa0aa2486942f3bfe888a0cd13b67130b147.tar.bz2
nixpkgs-8efdaa0aa2486942f3bfe888a0cd13b67130b147.tar.lz
nixpkgs-8efdaa0aa2486942f3bfe888a0cd13b67130b147.tar.xz
nixpkgs-8efdaa0aa2486942f3bfe888a0cd13b67130b147.tar.zst
nixpkgs-8efdaa0aa2486942f3bfe888a0cd13b67130b147.zip
Add the Pharo language and IDE package
http://pharo.org

I'm one of the developers of Pharo and the creator and maintainer of the
Ubuntu PPA : https://launchpad.net/~pharo/+archive/stable.
Diffstat (limited to 'pkgs/development/pharo/vm')
-rw-r--r--pkgs/development/pharo/vm/default.nix79
-rw-r--r--pkgs/development/pharo/vm/patches/fix-cmake-root-directory.patch84
-rw-r--r--pkgs/development/pharo/vm/patches/fix-executable-name.patch14
-rw-r--r--pkgs/development/pharo/vm/patches/pharo-is-not-squeak.patch23
-rw-r--r--pkgs/development/pharo/vm/resources/share/applications/pharo-vm.desktop11
-rw-r--r--pkgs/development/pharo/vm/resources/share/icons/hicolor/16x16/apps/pharo.pngbin0 -> 902 bytes
-rw-r--r--pkgs/development/pharo/vm/resources/share/icons/hicolor/256x256/apps/pharo.pngbin0 -> 52181 bytes
-rw-r--r--pkgs/development/pharo/vm/resources/share/icons/hicolor/32x32/apps/pharo.pngbin0 -> 2368 bytes
-rw-r--r--pkgs/development/pharo/vm/resources/share/icons/hicolor/48x48/apps/pharo.pngbin0 -> 4602 bytes
-rw-r--r--pkgs/development/pharo/vm/resources/share/mime/packages/pharo-image.xml9
10 files changed, 220 insertions, 0 deletions
diff --git a/pkgs/development/pharo/vm/default.nix b/pkgs/development/pharo/vm/default.nix
new file mode 100644
index 00000000000..939ff8ec750
--- /dev/null
+++ b/pkgs/development/pharo/vm/default.nix
@@ -0,0 +1,79 @@
+{ stdenv, fetchurl, cmake, bash, unzip, glibc, openssl, gcc, mesa, freetype, xlibs, alsaLib }:
+
+stdenv.mkDerivation rec {
+  name = "pharo-vm-core-i386-2014.06.25";
+  system = "x86_32-linux";
+  src = fetchurl {
+    url = http://files.pharo.org/vm/src/vm-unix-sources/pharo-vm-2014.06.25.tar.bz2;
+    md5 = "4d80d8169c2f2f0355c43ee90bbad23f";
+  };
+
+  sources10Zip = fetchurl {
+    url = http://files.pharo.org/sources/PharoV10.sources.zip;
+    md5 = "3476222a0345a6f8f8b6093b5e3b30fb";
+  };
+
+  sources20Zip = fetchurl {
+    url = http://files.pharo.org/sources/PharoV20.sources.zip;
+    md5 = "a145b0733f9d68d9ce6a76270b6b9ec8";
+  };
+
+  sources30Zip = fetchurl {
+    url = http://files.pharo.org/sources/PharoV30.sources.zip;
+    md5 = "bb0a66b8968ef7d0da97ec86331f68c8";
+  };
+
+  # Building
+  preConfigure = ''
+    cd build/
+  '';
+  resources = ./resources;
+  installPhase = ''
+    echo Current directory $(pwd)
+    echo Creating prefix "$prefix"
+    mkdir -p "$prefix/lib/pharo-vm"
+
+    cd ../../results
+
+    mv vm-display-null vm-display-null.so
+    mv vm-display-X11 vm-display-X11.so
+    mv vm-sound-null vm-sound-null.so
+    mv vm-sound-ALSA vm-sound-ALSA.so
+    mv pharo pharo-vm
+
+    cp * "$prefix/lib/pharo-vm"
+
+    cp -R "$resources"/* "$prefix/"
+
+    mkdir $prefix/bin
+
+    chmod u+w $prefix/bin
+    cat > $prefix/bin/pharo-vm-x <<EOF
+    #!${bash}/bin/bash
+
+    # disable parameter expansion to forward all arguments unprocessed to the VM
+    set -f
+
+    exec $prefix/lib/pharo-vm/pharo-vm "\$@"
+    EOF
+
+    cat > $prefix/bin/pharo-vm-nox <<EOF
+    #!${bash}/bin/bash
+
+    # disable parameter expansion to forward all arguments unprocessed to the VM
+    set -f
+
+    exec $prefix/lib/pharo-vm/pharo-vm -vm-display-null "\$@"
+    EOF
+
+    chmod +x $prefix/bin/pharo-vm-x $prefix/bin/pharo-vm-nox
+
+    unzip ${sources10Zip} -d $prefix/lib/pharo-vm/
+    unzip ${sources20Zip} -d $prefix/lib/pharo-vm/
+    unzip ${sources30Zip} -d $prefix/lib/pharo-vm/
+  '';
+
+  patches = [ patches/pharo-is-not-squeak.patch patches/fix-executable-name.patch patches/fix-cmake-root-directory.patch ];
+ 
+  buildInputs = [ bash unzip cmake glibc openssl gcc mesa freetype xlibs.libX11 xlibs.libICE xlibs.libSM alsaLib ];
+}
\ No newline at end of file
diff --git a/pkgs/development/pharo/vm/patches/fix-cmake-root-directory.patch b/pkgs/development/pharo/vm/patches/fix-cmake-root-directory.patch
new file mode 100644
index 00000000000..27cce4d6f4c
--- /dev/null
+++ b/pkgs/development/pharo/vm/patches/fix-cmake-root-directory.patch
@@ -0,0 +1,84 @@
+From: Damien Cassou <damien.cassou@gmail.com>
+Subject: Fix use of absolute paths in cmake files
+
+* build/directories.cmake
+* build/CMakeLists.txt
+* build/vm-sound-ALSA/CMakeLists.txt
+* build/vm-sound-null/CMakeLists.txt
+* build/vm-display-null/CMakeLists.txt
+* build/vm-display-X11/CMakeLists.txt
+--- a/build/CMakeLists.txt
++++ b/build/CMakeLists.txt
+@@ -71,7 +71,7 @@
+ list(APPEND LINKLIBS m)
+ list(APPEND LINKLIBS dl)
+ list(APPEND LINKLIBS pthread)
+-set(EXECUTABLE_OUTPUT_PATH "/builds/workspace/Pharo-vm-unix-sources/cog/results")
++set(EXECUTABLE_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/../results")
+ add_subdirectory("vm-display-null")
+ add_subdirectory("vm-display-X11")
+ add_subdirectory("vm-sound-ALSA")
+--- a/build/directories.cmake
++++ b/build/directories.cmake
+@@ -1,12 +1,12 @@
+-set(topDir "/builds/workspace/Pharo-vm-unix-sources/cog")
+-set(buildDir "/builds/workspace/Pharo-vm-unix-sources/cog/build")
++set(topDir "${CMAKE_SOURCE_DIR}/..")
++set(buildDir "${CMAKE_SOURCE_DIR}/../build")
+ set(thirdpartyDir "${buildDir}/thirdParty")
+-set(platformsDir "/builds/workspace/Pharo-vm-unix-sources/cog/platforms")
+-set(srcDir "/builds/workspace/Pharo-vm-unix-sources/cog/src")
++set(platformsDir "${CMAKE_SOURCE_DIR}/../platforms")
++set(srcDir "${CMAKE_SOURCE_DIR}/../src")
+ set(srcPluginsDir "${srcDir}/plugins")
+ set(srcVMDir "${srcDir}/vm")
+ set(platformName "unix")
+ set(targetPlatform ${platformsDir}/${platformName})
+ set(crossDir "${platformsDir}/Cross")
+ set(platformVMDir "${targetPlatform}/vm")
+-set(outputDir "/builds/workspace/Pharo-vm-unix-sources/cog/results")
++set(outputDir "${CMAKE_SOURCE_DIR}/../results")
+--- a/build/vm-display-X11/CMakeLists.txt
++++ b/build/vm-display-X11/CMakeLists.txt
+@@ -11,7 +11,7 @@
+ include_directories(${crossDir}/plugins/FilePlugin)
+ include_directories(${targetPlatform}/plugins/B3DAcceleratorPlugin)
+ include_directories(${crossDir}/plugins/B3DAcceleratorPlugin)
+-set(LIBRARY_OUTPUT_PATH "/builds/workspace/Pharo-vm-unix-sources/cog/results")
++set(LIBRARY_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/../results")
+ list(APPEND LINKLIBS SM)
+ list(APPEND LINKLIBS ICE)
+ list(APPEND LINKLIBS GL)
+--- a/build/vm-display-null/CMakeLists.txt
++++ b/build/vm-display-null/CMakeLists.txt
+@@ -11,7 +11,7 @@
+ include_directories(${crossDir}/plugins/FilePlugin)
+ include_directories(${targetPlatform}/plugins/B3DAcceleratorPlugin)
+ include_directories(${crossDir}/plugins/B3DAcceleratorPlugin)
+-set(LIBRARY_OUTPUT_PATH "/builds/workspace/Pharo-vm-unix-sources/cog/results")
++set(LIBRARY_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/../results")
+ target_link_libraries(vm-display-null ${LINKLIBS})
+ set_target_properties(vm-display-null PROPERTIES PREFIX "" SUFFIX "" 
+ 			LINK_FLAGS -m32)
+--- a/build/vm-sound-ALSA/CMakeLists.txt
++++ b/build/vm-sound-ALSA/CMakeLists.txt
+@@ -11,7 +11,7 @@
+ include_directories(${crossDir}/plugins/FilePlugin)
+ include_directories(${targetPlatform}/plugins/B3DAcceleratorPlugin)
+ include_directories(${crossDir}/plugins/B3DAcceleratorPlugin)
+-set(LIBRARY_OUTPUT_PATH "/builds/workspace/Pharo-vm-unix-sources/cog/results")
++set(LIBRARY_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/../results")
+ target_link_libraries(vm-sound-ALSA ${LINKLIBS})
+ set_target_properties(vm-sound-ALSA PROPERTIES PREFIX "" SUFFIX "" 
+ 			LINK_FLAGS -m32)
+--- a/build/vm-sound-null/CMakeLists.txt
++++ b/build/vm-sound-null/CMakeLists.txt
+@@ -11,7 +11,7 @@
+ include_directories(${crossDir}/plugins/FilePlugin)
+ include_directories(${targetPlatform}/plugins/B3DAcceleratorPlugin)
+ include_directories(${crossDir}/plugins/B3DAcceleratorPlugin)
+-set(LIBRARY_OUTPUT_PATH "/builds/workspace/Pharo-vm-unix-sources/cog/results")
++set(LIBRARY_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/../results")
+ target_link_libraries(vm-sound-null ${LINKLIBS})
+ set_target_properties(vm-sound-null PROPERTIES PREFIX "" SUFFIX "" 
+ 			LINK_FLAGS -m32)
diff --git a/pkgs/development/pharo/vm/patches/fix-executable-name.patch b/pkgs/development/pharo/vm/patches/fix-executable-name.patch
new file mode 100644
index 00000000000..b32ed7a32d2
--- /dev/null
+++ b/pkgs/development/pharo/vm/patches/fix-executable-name.patch
@@ -0,0 +1,14 @@
+Change the name of the executable file from Squeak to Pharo
+--- a/platforms/unix/vm-display-X11/sqUnixX11.c
++++ b/platforms/unix/vm-display-X11/sqUnixX11.c
+@@ -153,8 +153,8 @@
+ /*** Variables -- X11 Related ***/
+ 
+ /* name of Squeak windows in Xrm and the WM */
+-#define xResClass	"Squeak"
+-#define xResName	"squeak"
++#define xResClass	"pharo-vm"
++#define xResName	"Pharo"
+ 
+ char		*displayName= 0;	/* name of display, or 0 for $DISPLAY */
+ Display		*stDisplay= null;	/* Squeak display */
diff --git a/pkgs/development/pharo/vm/patches/pharo-is-not-squeak.patch b/pkgs/development/pharo/vm/patches/pharo-is-not-squeak.patch
new file mode 100644
index 00000000000..c06916c96ee
--- /dev/null
+++ b/pkgs/development/pharo/vm/patches/pharo-is-not-squeak.patch
@@ -0,0 +1,23 @@
+pharo --help must talk about Pharo and not about Squeak
+--- a/platforms/unix/vm-display-X11/sqUnixX11.c
++++ b/platforms/unix/vm-display-X11/sqUnixX11.c
+@@ -7075,8 +7075,8 @@
+   printf("  -lazy                 go to sleep when main window unmapped\n");
+   printf("  -mapdelbs             map Delete key onto Backspace\n");
+   printf("  -nointl               disable international keyboard support\n");
+-  printf("  -notitle              disable the Squeak window title bar\n");
+-  printf("  -title <t>            use t as the Squeak window title instead of the image name\n");
++  printf("  -notitle              disable the Pharo window title bar\n");
++  printf("  -title <t>            use t as the Pharo window title instead of the image name\n");
+   printf("  -ldtoms <n>           launch drop timeout milliseconds\n");
+   printf("  -noxdnd               disable X drag-and-drop protocol support\n");
+   printf("  -optmod <n>           map Mod<n> to the Option key\n");
+@@ -7095,7 +7095,7 @@
+ static void display_printUsageNotes(void)
+ {
+   printf("  Using `unix:0' for <dpy> may improve local display performance.\n");
+-  printf("  -xshm only works when Squeak is running on the X server host.\n");
++  printf("  -xshm only works when Pharo is running on the X server host.\n");
+ }
+ 
+ 
diff --git a/pkgs/development/pharo/vm/resources/share/applications/pharo-vm.desktop b/pkgs/development/pharo/vm/resources/share/applications/pharo-vm.desktop
new file mode 100644
index 00000000000..9061ec9b8e5
--- /dev/null
+++ b/pkgs/development/pharo/vm/resources/share/applications/pharo-vm.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Name=Pharo VM
+GenericName=Pharo Virtual Machine
+Exec=pharo-vm-x %F
+Icon=pharo
+Terminal=false
+Type=Application
+StartupNotify=false
+Categories=Development;
+MimeType=application/x-pharo-image;
+NoDisplay=true
diff --git a/pkgs/development/pharo/vm/resources/share/icons/hicolor/16x16/apps/pharo.png b/pkgs/development/pharo/vm/resources/share/icons/hicolor/16x16/apps/pharo.png
new file mode 100644
index 00000000000..7910e17ebc4
--- /dev/null
+++ b/pkgs/development/pharo/vm/resources/share/icons/hicolor/16x16/apps/pharo.png
Binary files differdiff --git a/pkgs/development/pharo/vm/resources/share/icons/hicolor/256x256/apps/pharo.png b/pkgs/development/pharo/vm/resources/share/icons/hicolor/256x256/apps/pharo.png
new file mode 100644
index 00000000000..f6e88141752
--- /dev/null
+++ b/pkgs/development/pharo/vm/resources/share/icons/hicolor/256x256/apps/pharo.png
Binary files differdiff --git a/pkgs/development/pharo/vm/resources/share/icons/hicolor/32x32/apps/pharo.png b/pkgs/development/pharo/vm/resources/share/icons/hicolor/32x32/apps/pharo.png
new file mode 100644
index 00000000000..ec8a5f95c6c
--- /dev/null
+++ b/pkgs/development/pharo/vm/resources/share/icons/hicolor/32x32/apps/pharo.png
Binary files differdiff --git a/pkgs/development/pharo/vm/resources/share/icons/hicolor/48x48/apps/pharo.png b/pkgs/development/pharo/vm/resources/share/icons/hicolor/48x48/apps/pharo.png
new file mode 100644
index 00000000000..3f206cf8b18
--- /dev/null
+++ b/pkgs/development/pharo/vm/resources/share/icons/hicolor/48x48/apps/pharo.png
Binary files differdiff --git a/pkgs/development/pharo/vm/resources/share/mime/packages/pharo-image.xml b/pkgs/development/pharo/vm/resources/share/mime/packages/pharo-image.xml
new file mode 100644
index 00000000000..927514dd215
--- /dev/null
+++ b/pkgs/development/pharo/vm/resources/share/mime/packages/pharo-image.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
+  <mime-type type="application/x-pharo-image">
+    <comment>Pharo image file</comment>
+    <comment xml:lang="fr">Fichier d'image Pharo</comment>
+    <glob pattern="*.image"/>
+    <icon name="pharo"/>
+  </mime-type>
+</mime-info>