Merge remote-tracking branch 'lukego/pharo6-for-nixpkgs'

Closes https://github.com/NixOS/nixpkgs/pull/26924

+392 -89
+9 -10
pkgs/development/pharo/launcher/default.nix
··· 1 - { stdenv, fetchurl, bash, pharo-vm, unzip, makeDesktopItem }: 1 + { stdenv, fetchurl, bash, pharo, unzip, makeDesktopItem }: 2 2 3 3 stdenv.mkDerivation rec { 4 - version = "0.2.9-2016.01.14"; 4 + version = "2017.02.28"; 5 5 name = "pharo-launcher-${version}"; 6 6 src = fetchurl { 7 - url = "http://files.pharo.org/platform/launcher/blessed/PharoLauncher-user-${version}.zip"; 8 - sha256 = "0lzdnaw7l1rrzbrq53xsy38aiz6id5x7s78ds1dhb31vqc241yy8"; 7 + url = "http://files.pharo.org/platform/launcher/PharoLauncher-user-stable-${version}.zip"; 8 + sha256 = "1hfwjyx0c47s6ivc1zr2sf5mk1xw2zspsv0ns8mj3kcaglzqwiq0"; 9 9 }; 10 10 11 11 executable-name = "pharo-launcher"; ··· 23 23 # because upstream tarball has no top-level directory. 24 24 sourceRoot = "."; 25 25 26 - buildInputs = [ bash pharo-vm unzip ]; 26 + buildInputs = [ bash pharo unzip ]; 27 27 28 28 installPhase = '' 29 29 mkdir -p $prefix/share/pharo-launcher ··· 37 37 38 38 cat > $prefix/bin/${executable-name} <<EOF 39 39 #!${bash}/bin/bash 40 - 41 - exec ${pharo-vm}/bin/pharo-vm-x $prefix/share/pharo-launcher/pharo-launcher.image 40 + exec "${pharo}/bin/pharo" $prefix/share/pharo-launcher/pharo-launcher.image 42 41 EOF 43 42 chmod +x $prefix/bin/${executable-name} 44 43 ''; ··· 52 51 secs=5 53 52 echo -n "Running headless Pharo for $secs seconds to check for a crash... " 54 53 timeout $secs \ 55 - ${pharo-vm}/bin/pharo-vm-nox PharoLauncher.image --no-quit eval 'true' 54 + "${pharo}/bin/pharo" -nodisplay PharoLauncher.image --no-quit eval 'true' 56 55 test "$?" == 124 && echo "ok") 57 56 ''; 58 57 ··· 78 77 ''; 79 78 homepage = http://pharo.org; 80 79 license = stdenv.lib.licenses.mit; 81 - maintainers = [ stdenv.lib.maintainers.lukego ]; 82 - platforms = pharo-vm.meta.platforms; 80 + maintainers = [ ]; 81 + platforms = pharo.meta.platforms; 83 82 }; 84 83 }
+78
pkgs/development/pharo/vm/build-vm-legacy.nix
··· 1 + { stdenv, fetchurl, cmake, bash, unzip, glibc, openssl, gcc, mesa, freetype, xorg, alsaLib, cairo, libuuid, makeWrapper, ... }: 2 + 3 + { name, src, ... }: 4 + 5 + stdenv.mkDerivation rec { 6 + 7 + inherit name src; 8 + 9 + pharo-share = import ./share.nix { inherit stdenv fetchurl unzip; }; 10 + 11 + hardeningDisable = [ "format" "pic" ]; 12 + 13 + # Building 14 + preConfigure = '' 15 + cd build/ 16 + ''; 17 + resources = ./resources; 18 + 19 + installPhase = '' 20 + mkdir -p "$prefix/lib/$name" 21 + 22 + cd ../../results 23 + 24 + mv vm-display-null vm-display-null.so 25 + mv vm-display-X11 vm-display-X11.so 26 + mv vm-sound-null vm-sound-null.so 27 + mv vm-sound-ALSA vm-sound-ALSA.so 28 + mv pharo pharo-vm 29 + 30 + cp * "$prefix/lib/$name" 31 + 32 + mkdir $prefix/bin 33 + 34 + chmod u+w $prefix/bin 35 + cat > $prefix/bin/pharo-cog <<EOF 36 + #!${bash}/bin/bash 37 + # disable parameter expansion to forward all arguments unprocessed to the VM 38 + set -f 39 + exec $prefix/lib/$name/pharo-vm "\$@" 40 + EOF 41 + 42 + chmod +x $prefix/bin/pharo-cog 43 + 44 + # Add cairo library to the library path. 45 + wrapProgram $prefix/bin/pharo-cog --prefix LD_LIBRARY_PATH : ${LD_LIBRARY_PATH} 46 + 47 + ln -s "${pharo-share}/lib/"*.sources $prefix/lib/$name 48 + ''; 49 + 50 + LD_LIBRARY_PATH = stdenv.lib.makeLibraryPath [ cairo mesa freetype openssl libuuid alsaLib xorg.libICE xorg.libSM ]; 51 + nativeBuildInputs = [ unzip cmake gcc makeWrapper ]; 52 + buildInputs = [ bash glibc openssl mesa freetype xorg.libX11 xorg.libICE xorg.libSM alsaLib cairo pharo-share ]; 53 + 54 + meta = { 55 + description = "Clean and innovative Smalltalk-inspired environment"; 56 + longDescription = '' 57 + Pharo's goal is to deliver a clean, innovative, free open-source 58 + Smalltalk-inspired environment. By providing a stable and small core 59 + system, excellent dev tools, and maintained releases, Pharo is an 60 + attractive platform to build and deploy mission critical applications. 61 + 62 + This package provides the executable VM. You should probably not care 63 + about this package (which represents a packaging detail) and have a 64 + look at the pharo-vm-core package instead. 65 + 66 + Please fill bug reports on http://bugs.pharo.org under the 'Ubuntu 67 + packaging (ppa:pharo/stable)' project. 68 + ''; 69 + homepage = http://pharo.org; 70 + license = stdenv.lib.licenses.mit; 71 + maintainers = [ stdenv.lib.maintainers.lukego ]; 72 + # Pharo VM sources are packaged separately for darwin (OS X) 73 + platforms = with stdenv.lib; 74 + intersectLists 75 + platforms.mesaPlatforms 76 + (subtractLists platforms.darwin platforms.unix); 77 + }; 78 + }
+85 -52
pkgs/development/pharo/vm/build-vm.nix
··· 1 - { stdenv, fetchurl, cmake, bash, unzip, glibc, openssl, gcc, mesa, freetype, xorg, alsaLib, cairo, makeDesktopItem }: 1 + { stdenv, fetchurl, bash, unzip, glibc, openssl, gcc, mesa, freetype, xorg, alsaLib, cairo, libuuid, autoreconfHook, gcc48, ... }: 2 2 3 - { name, src, binary-basename, ... }: 3 + { name, src, version, source-date, source-url, ... }: 4 4 5 + # Build the Pharo VM 5 6 stdenv.mkDerivation rec { 7 + inherit name src; 6 8 7 - inherit name src binary-basename; 9 + # Command line invocation name. 10 + # Distinct name for 64-bit builds because they only work with 64-bit images. 11 + cmd = if stdenv.is64bit then "pharo-spur64" else "pharo-spur"; 12 + 13 + # Choose desired VM sources. Separate for 32-bit and 64-bit VM. 14 + # (Could extent to building more VM variants e.g. SpurV3, Sista, etc.) 15 + vm = if stdenv.is64bit then "spur64src" else "spursrc"; 16 + 17 + # Choose target platform name in the format used by the vm. 18 + flavor = 19 + if stdenv.isLinux && stdenv.isi686 then "linux32x86" 20 + else if stdenv.isLinux && stdenv.isx86_64 then "linux64x64" 21 + else if stdenv.isDarwin && stdenv.isi686 then "macos32x86" 22 + else if stdenv.isDarwin && stdenv.isx86_64 then "macos64x64" 23 + else abort "Unsupported platform: only Linux/Darwin x86/x64 are supported."; 8 24 25 + # Shared data (for the sources file) 9 26 pharo-share = import ./share.nix { inherit stdenv fetchurl unzip; }; 10 27 11 - desktopItem = makeDesktopItem { 12 - inherit name; 13 - desktopName = "Pharo VM"; 14 - genericName = "Pharo Virtual Machine"; 15 - exec = "${binary-basename}-x %F"; 16 - icon = "pharo"; 17 - terminal = "false"; 18 - type="Application"; 19 - startupNotify = "false"; 20 - categories = "Development;"; 21 - mimeType = "application/x-pharo-image"; 22 - }; 28 + # Note: -fPIC causes the VM to segfault. 29 + hardeningDisable = [ "format" "pic" 30 + # while the VM depends on <= gcc48: 31 + "stackprotector" ]; 23 32 24 - hardeningDisable = [ "format" "pic" ]; 25 - 26 - # Building 27 - preConfigure = '' 28 - cd build/ 33 + # Regenerate the configure script. 34 + # Unnecessary? But the build breaks without this. 35 + autoreconfPhase = '' 36 + pushd platforms/unix/config 37 + make 38 + popd 29 39 ''; 30 - resources = ./resources; 31 - installPhase = '' 32 - mkdir -p "$prefix/lib/$name" 33 40 34 - cd ../../results 41 + # Configure with options modeled on the 'mvm' build script from the vm. 42 + configureScript = "platforms/unix/config/configure"; 43 + configureFlags = [ "--without-npsqueak" 44 + "--with-vmversion=5.0" 45 + "--with-src=${vm}" ]; 46 + CFLAGS = "-DPharoVM -DIMMUTABILITY=1 -msse2 -D_GNU_SOURCE -DCOGMTVM=0 -g -O2 -DNDEBUG -DDEBUGVM=0"; 47 + LDFLAGS = "-Wl,-z,now"; 35 48 36 - mv vm-display-null vm-display-null.so 37 - mv vm-display-X11 vm-display-X11.so 38 - mv vm-sound-null vm-sound-null.so 39 - mv vm-sound-ALSA vm-sound-ALSA.so 40 - mv pharo pharo-vm 49 + # VM sources require some patching before build. 50 + prePatch = '' 51 + patchShebangs build.${flavor} 52 + # Fix hard-coded path to /bin/rm in a script 53 + sed -i -e 's:/bin/rm:rm:' platforms/unix/config/mkmf 54 + # Fill in mandatory metadata about the VM source version 55 + sed -i -e 's!\$Date\$!$Date: ${source-date} $!' \ 56 + -e 's!\$Rev\$!$Rev: ${version} $!' \ 57 + -e 's!\$URL\$!$URL: ${source-url} $!' \ 58 + platforms/Cross/vm/sqSCCSVersion.h 59 + ''; 41 60 42 - cp * "$prefix/lib/$name" 43 - 44 - mkdir -p "$prefix/share/applications" 45 - cp "${desktopItem}/share/applications/"* $prefix/share/applications 61 + # Note: --with-vmcfg configure option is broken so copy plugin specs to ./ 62 + preConfigure = '' 63 + cp build."${flavor}"/pharo.cog.spur/plugins.{ext,int} . 64 + ''; 46 65 47 - mkdir $prefix/bin 66 + # (No special build phase.) 48 67 49 - chmod u+w $prefix/bin 50 - cat > $prefix/bin/${binary-basename}-x <<EOF 51 - #!${bash}/bin/bash 68 + installPhase = '' 69 + # Install in working directory and then copy 70 + make install-squeak install-plugins prefix=$(pwd)/products 52 71 53 - # disable parameter expansion to forward all arguments unprocessed to the VM 54 - set -f 72 + # Copy binaries & rename from 'squeak' to 'pharo' 73 + mkdir -p "$out" 74 + cp products/lib/squeak/5.0-*/squeak "$out/pharo" 75 + cp -r products/lib/squeak/5.0-*/*.so "$out" 76 + ln -s "${pharo-share}/lib/"*.sources "$out" 55 77 56 - exec $prefix/lib/$name/pharo-vm "\$@" 57 - EOF 78 + # Create a shell script to run the VM in the proper environment. 79 + # 80 + # These wrapper puts all relevant libraries into the 81 + # LD_LIBRARY_PATH. This is important because various C code in the VM 82 + # and Smalltalk code in the image will search for them there. 83 + mkdir -p "$out/bin" 58 84 59 - cat > $prefix/bin/${binary-basename}-nox <<EOF 60 - #!${bash}/bin/bash 85 + # Note: include ELF rpath in LD_LIBRARY_PATH for finding libc. 86 + libs=$out:$(patchelf --print-rpath "$out/pharo"):${cairo}/lib:${mesa}/lib:${freetype}/lib:${openssl}/lib:${libuuid}/lib:${alsaLib}/lib:${xorg.libICE}/lib:${xorg.libSM}/lib 61 87 62 - # disable parameter expansion to forward all arguments unprocessed to the VM 88 + # Create the script 89 + cat > "$out/bin/${cmd}" <<EOF 90 + #!/bin/sh 63 91 set -f 64 - 65 - exec $prefix/lib/$name/pharo-vm -vm-display-null "\$@" 92 + LD_LIBRARY_PATH="\$LD_LIBRARY_PATH:$libs" exec $out/pharo "\$@" 66 93 EOF 67 - 68 - chmod +x $prefix/bin/${binary-basename}-x $prefix/bin/${binary-basename}-nox 69 - 70 - ln -s "${pharo-share}/lib/"*.sources $prefix/lib/$name 94 + chmod +x "$out/bin/${cmd}" 71 95 ''; 72 96 73 - buildInputs = [ bash unzip cmake glibc openssl gcc mesa freetype xorg.libX11 xorg.libICE xorg.libSM alsaLib cairo pharo-share ]; 97 + enableParallelBuilding = true; 98 + 99 + # gcc 4.8 used for the build: 100 + # 101 + # gcc5 crashes during compilation; gcc >= 4.9 produces a 102 + # binary that crashes when forking a child process. See: 103 + # http://forum.world.st/OSProcess-fork-issue-with-Debian-built-VM-td4947326.html 104 + # 105 + # (stack protection is disabled above for gcc 4.8 compatibility.) 106 + buildInputs = [ bash unzip glibc openssl gcc48 mesa freetype xorg.libX11 xorg.libICE xorg.libSM alsaLib cairo pharo-share libuuid autoreconfHook ]; 74 107 75 108 meta = { 76 109 description = "Clean and innovative Smalltalk-inspired environment"; ··· 89 122 ''; 90 123 homepage = http://pharo.org; 91 124 license = stdenv.lib.licenses.mit; 92 - maintainers = [ ]; 125 + maintainers = [ stdenv.lib.maintainers.lukego ]; 93 126 # Pharo VM sources are packaged separately for darwin (macOS) 94 127 platforms = with stdenv.lib; 95 128 intersectLists
+11 -23
pkgs/development/pharo/vm/default.nix
··· 1 - { stdenv, fetchurl, cmake, bash, unzip, glibc, openssl, gcc, mesa, freetype, xorg, alsaLib, cairo, makeDesktopItem } @args: 1 + { stdenv, callPackage, callPackage_i686, makeWrapper, ...} @pkgs: 2 + 3 + let 4 + i686 = callPackage_i686 ./vms.nix {}; 5 + native = callPackage ./vms.nix {}; 6 + in 2 7 3 8 rec { 4 - pharo-vm-build = import ./build-vm.nix args; 9 + cog32 = i686.cog; 10 + spur32 = i686.spur; 11 + spur64 = if stdenv.is64bit then native.spur else "none"; 12 + multi-vm-wrapper = callPackage ../wrapper { inherit cog32 spur32 spur64; }; 13 + } 5 14 6 - base-url = http://files.pharo.org/vm/src/vm-unix-sources/blessed; 7 15 8 - pharo-no-spur = pharo-vm-build rec { 9 - version = "2016.02.18"; 10 - name = "pharo-vm-i386-${version}"; 11 - binary-basename = "pharo-vm"; 12 - src = fetchurl { 13 - url = "${base-url}/pharo-vm-${version}.tar.bz2"; 14 - sha256 = "16n2zg7v2s1ml0vvpbhkw6khmgn637sr0d7n2b28qm5yc8pfhcj4"; 15 - }; 16 - }; 17 - 18 - pharo-spur = pharo-vm-build rec { 19 - version = "2016.07.16"; 20 - name = "pharo-vm-spur-i386-${version}"; 21 - binary-basename = "pharo-spur-vm"; 22 - src = fetchurl { 23 - url = "${base-url}/pharo-vm-spur-${version}.tar.bz2"; 24 - sha256 = "07nk4w5wh7gcf27cch5paqp9zdlshnknpv4y7imxlkjd76viac2b"; 25 - }; 26 - }; 27 - }
+6
pkgs/development/pharo/vm/share.nix
··· 31 31 sha256 = "0ykl1y0a4yy5qn8fwz0wkl8fcn4pqv9q0w0r2llhzdz3jdg1k69g"; 32 32 }; 33 33 34 + sources60Zip = fetchurl { 35 + url = http://files.pharo.org/sources/PharoV60.sources.zip; 36 + sha256 = "0xbdi679ryb2zg412xy6zkh22l20pmbl92m3qhfgzjvgybna8z2a"; 37 + }; 38 + 34 39 buildInputs = [ unzip ]; 35 40 36 41 installPhase = '' ··· 43 48 unzip ${sources30Zip} -d $prefix/lib/ 44 49 unzip ${sources40Zip} -d $prefix/lib/ 45 50 unzip ${sources50Zip} -d $prefix/lib/ 51 + unzip ${sources60Zip} -d $prefix/lib/ 46 52 ''; 47 53 48 54 meta = {
+46
pkgs/development/pharo/vm/vms.nix
··· 1 + { cmake, stdenv, fetchurl, bash, unzip, glibc, openssl, gcc, mesa, freetype, xorg, alsaLib, cairo, libuuid, autoreconfHook, gcc48, fetchFromGitHub, makeWrapper} @args: 2 + 3 + let 4 + pharo-vm-build = import ./build-vm.nix args; 5 + pharo-vm-build-legacy = import ./build-vm-legacy.nix args; 6 + in 7 + 8 + let suffix = if stdenv.is64bit then "64" else "32"; in 9 + 10 + rec { 11 + # Build the latest VM 12 + spur = pharo-vm-build rec { 13 + name = "pharo-spur${suffix}"; 14 + version = "git.${revision}"; 15 + src = fetchFromGitHub { 16 + owner = "pharo-project"; 17 + repo = "pharo-vm"; 18 + rev = revision; 19 + sha256 = "0dkiy5fq1xn2n93cwf767xz24c01ic0wfw94jk9nvn7pmcfj7m62"; 20 + }; 21 + # This metadata will be compiled into the VM and introspectable 22 + # from Smalltalk. This has been manually extracted from 'git log'. 23 + # 24 + # The build would usually generate this automatically using 25 + # opensmalltalk-vm/.git_filters/RevDateURL.smudge but that script 26 + # is too impure to run from nix. 27 + revision = "6a63f68a3dd4deb7c17dd2c7ac6e4dd4b0b6d937"; 28 + source-date = "Tue May 30 19:41:27 2017 -0700"; 29 + source-url = "https://github.com/pharo-project/pharo-vm"; 30 + }; 31 + 32 + # Build an old ("legacy") CogV3 VM for running pre-spur images. 33 + # (Could be nicer to build the latest VM in CogV3 mode but this is 34 + # not supported on the Pharo VM variant at the moment.) 35 + cog = pharo-vm-build-legacy rec { 36 + version = "2016.02.18"; 37 + name = "pharo-cog${suffix}"; 38 + base-url = http://files.pharo.org/vm/src/vm-unix-sources/blessed; 39 + src = fetchurl { 40 + url = "${base-url}/pharo-vm-${version}.tar.bz2"; 41 + sha256 = "16n2zg7v2s1ml0vvpbhkw6khmgn637sr0d7n2b28qm5yc8pfhcj4"; 42 + }; 43 + }; 44 + 45 + } 46 +
+58
pkgs/development/pharo/wrapper/default.nix
··· 1 + { stdenv, file, makeDesktopItem, cog32, spur32, spur64 ? "none" }: 2 + 3 + stdenv.mkDerivation rec { 4 + name = "pharo"; 5 + src = ./.; 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 + buildPhase = '' 21 + substituteAllInPlace ./pharo-vm.sh 22 + ''; 23 + installPhase = '' 24 + mkdir -p $out/bin 25 + cp pharo-vm.sh $out/bin/pharo 26 + chmod +x $out/bin/pharo 27 + ''; 28 + meta = { 29 + description = "Pharo virtual machine (multiple variants)"; 30 + 31 + longDescription = '' 32 + Pharo's goal is to deliver a clean, innovative, free open-source 33 + Smalltalk-inspired environment. By providing a stable and small core 34 + system, excellent dev tools, and maintained releases, Pharo is an 35 + attractive platform to build and deploy mission critical applications. 36 + 37 + This package provides a front-end for starting the virtual 38 + machine. The command 'pharo-vm' automatically detects the type 39 + of image and executes a suitable virtual machine: CogV3, Spur, 40 + or Spur64. This makes it easy to open Pharo images because you 41 + do not have to worry about which virtual machine variant is 42 + required. 43 + 44 + More about the Cog family of virtual machines: 45 + http://www.mirandabanda.org/cogblog/about-cog/ 46 + ''; 47 + 48 + homepage = http://pharo.org; 49 + license = stdenv.lib.licenses.mit; 50 + maintainers = [ stdenv.lib.maintainers.lukego ]; 51 + # Pharo VM sources are packaged separately for darwin (OS X) 52 + platforms = with stdenv.lib; 53 + intersectLists 54 + platforms.mesaPlatforms 55 + (subtractLists platforms.darwin platforms.unix); 56 + }; 57 + } 58 +
+37
pkgs/development/pharo/wrapper/magic
··· 1 + # Smalltalk image file formats 2 + 0 lelong 6502 Smalltalk image V3 32b (%d) 3 + !:mime application/squeak-image 4 + 0 belong 6502 Smalltalk image V3 32b (%d) 5 + !:mime application/squeak-image 6 + 0 lelong 6504 Smalltalk image V3 32b +C (%d) 7 + !:mime application/cog-image 8 + 0 belong 6504 Smalltalk image V3 32b +C (%d) 9 + !:mime application/cog-image 10 + 0 lelong 68000 Smalltalk image V3 64b (%d) 11 + !:mime application/squeak64-image 12 + 4 belong 68000 Smalltalk image V3 64b (%d) 13 + !:mime application/squeak64-image 14 + 0 lelong 68002 Smalltalk image V3 64b +C (%d) 15 + !:mime application/cog64-image 16 + 4 belong 68002 Smalltalk image V3 64b +C (%d) 17 + !:mime application/cog64-image 18 + 0 lelong 6505 Smalltalk image V3 32b +C+NF (%d) 19 + !:mime application/cog-image 20 + 0 belong 6505 Smalltalk image V3 32b +C+NF (%d) 21 + !:mime application/cog-image 22 + 0 lelong 68003 Smalltalk image V3 64b +C+NF (%d) 23 + !:mime application/cog64-image 24 + 4 belong 68003 Smalltalk image V3 64b +C+NF (%d) 25 + !:mime application/cog64-image 26 + 0 lelong 6521 Smalltalk image Spur 32b +C+NF (%d) 27 + !:mime application/spur-image 28 + 0 belong 6521 Smalltalk image Spur 32b +C+NF (%d) 29 + !:mime application/spur-image 30 + 0 lelong 68019 Smalltalk image Spur 64b +C+NF (%d) 31 + !:mime application/spur64-image 32 + 4 belong 68019 Smalltalk image Spur 64b +C+NF (%d) 33 + !:mime application/spur64-image 34 + 0 lelong 68021 Smalltalk image Spur 64b +C+NF+Tag (%d) 35 + !:mime application/spur64-image 36 + 4 belong 68021 Smalltalk image Spur 64b +C+NF+Tag (%d) 37 + !:mime application/spur64-image
+57
pkgs/development/pharo/wrapper/pharo-vm.sh
··· 1 + #!/bin/sh 2 + # This is based on the script by David T. Lewis posted here: 3 + # http://lists.squeakfoundation.org/pipermail/vm-dev/2017-April/024836.html 4 + # 5 + # VM run utility script 6 + # usage: run <myimage> 7 + # 8 + # Select a VM and run an image based on the image format number 9 + 10 + PATH=$PATH:@file@/bin 11 + 12 + # Search for the image filename in the command line arguments 13 + for arg in $* $SQUEAK_IMAGE; do 14 + case ${arg} in 15 + -*) # ignore 16 + ;; 17 + *) # either an option argument or the image name 18 + if test -e ${arg}; then 19 + magic=$(file -L -b -m @magic@ "$arg") 20 + case "$magic" in 21 + "Smalltalk image V3 32b"*) 22 + image=${arg} 23 + vm=@cog32@/bin/pharo-cog 24 + ;; 25 + "Smalltalk image Spur 32b"*) 26 + image=${arg} 27 + vm=@spur32@/bin/pharo-spur 28 + ;; 29 + "Smalltalk image Spur 64b"*) 30 + if [ "@spur64vm@" == "none" ]; then 31 + echo "error: detected 64-bit image but 64-bit VM is not available" >&2 32 + exit 1 33 + fi 34 + image=${arg} 35 + vm=@spur64@/bin/pharo-spur64 36 + ;; 37 + esac 38 + fi 39 + ;; 40 + esac 41 + done 42 + 43 + # Print a message to explain our DWIM'ery. 44 + if [ -n "$image" ]; then 45 + echo "using VM selected by image type." 46 + echo " image: $image" 47 + echo " type: $magic" 48 + echo " vm: $vm" 49 + else 50 + echo "using default vm; image type not detected" 51 + vm=@cog32@/bin/pharo-cog 52 + fi 53 + 54 + # Run the VM 55 + set -f 56 + exec -- "${vm}" "$@" 57 +
+5 -4
pkgs/top-level/all-packages.nix
··· 6580 6580 6581 6581 guile-xcb = callPackage ../development/guile-modules/guile-xcb { }; 6582 6582 6583 - pharo-vms = callPackage_i686 ../development/pharo/vm { }; 6584 - pharo-vm = pharo-vms.pharo-no-spur; 6585 - pharo-vm5 = pharo-vms.pharo-spur; 6586 - 6583 + pharo-vms = callPackage ../development/pharo/vm { }; 6584 + pharo = pharo-vms.multi-vm-wrapper; 6585 + pharo-cog32 = pharo-vms.cog32; 6586 + pharo-spur32 = pharo-vms.spur32; 6587 + pharo-spur64 = assert stdenv.is64bit; pharo-vms.spur64; 6587 6588 pharo-launcher = callPackage ../development/pharo/launcher { }; 6588 6589 6589 6590 srecord = callPackage ../development/tools/misc/srecord { };