1{ stdenv, file, makeDesktopItem, cog32, spur32, spur64 ? "none" }:
2
3stdenv.mkDerivation rec {
4 name = "pharo";
5 src = ./pharo-vm.sh;
6 inherit cog32 spur32 spur64 file;
7 magic = ./magic;
8 desktopItem = makeDesktopItem {
9 inherit name;
10 desktopName = "Pharo VM";
11 genericName = "Pharo Virtual Machine";
12 exec = "pharo %F";
13 icon = "pharo";
14 terminal = "false";
15 type="Application";
16 startupNotify = "false";
17 categories = "Development;";
18 mimeType = "application/x-pharo-image";
19 };
20 unpackPhase = ''
21 cp $src ./pharo-vm.sh
22 sourceRoot=$PWD
23 '';
24 buildPhase = ''
25 substituteAllInPlace ./pharo-vm.sh
26 '';
27 installPhase = ''
28 mkdir -p $out/bin
29 cp pharo-vm.sh $out/bin/pharo
30 chmod +x $out/bin/pharo
31 '';
32 meta = {
33 description = "Pharo virtual machine (multiple variants)";
34
35 longDescription = ''
36 Pharo's goal is to deliver a clean, innovative, free open-source
37 Smalltalk-inspired environment. By providing a stable and small core
38 system, excellent dev tools, and maintained releases, Pharo is an
39 attractive platform to build and deploy mission critical applications.
40
41 This package provides a front-end for starting the virtual
42 machine. The command 'pharo-vm' automatically detects the type
43 of image and executes a suitable virtual machine: CogV3, Spur,
44 or Spur64. This makes it easy to open Pharo images because you
45 do not have to worry about which virtual machine variant is
46 required.
47
48 More about the Cog family of virtual machines:
49 http://www.mirandabanda.org/cogblog/about-cog/
50 '';
51
52 homepage = http://pharo.org;
53 license = stdenv.lib.licenses.mit;
54 maintainers = [ stdenv.lib.maintainers.lukego ];
55 # Pharo VM sources are packaged separately for darwin (OS X)
56 platforms = stdenv.lib.filter
57 (system: with stdenv.lib.systems.elaborate { inherit system; };
58 isUnix && !isDarwin)
59 stdenv.lib.platforms.mesaPlatforms;
60 };
61}
62