-
-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pharo: 5.0 -> 6.0 #26924
Merged
Merged
pharo: 5.0 -> 6.0 #26924
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
fdb90f6
pharo: 5.0 -> 6.0
lukego 54be67d
pharo6: Minor fixes and cleanups
lukego 8761ef2
pharo: Removed obsolete duplicate ofwrapper.sh
lukego 86d3b59
pharo: More quoting
lukego 4ed1d53
pharo: Add missing file: vms.nix
lukego d55f827
pharo: Update build-vm.nix for latest upstream
lukego 96600d5
pharo-vm: Add third-party libraries to LD_LIBRARY_PATH of legacy VM
Balletie 448fe16
pharo: Add PharoV60.sources to support newer images
lukego af92427
pharo: Compile with -DPharoVM
lukego 2b3dcfa
pharo: build with gcc48
lukego File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
{ stdenv, fetchurl, cmake, bash, unzip, glibc, openssl, gcc, mesa, freetype, xorg, alsaLib, cairo, libuuid, makeWrapper, ... }: | ||
|
||
{ name, src, ... }: | ||
|
||
stdenv.mkDerivation rec { | ||
|
||
inherit name src; | ||
|
||
pharo-share = import ./share.nix { inherit stdenv fetchurl unzip; }; | ||
|
||
hardeningDisable = [ "format" "pic" ]; | ||
|
||
# Building | ||
preConfigure = '' | ||
cd build/ | ||
''; | ||
resources = ./resources; | ||
|
||
installPhase = '' | ||
mkdir -p "$prefix/lib/$name" | ||
|
||
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/$name" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Better to use ./*. |
||
|
||
mkdir $prefix/bin | ||
|
||
chmod u+w $prefix/bin | ||
cat > $prefix/bin/pharo-cog <<EOF | ||
#!${bash}/bin/bash | ||
# disable parameter expansion to forward all arguments unprocessed to the VM | ||
set -f | ||
exec $prefix/lib/$name/pharo-vm "\$@" | ||
EOF | ||
|
||
chmod +x $prefix/bin/pharo-cog | ||
|
||
# Add cairo library to the library path. | ||
wrapProgram $prefix/bin/pharo-cog --prefix LD_LIBRARY_PATH : ${LD_LIBRARY_PATH} | ||
|
||
ln -s "${pharo-share}/lib/"*.sources $prefix/lib/$name | ||
''; | ||
|
||
LD_LIBRARY_PATH = stdenv.lib.makeLibraryPath [ cairo mesa freetype openssl libuuid alsaLib xorg.libICE xorg.libSM ]; | ||
nativeBuildInputs = [ unzip cmake gcc makeWrapper ]; | ||
buildInputs = [ bash glibc openssl mesa freetype xorg.libX11 xorg.libICE xorg.libSM alsaLib cairo pharo-share ]; | ||
|
||
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.lukego ]; | ||
# Pharo VM sources are packaged separately for darwin (OS X) | ||
platforms = with stdenv.lib; | ||
intersectLists | ||
platforms.mesaPlatforms | ||
(subtractLists platforms.darwin platforms.unix); | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,76 +1,109 @@ | ||
{ stdenv, fetchurl, cmake, bash, unzip, glibc, openssl, gcc, mesa, freetype, xorg, alsaLib, cairo, makeDesktopItem }: | ||
{ stdenv, fetchurl, bash, unzip, glibc, openssl, gcc, mesa, freetype, xorg, alsaLib, cairo, libuuid, autoreconfHook, gcc48, ... }: | ||
|
||
{ name, src, binary-basename, ... }: | ||
{ name, src, version, source-date, source-url, ... }: | ||
|
||
# Build the Pharo VM | ||
stdenv.mkDerivation rec { | ||
inherit name src; | ||
|
||
inherit name src binary-basename; | ||
# Command line invocation name. | ||
# Distinct name for 64-bit builds because they only work with 64-bit images. | ||
cmd = if stdenv.is64bit then "pharo-spur64" else "pharo-spur"; | ||
|
||
pharo-share = import ./share.nix { inherit stdenv fetchurl unzip; }; | ||
# Choose desired VM sources. Separate for 32-bit and 64-bit VM. | ||
# (Could extent to building more VM variants e.g. SpurV3, Sista, etc.) | ||
vm = if stdenv.is64bit then "spur64src" else "spursrc"; | ||
|
||
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"; | ||
}; | ||
# Choose target platform name in the format used by the vm. | ||
flavor = | ||
if stdenv.isLinux && stdenv.isi686 then "linux32x86" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This can be factored, but perhaps it was a conscious choice. No need to reply, just consider it. |
||
else if stdenv.isLinux && stdenv.isx86_64 then "linux64x64" | ||
else if stdenv.isDarwin && stdenv.isi686 then "macos32x86" | ||
else if stdenv.isDarwin && stdenv.isx86_64 then "macos64x64" | ||
else abort "Unsupported platform: only Linux/Darwin x86/x64 are supported."; | ||
|
||
hardeningDisable = [ "format" "pic" ]; | ||
# Shared data (for the sources file) | ||
pharo-share = import ./share.nix { inherit stdenv fetchurl unzip; }; | ||
|
||
# Building | ||
preConfigure = '' | ||
cd build/ | ||
# Note: -fPIC causes the VM to segfault. | ||
hardeningDisable = [ "format" "pic" | ||
# while the VM depends on <= gcc48: | ||
"stackprotector" ]; | ||
|
||
# Regenerate the configure script. | ||
# Unnecessary? But the build breaks without this. | ||
autoreconfPhase = '' | ||
pushd platforms/unix/config | ||
make | ||
popd | ||
''; | ||
resources = ./resources; | ||
installPhase = '' | ||
mkdir -p "$prefix/lib/$name" | ||
|
||
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/$name" | ||
|
||
mkdir -p "$prefix/share/applications" | ||
cp "${desktopItem}/share/applications/"* $prefix/share/applications | ||
|
||
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 | ||
# Configure with options modeled on the 'mvm' build script from the vm. | ||
configureScript = "platforms/unix/config/configure"; | ||
configureFlags = [ "--without-npsqueak" | ||
"--with-vmversion=5.0" | ||
"--with-src=${vm}" ]; | ||
CFLAGS = "-DPharoVM -DIMMUTABILITY=1 -msse2 -D_GNU_SOURCE -DCOGMTVM=0 -g -O2 -DNDEBUG -DDEBUGVM=0"; | ||
LDFLAGS = "-Wl,-z,now"; | ||
|
||
# VM sources require some patching before build. | ||
prePatch = '' | ||
patchShebangs build.${flavor} | ||
# Fix hard-coded path to /bin/rm in a script | ||
sed -i -e 's:/bin/rm:rm:' platforms/unix/config/mkmf | ||
# Fill in mandatory metadata about the VM source version | ||
sed -i -e 's!\$Date\$!$Date: ${source-date} $!' \ | ||
-e 's!\$Rev\$!$Rev: ${version} $!' \ | ||
-e 's!\$URL\$!$URL: ${source-url} $!' \ | ||
platforms/Cross/vm/sqSCCSVersion.h | ||
''; | ||
|
||
exec $prefix/lib/$name/pharo-vm "\$@" | ||
EOF | ||
# Note: --with-vmcfg configure option is broken so copy plugin specs to ./ | ||
preConfigure = '' | ||
cp build."${flavor}"/pharo.cog.spur/plugins.{ext,int} . | ||
''; | ||
|
||
cat > $prefix/bin/${binary-basename}-nox <<EOF | ||
#!${bash}/bin/bash | ||
# (No special build phase.) | ||
|
||
# disable parameter expansion to forward all arguments unprocessed to the VM | ||
installPhase = '' | ||
# Install in working directory and then copy | ||
make install-squeak install-plugins prefix=$(pwd)/products | ||
|
||
# Copy binaries & rename from 'squeak' to 'pharo' | ||
mkdir -p "$out" | ||
cp products/lib/squeak/5.0-*/squeak "$out/pharo" | ||
cp -r products/lib/squeak/5.0-*/*.so "$out" | ||
ln -s "${pharo-share}/lib/"*.sources "$out" | ||
|
||
# Create a shell script to run the VM in the proper environment. | ||
# | ||
# These wrapper puts all relevant libraries into the | ||
# LD_LIBRARY_PATH. This is important because various C code in the VM | ||
# and Smalltalk code in the image will search for them there. | ||
mkdir -p "$out/bin" | ||
|
||
# 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 | ||
|
||
# Create the script | ||
cat > "$out/bin/${cmd}" <<EOF | ||
#!/bin/sh | ||
set -f | ||
|
||
exec $prefix/lib/$name/pharo-vm -vm-display-null "\$@" | ||
LD_LIBRARY_PATH="\$LD_LIBRARY_PATH:$libs" exec $out/pharo "\$@" | ||
EOF | ||
|
||
chmod +x $prefix/bin/${binary-basename}-x $prefix/bin/${binary-basename}-nox | ||
|
||
ln -s "${pharo-share}/lib/"*.sources $prefix/lib/$name | ||
chmod +x "$out/bin/${cmd}" | ||
''; | ||
|
||
buildInputs = [ bash unzip cmake glibc openssl gcc mesa freetype xorg.libX11 xorg.libICE xorg.libSM alsaLib cairo pharo-share ]; | ||
enableParallelBuilding = true; | ||
|
||
# gcc 4.8 used for the build: | ||
# | ||
# gcc5 crashes during compilation; gcc >= 4.9 produces a | ||
# binary that crashes when forking a child process. See: | ||
# http://forum.world.st/OSProcess-fork-issue-with-Debian-built-VM-td4947326.html | ||
# | ||
# (stack protection is disabled above for gcc 4.8 compatibility.) | ||
buildInputs = [ bash unzip glibc openssl gcc48 mesa freetype xorg.libX11 xorg.libICE xorg.libSM alsaLib cairo pharo-share libuuid autoreconfHook ]; | ||
|
||
meta = { | ||
description = "Clean and innovative Smalltalk-inspired environment"; | ||
|
@@ -89,7 +122,7 @@ stdenv.mkDerivation rec { | |
''; | ||
homepage = http://pharo.org; | ||
license = stdenv.lib.licenses.mit; | ||
maintainers = [ ]; | ||
maintainers = [ stdenv.lib.maintainers.lukego ]; | ||
# Pharo VM sources are packaged separately for darwin (OS X) | ||
platforms = with stdenv.lib; | ||
intersectLists | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,15 @@ | ||
{ stdenv, fetchurl, cmake, bash, unzip, glibc, openssl, gcc, mesa, freetype, xorg, alsaLib, cairo, makeDesktopItem } @args: | ||
{ stdenv, callPackage, callPackage_i686, makeWrapper, ...} @pkgs: | ||
|
||
rec { | ||
pharo-vm-build = import ./build-vm.nix args; | ||
let | ||
i686 = callPackage_i686 ./vms.nix {}; | ||
native = callPackage ./vms.nix {}; | ||
in | ||
|
||
base-url = http://files.pharo.org/vm/src/vm-unix-sources/blessed; | ||
rec { | ||
cog32 = i686.cog; | ||
spur32 = i686.spur; | ||
spur64 = if stdenv.is64bit then native.spur else "none"; | ||
multi-vm-wrapper = callPackage ../wrapper { inherit cog32 spur32 spur64; }; | ||
} | ||
|
||
pharo-no-spur = pharo-vm-build rec { | ||
version = "2016.02.18"; | ||
name = "pharo-vm-i386-${version}"; | ||
binary-basename = "pharo-vm"; | ||
src = fetchurl { | ||
url = "${base-url}/pharo-vm-${version}.tar.bz2"; | ||
sha256 = "16n2zg7v2s1ml0vvpbhkw6khmgn637sr0d7n2b28qm5yc8pfhcj4"; | ||
}; | ||
}; | ||
|
||
pharo-spur = pharo-vm-build rec { | ||
version = "2016.07.16"; | ||
name = "pharo-vm-spur-i386-${version}"; | ||
binary-basename = "pharo-spur-vm"; | ||
src = fetchurl { | ||
url = "${base-url}/pharo-vm-spur-${version}.tar.bz2"; | ||
sha256 = "07nk4w5wh7gcf27cch5paqp9zdlshnknpv4y7imxlkjd76viac2b"; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possible minor typo: At least on my machine,
pharo
complains about the-nodisplay
argument, using two dashes (--nodisplay
) does the trick.