summaryrefslogtreecommitdiffstats
path: root/pkgs/development/interpreters/python/pypy/default.nix
diff options
context:
space:
mode:
authorSandro Jäckel <sandro.jaeckel@gmail.com>2023-06-28 01:14:29 +0200
committerSandro Jäckel <sandro.jaeckel@gmail.com>2023-12-10 03:10:47 +0100
commit904e7ce05b2366b960a7412354e31f8f9af227ab (patch)
tree192f1cb25af888eb8d9f39ef40116638c9caadc5 /pkgs/development/interpreters/python/pypy/default.nix
parent84536849e642d11780b35db7862b23cf4423aff0 (diff)
pypy: add option to change optimization level, update homepage, cleanup
Diffstat (limited to 'pkgs/development/interpreters/python/pypy/default.nix')
-rw-r--r--pkgs/development/interpreters/python/pypy/default.nix17
1 files changed, 11 insertions, 6 deletions
diff --git a/pkgs/development/interpreters/python/pypy/default.nix b/pkgs/development/interpreters/python/pypy/default.nix
index 84af77bade9e..c64c65df350e 100644
--- a/pkgs/development/interpreters/python/pypy/default.nix
+++ b/pkgs/development/interpreters/python/pypy/default.nix
@@ -1,9 +1,12 @@
{ lib, stdenv, substituteAll, fetchurl
-, zlib ? null, zlibSupport ? true, bzip2, pkg-config, libffi, libunwind, Security
+, zlibSupport ? true, zlib
+, bzip2, pkg-config, libffi, libunwind, Security
, sqlite, openssl, ncurses, python, expat, tcl, tk, tix, libX11
-, self, gdbm, db, xz
-, python-setup-hook
+, gdbm, db, xz, python-setup-hook
+, optimizationLevel ? "jit", boehmgc
# For the Python package set
+, hash
+, self
, packageOverrides ? (self: super: {})
, pkgsBuildBuild
, pkgsBuildHost
@@ -12,7 +15,6 @@
, pkgsTargetTarget
, sourceVersion
, pythonVersion
-, hash
, passthruFun
, pythonAttr ? "pypy${lib.substring 0 1 pythonVersion}${lib.substring 2 3 pythonVersion}"
}:
@@ -59,6 +61,8 @@ in with passthru; stdenv.mkDerivation rec {
stdenv.cc.libc
] ++ lib.optionals zlibSupport [
zlib
+ ] ++ lib.optionals (lib.any (l: l == optimizationLevel) [ "0" "1" "2" "3"]) [
+ boehmgc
] ++ lib.optionals stdenv.isDarwin [
libunwind Security
];
@@ -102,7 +106,7 @@ in with passthru; stdenv.mkDerivation rec {
${pythonForPypy.interpreter} rpython/bin/rpython \
--make-jobs="$NIX_BUILD_CORES" \
- -Ojit \
+ -O${optimizationLevel} \
--batch pypy/goal/targetpypystandalone.py
runHook postBuild
@@ -195,10 +199,11 @@ in with passthru; stdenv.mkDerivation rec {
enableParallelBuilding = true; # almost no parallelization without STM
meta = with lib; {
- homepage = "http://pypy.org/";
+ homepage = "https://www.pypy.org/";
description = "Fast, compliant alternative implementation of the Python language (${pythonVersion})";
license = licenses.mit;
platforms = [ "aarch64-linux" "x86_64-linux" "aarch64-darwin" "x86_64-darwin" ];
+ broken = optimizationLevel == "0"; # generates invalid code
maintainers = with maintainers; [ andersk ];
};
}