diff options
author | Alyssa Ross <hi@alyssa.is> | 2024-01-20 12:31:50 +0100 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2024-01-20 12:32:25 +0100 |
commit | b7baf40e099b4215181fe7b0c63083b12ef2c7fb (patch) | |
tree | a6efabd31d05b6d0a36624729e80377bbbfb0149 /nixpkgs/pkgs/by-name/ph/pharo | |
parent | 710028664e26e85cb831a869b3da9f6993902255 (diff) | |
parent | 0799f514b1cd74878174939df79ac60ca5036673 (diff) | |
download | nixlib-b7baf40e099b4215181fe7b0c63083b12ef2c7fb.tar nixlib-b7baf40e099b4215181fe7b0c63083b12ef2c7fb.tar.gz nixlib-b7baf40e099b4215181fe7b0c63083b12ef2c7fb.tar.bz2 nixlib-b7baf40e099b4215181fe7b0c63083b12ef2c7fb.tar.lz nixlib-b7baf40e099b4215181fe7b0c63083b12ef2c7fb.tar.xz nixlib-b7baf40e099b4215181fe7b0c63083b12ef2c7fb.tar.zst nixlib-b7baf40e099b4215181fe7b0c63083b12ef2c7fb.zip |
Merge branch 'nixos-unstable-small' of https://github.com/NixOS/nixpkgs
Conflicts: nixpkgs/pkgs/build-support/rust/build-rust-package/default.nix
Diffstat (limited to 'nixpkgs/pkgs/by-name/ph/pharo')
-rw-r--r-- | nixpkgs/pkgs/by-name/ph/pharo/package.nix | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/by-name/ph/pharo/package.nix b/nixpkgs/pkgs/by-name/ph/pharo/package.nix new file mode 100644 index 000000000000..1b76f6261365 --- /dev/null +++ b/nixpkgs/pkgs/by-name/ph/pharo/package.nix @@ -0,0 +1,94 @@ +{ lib +, stdenv +, cairo +, cmake +, fetchzip +, freetype +, libffi +, libgit2 +, libpng +, libuuid +, makeBinaryWrapper +, openssl +, pixman +, SDL2 +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "pharo"; + version = "10.0.9-de76067"; + + src = fetchzip { + # It is necessary to download from there instead of from the repository because that archive + # also contains artifacts necessary for the bootstrapping. + 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="; + }; + + strictDeps = true; + + buildInputs = [ + cairo + freetype + libffi + libgit2 + libpng + libuuid + openssl + pixman + SDL2 + ]; + + nativeBuildInputs = [ + cmake + makeBinaryWrapper + ]; + + cmakeFlags = [ + # Necessary to perform the bootstrapping without already having Pharo available. + "-DGENERATED_SOURCE_DIR=." + "-DALWAYS_INTERACTIVE=ON" + "-DBUILD_IS_RELEASE=ON" + "-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" + + 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}" + ''; + + meta = { + description = "Clean and innovative Smalltalk-inspired environment"; + homepage = "https://pharo.org"; + license = lib.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 = with lib.maintainers; [ ehmry ]; + mainProgram = "pharo"; + platforms = lib.platforms.linux; + }; +}) |