pharo6: Minor fixes and cleanups

This commit is contained in:
Luke Gorrie 2017-06-29 18:09:06 +00:00
parent fdb90f6df7
commit 54be67dbd0
3 changed files with 15 additions and 16 deletions

View File

@ -37,7 +37,7 @@ stdenv.mkDerivation rec {
cat > $prefix/bin/${executable-name} <<EOF cat > $prefix/bin/${executable-name} <<EOF
#!${bash}/bin/bash #!${bash}/bin/bash
exec ${pharo}/bin/pharo $prefix/share/pharo-launcher/pharo-launcher.image exec "${pharo}/bin/pharo" $prefix/share/pharo-launcher/pharo-launcher.image
EOF EOF
chmod +x $prefix/bin/${executable-name} chmod +x $prefix/bin/${executable-name}
''; '';
@ -51,7 +51,7 @@ stdenv.mkDerivation rec {
secs=5 secs=5
echo -n "Running headless Pharo for $secs seconds to check for a crash... " echo -n "Running headless Pharo for $secs seconds to check for a crash... "
timeout $secs \ timeout $secs \
${pharo}/bin/pharo -nodisplay PharoLauncher.image --no-quit eval 'true' "${pharo}/bin/pharo" -nodisplay PharoLauncher.image --no-quit eval 'true'
test "$?" == 124 && echo "ok") test "$?" == 124 && echo "ok")
''; '';

View File

@ -31,7 +31,9 @@ stdenv.mkDerivation rec {
# Regenerate the configure script. # Regenerate the configure script.
# Unnecessary? But the build breaks without this. # Unnecessary? But the build breaks without this.
autoreconfPhase = '' autoreconfPhase = ''
(cd opensmalltalk-vm/platforms/unix/config && make) pushd opensmalltalk-vm/platforms/unix/config
make
popd
''; '';
# Configure with options modeled on the 'mvm' build script from the vm. # Configure with options modeled on the 'mvm' build script from the vm.
@ -67,30 +69,28 @@ stdenv.mkDerivation rec {
make install-squeak install-plugins prefix=$(pwd)/products make install-squeak install-plugins prefix=$(pwd)/products
# Copy binaries & rename from 'squeak' to 'pharo' # Copy binaries & rename from 'squeak' to 'pharo'
mkdir -p $out mkdir -p "$out"
cp products/lib/squeak/5.0-*/squeak $out/pharo cp products/lib/squeak/5.0-*/squeak "$out/pharo"
cp -r products/lib/squeak/5.0-*/*.so "$out"
cp -r products/lib/squeak/5.0-*/*.so $out ln -s "${pharo-share}/lib/"*.sources "$out"
ln -s "${pharo-share}/lib/"*.sources $out
# Create a shell script to run the VM in the proper environment. # Create a shell script to run the VM in the proper environment.
# #
# These wrapper puts all relevant libraries into the # These wrapper puts all relevant libraries into the
# LD_LIBRARY_PATH. This is important because various C code in the VM # LD_LIBRARY_PATH. This is important because various C code in the VM
# and Smalltalk code in the image will search for them there. # and Smalltalk code in the image will search for them there.
mkdir -p $out/bin mkdir -p "$out/bin"
chmod u+w $out/bin
# Note: include ELF rpath in LD_LIBRARY_PATH for finding libc. # Note: include ELF rpath in LD_LIBRARY_PATH for finding libc.
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 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
# Create the script # Create the script
cat > $out/bin/${cmd} <<EOF cat > "$out/bin/${cmd}" <<EOF
#!/bin/sh #!/bin/sh
set -f set -f
LD_LIBRARY_PATH="\$LD_LIBRARY_PATH:$libs" exec $out/pharo "\$@" LD_LIBRARY_PATH="\$LD_LIBRARY_PATH:$libs" exec $out/pharo "\$@"
EOF EOF
chmod +x $prefix/bin/${cmd} chmod +x "$out/bin/${cmd}"
''; '';
enableParallelBuilding = true; enableParallelBuilding = true;
@ -98,7 +98,6 @@ stdenv.mkDerivation rec {
# Note: Force gcc6 because gcc5 crashes when compiling the VM. # Note: Force gcc6 because gcc5 crashes when compiling the VM.
buildInputs = [ bash unzip glibc openssl gcc6 mesa freetype xorg.libX11 xorg.libICE xorg.libSM alsaLib cairo pharo-share libuuid autoreconfHook ]; buildInputs = [ bash unzip glibc openssl gcc6 mesa freetype xorg.libX11 xorg.libICE xorg.libSM alsaLib cairo pharo-share libuuid autoreconfHook ];
meta = { meta = {
description = "Clean and innovative Smalltalk-inspired environment"; description = "Clean and innovative Smalltalk-inspired environment";
longDescription = '' longDescription = ''

View File

@ -1,7 +1,7 @@
{ stdenv, file, makeDesktopItem, cog32, spur32, spur64 ? "none" }: { stdenv, file, makeDesktopItem, cog32, spur32, spur64 ? "none" }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "pharo-vm"; name = "pharo";
src = ./.; src = ./.;
inherit cog32 spur32 spur64 file; inherit cog32 spur32 spur64 file;
magic = ./magic; magic = ./magic;