nixpkgs/pkgs/by-name/ph/pharo/package.nix

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

95 lines
2.3 KiB
Nix
Raw Normal View History

{ lib
, stdenv
, cairo
2023-06-15 08:31:26 +00:00
, cmake
2024-01-01 10:01:11 +00:00
, fetchzip
2023-06-15 08:31:26 +00:00
, freetype
, libffi
, libgit2
, libpng
, libuuid
, makeBinaryWrapper
, openssl
, pixman
, SDL2
}:
2024-01-01 10:01:11 +00:00
stdenv.mkDerivation (finalAttrs: {
pname = "pharo";
2024-01-01 10:01:11 +00:00
version = "10.0.9-de76067";
2024-01-01 10:01:11 +00:00
src = fetchzip {
2023-06-15 08:31:26 +00:00
# It is necessary to download from there instead of from the repository because that archive
# also contains artifacts necessary for the bootstrapping.
2024-01-01 10:01:11 +00:00
url = "https://files.pharo.org/vm/pharo-spur64-headless/Linux-x86_64/source/PharoVM-${finalAttrs.version}-Linux-x86_64-c-src.zip";
hash = "sha256-INeQGYCxBu7DvFmlDRXO0K2nhxcd9K9Xwp55iNdlvhk=";
2023-06-15 08:31:26 +00:00
};
strictDeps = true;
2023-06-15 08:31:26 +00:00
buildInputs = [
cairo
freetype
libffi
2023-06-15 08:31:26 +00:00
libgit2
libpng
libuuid
openssl
2023-06-15 08:31:26 +00:00
pixman
SDL2
];
nativeBuildInputs = [
cmake
makeBinaryWrapper
];
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"
];
2023-12-22 01:08:11 +00:00
installPhase = ''
runHook preInstall
2023-06-15 08:31:26 +00:00
2023-12-22 01:08:11 +00:00
cmake --build . --target=install
mkdir -p "$out/lib"
mkdir "$out/bin"
cp build/vm/*.so* "$out/lib/"
cp build/vm/pharo "$out/bin/pharo"
2023-06-15 08:31:26 +00:00
2023-12-22 01:08:11 +00:00
runHook postInstall
'';
preFixup = let
libPath = lib.makeLibraryPath (finalAttrs.buildInputs ++ [
stdenv.cc.cc.lib
"$out"
]);
in ''
patchelf --allowed-rpath-prefixes "$NIX_STORE" --shrink-rpath "$out/bin/pharo"
ln -s "${libgit2}/lib/libgit2.so" $out/lib/libgit2.so.1.1
wrapProgram "$out/bin/pharo" --argv0 $out/bin/pharo --prefix LD_LIBRARY_PATH ":" "${libPath}"
'';
2023-06-15 08:31:26 +00:00
meta = {
2023-06-15 08:31:26 +00:00
description = "Clean and innovative Smalltalk-inspired environment";
homepage = "https://pharo.org";
license = lib.licenses.mit;
2023-06-15 08:31:26 +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.
'';
maintainers = with lib.maintainers; [ ehmry ];
mainProgram = "pharo";
2023-06-15 08:31:26 +00:00
platforms = lib.platforms.linux;
};
2024-01-01 10:01:11 +00:00
})