2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv
|
2020-11-03 02:18:15 +00:00
|
|
|
, fetchurl
|
|
|
|
, cmake
|
|
|
|
, bash
|
|
|
|
, unzip
|
|
|
|
, glibc
|
|
|
|
, openssl
|
|
|
|
, gcc
|
|
|
|
, libGLU
|
|
|
|
, libGL
|
|
|
|
, freetype
|
|
|
|
, xorg
|
2021-06-28 23:13:55 +00:00
|
|
|
, alsa-lib
|
2020-11-03 02:18:15 +00:00
|
|
|
, cairo
|
|
|
|
, libuuid
|
2021-05-20 23:08:51 +00:00
|
|
|
, libnsl
|
2020-11-03 02:18:15 +00:00
|
|
|
, makeWrapper
|
|
|
|
, ... }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
{ name, src, ... }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
|
|
|
|
inherit name src;
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
pharo-share = import ./share.nix { inherit lib stdenv fetchurl unzip; };
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
hardeningDisable = [ "format" "pic" ];
|
|
|
|
|
2020-11-03 02:18:15 +00:00
|
|
|
nativeBuildInputs = [ unzip cmake gcc makeWrapper ];
|
|
|
|
|
|
|
|
buildInputs = [ bash glibc openssl libGLU libGL freetype
|
2021-06-28 23:13:55 +00:00
|
|
|
xorg.libX11 xorg.libICE xorg.libSM alsa-lib cairo pharo-share libnsl ];
|
2020-11-03 02:18:15 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
LD_LIBRARY_PATH = lib.makeLibraryPath
|
2021-06-28 23:13:55 +00:00
|
|
|
[ cairo libGLU libGL freetype openssl libuuid alsa-lib
|
2020-11-03 02:18:15 +00:00
|
|
|
xorg.libICE xorg.libSM ];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
preConfigure = ''
|
|
|
|
cd build/
|
|
|
|
'';
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
# -fcommon is a workaround build failure on -fno-common toolchains like upstream
|
|
|
|
# gcc-10. Otherwise build fails as:
|
|
|
|
# ld: CMakeFiles/pharo.dir/build/pharo-vm-2016.02.18/src/vm/gcc3x-cointerp.c.o:(.bss+0x88): multiple definition of
|
|
|
|
# `sendTrace'; CMakeFiles/pharo.dir/build/pharo-vm-2016.02.18/src/vm/cogit.c.o:(.bss+0x84): first defined here
|
2023-03-04 12:14:45 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE = "-fcommon";
|
2022-06-16 17:23:12 +00:00
|
|
|
|
2020-04-24 23:36:52 +00: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
|
|
|
|
|
|
|
|
# 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
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Clean and innovative Smalltalk-inspired environment";
|
2020-11-03 02:18:15 +00:00
|
|
|
homepage = "https://pharo.org";
|
2020-04-24 23:36:52 +00: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-11-03 02:18:15 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = [ maintainers.lukego ];
|
2020-04-24 23:36:52 +00:00
|
|
|
# Pharo VM sources are packaged separately for darwin (OS X)
|
2021-02-05 17:12:51 +00:00
|
|
|
platforms = lib.filter
|
|
|
|
(system: with lib.systems.elaborate { inherit system; };
|
2020-04-24 23:36:52 +00:00
|
|
|
isUnix && !isDarwin)
|
2021-02-05 17:12:51 +00:00
|
|
|
lib.platforms.mesaPlatforms;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|