2016-01-16 15:28:12 +00:00
|
|
|
{ stdenv, fetchurl, cmake, bash, unzip, glibc, openssl, gcc, mesa, freetype, xorg, alsaLib, cairo, makeDesktopItem }:
|
2016-01-14 10:33:59 +00:00
|
|
|
|
|
|
|
{ name, src, binary-basename, ... }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
|
|
|
|
inherit name src binary-basename;
|
|
|
|
|
2016-01-16 15:28:12 +00:00
|
|
|
pharo-share = import ./share.nix { inherit stdenv fetchurl unzip; };
|
|
|
|
|
|
|
|
desktopItem = makeDesktopItem {
|
|
|
|
inherit name;
|
|
|
|
desktopName = "Pharo VM";
|
|
|
|
genericName = "Pharo Virtual Machine";
|
|
|
|
exec = "${binary-basename}-x %F";
|
|
|
|
icon = "pharo";
|
|
|
|
terminal = "false";
|
|
|
|
type="Application";
|
|
|
|
startupNotify = "false";
|
|
|
|
categories = "Development;";
|
|
|
|
mimeType = "application/x-pharo-image";
|
2016-01-14 10:33:59 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# Building
|
|
|
|
preConfigure = ''
|
|
|
|
cd build/
|
|
|
|
'';
|
|
|
|
resources = ./resources;
|
|
|
|
installPhase = ''
|
2016-01-16 15:28:12 +00:00
|
|
|
mkdir -p "$prefix/lib/$name"
|
2016-01-14 10:33:59 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2016-01-16 15:28:12 +00:00
|
|
|
cp * "$prefix/lib/$name"
|
2016-01-14 10:33:59 +00:00
|
|
|
|
2016-01-16 15:28:12 +00:00
|
|
|
mkdir -p "$prefix/share/applications"
|
|
|
|
cp "${desktopItem}/share/applications/"* $prefix/share/applications
|
2016-01-14 10:33:59 +00:00
|
|
|
|
|
|
|
mkdir $prefix/bin
|
|
|
|
|
|
|
|
chmod u+w $prefix/bin
|
|
|
|
cat > $prefix/bin/${binary-basename}-x <<EOF
|
|
|
|
#!${bash}/bin/bash
|
|
|
|
|
|
|
|
# disable parameter expansion to forward all arguments unprocessed to the VM
|
|
|
|
set -f
|
|
|
|
|
2016-01-16 15:28:12 +00:00
|
|
|
exec $prefix/lib/$name/pharo-vm "\$@"
|
2016-01-14 10:33:59 +00:00
|
|
|
EOF
|
|
|
|
|
|
|
|
cat > $prefix/bin/${binary-basename}-nox <<EOF
|
|
|
|
#!${bash}/bin/bash
|
|
|
|
|
|
|
|
# disable parameter expansion to forward all arguments unprocessed to the VM
|
|
|
|
set -f
|
|
|
|
|
2016-01-16 15:28:12 +00:00
|
|
|
exec $prefix/lib/$name/pharo-vm -vm-display-null "\$@"
|
2016-01-14 10:33:59 +00:00
|
|
|
EOF
|
|
|
|
|
|
|
|
chmod +x $prefix/bin/${binary-basename}-x $prefix/bin/${binary-basename}-nox
|
|
|
|
|
2016-01-16 15:28:12 +00:00
|
|
|
ln -s "${pharo-share}/lib/"*.sources $prefix/lib/$name
|
2016-01-14 10:33:59 +00:00
|
|
|
'';
|
|
|
|
|
2016-01-16 15:28:12 +00:00
|
|
|
buildInputs = [ bash unzip cmake glibc openssl gcc mesa freetype xorg.libX11 xorg.libICE xorg.libSM alsaLib cairo pharo-share ];
|
2016-01-14 10:33:59 +00:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Clean and innovative Smalltalk-inspired environment";
|
|
|
|
longDescription = ''
|
|
|
|
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.
|
|
|
|
|
|
|
|
This package provides the executable VM. You should probably not care
|
|
|
|
about this package (which represents a packaging detail) and have a
|
|
|
|
look at the pharo-vm-core package instead.
|
|
|
|
|
|
|
|
Please fill bug reports on http://bugs.pharo.org under the 'Ubuntu
|
|
|
|
packaging (ppa:pharo/stable)' project.
|
|
|
|
'';
|
|
|
|
homepage = http://pharo.org;
|
|
|
|
license = stdenv.lib.licenses.mit;
|
|
|
|
maintainers = [ stdenv.lib.maintainers.DamienCassou ];
|
2016-02-29 12:08:12 +00:00
|
|
|
# Pharo VM sources are packaged separately for darwin (OS X)
|
|
|
|
platforms = with stdenv.lib;
|
|
|
|
intersectLists
|
|
|
|
platforms.mesaPlatforms
|
|
|
|
(subtractLists platforms.darwin platforms.unix);
|
2016-01-14 10:33:59 +00:00
|
|
|
};
|
|
|
|
}
|