diff options
Diffstat (limited to 'pkgs/development/interpreters')
42 files changed, 707 insertions, 165 deletions
diff --git a/pkgs/development/interpreters/bats/default.nix b/pkgs/development/interpreters/bats/default.nix index 3379d1370af11..da12e7a3e65f4 100644 --- a/pkgs/development/interpreters/bats/default.nix +++ b/pkgs/development/interpreters/bats/default.nix @@ -1,4 +1,4 @@ -{ resholvePackage +{ resholve , lib , stdenv , fetchFromGitHub @@ -10,7 +10,7 @@ , doInstallCheck ? true }: -resholvePackage rec { +resholve.mkDerivation rec { pname = "bats"; version = "1.6.0"; diff --git a/pkgs/development/interpreters/clojure/babashka.nix b/pkgs/development/interpreters/clojure/babashka.nix index c3dcd0a0f71ff..1f663b5488d2d 100644 --- a/pkgs/development/interpreters/clojure/babashka.nix +++ b/pkgs/development/interpreters/clojure/babashka.nix @@ -2,11 +2,11 @@ buildGraalvmNativeImage rec { pname = "babashka"; - version = "0.7.8"; + version = "0.8.1"; src = fetchurl { url = "https://github.com/babashka/${pname}/releases/download/v${version}/${pname}-${version}-standalone.jar"; - sha256 = "sha256-VbDivl92YYWzIbkbOgDijzf9bZ5ZyodcapPPG4EiGXc="; + sha256 = "sha256-9mh3ki6Q0vwlF+j4+UVznIhZ6Xleh7ChklJ5ojjGhYM="; }; executable = "bb"; diff --git a/pkgs/development/interpreters/clojure/default.nix b/pkgs/development/interpreters/clojure/default.nix index cd63e506a55f4..212e453b7a724 100644 --- a/pkgs/development/interpreters/clojure/default.nix +++ b/pkgs/development/interpreters/clojure/default.nix @@ -2,12 +2,12 @@ stdenv.mkDerivation rec { pname = "clojure"; - version = "1.11.0.1100"; + version = "1.11.1.1113"; src = fetchurl { # https://clojure.org/releases/tools url = "https://download.clojure.org/install/clojure-tools-${version}.tar.gz"; - sha256 = "sha256-9KEsO32118fvKE1Gls+9nAeRdlhTKfmJylsiSYCoKKU="; + sha256 = "sha256-DJVKVqBx8zueA5+KuQX4NypaYBoNFKMuDM8jDqdgaiI="; }; nativeBuildInputs = [ diff --git a/pkgs/development/interpreters/dart/default.nix b/pkgs/development/interpreters/dart/default.nix index 366b7df3edd44..0891bfd2d8ff0 100644 --- a/pkgs/development/interpreters/dart/default.nix +++ b/pkgs/development/interpreters/dart/default.nix @@ -13,6 +13,10 @@ version = "2.15.1"; in { + "${version}-aarch64-darwin" = fetchurl { + url = "${base}/stable/release/${version}/sdk/dartsdk-macos-${aarch64}-release.zip"; + sha256 = "sha256-DDE4DpA2m8wKkUZuQDn4NpXVvtaJ6sIHeKNjk3RbpYE="; + }; "${version}-x86_64-darwin" = fetchurl { url = "${base}/stable/release/${version}/sdk/dartsdk-macos-${x86_64}-release.zip"; sha256 = "sha256-s6bkwh2m5KdRr/WxWXwItO9YaDpp/HI3xjnS2UHmN+I="; @@ -47,6 +51,7 @@ stdenv.mkDerivation { mkdir -p $out cp -R * $out/ echo $libPath + '' + lib.optionalString(stdenv.isLinux) '' find $out/bin -executable -type f -exec patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) {} \; ''; @@ -63,7 +68,7 @@ stdenv.mkDerivation { with C-style syntax. It offers compilation to JavaScript, interfaces, mixins, abstract classes, reified generics, and optional typing. ''; - platforms = [ "x86_64-linux" "i686-linux" "aarch64-linux" "x86_64-darwin" ]; + platforms = [ "x86_64-linux" "i686-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ]; license = licenses.bsd3; }; } diff --git a/pkgs/development/interpreters/duktape/default.nix b/pkgs/development/interpreters/duktape/default.nix index 912fc691dd919..3d52eda7660e0 100644 --- a/pkgs/development/interpreters/duktape/default.nix +++ b/pkgs/development/interpreters/duktape/default.nix @@ -38,6 +38,7 @@ stdenv.mkDerivation rec { downloadPage = "https://duktape.org/download.html"; license = licenses.mit; maintainers = [ maintainers.fgaz ]; + mainProgram = "duk"; platforms = platforms.all; }; } diff --git a/pkgs/development/interpreters/elixir/1.13.nix b/pkgs/development/interpreters/elixir/1.13.nix index 0e1ddcc19bf0c..452c3c5413ec9 100644 --- a/pkgs/development/interpreters/elixir/1.13.nix +++ b/pkgs/development/interpreters/elixir/1.13.nix @@ -3,7 +3,7 @@ # How to obtain `sha256`: # nix-prefetch-url --unpack https://github.com/elixir-lang/elixir/archive/v${version}.tar.gz mkDerivation { - version = "1.13.3"; - sha256 = "sha256-xOIGMpjemPi1xLiYmFpQR4FD6PzeFBxSJP4QpNnEUSE="; + version = "1.13.4"; + sha256 = "sha256-xGKq62wzaIfgZN2j808fL3b8ykizQVPuePWzsy2HKfw="; minimumOTPVersion = "22"; } diff --git a/pkgs/development/interpreters/gnu-apl/default.nix b/pkgs/development/interpreters/gnu-apl/default.nix index 0f666dd9af5db..836a09961fafa 100644 --- a/pkgs/development/interpreters/gnu-apl/default.nix +++ b/pkgs/development/interpreters/gnu-apl/default.nix @@ -11,14 +11,16 @@ stdenv.mkDerivation rec { buildInputs = [ readline gettext ncurses ]; - # Needed with GCC 8 NIX_CFLAGS_COMPILE = with lib; toString ((optionals stdenv.cc.isGNU [ + # Needed with GCC 8 "-Wno-error=int-in-bool-context" "-Wno-error=class-memaccess" "-Wno-error=restrict" "-Wno-error=format-truncation" # Needed with GCC 10 "-Wno-error=maybe-uninitialized" + # Needed with GCC 11 + "-Wno-error=misleading-indentation" ]) ++ optional stdenv.cc.isClang "-Wno-error=null-dereference"); patchPhase = lib.optionalString stdenv.isDarwin '' diff --git a/pkgs/development/interpreters/janet/default.nix b/pkgs/development/interpreters/janet/default.nix index 4601faafb06d3..098a7fe7d3a10 100644 --- a/pkgs/development/interpreters/janet/default.nix +++ b/pkgs/development/interpreters/janet/default.nix @@ -2,13 +2,13 @@ stdenv.mkDerivation rec { pname = "janet"; - version = "1.21.1"; + version = "1.21.2"; src = fetchFromGitHub { owner = "janet-lang"; repo = pname; rev = "v${version}"; - sha256 = "sha256-wJwlGliXoj0XmC9qb6SCo8mUy4aqHvJtFiigUB7PFLE="; + sha256 = "sha256-6E726+DLs1hCUbr2/rqIdSn8u94LLFdKBBHkbB4rgm0="; }; # This release fails the test suite on darwin, remove when debugged. diff --git a/pkgs/development/interpreters/joker/default.nix b/pkgs/development/interpreters/joker/default.nix index 141bda75fa884..ae408f5fec5e0 100644 --- a/pkgs/development/interpreters/joker/default.nix +++ b/pkgs/development/interpreters/joker/default.nix @@ -2,13 +2,13 @@ buildGoModule rec { pname = "joker"; - version = "0.18.0"; + version = "1.0.0"; src = fetchFromGitHub { rev = "v${version}"; owner = "candid82"; repo = "joker"; - sha256 = "sha256-Iia4sl8lRTpek5aZvQW/yy+TnMq5KNJH+pBnksqL/G0="; + sha256 = "sha256-SlkhxALJwrZ/DOuBbqjb+wHEfT5mhd3lSD6E0geFP4Y="; }; vendorSha256 = "sha256-AYoespfzFLP/jIIxbw5K653wc7sSfLY8K7di8GZ64wA="; diff --git a/pkgs/development/interpreters/lolcode/default.nix b/pkgs/development/interpreters/lolcode/default.nix index 0bb95ed6ea52f..23a77596e1d9d 100644 --- a/pkgs/development/interpreters/lolcode/default.nix +++ b/pkgs/development/interpreters/lolcode/default.nix @@ -28,6 +28,7 @@ stdenv.mkDerivation rec { ''; license = licenses.gpl3; maintainers = [ maintainers.AndersonTorres ]; + mainProgram = "lolcode-lci"; platforms = lib.platforms.unix; }; diff --git a/pkgs/development/interpreters/luajit/2.0.nix b/pkgs/development/interpreters/luajit/2.0.nix index 5516bf002cd96..f2fc16963cadb 100644 --- a/pkgs/development/interpreters/luajit/2.0.nix +++ b/pkgs/development/interpreters/luajit/2.0.nix @@ -1,10 +1,10 @@ { self, callPackage, lib }: callPackage ./default.nix { inherit self; - version = "2.0.5-2021-10-02"; - rev = "d3294fa63b344173db68dd612c6d3801631e28d4"; + version = "2.0.5-2022-03-13"; + rev = "93a65d3cc263aef2d2feb3d7ff2206aca3bee17e"; isStable = true; - sha256 = "0ja6x7bv3iqnf6m8xk6qp1dgan2b7mys0ff86dw671fqqrfw28fn"; + hash = "sha256-Gp7OdfxBGkW59zxWUml2ugPABLUv2SezMiDblA/FZ7g="; extraMeta = { # this isn't precise but it at least stops the useless Hydra build platforms = with lib; filter (p: !hasPrefix "aarch64-" p) (platforms.linux ++ platforms.darwin); diff --git a/pkgs/development/interpreters/luajit/2.1.nix b/pkgs/development/interpreters/luajit/2.1.nix index 4898999281d0e..507bc40fcf6a4 100644 --- a/pkgs/development/interpreters/luajit/2.1.nix +++ b/pkgs/development/interpreters/luajit/2.1.nix @@ -1,8 +1,8 @@ { self, callPackage }: callPackage ./default.nix { inherit self; - version = "2.1.0-2021-10-27"; - rev = "b4b2dce9fc3ffaaaede39b36d06415311e2aa516"; + version = "2.1.0-2022-04-05"; + rev = "5e3c45c43bb0e0f1f2917d432e9d2dba12c42a6e"; isStable = false; - sha256 = "185s071aa0yffz8npgdxj7l98cs987vddb2l5pzfcdqfj41gn55q"; + hash = "sha256-Q+34hJDgyCqmtThHbxR16Nn7zhq4Ql142No2rO57HL0="; } diff --git a/pkgs/development/interpreters/luajit/default.nix b/pkgs/development/interpreters/luajit/default.nix index 4e2931aa76885..480e34244134f 100644 --- a/pkgs/development/interpreters/luajit/default.nix +++ b/pkgs/development/interpreters/luajit/default.nix @@ -4,7 +4,7 @@ , buildPackages , name ? "luajit-${version}" , isStable -, sha256 +, hash , rev , version , extraMeta ? { } @@ -46,7 +46,7 @@ stdenv.mkDerivation rec { src = fetchFromGitHub { owner = "LuaJIT"; repo = "LuaJIT"; - inherit sha256 rev; + inherit hash rev; }; luaversion = "5.1"; diff --git a/pkgs/development/interpreters/maude/default.nix b/pkgs/development/interpreters/maude/default.nix index 860f9ac3a5eb1..30055dc7a3dd6 100644 --- a/pkgs/development/interpreters/maude/default.nix +++ b/pkgs/development/interpreters/maude/default.nix @@ -30,6 +30,10 @@ stdenv.mkDerivation { hardeningDisable = [ "stackprotector" ] ++ lib.optionals stdenv.isi686 [ "pic" "fortify" ]; + # Fix for glibc-2.34, see + # https://gitweb.gentoo.org/repo/gentoo.git/commit/dev-lang/maude/maude-3.1-r1.ebuild?id=f021cc6cfa1e35eb9c59955830f1fd89bfcb26b4 + configureFlags = [ "--without-libsigsegv" ]; + preConfigure = '' configureFlagsArray=( --datadir="$out/share/maude" diff --git a/pkgs/development/interpreters/nickel/default.nix b/pkgs/development/interpreters/nickel/default.nix new file mode 100644 index 0000000000000..7a097391ba5d5 --- /dev/null +++ b/pkgs/development/interpreters/nickel/default.nix @@ -0,0 +1,33 @@ +{ lib +, rustPlatform +, fetchFromGitHub +}: + +rustPlatform.buildRustPackage rec { + pname = "nickel"; + version = "0.1.0"; + + src = fetchFromGitHub { + owner = "tweag"; + repo = pname; + rev = "refs/tags/${version}"; # because pure ${version} doesn't work + hash = "sha256-St8oK9vP2cAhsNindkebtAMeRPwYggP9E4CciSZc7oA="; + }; + + cargoSha256 = "sha256-VsyK/api8acIpADpXQ8RdbRLiZwHFSDH0vwQrZQ8zp4="; + + meta = with lib; { + homepage = "https://nickel-lang.org/"; + description = "Better configuration for less"; + longDescription = '' + Nickel is the cheap configuration language. + + Its purpose is to automate the generation of static configuration files - + think JSON, YAML, XML, or your favorite data representation language - + that are then fed to another system. It is designed to have a simple, + well-understood core: it is in essence JSON with functions. + ''; + license = licenses.mit; + maintainers = with maintainers; [ AndersonTorres ]; + }; +} diff --git a/pkgs/development/interpreters/octave/default.nix b/pkgs/development/interpreters/octave/default.nix index 1bd78a8a2d4e4..2fcdab95509e7 100644 --- a/pkgs/development/interpreters/octave/default.nix +++ b/pkgs/development/interpreters/octave/default.nix @@ -58,9 +58,6 @@ , qtscript ? null , qscintilla ? null , qttools ? null -# - JIT compiler for loops: -, enableJIT ? false -, llvm ? null , libiconv , darwin }: @@ -114,12 +111,12 @@ let }; self = mkDerivation rec { - version = "6.4.0"; + version = "7.1.0"; pname = "octave"; src = fetchurl { url = "mirror://gnu/octave/${pname}-${version}.tar.gz"; - sha256 = "sha256-tI8z1Pzq85TPvqc6jIUAAJNtg6QXOaJPdWi1sKezms0="; + sha256 = "sha256-1KnYHz9ntKbgfLeoDcsQrV6RdvzDB2LHCoFYCmS4sLY="; }; buildInputs = [ @@ -173,7 +170,6 @@ let texinfo ] ++ lib.optionals (sundials != null) [ sundials ] - ++ lib.optionals enableJIT [ llvm ] ++ lib.optionals enableQt [ qtscript qttools @@ -199,7 +195,6 @@ let ++ lib.optionals enableReadline [ "--enable-readline" ] ++ lib.optionals stdenv.isDarwin [ "--with-x=no" ] ++ lib.optionals enableQt [ "--with-qt=5" ] - ++ lib.optionals enableJIT [ "--enable-jit" ] ; # Keep a copy of the octave tests detailed results in the output @@ -220,7 +215,7 @@ let inherit portaudio; inherit jdk; inherit python; - inherit enableQt enableJIT enableReadline enableJava; + inherit enableQt enableReadline enableJava; buildEnv = callPackage ./build-env.nix { octave = self; inherit octavePackages wrapOctave; @@ -236,8 +231,6 @@ let license = lib.licenses.gpl3Plus; maintainers = with lib.maintainers; [ raskin doronbehar ]; description = "Scientific Programming Language"; - # https://savannah.gnu.org/bugs/?func=detailitem&item_id=56425 is the best attempt to fix JIT - broken = enableJIT; platforms = if overridePlatforms == null then (lib.platforms.linux ++ lib.platforms.darwin) else overridePlatforms; diff --git a/pkgs/development/interpreters/perl/default.nix b/pkgs/development/interpreters/perl/default.nix index 54769a03b7b6f..9c3c34c73aad1 100644 --- a/pkgs/development/interpreters/perl/default.nix +++ b/pkgs/development/interpreters/perl/default.nix @@ -1,6 +1,7 @@ -{ config, lib, stdenv, fetchurl, fetchpatch, fetchFromGitHub, pkgs, buildPackages +{ config, lib, stdenv, fetchurl, fetchFromGitHub, pkgs, buildPackages , callPackage , enableThreading ? true, coreutils, makeWrapper +, zlib }: # Note: this package is used for bootstrapping fetchurl, and thus @@ -19,11 +20,10 @@ let common = { perl, buildPerl, version, sha256 }: stdenv.mkDerivation (rec { inherit version; - - name = "perl-${version}"; + pname = "perl"; src = fetchurl { - url = "mirror://cpan/src/5.0/${name}.tar.gz"; + url = "mirror://cpan/src/5.0/perl-${version}.tar.gz"; inherit sha256; }; @@ -41,14 +41,7 @@ let ] ++ optional stdenv.isSunOS ./ld-shared.patch ++ optionals stdenv.isDarwin [ ./cpp-precomp.patch ./sw_vers.patch ] - ++ optionals crossCompiling [ - ./MakeMaker-cross.patch - # https://github.com/arsv/perl-cross/pull/120 - (fetchpatch { - url = "https://github.com/arsv/perl-cross/commit/3c318ae6572f8b36cb077c8b49c851e2f5fe181e.patch"; - sha256 = "0cmcy8bams3c68f6xadl52z2w378wcpdjzi3qi4pcyvcfs011l6g"; - }) - ]; + ++ optional crossCompiling ./MakeMaker-cross.patch; # This is not done for native builds because pwd may need to come from # bootstrap tools when building bootstrap perl. @@ -116,6 +109,16 @@ let cf_by="nixpkgs" cf_time="$(date -d "@$SOURCE_DATE_EPOCH")" EOF + + # Compress::Raw::Zlib should use our zlib package instead of the one + # included with the distribution + cat > ./cpan/Compress-Raw-Zlib/config.in <<EOF + BUILD_ZLIB = False + INCLUDE = ${zlib.dev}/include + LIB = ${zlib.out}/lib + OLD_ZLIB = False + GZIP_OS_CODE = AUTO_DETECT + EOF '' + optionalString stdenv.isDarwin '' substituteInPlace hints/darwin.sh --replace "env MACOSX_DEPLOYMENT_TARGET=10.3" "" '' + optionalString (!enableThreading) '' @@ -194,14 +197,14 @@ let priority = 6; # in `buildEnv' (including the one inside `perl.withPackages') the library files will have priority over files in `perl` }; } // optionalAttrs (stdenv.buildPlatform != stdenv.hostPlatform) rec { - crossVersion = "393821c7cf53774233aaf130ff2c8ccec701b0a9"; # Sep 22, 2021 + crossVersion = "1.3.7"; # Mar 15, 2022 perl-cross-src = fetchFromGitHub { name = "perl-cross-${crossVersion}"; owner = "arsv"; repo = "perl-cross"; rev = crossVersion; - sha256 = "1fn35b1773aibi2z54m0mar7114737mvfyp81wkdwhakrmzr5nv1"; + sha256 = "sha256-F7Vi3RAgIE/3NPlbD5zQ3Q8Ex9ddXTC4zoCRaOxXK0A="; }; depsBuildBuild = [ buildPackages.stdenv.cc makeWrapper ]; @@ -230,15 +233,15 @@ in { perl534 = common { perl = pkgs.perl534; buildPerl = buildPackages.perl534; - version = "5.34.0"; - sha256 = "16mywn5afpv1mczv9dlc1w84rbgjgrr0pyr4c0hhb2wnif0zq7jm"; + version = "5.34.1"; + sha256 = "sha256-NXlRpJGwuhzjYRJjki/ux4zNWB3dwkpEawM+JazyQqE="; }; # the latest Devel version perldevel = common { perl = pkgs.perldevel; buildPerl = buildPackages.perldevel; - version = "5.35.4"; - sha256 = "1ss2r0qq5li6d2qghfv1iah5nl6nraymd7b7ib1iy1395rwyhl4q"; + version = "5.35.9"; + sha256 = "sha256-/nmSCIIXHXoC68DxFM9b5GM2AKU4WlLbfWLgduanL7U="; }; } diff --git a/pkgs/development/interpreters/php/7.4.nix b/pkgs/development/interpreters/php/7.4.nix index 4bd00811b5fb5..823002978785d 100644 --- a/pkgs/development/interpreters/php/7.4.nix +++ b/pkgs/development/interpreters/php/7.4.nix @@ -2,8 +2,8 @@ let base = callPackage ./generic.nix (_args // { - version = "7.4.28"; - sha256 = "sha256-IIUIaoY0RLDjlUfeGklp/RxAoMGI61j6spOLZJsMS1g="; + version = "7.4.29"; + sha256 = "sha256-fd5YoCsiXCUTDG4q4su6clS7A0D3/hcpFHgXbYZvlII="; }); in diff --git a/pkgs/development/interpreters/php/8.0.nix b/pkgs/development/interpreters/php/8.0.nix index 3332c9d5a420c..1a3cb77bab11e 100644 --- a/pkgs/development/interpreters/php/8.0.nix +++ b/pkgs/development/interpreters/php/8.0.nix @@ -2,8 +2,8 @@ let base = callPackage ./generic.nix (_args // { - version = "8.0.17"; - sha256 = "52811ee2dde71660ca32737a4ac696c24591eb22e846dd8e09ee77122660283f"; + version = "8.0.18"; + sha256 = "sha256-gm7jSIGhw0lnjU98xV/5FB+hQRNE5LuPldD5IjvOtVo="; }); in diff --git a/pkgs/development/interpreters/php/8.1.nix b/pkgs/development/interpreters/php/8.1.nix index aa98204b9979c..5c94f168866ce 100644 --- a/pkgs/development/interpreters/php/8.1.nix +++ b/pkgs/development/interpreters/php/8.1.nix @@ -2,8 +2,8 @@ let base = callPackage ./generic.nix (_args // { - version = "8.1.4"; - sha256 = "b3f688cb69758523838b8e7f509aaef0152133d9b84a84a0b7cf68eeafc1df76"; + version = "8.1.5"; + sha256 = "sha256-gn3lZ3HDq4MToGmBLxX27EmYnVEK69Dc4YCDnG2Nb/M="; }); in diff --git a/pkgs/development/interpreters/php/generic.nix b/pkgs/development/interpreters/php/generic.nix index bf2ff11158ecb..7c0994d15b645 100644 --- a/pkgs/development/interpreters/php/generic.nix +++ b/pkgs/development/interpreters/php/generic.nix @@ -176,6 +176,10 @@ let if test -e $out/bin/phpdbg; then wrapProgram $out/bin/phpdbg --set PHP_INI_SCAN_DIR $out/lib fi + + if test -e $out/bin/php-cgi; then + wrapProgram $out/bin/php-cgi --set PHP_INI_SCAN_DIR $out/lib + fi ''; }; in @@ -268,7 +272,7 @@ let export EXTENSION_DIR=$out/lib/php/extensions '' # PKG_CONFIG need not be a relative path - + lib.optionalString (!lib.versionAtLeast version "7.4") '' + + lib.optionalString (lib.versionOlder version "7.4") '' for i in $(find . -type f -name "*.m4"); do substituteInPlace $i \ --replace 'test -x "$PKG_CONFIG"' 'type -P "$PKG_CONFIG" >/dev/null' diff --git a/pkgs/development/interpreters/python/cpython/3.11/python-3.x-distutils-C++.patch b/pkgs/development/interpreters/python/cpython/3.11/python-3.x-distutils-C++.patch new file mode 100644 index 0000000000000..335e06b93c397 --- /dev/null +++ b/pkgs/development/interpreters/python/cpython/3.11/python-3.x-distutils-C++.patch @@ -0,0 +1,257 @@ +diff --git a/Lib/_osx_support.py b/Lib/_osx_support.py +index aa66c8b9f4..71e6556bac 100644 +--- a/Lib/_osx_support.py ++++ b/Lib/_osx_support.py +@@ -14,13 +14,13 @@ + # configuration variables that may contain universal build flags, + # like "-arch" or "-isdkroot", that may need customization for + # the user environment +-_UNIVERSAL_CONFIG_VARS = ('CFLAGS', 'LDFLAGS', 'CPPFLAGS', 'BASECFLAGS', +- 'BLDSHARED', 'LDSHARED', 'CC', 'CXX', +- 'PY_CFLAGS', 'PY_LDFLAGS', 'PY_CPPFLAGS', +- 'PY_CORE_CFLAGS', 'PY_CORE_LDFLAGS') ++_UNIVERSAL_CONFIG_VARS = ('CFLAGS', 'CXXFLAGS', 'LDFLAGS', 'CPPFLAGS', ++ 'BASECFLAGS', 'BLDSHARED', 'LDSHARED', 'LDCXXSHARED', ++ 'CC', 'CXX', 'PY_CFLAGS', 'PY_LDFLAGS', ++ 'PY_CPPFLAGS', 'PY_CORE_LDFLAGS', 'PY_CORE_CFLAGS') + + # configuration variables that may contain compiler calls +-_COMPILER_CONFIG_VARS = ('BLDSHARED', 'LDSHARED', 'CC', 'CXX') ++_COMPILER_CONFIG_VARS = ('BLDSHARED', 'LDSHARED', 'LDCXXSHARED', 'CC', 'CXX') + + # prefix added to original configuration variable names + _INITPRE = '_OSX_SUPPORT_INITIAL_' +diff --git a/Lib/distutils/cygwinccompiler.py b/Lib/distutils/cygwinccompiler.py +index 66c12dd358..dddb9fd2d4 100644 +--- a/Lib/distutils/cygwinccompiler.py ++++ b/Lib/distutils/cygwinccompiler.py +@@ -123,8 +123,10 @@ def __init__(self, verbose=0, dry_run=0, force=0): + # dllwrap 2.10.90 is buggy + if self.ld_version >= "2.10.90": + self.linker_dll = "gcc" ++ self.linker_dll_cxx = "g++" + else: + self.linker_dll = "dllwrap" ++ self.linker_dll_cxx = "dllwrap" + + # ld_version >= "2.13" support -shared so use it instead of + # -mdll -static +@@ -138,9 +140,13 @@ def __init__(self, verbose=0, dry_run=0, force=0): + self.set_executables(compiler='gcc -mcygwin -O -Wall', + compiler_so='gcc -mcygwin -mdll -O -Wall', + compiler_cxx='g++ -mcygwin -O -Wall', ++ compiler_so_cxx='g++ -mcygwin -mdll -O -Wall', + linker_exe='gcc -mcygwin', + linker_so=('%s -mcygwin %s' % +- (self.linker_dll, shared_option))) ++ (self.linker_dll, shared_option)), ++ linker_exe_cxx='g++ -mcygwin', ++ linker_so_cxx=('%s -mcygwin %s' % ++ (self.linker_dll_cxx, shared_option))) + + # cygwin and mingw32 need different sets of libraries + if self.gcc_version == "2.91.57": +@@ -164,8 +170,12 @@ def _compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts): + raise CompileError(msg) + else: # for other files use the C-compiler + try: +- self.spawn(self.compiler_so + cc_args + [src, '-o', obj] + +- extra_postargs) ++ if self.detect_language(src) == 'c++': ++ self.spawn(self.compiler_so_cxx + cc_args + [src, '-o', obj] + ++ extra_postargs) ++ else: ++ self.spawn(self.compiler_so + cc_args + [src, '-o', obj] + ++ extra_postargs) + except DistutilsExecError as msg: + raise CompileError(msg) + +@@ -300,9 +310,14 @@ def __init__(self, verbose=0, dry_run=0, force=0): + self.set_executables(compiler='gcc -O -Wall', + compiler_so='gcc -mdll -O -Wall', + compiler_cxx='g++ -O -Wall', ++ compiler_so_cxx='g++ -mdll -O -Wall', + linker_exe='gcc', + linker_so='%s %s %s' + % (self.linker_dll, shared_option, ++ entry_point), ++ linker_exe_cxx='g++', ++ linker_so_cxx='%s %s %s' ++ % (self.linker_dll_cxx, shared_option, + entry_point)) + # Maybe we should also append -mthreads, but then the finished + # dlls need another dll (mingwm10.dll see Mingw32 docs) +diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py +index 3414a761e7..f1af560cc1 100644 +--- a/Lib/distutils/sysconfig.py ++++ b/Lib/distutils/sysconfig.py +@@ -216,9 +216,11 @@ def customize_compiler(compiler): + _osx_support.customize_compiler(_config_vars) + _config_vars['CUSTOMIZED_OSX_COMPILER'] = 'True' + +- (cc, cxx, cflags, ccshared, ldshared, shlib_suffix, ar, ar_flags) = \ +- get_config_vars('CC', 'CXX', 'CFLAGS', +- 'CCSHARED', 'LDSHARED', 'SHLIB_SUFFIX', 'AR', 'ARFLAGS') ++ (cc, cxx, cflags, ccshared, ldshared, ldcxxshared, shlib_suffix, ar, ar_flags) = \ ++ get_config_vars('CC', 'CXX', 'CFLAGS', 'CCSHARED', 'LDSHARED', 'LDCXXSHARED', ++ 'SHLIB_SUFFIX', 'AR', 'ARFLAGS') ++ ++ cxxflags = cflags + + if 'CC' in os.environ: + newcc = os.environ['CC'] +@@ -233,19 +235,27 @@ def customize_compiler(compiler): + cxx = os.environ['CXX'] + if 'LDSHARED' in os.environ: + ldshared = os.environ['LDSHARED'] ++ if 'LDCXXSHARED' in os.environ: ++ ldcxxshared = os.environ['LDCXXSHARED'] + if 'CPP' in os.environ: + cpp = os.environ['CPP'] + else: + cpp = cc + " -E" # not always + if 'LDFLAGS' in os.environ: + ldshared = ldshared + ' ' + os.environ['LDFLAGS'] ++ ldcxxshared = ldcxxshared + ' ' + os.environ['LDFLAGS'] + if 'CFLAGS' in os.environ: +- cflags = cflags + ' ' + os.environ['CFLAGS'] ++ cflags = os.environ['CFLAGS'] + ldshared = ldshared + ' ' + os.environ['CFLAGS'] ++ if 'CXXFLAGS' in os.environ: ++ cxxflags = os.environ['CXXFLAGS'] ++ ldcxxshared = ldcxxshared + ' ' + os.environ['CXXFLAGS'] + if 'CPPFLAGS' in os.environ: + cpp = cpp + ' ' + os.environ['CPPFLAGS'] + cflags = cflags + ' ' + os.environ['CPPFLAGS'] ++ cxxflags = cxxflags + ' ' + os.environ['CPPFLAGS'] + ldshared = ldshared + ' ' + os.environ['CPPFLAGS'] ++ ldcxxshared = ldcxxshared + ' ' + os.environ['CPPFLAGS'] + if 'AR' in os.environ: + ar = os.environ['AR'] + if 'ARFLAGS' in os.environ: +@@ -254,13 +264,17 @@ def customize_compiler(compiler): + archiver = ar + ' ' + ar_flags + + cc_cmd = cc + ' ' + cflags ++ cxx_cmd = cxx + ' ' + cxxflags + compiler.set_executables( + preprocessor=cpp, + compiler=cc_cmd, + compiler_so=cc_cmd + ' ' + ccshared, +- compiler_cxx=cxx, ++ compiler_cxx=cxx_cmd, ++ compiler_so_cxx=cxx_cmd + ' ' + ccshared, + linker_so=ldshared, + linker_exe=cc, ++ linker_so_cxx=ldcxxshared, ++ linker_exe_cxx=cxx, + archiver=archiver) + + compiler.shared_lib_extension = shlib_suffix +diff --git a/Lib/distutils/unixccompiler.py b/Lib/distutils/unixccompiler.py +index d00c48981e..4a3d271fee 100644 +--- a/Lib/distutils/unixccompiler.py ++++ b/Lib/distutils/unixccompiler.py +@@ -52,14 +52,17 @@ class UnixCCompiler(CCompiler): + # are pretty generic; they will probably have to be set by an outsider + # (eg. using information discovered by the sysconfig about building + # Python extensions). +- executables = {'preprocessor' : None, +- 'compiler' : ["cc"], +- 'compiler_so' : ["cc"], +- 'compiler_cxx' : ["cc"], +- 'linker_so' : ["cc", "-shared"], +- 'linker_exe' : ["cc"], +- 'archiver' : ["ar", "-cr"], +- 'ranlib' : None, ++ executables = {'preprocessor' : None, ++ 'compiler' : ["cc"], ++ 'compiler_so' : ["cc"], ++ 'compiler_cxx' : ["c++"], ++ 'compiler_so_cxx' : ["c++"], ++ 'linker_so' : ["cc", "-shared"], ++ 'linker_exe' : ["cc"], ++ 'linker_so_cxx' : ["c++", "-shared"], ++ 'linker_exe_cxx' : ["c++"], ++ 'archiver' : ["ar", "-cr"], ++ 'ranlib' : None, + } + + if sys.platform[:6] == "darwin": +@@ -110,12 +113,19 @@ def preprocess(self, source, output_file=None, macros=None, + + def _compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts): + compiler_so = self.compiler_so ++ compiler_so_cxx = self.compiler_so_cxx + if sys.platform == 'darwin': + compiler_so = _osx_support.compiler_fixup(compiler_so, + cc_args + extra_postargs) ++ compiler_so_cxx = _osx_support.compiler_fixup(compiler_so_cxx, ++ cc_args + extra_postargs) + try: +- self.spawn(compiler_so + cc_args + [src, '-o', obj] + +- extra_postargs) ++ if self.detect_language(src) == 'c++': ++ self.spawn(compiler_so_cxx + cc_args + [src, '-o', obj] + ++ extra_postargs) ++ else: ++ self.spawn(compiler_so + cc_args + [src, '-o', obj] + ++ extra_postargs) + except DistutilsExecError as msg: + raise CompileError(msg) + +@@ -173,30 +183,16 @@ def link(self, target_desc, objects, + ld_args.extend(extra_postargs) + self.mkpath(os.path.dirname(output_filename)) + try: +- if target_desc == CCompiler.EXECUTABLE: +- linker = self.linker_exe[:] ++ if target_lang == "c++": ++ if target_desc == CCompiler.EXECUTABLE: ++ linker = self.linker_exe_cxx[:] ++ else: ++ linker = self.linker_so_cxx[:] + else: +- linker = self.linker_so[:] +- if target_lang == "c++" and self.compiler_cxx: +- # skip over environment variable settings if /usr/bin/env +- # is used to set up the linker's environment. +- # This is needed on OSX. Note: this assumes that the +- # normal and C++ compiler have the same environment +- # settings. +- i = 0 +- if os.path.basename(linker[0]) == "env": +- i = 1 +- while '=' in linker[i]: +- i += 1 +- +- if os.path.basename(linker[i]) == 'ld_so_aix': +- # AIX platforms prefix the compiler with the ld_so_aix +- # script, so we need to adjust our linker index +- offset = 1 ++ if target_desc == CCompiler.EXECUTABLE: ++ linker = self.linker_exe[:] + else: +- offset = 0 +- +- linker[i+offset] = self.compiler_cxx[i] ++ linker = self.linker_so[:] + + if sys.platform == 'darwin': + linker = _osx_support.compiler_fixup(linker, ld_args) +diff --git a/Makefile.pre.in b/Makefile.pre.in +index f803391346..090f14c46c 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -732,9 +732,9 @@ sharedmods: $(BUILDPYTHON) pybuilddir.txt @LIBMPDEC_INTERNAL@ @LIBEXPAT_INTERNAL + *\ -s*|s*) quiet="-q";; \ + *) quiet="";; \ + esac; \ +- echo "$(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ ++ echo "$(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' CFLAGS='$(PY_CFLAGS)' \ + $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build"; \ +- $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ ++ $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' CFLAGS='$(PY_CFLAGS)' \ + $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build + + diff --git a/pkgs/development/interpreters/python/cpython/default.nix b/pkgs/development/interpreters/python/cpython/default.nix index 02ecf8d25b1ef..4463dc8e9ba0d 100644 --- a/pkgs/development/interpreters/python/cpython/default.nix +++ b/pkgs/development/interpreters/python/cpython/default.nix @@ -49,7 +49,7 @@ , enableLTO ? stdenv.is64bit && stdenv.isLinux , reproducibleBuild ? false , pythonAttr ? "python${sourceVersion.major}${sourceVersion.minor}" -}: +} @ inputs: # Note: this package is used for bootstrapping fetchurl, and thus # cannot use fetchpatch! All mutable patches (generated by GitHub or @@ -83,7 +83,11 @@ let tzdataSupport = tzdata != null && passthru.pythonAtLeast "3.9"; - passthru = passthruFun rec { + passthru = let + # When we override the interpreter we also need to override the spliced versions of the interpreter + inputs' = lib.filterAttrs (_: v: ! lib.isDerivation v) inputs; + override = attr: let python = attr.override (inputs' // { self = python; }); in python; + in passthruFun rec { inherit self sourceVersion packageOverrides; implementation = "cpython"; libPrefix = "python${pythonVersion}"; @@ -91,11 +95,11 @@ let pythonVersion = with sourceVersion; "${major}.${minor}"; sitePackages = "lib/${libPrefix}/site-packages"; inherit hasDistutilsCxxPatch; - pythonOnBuildForBuild = pkgsBuildBuild.${pythonAttr}; - pythonOnBuildForHost = pkgsBuildHost.${pythonAttr}; - pythonOnBuildForTarget = pkgsBuildTarget.${pythonAttr}; - pythonOnHostForHost = pkgsHostHost.${pythonAttr}; - pythonOnTargetForTarget = pkgsTargetTarget.${pythonAttr} or {}; + pythonOnBuildForBuild = override pkgsBuildBuild.${pythonAttr}; + pythonOnBuildForHost = override pkgsBuildHost.${pythonAttr}; + pythonOnBuildForTarget = override pkgsBuildTarget.${pythonAttr}; + pythonOnHostForHost = override pkgsHostHost.${pythonAttr}; + pythonOnTargetForTarget = if lib.hasAttr pythonAttr pkgsTargetTarget then (override pkgsTargetTarget.${pythonAttr}) else {}; }; version = with sourceVersion; "${major}.${minor}.${patch}${suffix}"; @@ -236,7 +240,7 @@ in with passthru; stdenv.mkDerivation { else ./3.5/profile-task.patch ) - ] ++ optionals (pythonAtLeast "3.9" && stdenv.isDarwin) [ + ] ++ optionals (pythonAtLeast "3.9" && pythonOlder "3.11" && stdenv.isDarwin) [ # Stop checking for TCL/TK in global macOS locations ./3.9/darwin-tcl-tk.patch ] ++ optionals (isPy3k && hasDistutilsCxxPatch) [ @@ -247,8 +251,10 @@ in with passthru; stdenv.mkDerivation { ( if isPy35 then ./3.5/python-3.x-distutils-C++.patch - else if pythonAtLeast "3.7" then + else if pythonAtLeast "3.7" && pythonOlder "3.11" then ./3.7/python-3.x-distutils-C++.patch + else if pythonAtLeast "3.11" then + ./3.11/python-3.x-distutils-C++.patch else fetchpatch { url = "https://bugs.python.org/file48016/python-3.x-distutils-C++.patch"; @@ -282,7 +288,7 @@ in with passthru; stdenv.mkDerivation { CPPFLAGS = concatStringsSep " " (map (p: "-I${getDev p}/include") buildInputs); LDFLAGS = concatStringsSep " " (map (p: "-L${getLib p}/lib") buildInputs); - LIBS = "${optionalString (!stdenv.isDarwin) "-lcrypt"} ${optionalString (ncurses != null) "-lncurses"}"; + LIBS = "${optionalString (!stdenv.isDarwin) "-lcrypt"}"; NIX_LDFLAGS = lib.optionalString stdenv.cc.isGNU ({ "glibc" = "-lgcc_s"; "musl" = "-lgcc_eh"; diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix index bac5ba69c44ad..d9ade27def64d 100644 --- a/pkgs/development/interpreters/python/default.nix +++ b/pkgs/development/interpreters/python/default.nix @@ -124,19 +124,19 @@ with pkgs; sourceVersion = { major = "3"; minor = "9"; - patch = "10"; + patch = "12"; suffix = ""; }; - sha256 = "sha256-Co+/tSh+vDoT6brz1U4I+gZ3j/7M9jEa74Ibs6ZYbMg="; + sha256 = "sha256-LNlLIGcOQVnG2atX+R2/JVuX2MGhRR0cNfTsGWit+XE="; }; python310 = { sourceVersion = { major = "3"; minor = "10"; - patch = "2"; + patch = "4"; suffix = ""; }; - sha256 = "sha256-F946x9qfJRmqnWQ3jGA6c6DprVjf+ogS5FFgwIbeZMc="; + sha256 = "sha256-gL+SX1cdpDazUhCIbPefbrX6XWxXExa3NWg0NFH3ehk="; }; }; @@ -199,9 +199,9 @@ in { major = "3"; minor = "11"; patch = "0"; - suffix = "a6"; + suffix = "a7"; }; - sha256 = "sha256-HFOi/3WHljPjDKwp0qpregEONVuV8L+axpG+zPX50So="; + sha256 = "sha256-t8Vt10wvRy1Ja1qNNWvWrZ75sD8mKIwyN9P/aYqwPXQ="; inherit (darwin) configd; inherit passthruFun; }; @@ -300,11 +300,6 @@ in { inherit passthruFun; }; - graalpython37 = callPackage ./graalpython/default.nix { - self = pythonInterpreters.graalpython37; - inherit passthruFun; - }; - rustpython = callPackage ./rustpython/default.nix { inherit (darwin.apple_sdk.frameworks) SystemConfiguration; }; diff --git a/pkgs/development/interpreters/python/graalpython/default.nix b/pkgs/development/interpreters/python/graalpython/default.nix deleted file mode 100644 index b5d7d130b5a7e..0000000000000 --- a/pkgs/development/interpreters/python/graalpython/default.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ pkgs -, lib -, graalvm8 -, passthruFun -, packageOverrides ? (self: super: {}) -, self -}: - -let - passthru = passthruFun { - inherit self packageOverrides; - implementation = "graal"; - sourceVersion = graalvm8.version; - pythonVersion = "3.7"; - libPrefix = "graalvm"; - sitePackages = "jre/languages/python/lib-python/3/site-packages"; - executable = "graalpython"; - hasDistutilsCxxPatch = false; - pythonForBuild = pkgs.buildPackages.pythonInterpreters.graalpython37; - }; -in lib.extendDerivation true passthru graalvm8 diff --git a/pkgs/development/interpreters/python/update-python-libraries/update-python-libraries.py b/pkgs/development/interpreters/python/update-python-libraries/update-python-libraries.py index 5f55ed5ecaf1a..3843497d94e53 100755 --- a/pkgs/development/interpreters/python/update-python-libraries/update-python-libraries.py +++ b/pkgs/development/interpreters/python/update-python-libraries/update-python-libraries.py @@ -356,17 +356,19 @@ def _update_package(path, target): text = _replace_value('hash', sri_hash, text) if fetcher == 'fetchFromGitHub': - # in the case of fetchFromGitHub, it's common to see `rev = version;` - # in which no string value is meant to be substituted. - # Verify that the attribute is set to a variable - regex = '(rev\s+=\s+([_a-zA-Z][_a-zA-Z0-9\.]*);)' + # in the case of fetchFromGitHub, it's common to see `rev = version;` or `rev = "v${version}";` + # in which no string value is meant to be substituted. However, we can just overwrite the previous value. + regex = '(rev\s+=\s+[^;]*;)' regex = re.compile(regex) - value = regex.findall(text) - n = len(value) + matches = regex.findall(text) + n = len(matches) if n == 0: - # value is set to a string, e.g. `rev = "v${version}";` - text = _replace_value('rev', f"{prefix}${{version}}", text) + raise ValueError("Unable to find rev value for {}.".format(pname)) + else: + # forcefully rewrite rev, incase tagging conventions changed for a release + match = matches[0] + text = text.replace(match, f'rev = "refs/tags/{prefix}${{version}}";') # incase there's no prefix, just rewrite without interpolation text = text.replace('"${version}";', 'version;') diff --git a/pkgs/development/interpreters/rakudo/default.nix b/pkgs/development/interpreters/rakudo/default.nix index 9de6c1b12398d..fd8fbd42caeb2 100644 --- a/pkgs/development/interpreters/rakudo/default.nix +++ b/pkgs/development/interpreters/rakudo/default.nix @@ -2,11 +2,11 @@ stdenv.mkDerivation rec { pname = "rakudo"; - version = "2022.02"; + version = "2022.03"; src = fetchurl { url = "https://rakudo.org/dl/rakudo/rakudo-${version}.tar.gz"; - sha256 = "sha256-am6dvMbZoWEKNMbsZ+LT9pTXsz6eCg8iRUMIn6f3EzI="; + sha256 = "sha256-A+IVsAGoeXR2GNb8GOt/icC4EvXlQ6Q+1mwTQ56ooic="; }; nativeBuildInputs = [ removeReferencesTo ]; diff --git a/pkgs/development/interpreters/rakudo/moarvm.nix b/pkgs/development/interpreters/rakudo/moarvm.nix index 41462e67a4c98..6ecc3ad605360 100644 --- a/pkgs/development/interpreters/rakudo/moarvm.nix +++ b/pkgs/development/interpreters/rakudo/moarvm.nix @@ -8,11 +8,11 @@ stdenv.mkDerivation rec { pname = "moarvm"; - version = "2022.02"; + version = "2022.03"; src = fetchurl { url = "https://moarvm.org/releases/MoarVM-${version}.tar.gz"; - sha256 = "sha256-T5PNzmuKVloyKCuzjMlxzv63H10CLIUMM47oFFV07pY="; + sha256 = "sha256-+3HNE5EkZEgrmbM/DAbp/XxRoVHG5jKpIgz5PFhV/a8="; }; postPatch = '' diff --git a/pkgs/development/interpreters/rakudo/nqp.nix b/pkgs/development/interpreters/rakudo/nqp.nix index 57cdef94c02d2..dbcb945f4c347 100644 --- a/pkgs/development/interpreters/rakudo/nqp.nix +++ b/pkgs/development/interpreters/rakudo/nqp.nix @@ -2,16 +2,26 @@ stdenv.mkDerivation rec { pname = "nqp"; - version = "2022.02"; + version = "2022.03"; src = fetchurl { url = "https://github.com/raku/nqp/releases/download/${version}/nqp-${version}.tar.gz"; - sha256 = "sha256-JdPJl0XNhPQEmpvZzya7XcgXklq6r+ccm9tohBzbGLE="; + sha256 = "sha256-qV53iXDE0JwJHSqimcBQNiCM5LSw06evNzGYwSJYswY="; }; buildInputs = [ perl ]; configureScript = "${perl}/bin/perl ./Configure.pl"; + + # Fix for issue where nqp expects to find files from moarvm in the same output: + # https://github.com/Raku/nqp/commit/e6e069507de135cc71f77524455fc6b03b765b2f + # + preBuild = '' + share_dir="share/nqp/lib/MAST" + mkdir -p $out/$share_dir + ln -fs ${moarvm}/$share_dir/{Nodes,Ops}.nqp $out/$share_dir + ''; + configureFlags = [ "--backends=moar" "--with-moar=${moarvm}/bin/moar" diff --git a/pkgs/development/interpreters/ruby/default.nix b/pkgs/development/interpreters/ruby/default.nix index ea31f354d0d7f..d30a2d2073eaa 100644 --- a/pkgs/development/interpreters/ruby/default.nix +++ b/pkgs/development/interpreters/ruby/default.nix @@ -59,14 +59,9 @@ let pname = "ruby"; inherit version; - src = if useRailsExpress then fetchFromGitHub { - owner = "ruby"; - repo = "ruby"; - rev = tag; - sha256 = sha256.git; - } else fetchurl { + src = fetchurl { url = "https://cache.ruby-lang.org/pub/ruby/${ver.majMin}/ruby-${ver}.tar.gz"; - sha256 = sha256.src; + inherit sha256; }; # Have `configure' avoid `/usr/bin/nroff' in non-chroot builds. @@ -100,17 +95,22 @@ let patchLevel = ver.patchLevel; }).${ver.majMinTiny} ++ op (lib.versionOlder ver.majMin "3.1") ./do-not-regenerate-revision.h.patch - ++ op (atLeast30 && useRailsExpress) ./do-not-update-gems-baseruby.patch - # Ruby prior to 3.0 has a bug the installer (tools/rbinstall.rb) but - # the resulting error was swallowed. Newer rubygems no longer swallows - # this error. We upgrade rubygems when rubygemsSupport is enabled, so - # we have to fix this bug to prevent the install step from failing. - # See https://github.com/ruby/ruby/pull/2930 - ++ op (!atLeast30 && rubygemsSupport) + ++ op (atLeast30 && useBaseRuby) ./do-not-update-gems-baseruby.patch + ++ ops (!atLeast30 && rubygemsSupport) [ + # We upgrade rubygems to a version that isn't compatible with the + # ruby 2.7 installer. Backport the upstream fix. + ./rbinstall-new-rubygems-compat.patch + + # Ruby prior to 3.0 has a bug the installer (tools/rbinstall.rb) but + # the resulting error was swallowed. Newer rubygems no longer swallows + # this error. We upgrade rubygems when rubygemsSupport is enabled, so + # we have to fix this bug to prevent the install step from failing. + # See https://github.com/ruby/ruby/pull/2930 (fetchpatch { url = "https://github.com/ruby/ruby/commit/261d8dd20afd26feb05f00a560abd99227269c1c.patch"; sha256 = "0wrii25cxcz2v8bgkrf7ibcanjlxwclzhayin578bf0qydxdm9qy"; - }); + }) + ]; postUnpack = opString rubygemsSupport '' rm -rf $sourceRoot/{lib,test}/rubygems* @@ -182,6 +182,11 @@ let sed -i '/CC_VERSION_MESSAGE/d' $rbConfig '' } + # Remove unnecessary external intermediate files created by gems + extMakefiles=$(find $out/lib/ruby/gems -name Makefile) + for makefile in $extMakefiles; do + make -C "$(dirname "$makefile")" distclean + done # Bundler tries to create this directory mkdir -p $out/nix-support cat > $out/nix-support/setup-hook <<EOF @@ -252,26 +257,17 @@ let in { ruby_2_7 = generic { - version = rubyVersion "2" "7" "5" ""; - sha256 = { - src = "1wc1hwmz4m6iqlmqag8liyld917p6a8dvnhnpd1v8d8jl80bjm97"; - git = "16565fyl7141hr6q6d74myhsz46lvgam8ifnacshi68vzibwjbbh"; - }; + version = rubyVersion "2" "7" "6" ""; + sha256 = "042xrdk7hsv4072bayz3f8ffqh61i8zlhvck10nfshllq063n877"; }; ruby_3_0 = generic { - version = rubyVersion "3" "0" "3" ""; - sha256 = { - src = "1b4j39zyyvdkf1ax2c6qfa40b4mxfkr87zghhw19fmnzn8f8d1im"; - git = "1q19w5i1jkfxn7qq6f9v9ngax9h52gxwijk7hp312dx6amwrkaim"; - }; + version = rubyVersion "3" "0" "4" ""; + sha256 = "0avj4g3s2839b2y4m6pk8kid74r8nj7k0qm2rsdcwjzhg8h7rd3h"; }; ruby_3_1 = generic { - version = rubyVersion "3" "1" "1" ""; - sha256 = { - src = "sha256-/m5Hgt6XRDl43bqLpL440iKqJNw+PwKmqOdwHA7rYZ0="; - git = "sha256-76t/tGyK5nz7nvcRdHJTjjckU+Kv+/kbTMiNWJ93jU8="; - }; + version = rubyVersion "3" "1" "2" ""; + sha256 = "0gm84ipk6mrfw94852w5h7xxk2lqrxjbnlwb88svf0lz70933131"; }; } diff --git a/pkgs/development/interpreters/ruby/patchsets.nix b/pkgs/development/interpreters/ruby/patchsets.nix index b76dc1a23b165..a0e2b90b0f4a3 100644 --- a/pkgs/development/interpreters/ruby/patchsets.nix +++ b/pkgs/development/interpreters/ruby/patchsets.nix @@ -1,15 +1,15 @@ { patchSet, useRailsExpress, ops, patchLevel, fetchpatch }: { - "2.7.5" = ops useRailsExpress [ + "2.7.6" = ops useRailsExpress [ "${patchSet}/patches/ruby/2.7/head/railsexpress/01-fix-broken-tests-caused-by-ad.patch" "${patchSet}/patches/ruby/2.7/head/railsexpress/02-improve-gc-stats.patch" "${patchSet}/patches/ruby/2.7/head/railsexpress/03-more-detailed-stacktrace.patch" ]; - "3.0.3" = ops useRailsExpress [ + "3.0.4" = ops useRailsExpress [ "${patchSet}/patches/ruby/3.0/head/railsexpress/01-improve-gc-stats.patch" "${patchSet}/patches/ruby/3.0/head/railsexpress/02-malloc-trim.patch" ]; - "3.1.1" = ops useRailsExpress [ # no patches yet (2021-12-25) + "3.1.2" = ops useRailsExpress [ # no patches yet (2021-12-25) ]; } diff --git a/pkgs/development/interpreters/ruby/rbinstall-new-rubygems-compat.patch b/pkgs/development/interpreters/ruby/rbinstall-new-rubygems-compat.patch new file mode 100644 index 0000000000000..54ce8a357a86a --- /dev/null +++ b/pkgs/development/interpreters/ruby/rbinstall-new-rubygems-compat.patch @@ -0,0 +1,87 @@ +From 8e85d27f9ccfe152fc1b891c19f125915a907493 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com> +Date: Tue, 1 Oct 2019 12:03:33 +0200 +Subject: [PATCH] Use `Gem::Package` like object instead of monkey patching. + +1. This is similar to what RubyGems does and it is less magic [[1]]. +2. It avoids deprecated code paths in RubyGems [[2]]. + +[1]: https://github.com/rubygems/rubygems/blob/92892bbc3adba86a90756c385433835f6761b8da/lib/rubygems/installer.rb#L151 +[2]: https://github.com/rubygems/rubygems/blob/92892bbc3adba86a90756c385433835f6761b8da/lib/rubygems/installer.rb#L187 + +(cherry picked from commit e960ef6f18a25c637c54f00c75bb6c24f8ab55d0) +--- + tool/rbinstall.rb | 47 +++++++++++++++++++++++++++-------------------- + 1 file changed, 27 insertions(+), 20 deletions(-) + +diff --git a/tool/rbinstall.rb b/tool/rbinstall.rb +index 060390626f..28ae8c409a 100755 +--- a/tool/rbinstall.rb ++++ b/tool/rbinstall.rb +@@ -710,28 +710,34 @@ def remove_prefix(prefix, string) + end + end + +- class UnpackedInstaller < Gem::Installer +- module DirPackage +- def extract_files(destination_dir, pattern = "*") +- path = File.dirname(@gem.path) +- return if path == destination_dir +- File.chmod(0700, destination_dir) +- mode = pattern == "bin/*" ? $script_mode : $data_mode +- spec.files.each do |f| +- src = File.join(path, f) +- dest = File.join(without_destdir(destination_dir), f) +- makedirs(dest[/.*(?=\/)/m]) +- install src, dest, :mode => mode +- end +- File.chmod($dir_mode, destination_dir) ++ class DirPackage ++ attr_reader :spec ++ ++ attr_accessor :dir_mode ++ attr_accessor :prog_mode ++ attr_accessor :data_mode ++ ++ def initialize(spec) ++ @spec = spec ++ @src_dir = File.dirname(@spec.loaded_from) ++ end ++ ++ def extract_files(destination_dir, pattern = "*") ++ path = @src_dir ++ return if path == destination_dir ++ File.chmod(0700, destination_dir) ++ mode = pattern == "bin/*" ? $script_mode : $data_mode ++ spec.files.each do |f| ++ src = File.join(path, f) ++ dest = File.join(without_destdir(destination_dir), f) ++ makedirs(dest[/.*(?=\/)/m]) ++ install src, dest, :mode => mode + end ++ File.chmod($dir_mode, destination_dir) + end ++ end + +- def initialize(spec, *options) +- super(spec.loaded_from, *options) +- @package.extend(DirPackage).spec = spec +- end +- ++ class UnpackedInstaller < Gem::Installer + def write_cache_file + end + +@@ -890,7 +896,8 @@ def install_default_gem(dir, srcdir) + if File.directory?(ext = "#{gem_ext_dir}/#{spec.full_name}") + spec.extensions[0] ||= "-" + end +- ins = RbInstall::UnpackedInstaller.new(spec, options) ++ package = RbInstall::DirPackage.new spec ++ ins = RbInstall::UnpackedInstaller.new(package, options) + puts "#{INDENT}#{spec.name} #{spec.version}" + ins.install + File.chmod($data_mode, File.join(install_dir, "specifications", "#{spec.full_name}.gemspec")) +-- +2.35.1 + diff --git a/pkgs/development/interpreters/ruby/rubygems/default.nix b/pkgs/development/interpreters/ruby/rubygems/default.nix index 4150f7683d5dd..6a8e171ee6e16 100644 --- a/pkgs/development/interpreters/ruby/rubygems/default.nix +++ b/pkgs/development/interpreters/ruby/rubygems/default.nix @@ -1,7 +1,7 @@ { stdenv, lib, fetchurl }: stdenv.mkDerivation rec { - name = "rubygems"; + pname = "rubygems"; version = "3.2.26"; src = fetchurl { diff --git a/pkgs/development/interpreters/spidermonkey/91.nix b/pkgs/development/interpreters/spidermonkey/91.nix index fede01c0ada77..c1e647deb7057 100644 --- a/pkgs/development/interpreters/spidermonkey/91.nix +++ b/pkgs/development/interpreters/spidermonkey/91.nix @@ -19,11 +19,11 @@ stdenv.mkDerivation rec { pname = "spidermonkey"; - version = "91.7.0"; + version = "91.8.0"; src = fetchurl { url = "mirror://mozilla/firefox/releases/${version}esr/source/firefox-${version}esr.source.tar.xz"; - sha512 = "925811989d8a91d826ba356bd46ac54be8153288ec0319c28d2bfbe89191e62e107691159dd7ca247253e2a4952eb59a5b9613e3feea3f5351238d4822e26301"; + sha512 = "edea2c7d4d3d0322091b20b623019ef041090d9f89f33c8e3140f66a54624261f278257393db70d2038154de8ee02da0bee6ecf85c281f3558338da71fc173c3"; }; outputs = [ "out" "dev" ]; diff --git a/pkgs/development/interpreters/supercollider/default.nix b/pkgs/development/interpreters/supercollider/default.nix index 2a0ef3b0957c6..0446e5d540c1f 100644 --- a/pkgs/development/interpreters/supercollider/default.nix +++ b/pkgs/development/interpreters/supercollider/default.nix @@ -1,12 +1,11 @@ -{ lib, stdenv, mkDerivation, fetchurl, cmake, pkg-config, alsa-lib -, libjack2, libsndfile, fftw, curl, gcc -, libXt, qtbase, qttools, qtwebengine +{ lib, stdenv, mkDerivation, fetchurl, cmake +, pkg-config, alsa-lib, libjack2, libsndfile, fftw +, curl, gcc, libXt, qtbase, qttools, qtwebengine , readline, qtwebsockets, useSCEL ? false, emacs +, supercollider-with-plugins, supercolliderPlugins +, writeText, runCommand }: -let - inherit (lib) optional; -in mkDerivation rec { pname = "supercollider"; version = "3.12.2"; @@ -16,6 +15,17 @@ mkDerivation rec { sha256 = "sha256-1QYorCgSwBK+SVAm4k7HZirr1j+znPmVicFmJdvO3g4="; }; + patches = [ + # add support for SC_DATA_DIR and SC_PLUGIN_DIR env vars to override compile-time values + ./supercollider-3.12.0-env-dirs.patch + ]; + + nativeBuildInputs = [ cmake pkg-config qttools ]; + + buildInputs = [ gcc libjack2 libsndfile fftw curl libXt qtbase qtwebengine qtwebsockets readline ] + ++ lib.optional (!stdenv.isDarwin) alsa-lib + ++ lib.optional useSCEL emacs; + hardeningDisable = [ "stackprotector" ]; cmakeFlags = [ @@ -23,17 +33,30 @@ mkDerivation rec { "-DSC_EL=${if useSCEL then "ON" else "OFF"}" ]; - nativeBuildInputs = [ cmake pkg-config qttools ]; - - buildInputs = [ - gcc libjack2 libsndfile fftw curl libXt qtbase qtwebengine qtwebsockets readline ] - ++ optional (!stdenv.isDarwin) alsa-lib - ++ optional useSCEL emacs; + passthru.tests = { + # test to make sure sclang runs and included plugins are successfully found + sclang-sc3-plugins = let + supercollider-with-test-plugins = supercollider-with-plugins.override { + plugins = with supercolliderPlugins; [ sc3-plugins ]; + }; + testsc = writeText "test.sc" '' + var err = 0; + try { + MdaPiano.name.postln; + } { + err = 1; + }; + err.exit; + ''; + in runCommand "sclang-sc3-plugins-test" {} '' + timeout 60s env XDG_CONFIG_HOME="$(mktemp -d)" QT_QPA_PLATFORM=minimal ${supercollider-with-test-plugins}/bin/sclang ${testsc} >$out + ''; + }; meta = with lib; { description = "Programming language for real time audio synthesis"; homepage = "https://supercollider.github.io"; - maintainers = with maintainers; [ mrmebelman ]; + maintainers = with maintainers; [ lilyinstarlight ]; license = licenses.gpl3Plus; platforms = platforms.linux; }; diff --git a/pkgs/development/interpreters/supercollider/plugins/sc3-plugins.nix b/pkgs/development/interpreters/supercollider/plugins/sc3-plugins.nix new file mode 100644 index 0000000000000..a596d6d770aef --- /dev/null +++ b/pkgs/development/interpreters/supercollider/plugins/sc3-plugins.nix @@ -0,0 +1,33 @@ +{ stdenv, lib, fetchurl, cmake, supercollider, fftw }: + +stdenv.mkDerivation rec { + pname = "sc3-plugins"; + version = "3.11.1"; + + src = fetchurl { + url = "https://github.com/supercollider/sc3-plugins/releases/download/Version-${version}/sc3-plugins-${version}-Source.tar.bz2"; + sha256 = "sha256-JjUmu7PJ+x3yRibr+Av2gTREng51fPo7Rk+B4y2JvkQ="; + }; + + nativeBuildInputs = [ cmake ]; + + buildInputs = [ + supercollider + fftw + ]; + + cmakeFlags = [ + "-DSC_PATH=${supercollider}/include/SuperCollider" + "-DSUPERNOVA=ON" + ]; + + stripDebugList = [ "lib" "share" ]; + + meta = with lib; { + description = "Community plugins for SuperCollider"; + homepage = "https://supercollider.github.io/sc3-plugins/"; + maintainers = with maintainers; [ lilyinstarlight ]; + license = licenses.gpl2Plus; + platforms = platforms.linux; + }; +} diff --git a/pkgs/development/interpreters/supercollider/supercollider-3.12.0-env-dirs.patch b/pkgs/development/interpreters/supercollider/supercollider-3.12.0-env-dirs.patch new file mode 100644 index 0000000000000..dd92028b52256 --- /dev/null +++ b/pkgs/development/interpreters/supercollider/supercollider-3.12.0-env-dirs.patch @@ -0,0 +1,65 @@ +diff --git a/common/SC_Filesystem_unix.cpp b/common/SC_Filesystem_unix.cpp +index 52dc1fd2d..aae09ed9c 100644 +--- a/common/SC_Filesystem_unix.cpp ++++ b/common/SC_Filesystem_unix.cpp +@@ -94,6 +94,10 @@ bool SC_Filesystem::isNonHostPlatformDirectoryName(const std::string& s) { + } + + Path SC_Filesystem::defaultSystemAppSupportDirectory() { ++ const char* sc_data_dir = getenv("SC_DATA_DIR"); ++ if (sc_data_dir) ++ return Path(sc_data_dir); ++ + # ifdef SC_DATA_DIR + return Path(SC_DATA_DIR); + # else +@@ -125,6 +129,10 @@ Path SC_Filesystem::defaultUserConfigDirectory() { + } + + Path SC_Filesystem::defaultResourceDirectory() { ++ const char* sc_data_dir = getenv("SC_DATA_DIR"); ++ if (sc_data_dir) ++ return Path(sc_data_dir); ++ + # ifdef SC_DATA_DIR + return Path(SC_DATA_DIR); + # else +diff --git a/server/scsynth/SC_Lib_Cintf.cpp b/server/scsynth/SC_Lib_Cintf.cpp +index f6219307e..28e13eb98 100644 +--- a/server/scsynth/SC_Lib_Cintf.cpp ++++ b/server/scsynth/SC_Lib_Cintf.cpp +@@ -178,9 +178,13 @@ void initialize_library(const char* uGensPluginPath) { + using DirName = SC_Filesystem::DirName; + + if (loadUGensExtDirs) { ++ const char* sc_plugin_dir = getenv("SC_PLUGIN_DIR"); ++ if (sc_plugin_dir) { ++ PlugIn_LoadDir(sc_plugin_dir, true); ++ } + #ifdef SC_PLUGIN_DIR + // load globally installed plugins +- if (bfs::is_directory(SC_PLUGIN_DIR)) { ++ else if (bfs::is_directory(SC_PLUGIN_DIR)) { + PlugIn_LoadDir(SC_PLUGIN_DIR, true); + } + #endif // SC_PLUGIN_DIR +diff --git a/server/supernova/server/main.cpp b/server/supernova/server/main.cpp +index b2b5adf4e..6cb8c411c 100644 +--- a/server/supernova/server/main.cpp ++++ b/server/supernova/server/main.cpp +@@ -224,8 +224,14 @@ void set_plugin_paths(server_arguments const& args, nova::sc_ugen_factory* facto + } + } + } else { ++ const char* sc_plugin_dir = getenv("SC_PLUGIN_DIR"); ++ if (sc_plugin_dir) { ++ factory->load_plugin_folder(sc_plugin_dir); ++ } + #ifdef SC_PLUGIN_DIR +- factory->load_plugin_folder(SC_PLUGIN_DIR); ++ else { ++ factory->load_plugin_folder(SC_PLUGIN_DIR); ++ } + #endif + factory->load_plugin_folder(SC_Filesystem::instance().getDirectory(DirName::Resource) / SC_PLUGIN_DIR_NAME); + factory->load_plugin_folder(SC_Filesystem::instance().getDirectory(DirName::SystemExtension)); diff --git a/pkgs/development/interpreters/supercollider/wrapper.nix b/pkgs/development/interpreters/supercollider/wrapper.nix new file mode 100644 index 0000000000000..e9e97f2b98de9 --- /dev/null +++ b/pkgs/development/interpreters/supercollider/wrapper.nix @@ -0,0 +1,18 @@ +{ symlinkJoin, makeWrapper, supercollider, plugins }: + +symlinkJoin { + name = "supercollider-with-plugins-${supercollider.version}"; + paths = [ supercollider ] ++ plugins; + + nativeBuildInputs = [ makeWrapper ]; + + postBuild = '' + for exe in $out/bin/*; do + wrapProgram $exe \ + --set SC_PLUGIN_DIR "$out/lib/SuperCollider/plugins" \ + --set SC_DATA_DIR "$out/share/SuperCollider" + done + ''; + + inherit (supercollider) pname version meta; +} diff --git a/pkgs/development/interpreters/trealla/default.nix b/pkgs/development/interpreters/trealla/default.nix index d6dc01348a1d4..45e63d98bdae5 100644 --- a/pkgs/development/interpreters/trealla/default.nix +++ b/pkgs/development/interpreters/trealla/default.nix @@ -43,6 +43,7 @@ stdenv.mkDerivation rec { homepage = "https://github.com/infradig/trealla"; license = licenses.mit; maintainers = with maintainers; [ siraben ]; + mainProgram = "tpl"; platforms = platforms.all; }; } diff --git a/pkgs/development/interpreters/wasmtime/default.nix b/pkgs/development/interpreters/wasmtime/default.nix index 7f00faa76476b..a475f53f91f73 100644 --- a/pkgs/development/interpreters/wasmtime/default.nix +++ b/pkgs/development/interpreters/wasmtime/default.nix @@ -2,17 +2,17 @@ rustPlatform.buildRustPackage rec { pname = "wasmtime"; - version = "0.35.2"; + version = "0.36.0"; src = fetchFromGitHub { owner = "bytecodealliance"; repo = pname; rev = "v${version}"; - sha256 = "sha256-4oZglk7MInLIsvbeCfs4InAcmSmzZp16XL5+8eoYXJk="; + sha256 = "sha256-nSA78eQRbJ5JTDquaRqRgFU0V8RVCzvWUONgHxGj+Mc="; fetchSubmodules = true; }; - cargoSha256 = "sha256-IqFOw9bGdM3IEoMeqDlxKfLnZvR80PSnwP9kr1tI/h0="; + cargoSha256 = "sha256-/+uioJRXiugsV7SUwsDNHGaPxrxrhscQUGyXOzzwG/g="; # This environment variable is required so that when wasmtime tries # to run tests by using the rusty_v8 crate, it does not try to diff --git a/pkgs/development/interpreters/yex-lang/default.nix b/pkgs/development/interpreters/yex-lang/default.nix index 738b73d8e4c8c..7223b7aca7802 100644 --- a/pkgs/development/interpreters/yex-lang/default.nix +++ b/pkgs/development/interpreters/yex-lang/default.nix @@ -18,6 +18,7 @@ rustPlatform.buildRustPackage rec { description = "A cool functional scripting language written in rust"; license = licenses.mit; maintainers = with maintainers; [ AndersonTorres ]; + mainProgram = "yex"; platforms = platforms.unix; broken = stdenv.isAarch64 && stdenv.isLinux; }; diff --git a/pkgs/development/interpreters/zuo/default.nix b/pkgs/development/interpreters/zuo/default.nix new file mode 100644 index 0000000000000..f70e674eda649 --- /dev/null +++ b/pkgs/development/interpreters/zuo/default.nix @@ -0,0 +1,23 @@ +{ lib, stdenv, fetchFromGitHub }: + +stdenv.mkDerivation rec { + pname = "zuo"; + version = "unstable-2022-04-23"; + + src = fetchFromGitHub { + owner = "racket"; + repo = "zuo"; + rev = "2f3e23bd374f9a6504de6000989ebf2adf67c80c"; + sha256 = "sha256-TxX3iinfL1hXFlQlGQ7x52O6zvYoJYXrMfEfSL4Axig="; + }; + + doCheck = true; + + meta = with lib; { + description = "A Tiny Racket for Scripting"; + homepage = "https://github.com/racket/zuo"; + license = licenses.mit; + platforms = platforms.all; + maintainers = [ maintainers.marsam ]; + }; +} |