2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv
|
2020-10-26 00:41:28 +00:00
|
|
|
, fetchurl
|
|
|
|
, cmake
|
|
|
|
, bash
|
|
|
|
, unzip
|
|
|
|
, glibc
|
|
|
|
, openssl
|
|
|
|
, gcc
|
|
|
|
, libGLU
|
|
|
|
, libGL
|
|
|
|
, freetype
|
|
|
|
, xorg
|
|
|
|
, alsaLib
|
|
|
|
, cairo
|
|
|
|
, libuuid
|
|
|
|
, makeWrapper
|
|
|
|
, ... }:
|
2017-04-17 18:00:23 +01:00
|
|
|
|
|
|
|
{ name, src, ... }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
|
|
|
|
inherit name src;
|
|
|
|
|
|
|
|
pharo-share = import ./share.nix { inherit stdenv fetchurl unzip; };
|
|
|
|
|
|
|
|
hardeningDisable = [ "format" "pic" ];
|
|
|
|
|
2020-10-26 00:41:28 +00:00
|
|
|
nativeBuildInputs = [ unzip cmake gcc makeWrapper ];
|
|
|
|
|
|
|
|
buildInputs = [ bash glibc openssl libGLU libGL freetype
|
|
|
|
xorg.libX11 xorg.libICE xorg.libSM alsaLib cairo pharo-share ];
|
|
|
|
|
|
|
|
LD_LIBRARY_PATH = stdenv.lib.makeLibraryPath
|
|
|
|
[ cairo libGLU libGL freetype openssl libuuid alsaLib
|
|
|
|
xorg.libICE xorg.libSM ];
|
|
|
|
|
2017-04-17 18:00:23 +01:00
|
|
|
preConfigure = ''
|
|
|
|
cd build/
|
|
|
|
'';
|
2017-05-10 20:15:20 +01:00
|
|
|
|
2017-04-17 18:00:23 +01:00
|
|
|
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 $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
|
|
|
|
|
2017-05-10 20:15:20 +01:00
|
|
|
# Add cairo library to the library path.
|
|
|
|
wrapProgram $prefix/bin/pharo-cog --prefix LD_LIBRARY_PATH : ${LD_LIBRARY_PATH}
|
|
|
|
|
2017-04-17 18:00:23 +01:00
|
|
|
ln -s "${pharo-share}/lib/"*.sources $prefix/lib/$name
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2017-04-17 18:00:23 +01:00
|
|
|
description = "Clean and innovative Smalltalk-inspired environment";
|
2020-10-26 00:41:28 +00:00
|
|
|
homepage = "https://pharo.org";
|
2017-04-17 18:00:23 +01:00
|
|
|
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.
|
|
|
|
'';
|
2020-10-26 00:41:28 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = [ maintainers.lukego ];
|
2017-04-17 18:00:23 +01:00
|
|
|
# Pharo VM sources are packaged separately for darwin (OS X)
|
2018-03-12 19:18:25 +00:00
|
|
|
platforms = stdenv.lib.filter
|
|
|
|
(system: with stdenv.lib.systems.elaborate { inherit system; };
|
|
|
|
isUnix && !isDarwin)
|
|
|
|
stdenv.lib.platforms.mesaPlatforms;
|
2017-04-17 18:00:23 +01:00
|
|
|
};
|
|
|
|
}
|