nixpkgs/pkgs/development/pharo/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

102 lines
2.2 KiB
Nix
Raw Normal View History

2023-06-15 08:31:26 +00:00
{ cairo
, cmake
, fetchurl
, freetype
, gcc
, git
, gnumake
, lib
, libffi
, libgit2
, libpng
, libuuid
, makeBinaryWrapper
, openssl
, pixman
, runtimeShell
, SDL2
, stdenv
, unzip
}:
let
inherit (lib.strings) makeLibraryPath;
pharo-sources = fetchurl {
# It is necessary to download from there instead of from the repository because that archive
# also contains artifacts necessary for the bootstrapping.
2023-11-13 19:31:03 +00:00
url = "https://files.pharo.org/vm/pharo-spur64-headless/Linux-x86_64/source/PharoVM-10.0.8-b323c5f-Linux-x86_64-c-src.zip";
hash = "sha256-5IHymk6yl3pMLG3FeM4nqos0yLYMa3B2+hYW08Yo1V0=";
2023-06-15 08:31:26 +00:00
};
library_path = makeLibraryPath [
libgit2
SDL2
cairo
"$out"
];
in
stdenv.mkDerivation {
pname = "pharo";
2023-11-13 19:31:03 +00:00
version = "10.0.8";
2023-06-15 08:31:26 +00:00
src = pharo-sources;
buildInputs = [
cairo
libgit2
libpng
pixman
SDL2
];
nativeBuildInputs = [
cmake
freetype
gcc
git
gnumake
libffi
libuuid
makeBinaryWrapper
openssl
pixman
SDL2
unzip
];
cmakeFlags = [
# Necessary to perform the bootstrapping without already having Pharo available.
"-DGENERATED_SOURCE_DIR=."
2023-11-13 19:31:03 +00:00
"-DALWAYS_INTERACTIVE=ON"
"-DBUILD_IS_RELEASE=ON"
2023-06-15 08:31:26 +00:00
"-DGENERATE_SOURCES=OFF"
# Prevents CMake from trying to download stuff.
"-DBUILD_BUNDLE=OFF"
];
installPhase = ''
runHook preInstall
cmake --build . --target=install
mkdir -p "$out/lib"
mkdir "$out/bin"
cp build/vm/*.so* "$out/lib/"
cp build/vm/pharo "$out/bin/pharo"
patchelf --allowed-rpath-prefixes "$NIX_STORE" --shrink-rpath "$out/bin/pharo"
2023-06-15 08:31:26 +00:00
wrapProgram "$out/bin/pharo" --set LD_LIBRARY_PATH "${library_path}"
runHook postInstall
'';
meta = with lib; {
description = "Clean and innovative Smalltalk-inspired environment";
homepage = "https://pharo.org";
license = licenses.mit;
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.
'';
maintainers = [ ];
platforms = lib.platforms.linux;
};
}