<ins> diff --git a/sdk/program/src/account_info.rs b/sdk/program/src/account_info.rs index 372370d0e15a0f2877b02ad29586e5b352438b24..3db3e9839b6535786e60be5602c03d0c909bf937 100644 --- a/sdk/program/src/account_info.rs +++ b/sdk/program/src/account_info.rs @@ -182,6 +182,7 @@ impl<'a> AccountInfo<'a> { Ok(()) } +    #[rustversion::attr(since(1.72), allow(invalid_reference_casting))] pub fn assign(&self, new_owner: &Pubkey) { // Set the non-mut owner field unsafe { </ins>


"solana-gossip" "solana-install" "solana-keygen" <ins> "solana-ledger-tool" </ins> "solana-log-analyzer" "solana-net-shaper" <del> "solana-sys-tuner" "rbpf-cli" </del> "solana-validator" <del> "solana-ledger-tool" "cargo-build-bpf" "cargo-test-bpf" "solana-dos" "solana-install-init" "solana-stake-accounts" "solana-test-validator" "solana-tokens" "solana-watchtower" "cargo-test-sbf" "cargo-build-sbf" </del> ] ++ [ # XXX: Ensure `solana-genesis` is built LAST! # See https://github.com/solana-labs/solana/issues/5826


] }: let <del> version = "1.14.23"; sha256 = "sha256-NUkkLzLNh8P7PFh/SVtd9JM18w3egDaaK80urGw1SSs="; cargoSha256 = "sha256-7t8Quh6T2MzJWEM5Y50CgCyFfx2ZJRAdCpZyyYvJrt4="; </del> <ins> version = "1.16.27"; sha256 = "sha256-xd0FCSlpPJDVWOlt9rIlnSbjksmvlXJWHkvlZONd2dM="; </ins> inherit (darwin.apple_sdk_11_0) Libsystem; inherit (darwin.apple_sdk_11_0.frameworks) System IOKit AppKit Security; in rustPlatform.buildRustPackage rec { pname = "solana-cli"; <del> inherit version cargoSha256; </del> <ins> inherit version; </ins> src = fetchFromGitHub { owner = "solana-labs";


inherit sha256; }; <ins> cargoLock = { lockFile = ./Cargo.lock; outputHashes = { "crossbeam-epoch-0.9.5" = "sha256-Jf0RarsgJiXiZ+ddy0vp4jQ59J9m0k3sgXhWhCdhgws="; "ntapi-0.3.7" = "sha256-G6ZCsa3GWiI/FeGKiK9TWkmTxen7nwpXvm5FtjNtjWU="; }; }; patches = [ # Fix: https://github.com/solana-labs/solana/issues/34203 # From https://github.com/Homebrew/homebrew-core/pull/156930/files#diff-f27c55b86df31cd4935c956efee1be743eae0958e3850f3f9891d51bfea50b1cR76 ./account-info.patch ]; </ins> strictDeps = true; cargoBuildFlags = builtins.map (n: "--bin=${n}") solanaPkgs;


description = "Web-Scale Blockchain for fast, secure, scalable, decentralized apps and marketplaces. "; homepage = "https://solana.com"; license = licenses.asl20; <del> maintainers = with maintainers; [ netfox happysalada ]; </del> <ins> maintainers = with maintainers; [ netfox happysalada aikooo7 ]; </ins> platforms = platforms.unix; };


-e 's^addCVars^addCVars${_infixSalt}^g'  -e 's^[ -z "$crossConfig" ]^[[ "${builtins.toString (targetPlatform != hostPlatform)}" || -z "$crossConfig" ]]^g' <del> '' + stdenv.lib.optionalString (textFile == ./setup-hook.sh) '' cat << 'EOF' >> $out for CMD in ar as nm objcopy ranlib strip strings size ld windres do # which is not part of stdenv, but compgen will do for now if PATH=$_PATH type -p ${prefix}$CMD > /dev/null then export ''$(echo "$CMD" | tr "[:lower:]" "[:upper:]")=${prefix}''${CMD}; fi done EOF sed -i $out -e 's_envHooks_crossEnvHooks_g' '' + '' </del> # NIX_ things which we don't both use and define, we revert them #asymmetric=$( #  for pre in "" "$"


inherit cc shell libc_bin libc_dev libc_lib binutils_bin coreutils_bin; gnugrep_bin = if nativeTools then "" else gnugrep; <ins> binPrefix = prefix; </ins> passthru = { inherit libc nativeTools nativeLibc nativePrefix isGNU isClang default_cxx_stdlib_compile


wrap ${prefix}ld.bfd ${preWrap ./ld-wrapper.sh} ${binutils_bin}/bin/${prefix}ld.bfd fi <del> export real_cc=${prefix}cc export real_cxx=${prefix}c++ </del> <ins> # We export environment variables pointing to the wrapped nonstandard # cmds, lest some lousy configure script use those to guess compiler # version. export named_cc=${prefix}cc export named_cxx=${prefix}c++ </ins> export default_cxx_stdlib_compile="${default_cxx_stdlib_compile}" if [ -e $ccPath/${prefix}gcc ]; then wrap ${prefix}gcc ${preWrap ./cc-wrapper.sh} $ccPath/${prefix}gcc ln -s ${prefix}gcc $out/bin/${prefix}cc <del> export real_cc=${prefix}gcc export real_cxx=${prefix}g++ </del> <ins> export named_cc=${prefix}gcc export named_cxx=${prefix}g++ </ins> elif [ -e $ccPath/clang ]; then wrap ${prefix}clang ${preWrap ./cc-wrapper.sh} $ccPath/clang ln -s ${prefix}clang $out/bin/${prefix}cc <del> export real_cc=clang export real_cxx=clang++ </del> <ins> export named_cc=${prefix}clang export named_cxx=${prefix}clang++ </ins> fi if [ -e $ccPath/${prefix}g++ ]; then


<del> export NIX_CC=@out@ </del> addCVars () { if [ -d $1/include ]; then export NIX_CFLAGS_COMPILE+=" ${ccIncludeFlag:--isystem} $1/include"


fi if [ -z "$crossConfig" ]; then <del> export CC=@real_cc@ export CXX=@real_cxx@ </del> <ins> ENV_PREFIX="" </ins> else <del> export BUILD_CC=@real_cc@ export BUILD_CXX=@real_cxx@ </del> <ins> ENV_PREFIX="BUILD_" </ins> fi <ins> export NIX_${ENV_PREFIX}CC=@out@ export ${ENV_PREFIX}CC=@named_cc@ export ${ENV_PREFIX}CXX=@named_cxx@ for CMD in  cpp  ar as nm objcopy ranlib strip strings size ld windres do if PATH=$_PATH type -p "@binPrefix@$CMD" > /dev/null then export "${ENV_PREFIX}${CMD^^}=@binPrefix@${CMD}"; fi done # No local scope available for sourced files unset ENV_PREFIX </ins>


<ins> { stdenv, fetchFromGitHub, rustPlatform, cargo, cmake, sphinx, lib, prefix ? "uutils-" }: rustPlatform.buildRustPackage { name = "uutils-coreutils-2018-02-09"; src = fetchFromGitHub { owner = "uutils"; repo = "coreutils"; rev = "f333ab26b03294a32a10c1c203a03c6b5cf8a89a"; sha256 = "0nkggs5nqvc1mxzzgcsqm1ahchh4ll11xh0xqmcljrr5yg1rhhzf"; }; # too many impure/platform-dependent tests doCheck = false; cargoSha256 = "0qv2wz1bxhm5xhzbic7cqmn8jj8fyap0s18ylia4fbwpmv89nkc5"; makeFlags = [ "CARGO=${cargo}/bin/cargo" "PREFIX=$(out)" "PROFILE=release" "INSTALLDIR_MAN=$(out)/share/man/man1" ] ++ lib.optional (prefix != null) [ "PROG_PREFIX=${prefix}" ]; nativeBuildInputs = [ cmake ]; buildInputs = [ cargo sphinx ]; # empty {build,install}Phase to use defaults of `stdenv.mkDerivation` rather than rust defaults buildPhase = ""; installPhase = ""; meta = with stdenv.lib; { description = "Cross-platform Rust rewrite of the GNU coreutils"; longDescription = '' uutils is an attempt at writing universal (as in cross-platform) CLI utils in Rust. This repo is to aggregate the GNU coreutils rewrites. ''; homepage = https://github.com/uutils/coreutils; maintainers = with maintainers; [ ma27 ]; license = licenses.mit; platforms = platforms.unix; }; } </ins>


uudeview = callPackage ../tools/misc/uudeview { }; <ins> uutils-coreutils = callPackage ../tools/misc/uutils-coreutils { inherit (pythonPackages) sphinx; }; </ins> zabbix-cli = callPackage ../tools/misc/zabbix-cli { }; ### DEVELOPMENT / EMSCRIPTEN


<del> { lib, stdenv, fetchFromGitHub, cmake, libarcus, stb, protobuf }: </del> <ins> { lib, stdenv, fetchFromGitHub, cmake, libarcus, stb, protobuf, fetchpatch }: </ins> stdenv.mkDerivation rec { pname = "curaengine";


cmakeFlags = [ "-DCURA_ENGINE_VERSION=${version}" ]; <ins> # TODO already fixed in master, remove in next release patches = [ (fetchpatch { url = "https://github.com/Ultimaker/CuraEngine/commit/de60e86a6ea11cb7d121471b5dd192e5deac0f3d.patch"; hash = "sha256-/gT9yErIDDYAXvZ6vX5TGlwljy31K563+sqkm1UGljQ="; includes = [ "src/utils/math.h" ]; }) ]; </ins> meta = with lib; { description = "A powerful, fast and robust engine for processing 3D models into 3D printing instruction"; homepage = "https://github.com/Ultimaker/CuraEngine";


<del> { lib , stdenv , callPackage , fetchFromGitHub , testers , enableE57 ? lib.meta.availableOn stdenv.hostPlatform libe57format , cmake , curl , gdal , hdf5-cpp , LASzip , libe57format , libgeotiff , libtiff , libxml2 , openscenegraph , pkg-config , postgresql , tiledb , xercesc , zlib , zstd }: stdenv.mkDerivation (finalAttrs: { pname = "pdal"; version = "2.5.6"; src = fetchFromGitHub { owner = "PDAL"; repo = "PDAL"; rev = finalAttrs.version; sha256 = "sha256-JKwa89c05EfZ/FxOkj8lYmw0o2EgSqafRDIV2mTpZ5E="; }; nativeBuildInputs = [ cmake pkg-config ]; buildInputs = [ curl gdal hdf5-cpp LASzip libgeotiff libtiff libxml2 openscenegraph postgresql tiledb xercesc zlib zstd ] ++ lib.optionals enableE57 [ libe57format ]; cmakeFlags = [ "-DBUILD_PLUGIN_E57=${if enableE57 then "ON" else "OFF"}" "-DBUILD_PLUGIN_HDF=ON" "-DBUILD_PLUGIN_PGPOINTCLOUD=ON" "-DBUILD_PLUGIN_TILEDB=ON" "-DWITH_TESTS=ON" "-DBUILD_PGPOINTCLOUD_TESTS=OFF" # Plugins can probably not be made work easily: "-DBUILD_PLUGIN_CPD=OFF" "-DBUILD_PLUGIN_FBX=OFF" # Autodesk FBX SDK is gratis+proprietary; not packaged in nixpkgs "-DBUILD_PLUGIN_GEOWAVE=OFF" "-DBUILD_PLUGIN_I3S=OFF" "-DBUILD_PLUGIN_ICEBRIDGE=OFF" "-DBUILD_PLUGIN_MATLAB=OFF" "-DBUILD_PLUGIN_MBIO=OFF" "-DBUILD_PLUGIN_MRSID=OFF" "-DBUILD_PLUGIN_NITF=OFF" "-DBUILD_PLUGIN_OCI=OFF" "-DBUILD_PLUGIN_RDBLIB=OFF" # Riegl rdblib is proprietary; not packaged in nixpkgs "-DBUILD_PLUGIN_RIVLIB=OFF" ]; doCheck = true; disabledTests = [ # Tests failing due to TileDB library implementation, disabled also # by upstream CI. # See: https://github.com/PDAL/PDAL/blob/bc46bc77f595add4a6d568a1ff923d7fe20f7e74/.github/workflows/linux.yml#L81 "pdal_io_tiledb_writer_test" "pdal_io_tiledb_reader_test" "pdal_io_tiledb_time_writer_test" "pdal_io_tiledb_time_reader_test" "pdal_io_tiledb_bit_fields_test" "pdal_io_e57_read_test" "pdal_io_e57_write_test" "pdal_io_stac_reader_test" # Segfault "pdal_io_hdf_reader_test" # Failure "pdal_app_plugin_test" ]; checkPhase = '' runHook preCheck # tests are flaky and they seem to fail less often when they don't run in # parallel ctest -j 1 --output-on-failure -E '^${lib.concatStringsSep "|" finalAttrs.disabledTests}$' runHook postCheck ''; passthru.tests = { version = testers.testVersion { package = finalAttrs.finalPackage; command = "pdal --version"; version = "pdal ${finalAttrs.finalPackage.version}"; }; pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; }; meta = with lib; { description = "PDAL is Point Data Abstraction Library. GDAL for point cloud data"; homepage = "https://pdal.io"; license = licenses.bsd3; maintainers = teams.geospatial.members; platforms = platforms.all; pkgConfigModules = [ "pdal" ]; }; }) </del>


}: let <del> # replace with global pdal version once # https://github.com/qgis/QGIS/pull/54940 is backported pdal = callPackage ./pdal-2_5.nix { }; </del> py = python3.override { packageOverrides = self: super: { pyqt5 = super.pyqt5.override {


qtserialport qtxmlpatterns qt3d <del> pdal </del> <ins> # pdal </ins> zstd ] ++ lib.optional withGrass grass ++ lib.optional withWebKit qtwebkit


}) ]; <ins> # PDAL is disabled until https://github.com/qgis/QGIS/pull/54940 # is backported. </ins> cmakeFlags = [ "-DWITH_3D=True" <del> "-DWITH_PDAL=TRUE" </del> <ins> "-DWITH_PDAL=False"  # TODO: re-enable PDAL </ins> "-DENABLE_TESTS=False" ] ++ lib.optional (!withWebKit) "-DWITH_QTWEBKIT=OFF" ++ lib.optional withGrass (let


{ config, lib, pkgs, ... }: <del> with lib; </del> let cfg = config.services.locate; <del> isMLocate = hasPrefix "mlocate" cfg.package.name; isPLocate = hasPrefix "plocate" cfg.package.name; </del> <ins> isMLocate = lib.hasPrefix "mlocate" cfg.package.name; isPLocate = lib.hasPrefix "plocate" cfg.package.name; </ins> isMorPLocate = isMLocate || isPLocate; <del> isFindutils = hasPrefix "findutils" cfg.package.name; </del> <ins> isFindutils = lib.hasPrefix "findutils" cfg.package.name; </ins> in { imports = [ <del> (mkRenamedOptionModule [ "services" "locate" "period" ] [ "services" "locate" "interval" ]) (mkRenamedOptionModule [ "services" "locate" "locate" ] [ "services" "locate" "package" ]) (mkRemovedOptionModule [ "services" "locate" "includeStore" ] "Use services.locate.prunePaths") </del> <ins> (lib.mkRenamedOptionModule [ "services" "locate" "period" ] [ "services" "locate" "interval" ]) (lib.mkRenamedOptionModule [ "services" "locate" "locate" ] [ "services" "locate" "package" ]) (lib.mkRemovedOptionModule [ "services" "locate" "includeStore" ] "Use services.locate.prunePaths") </ins> ]; <del> options.services.locate = with types; { enable = mkOption { type = bool; </del> <ins> options.services.locate = { enable = lib.mkOption { type = lib.types.bool; </ins> default = false; description = '' If enabled, NixOS will periodically update the database of


''; }; <del> package = mkPackageOption pkgs [ "findutils" "locate" ] { </del> <ins> package = lib.mkPackageOption pkgs [ "findutils" "locate" ] { </ins> example = "mlocate"; }; <del> interval = mkOption { type = str; </del> <ins> interval = lib.mkOption { type = lib.types.str; </ins> default = "02:15"; example = "hourly"; description = ''


''; }; <del> extraFlags = mkOption { type = listOf str; </del> <ins> extraFlags = lib.mkOption { type = lib.types.listOf lib.types.str; </ins> default = [ ]; description = '' Extra flags to pass to {command}`updatedb`. ''; }; <del> output = mkOption { type = path; </del> <ins> output = lib.mkOption { type = lib.types.path; </ins> default = "/var/cache/locatedb"; description = '' The database file to build. ''; }; <del> localuser = mkOption { type = nullOr str; </del> <ins> localuser = lib.mkOption { type = lib.types.nullOr lib.types.str; </ins> default = "nobody"; description = '' The user to search non-network directories as, using


''; }; <del> pruneFS = mkOption { type = listOf str; </del> <ins> pruneFS = lib.mkOption { type = lib.types.listOf lib.types.str; </ins> default = [ "afs" "anon_inodefs"


''; }; <del> prunePaths = mkOption { type = listOf path; </del> <ins> prunePaths = lib.mkOption { type = lib.types.listOf lib.types.path; </ins> default = [ "/tmp" "/var/tmp"


''; }; <del> pruneNames = mkOption { type = listOf str; </del> <ins> pruneNames = lib.mkOption { type = lib.types.listOf lib.types.str; </ins> default = lib.optionals (!isFindutils) [ ".bzr" ".cache" ".git" ".hg" ".svn" ]; <del> defaultText = literalMD '' </del> <ins> defaultText = lib.literalMD '' </ins> `[ ".bzr" ".cache" ".git" ".hg" ".svn" ]`, if supported by the locate implementation (i.e. mlocate or plocate). '';


''; }; <del> pruneBindMounts = mkOption { type = bool; </del> <ins> pruneBindMounts = lib.mkOption { type = lib.types.bool; </ins> default = false; description = '' Whether not to index bind mounts


}; <del> config = mkIf cfg.enable { users.groups = mkMerge [ (mkIf isMLocate { mlocate = { }; }) (mkIf isPLocate { plocate = { }; }) </del> <ins> config = lib.mkIf cfg.enable { users.groups = lib.mkMerge [ (lib.mkIf isMLocate { mlocate = { }; }) (lib.mkIf isPLocate { plocate = { }; }) </ins> ]; security.wrappers =


setgid = true; setuid = false; }; <del> mlocate = mkIf isMLocate { </del> <ins> mlocate = lib.mkIf isMLocate { </ins> group = "mlocate"; source = "${cfg.package}/bin/locate"; }; <del> plocate = mkIf isPLocate { </del> <ins> plocate = lib.mkIf isPLocate { </ins> group = "plocate"; source = "${cfg.package}/bin/plocate"; }; in <del> mkIf isMorPLocate { locate = mkMerge [ common mlocate plocate ]; plocate = mkIf isPLocate (mkMerge [ common plocate ]); </del> <ins> lib.mkIf isMorPLocate { locate = lib.mkMerge [ common mlocate plocate ]; plocate = lib.mkIf isPLocate (lib.mkMerge [ common plocate ]); </ins> }; <del> environment.systemPackages = [ cfg.package ]; </del> <ins> environment = { # write /etc/updatedb.conf for manual calls to `updatedb` etc."updatedb.conf".text = '' PRUNEFS="${lib.concatStringsSep " " cfg.pruneFS}" PRUNENAMES="${lib.concatStringsSep " " cfg.pruneNames}" PRUNEPATHS="${lib.concatStringsSep " " cfg.prunePaths}" PRUNE_BIND_MOUNTS="${if cfg.pruneBindMounts then "yes" else "no"}" ''; </ins> <del> environment.variables.LOCATE_PATH = cfg.output; </del> <ins> systemPackages = [ cfg.package ]; </ins> <del> environment.etc = { # write /etc/updatedb.conf for manual calls to `updatedb` "updatedb.conf" = { text = '' PRUNEFS="${lib.concatStringsSep " " cfg.pruneFS}" PRUNENAMES="${lib.concatStringsSep " " cfg.pruneNames}" PRUNEPATHS="${lib.concatStringsSep " " cfg.prunePaths}" PRUNE_BIND_MOUNTS="${if cfg.pruneBindMounts then "yes" else "no"}" ''; </del> <ins> variables = lib.mkIf isFindutils { LOCATE_PATH = cfg.output; </ins> }; }; <del> warnings = optional (isMorPLocate && cfg.localuser != null) </del> <ins> warnings = lib.optional (isMorPLocate && cfg.localuser != null) </ins> "mlocate and plocate do not support the services.locate.localuser option. updatedb will run as root. Silence this warning by setting services.locate.localuser = null." <del> ++ optional (isFindutils && cfg.pruneNames != [ ]) </del> <ins> ++ lib.optional (isFindutils && cfg.pruneNames != [ ]) </ins> "findutils locate does not support pruning by directory component" <del> ++ optional (isFindutils && cfg.pruneBindMounts) </del> <ins> ++ lib.optional (isFindutils && cfg.pruneBindMounts) </ins> "findutils locate does not support skipping bind mounts"; systemd.services.update-locatedb = { description = "Update Locate Database"; <del> path = mkIf (!isMorPLocate) [ pkgs.su ]; </del> <ins> path = lib.mkIf (!isMorPLocate) [ pkgs.su ]; </ins> # mlocate's updatedb takes flags via a configuration file or # on the command line, but not by environment variable.


if isMorPLocate then let toFlags = x: <del> optional (cfg.${x} != [ ]) "--${lib.toLower x} '${concatStringsSep " " cfg.${x}}'"; args = concatLists (map toFlags [ "pruneFS" "pruneNames" "prunePaths" ]); </del> <ins> lib.optional (cfg.${x} != [ ]) "--${lib.toLower x} '${lib.concatStringsSep " " cfg.${x}}'"; args = lib.concatLists (map toFlags [ "pruneFS" "pruneNames" "prunePaths" ]); </ins> in '' exec ${cfg.package}/bin/updatedb  <del> --output ${toString cfg.output} ${concatStringsSep " " args}  </del> <ins> --output ${toString cfg.output} ${lib.concatStringsSep " " args}  </ins> --prune-bind-mounts ${if cfg.pruneBindMounts then "yes" else "no"}  <del> ${concatStringsSep " " cfg.extraFlags} </del> <ins> ${lib.concatStringsSep " " cfg.extraFlags} </ins> '' else '' exec ${cfg.package}/bin/updatedb  <del> ${optionalString (cfg.localuser != null && !isMorPLocate) "--localuser=${cfg.localuser}"}  --output=${toString cfg.output} ${concatStringsSep " " cfg.extraFlags} </del> <ins> ${lib.optionalString (cfg.localuser != null && !isMorPLocate) "--localuser=${cfg.localuser}"}  --output=${toString cfg.output} ${lib.concatStringsSep " " cfg.extraFlags} </ins> ''; <del> environment = optionalAttrs (!isMorPLocate) { PRUNEFS = concatStringsSep " " cfg.pruneFS; PRUNEPATHS = concatStringsSep " " cfg.prunePaths; PRUNENAMES = concatStringsSep " " cfg.pruneNames; </del> <ins> environment = lib.optionalAttrs (!isMorPLocate) { PRUNEFS = lib.concatStringsSep " " cfg.pruneFS; PRUNEPATHS = lib.concatStringsSep " " cfg.prunePaths; PRUNENAMES = lib.concatStringsSep " " cfg.pruneNames; </ins> PRUNE_BIND_MOUNTS = if cfg.pruneBindMounts then "yes" else "no"; }; <del> serviceConfig.Nice = 19; serviceConfig.IOSchedulingClass = "idle"; serviceConfig.PrivateTmp = "yes"; serviceConfig.PrivateNetwork = "yes"; serviceConfig.NoNewPrivileges = "yes"; serviceConfig.ReadOnlyPaths = "/"; # Use dirOf cfg.output because mlocate creates temporary files next to # the actual database. We could specify and create them as well, # but that would make this quite brittle when they change something. # NOTE: If /var/cache does not exist, this leads to the misleading error message: # update-locatedb.service: Failed at step NAMESPACE spawning …/update-locatedb-start: No such file or directory serviceConfig.ReadWritePaths = dirOf cfg.output; </del> <ins> serviceConfig = { Nice = 19; IOSchedulingClass = "idle"; PrivateTmp = "yes"; PrivateNetwork = "yes"; NoNewPrivileges = "yes"; ReadOnlyPaths = "/"; # Use dirOf cfg.output because mlocate creates temporary files next to # the actual database. We could specify and create them as well, # but that would make this quite brittle when they change something. # NOTE: If /var/cache does not exist, this leads to the misleading error message: # update-locatedb.service: Failed at step NAMESPACE spawning …/update-locatedb-start: No such file or directory ReadWritePaths = dirOf cfg.output; }; </ins> }; <del> systemd.timers.update-locatedb = mkIf (cfg.interval != "never") { </del> <ins> systemd.timers.update-locatedb = lib.mkIf (cfg.interval != "never") { </ins> description = "Update timer for locate database"; partOf = [ "update-locatedb.service" ]; wantedBy = [ "timers.target" ];


<del> { lib , stdenv , fetchurl , fetchPypi , python3 , makeWrapper , libtorrent-rasterbar-1_2_x , qt5 }: let libtorrent = (python3.pkgs.toPythonModule (libtorrent-rasterbar-1_2_x)).python; in stdenv.mkDerivation rec { pname = "tribler"; version = "7.13.0"; src = fetchurl { url = "https://github.com/Tribler/tribler/releases/download/v${version}/Tribler-${version}.tar.xz"; hash = "sha256-j9+Kq6dOqiJCTY3vuRWGnciuwACU7L0pl73l6nkDLN4="; }; nativeBuildInputs = [ python3.pkgs.wrapPython makeWrapper # we had a "copy" of this in tribler's makeWrapper # but it went out of date and broke, so please just use it directly qt5.wrapQtAppsHook ]; buildInputs = [ python3.pkgs.python ]; pythonPath = [ libtorrent ] ++ (with python3.pkgs; [ # requirements-core.txt aiohttp aiohttp-apispec anyio chardet configobj cryptography decorator faker libnacl lz4 marshmallow netifaces networkx pony psutil pyasn1 pydantic_1 pyopenssl pyyaml sentry-sdk service-identity yappi yarl bitarray (pyipv8.overrideAttrs (p: rec { version = "2.10.0"; src = fetchPypi { inherit (p) pname; inherit version; hash = "sha256-yxiXBxBiPokequm+vjsHIoG9kQnRnbsOx3mYOd8nmiU="; }; })) libtorrent file-read-backwards brotli human-readable # requirements.txt pillow pyqt5 #pyqt5-sip pyqtgraph pyqtwebengine ]); installPhase = '' mkdir -pv $out # Nasty hack; call wrapPythonPrograms to set program_PYTHONPATH. wrapPythonPrograms cp -prvd ./* $out/ makeWrapper ${python3.pkgs.python}/bin/python $out/bin/tribler  --set _TRIBLERPATH "$out/src"  --set PYTHONPATH $out/src/tribler-core:$out/src/tribler-common:$out/src/tribler-gui:$program_PYTHONPATH  --set NO_AT_BRIDGE 1  --chdir "$out/src"  --add-flags "-O $out/src/run_tribler.py" mkdir -p $out/share/applications $out/share/icons cp $out/build/debian/tribler/usr/share/applications/org.tribler.Tribler.desktop $out/share/applications/ cp $out/build/debian/tribler/usr/share/pixmaps/tribler_big.xpm $out/share/icons/tribler.xpm mkdir -p $out/share/copyright/tribler mv $out/LICENSE $out/share/copyright/tribler ''; shellHook = '' wrapPythonPrograms || true export QT_QPA_PLATFORM_PLUGIN_PATH=$(echo ${qt5.qtbase.bin}/lib/qt-*/plugins/platforms) export PYTHONPATH=./tribler-core:./tribler-common:./tribler-gui:$program_PYTHONPATH export QT_PLUGIN_PATH="${qt5.qtsvg.bin}/${qt5.qtbase.qtPluginPrefix}" ''; meta = with lib; { description = "Decentralised P2P filesharing client based on the Bittorrent protocol"; mainProgram = "tribler"; homepage = "https://www.tribler.org/"; license = licenses.lgpl21Plus; maintainers = with maintainers; [ xvapx viric mkg20001 ]; platforms = platforms.linux; }; } </del>


<ins> { lib, stdenv, fetchurl, fetchPypi, python3, makeWrapper, libtorrent-rasterbar-1_2_x, qt5, nix-update-script, }: let libtorrent = (python3.pkgs.toPythonModule (libtorrent-rasterbar-1_2_x)).python; in stdenv.mkDerivation (finalAttrs: { pname = "tribler"; version = "7.14.0"; src = fetchurl { url = "https://github.com/Tribler/tribler/releases/download/v${finalAttrs.version}/Tribler-${finalAttrs.version}.tar.xz"; hash = "sha256-fQJOs9P4y71De/+svmD7YZ4+tm/bC3rspm7SbOHlSR4="; }; nativeBuildInputs = [ python3.pkgs.wrapPython makeWrapper # we had a "copy" of this in tribler's makeWrapper # but it went out of date and broke, so please just use it directly qt5.wrapQtAppsHook ]; buildInputs = [ python3.pkgs.python ]; pythonPath = [ libtorrent ] ++ (with python3.pkgs; [ # requirements-core.txt aiohttp aiohttp-apispec anyio chardet configobj cryptography decorator faker libnacl lz4 marshmallow netifaces networkx pony psutil pyasn1 pydantic_1 pyopenssl pyyaml sentry-sdk service-identity yappi yarl bitarray filelock (pyipv8.overrideAttrs (p: rec { version = "2.10.0"; src = fetchPypi { inherit (p) pname; inherit version; hash = "sha256-yxiXBxBiPokequm+vjsHIoG9kQnRnbsOx3mYOd8nmiU="; }; })) file-read-backwards brotli human-readable # requirements.txt pillow pyqt5 #pyqt5-sip pyqtgraph pyqtwebengine ]); installPhase = '' mkdir -pv $out # Nasty hack; call wrapPythonPrograms to set program_PYTHONPATH. wrapPythonPrograms cp -prvd ./* $out/ makeWrapper ${python3.pkgs.python}/bin/python $out/bin/tribler  --set _TRIBLERPATH "$out/src"  --set PYTHONPATH $out/src/tribler-core:$out/src/tribler-common:$out/src/tribler-gui:$program_PYTHONPATH  --set NO_AT_BRIDGE 1  --chdir "$out/src"  --add-flags "-O $out/src/run_tribler.py" mkdir -p $out/share/applications $out/share/icons cp $out/build/debian/tribler/usr/share/applications/org.tribler.Tribler.desktop $out/share/applications/ cp $out/build/debian/tribler/usr/share/pixmaps/tribler_big.xpm $out/share/icons/tribler.xpm mkdir -p $out/share/copyright/tribler mv $out/LICENSE $out/share/copyright/tribler ''; shellHook = '' wrapPythonPrograms || true export QT_QPA_PLATFORM_PLUGIN_PATH=$(echo ${qt5.qtbase.bin}/lib/qt-*/plugins/platforms) export PYTHONPATH=./tribler-core:./tribler-common:./tribler-gui:$program_PYTHONPATH export QT_PLUGIN_PATH="${qt5.qtsvg.bin}/${qt5.qtbase.qtPluginPrefix}" ''; passthru.updateScript = nix-update-script { }; meta = { description = "Decentralised P2P filesharing client based on the Bittorrent protocol"; mainProgram = "tribler"; homepage = "https://www.tribler.org/"; changelog = "https://github.com/Tribler/tribler/releases/tag/v${finalAttrs.version}"; license = lib.licenses.lgpl21Plus; maintainers = with lib.maintainers; [ xvapx viric mkg20001 ]; platforms = lib.platforms.linux; }; }) </ins>


tremc = callPackage ../applications/networking/p2p/tremc { }; <del> tribler = callPackage ../applications/networking/p2p/tribler { }; </del> trillian-im = callPackage ../applications/networking/instant-messengers/trillian-im { }; trojita = libsForQt5.callPackage ../applications/networking/mailreaders/trojita { };


<ins> diff --git a/build.gradle b/build.gradle index c206e2f..b1fda33 100644 --- a/build.gradle +++ b/build.gradle @@ -69,19 +69,7 @@ launch4j { messagesInstanceAlreadyExists="Stirling-PDF is already running." } -spotless { -    java { -        target project.fileTree('src/main/java') -        googleJavaFormat('1.19.1').aosp().reorderImports(false) - -        importOrder('java', 'javax', 'org', 'com', 'net', 'io') -        toggleOffOn() -        trimTrailingWhitespace() -        indentWithSpaces() -        endWithNewline() -    } -} dependencies { //security updates @@ -163,9 +151,6 @@ dependencies { annotationProcessor 'org.projectlombok:lombok:1.18.28' } -tasks.withType(JavaCompile) { -    dependsOn 'spotlessApply' -} compileJava { options.compilerArgs << '-parameters' } </ins>


<ins> diff --git a/build.gradle b/build.gradle index 7025b2b..d063da3 100644 --- a/build.gradle +++ b/build.gradle @@ -20,6 +20,11 @@ repositories { } +tasks.withType(AbstractArchiveTask) { +    preserveFileTimestamps = false +    reproducibleFileOrder = true +} + licenseReport { renderers = [new JsonReportRenderer()] </ins>


<ins> { lib, stdenv, fetchFromGitHub, substituteAll, gradle_7, perl, makeWrapper, jre, }: stdenv.mkDerivation (finalAttrs: { pname = "stirling-pdf"; version = "0.22.3"; src = fetchFromGitHub { owner = "Stirling-Tools"; repo = "Stirling-PDF"; rev = "v${finalAttrs.version}"; hash = "sha256-8zXTapFAXw4+KLLirxBeEBmqNw6ILFHtbsaBSP3Ehyg="; }; patches = [ # disable spotless because it tries to fetch files not in the FOD # and also because it slows down the build process ./disable-spotless.patch # remove timestamp from the header of a generated .properties file ./remove-props-file-timestamp.patch # use gradle's built-in method of zeroing out timestamps, # because stripJavaArchivesHook can't patch signed JAR files ./fix-jar-timestamp.patch # set the FOD as the only repository gradle can resolve from (substituteAll { src = ./use-fod-maven-repo.patch; inherit (finalAttrs) deps; }) ]; # fake build to pre-download deps into fixed-output derivation deps = stdenv.mkDerivation { name = "${finalAttrs.pname}-${finalAttrs.version}-deps"; inherit (finalAttrs) src; patches = [ ./disable-spotless.patch ]; nativeBuildInputs = [ gradle_7 perl ]; buildPhase = '' runHook preBuild export GRADLE_USER_HOME=$(mktemp -d) gradle --no-daemon --console=plain build runHook postBuild ''; # perl code mavenizes pathes (com.squareup.okio/okio/1.13.0/a9283170b7305c8d92d25aff02a6ab7e45d06cbe/okio-1.13.0.jar -> com/squareup/okio/okio/1.13.0/okio-1.13.0.jar) installPhase = '' runHook preInstall find $GRADLE_USER_HOME/caches/modules-2 -type f -regex '.*.(jar|pom)'  | perl -pe 's#(.*/([^/]+)/([^/]+)/([^/]+)/[0-9a-f]{30,40}/([^/s]+))$# ($x = $2) =~ tr|.|/|; "install -Dm444 $1 $out/$x/$3/$4/$5" #e'  | sh # Mimic existence of okio-3.6.0.jar, originally known as okio-jvm-3.6.0 (and renamed). # Gradle doesn't detect such renames and only fetches the latter. # Whenever this package gets updated, please check if this hack is obsolete. ln -s $out/com/squareup/okio/okio-jvm/3.6.0/okio-jvm-3.6.0.jar $out/com/squareup/okio/okio/3.6.0/okio-3.6.0.jar runHook postInstall ''; outputHashAlgo = "sha256"; outputHashMode = "recursive"; outputHash = "sha256-zUzKSa7zuIoXE77Hk/Xr5iMF4CEumV9horW2BTFRdtE="; }; nativeBuildInputs = [ gradle_7 makeWrapper ]; buildPhase = '' runHook preBuild export GRADLE_USER_HOME=$(mktemp -d) gradle --offline --no-daemon --console=plain build runHook postBuild ''; installPhase = '' runHook preInstall install -Dm644 build/libs/Stirling-PDF-*.jar $out/share/stirling-pdf/Stirling-PDF.jar makeWrapper ${jre}/bin/java $out/bin/Stirling-PDF  --add-flags "-jar $out/share/stirling-pdf/Stirling-PDF.jar" runHook postInstall ''; meta = { changelog = "https://github.com/Stirling-Tools/Stirling-PDF/releases/tag/${finalAttrs.src.rev}"; description = "A locally hosted web application that allows you to perform various operations on PDF files"; homepage = "https://github.com/Stirling-Tools/Stirling-PDF"; license = lib.licenses.gpl3Only; mainProgram = "Stirling-PDF"; maintainers = with lib.maintainers; [ tomasajt ]; platforms = jre.meta.platforms; sourceProvenance = with lib.sourceTypes; [ fromSource binaryBytecode # deps ]; }; }) </ins>


<ins> diff --git a/build.gradle b/build.gradle index e12cbd3..094a219 100644 --- a/build.gradle +++ b/build.gradle @@ -173,6 +173,7 @@ task writeVersion { def props = new Properties() props.setProperty('version', version) props.store(propsFile.newWriter(), null) +    propsFile.text = propsFile.readLines().tail().join('n') } swaggerhubUpload { </ins>


<ins> diff --git a/build.gradle b/build.gradle index c206e2f..cdaddf7 100644 --- a/build.gradle +++ b/build.gradle @@ -16,7 +16,7 @@ version = '0.22.3' sourceCompatibility = '17' repositories { -    mavenCentral() +    maven { url '@deps@' } } diff --git a/settings.gradle b/settings.gradle index f813993..2c87f3c 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1,7 @@ +pluginManagement { +    repositories { +        maven { url '@deps@' } +    } +} + rootProject.name = 'Stirling-PDF' </ins>


, curl , cython , fetchFromGitHub <ins> , fetchpatch </ins> , git , IOKit , jsoncpp


# MKL: , mklSupport ? true <del> }: </del> <ins> }@inputs: </ins> let <del> inherit (cudaPackagesGoogle) backendStdenv cudatoolkit cudaFlags cudnn nccl; </del> <ins> inherit (cudaPackagesGoogle) autoAddOpenGLRunpathHook cudaFlags cudaVersion cudnn nccl; </ins> pname = "jaxlib"; version = "0.4.24"; <ins> # It's necessary to consistently use backendStdenv when building with CUDA # support, otherwise we get libstdc++ errors downstream stdenv = throw "Use effectiveStdenv instead"; effectiveStdenv = if cudaSupport then cudaPackagesGoogle.backendStdenv else inputs.stdenv; </ins> meta = with lib; { description = "JAX is Autograd and XLA, brought together for high-performance machine learning research."; homepage = "https://github.com/google/jax";


# however even with that fix applied, it doesn't work for everyone: # https://github.com/NixOS/nixpkgs/pull/184395#issuecomment-1207287129 # NOTE: We always build with NCCL; if it is unsupported, then our build is broken. <del> broken = stdenv.isDarwin || nccl.meta.unsupported; </del> <ins> broken = effectiveStdenv.isDarwin || nccl.meta.unsupported; </ins> }; <del> cudatoolkit_joined = symlinkJoin { name = "${cudatoolkit.name}-merged"; paths = [ cudatoolkit.lib cudatoolkit.out ] ++ lib.optionals (lib.versionOlder cudatoolkit.version "11") [ # for some reason some of the required libs are in the targets/x86_64-linux # directory; not sure why but this works around it "${cudatoolkit}/targets/${stdenv.system}" </del> <ins> # These are necessary at build time and run time. cuda_libs_joined = symlinkJoin { name = "cuda-joined"; paths = with cudaPackagesGoogle; [ cuda_cudart.lib # libcudart.so cuda_cudart.static # libcudart_static.a cuda_cupti.lib # libcupti.so libcublas.lib # libcublas.so libcufft.lib # libcufft.so libcurand.lib # libcurand.so libcusolver.lib # libcusolver.so libcusparse.lib # libcusparse.so ]; }; # These are only necessary at build time. cuda_build_deps_joined = symlinkJoin { name = "cuda-build-deps-joined"; paths = with cudaPackagesGoogle; [ cuda_libs_joined # Binaries cudaPackagesGoogle.cuda_nvcc.bin # nvcc # Headers cuda_cccl.dev # block_load.cuh cuda_cudart.dev # cuda.h cuda_cupti.dev # cupti.h cuda_nvcc.dev # See https://github.com/google/jax/issues/19811 cuda_nvml_dev # nvml.h cuda_nvtx.dev # nvToolsExt.h libcublas.dev # cublas_api.h libcufft.dev # cufft.h libcurand.dev # curand.h libcusolver.dev # cusolver_common.h libcusparse.dev # cusparse.h </ins> ]; }; <del> cudatoolkit_cc_joined = symlinkJoin { name = "${cudatoolkit.cc.name}-merged"; </del> <ins> backend_cc_joined = symlinkJoin { name = "cuda-cc-joined"; </ins> paths = [ <del> backendStdenv.cc </del> <ins> effectiveStdenv.cc </ins> binutils.bintools # for ar, dwp, nm, objcopy, objdump, strip ]; };


arch = # KeyError: ('Linux', 'arm64') <del> if stdenv.hostPlatform.isLinux && stdenv.hostPlatform.linuxArch == "arm64" then "aarch64" else stdenv.hostPlatform.linuxArch; </del> <ins> if effectiveStdenv.hostPlatform.isLinux && effectiveStdenv.hostPlatform.linuxArch == "arm64" then "aarch64" else effectiveStdenv.hostPlatform.linuxArch; xla = effectiveStdenv.mkDerivation { pname = "xla-src"; version = "unstable"; src = fetchFromGitHub { owner = "openxla"; repo = "xla"; # Update this according to https://github.com/google/jax/blob/jaxlib-v${version}/third_party/xla/workspace.bzl. rev = "12eee889e1f2ad41e27d7b0e970cb92d282d3ec5"; hash = "sha256-68kjjgwYjRlcT0TVJo9BN6s+WTkdu5UMJqQcfHpBT90="; }; patches = [ # Resolves "could not convert ‘result’ from ‘SmallVector<[...],6>’ to # ‘SmallVector<[...],4>’" compilation error. See https://github.com/google/jax/issues/19814#issuecomment-1945141259. (fetchpatch { url = "https://github.com/openxla/xla/commit/7a614cd346594fc7ea2fe75570c9c53a4a444f60.patch"; hash = "sha256-RtuQTH8wzNiJcOtISLhf+gMlH1gg8hekvxEB+4wX6BM="; }) ]; dontBuild = true; # This is necessary for patchShebangs to know the right path to use. nativeBuildInputs = [ python ]; # Main culprits we're targeting are third_party/tsl/third_party/gpus/crosstool/clang/bin/*.tpl postPatch = '' patchShebangs . ''; installPhase = '' cp -r . $out ''; }; </ins> bazel-build = buildBazelPackage rec { name = "bazel-build-${pname}-${version}";


wheel build which <del> ] ++ lib.optionals stdenv.isDarwin [ </del> <ins> ] ++ lib.optionals effectiveStdenv.isDarwin [ </ins> cctools ];


six snappy zlib <del> ] ++ lib.optionals cudaSupport [ cudatoolkit cudnn ] ++ lib.optionals stdenv.isDarwin [ </del> <ins> ] ++ lib.optionals effectiveStdenv.isDarwin [ </ins> IOKit <del> ] ++ lib.optionals (!stdenv.isDarwin) [ </del> <ins> ] ++ lib.optionals (!effectiveStdenv.isDarwin) [ </ins> nsync ]; <ins> # We don't want to be quite so picky regarding bazel version </ins> postPatch = '' rm -f .bazelversion '';


removeRulesCC = false; <del> GCC_HOST_COMPILER_PREFIX = lib.optionalString cudaSupport "${cudatoolkit_cc_joined}/bin"; GCC_HOST_COMPILER_PATH = lib.optionalString cudaSupport "${cudatoolkit_cc_joined}/bin/gcc"; </del> <ins> GCC_HOST_COMPILER_PREFIX = lib.optionalString cudaSupport "${backend_cc_joined}/bin"; GCC_HOST_COMPILER_PATH = lib.optionalString cudaSupport "${backend_cc_joined}/bin/gcc"; </ins> # The version is automatically set to ".dev" if this variable is not set. # https://github.com/google/jax/commit/e01f2617b85c5bdffc5ffb60b3d8d8ca9519a1f3 JAXLIB_RELEASE = "1"; <del> preConfigure = '' # dummy ldconfig mkdir dummy-ldconfig echo "#!${stdenv.shell}" > dummy-ldconfig/ldconfig chmod +x dummy-ldconfig/ldconfig export PATH="$PWD/dummy-ldconfig:$PATH" cat <<CFG > ./.jax_configure.bazelrc build --strategy=Genrule=standalone build --repo_env PYTHON_BIN_PATH="${python}/bin/python" build --action_env=PYENV_ROOT build --python_path="${python}/bin/python" build --distinct_host_configuration=false build --define PROTOBUF_INCLUDE_PATH="${pkgs.protobuf}/include" '' + lib.optionalString (stdenv.hostPlatform.avxSupport && stdenv.hostPlatform.isUnix) '' build --config=avx_posix '' + lib.optionalString mklSupport '' build --config=mkl_open_source_only '' + lib.optionalString cudaSupport '' build --action_env CUDA_TOOLKIT_PATH="${cudatoolkit_joined}" build --action_env CUDNN_INSTALL_PATH="${cudnn}" build --action_env TF_CUDA_PATHS="${cudatoolkit_joined},${cudnn},${nccl}" build --action_env TF_CUDA_VERSION="${lib.versions.majorMinor cudatoolkit.version}" build --action_env TF_CUDNN_VERSION="${lib.versions.major cudnn.version}" build:cuda --action_env TF_CUDA_COMPUTE_CAPABILITIES="${builtins.concatStringsSep "," cudaFlags.realArches}" '' + '' CFG ''; </del> <ins> preConfigure = # Dummy ldconfig to work around "Can't open cache file /nix/store/<hash>-glibc-2.38-44/etc/ld.so.cache" error '' mkdir dummy-ldconfig echo "#!${effectiveStdenv.shell}" > dummy-ldconfig/ldconfig chmod +x dummy-ldconfig/ldconfig export PATH="$PWD/dummy-ldconfig:$PATH" '' + # Construct .jax_configure.bazelrc. See https://github.com/google/jax/blob/b9824d7de3cb30f1df738cc42e486db3e9d915ff/build/build.py#L259-L345 # for more info. We assume # * `cpu = None` # * `enable_nccl = True` # * `target_cpu_features = "release"` # * `rocm_amdgpu_targets = None` # * `enable_rocm = False` # * `build_gpu_plugin = False` # * `use_clang = False` (Should we use `effectiveStdenv.cc.isClang` instead?) # # Note: We should try just running https://github.com/google/jax/blob/ceb198582b62b9e6f6bdf20ab74839b0cf1db16e/build/build.py#L259-L266 # instead of duplicating the logic here. Perhaps we can leverage the # `--configure_only` flag (https://github.com/google/jax/blob/ceb198582b62b9e6f6bdf20ab74839b0cf1db16e/build/build.py#L544-L548)? '' cat <<CFG > ./.jax_configure.bazelrc build --strategy=Genrule=standalone build --repo_env PYTHON_BIN_PATH="${python}/bin/python" build --action_env=PYENV_ROOT build --python_path="${python}/bin/python" build --distinct_host_configuration=false build --define PROTOBUF_INCLUDE_PATH="${pkgs.protobuf}/include" '' + lib.optionalString cudaSupport '' build --config=cuda build --action_env CUDA_TOOLKIT_PATH="${cuda_build_deps_joined}" build --action_env CUDNN_INSTALL_PATH="${cudnn}" build --action_env TF_CUDA_PATHS="${cuda_build_deps_joined},${cudnn},${nccl}" build --action_env TF_CUDA_VERSION="${lib.versions.majorMinor cudaVersion}" build --action_env TF_CUDNN_VERSION="${lib.versions.major cudnn.version}" build:cuda --action_env TF_CUDA_COMPUTE_CAPABILITIES="${builtins.concatStringsSep "," cudaFlags.realArches}" '' + # Note that upstream conditions this on `wheel_cpu == "x86_64"`. We just # rely on `effectiveStdenv.hostPlatform.avxSupport` instead. So far so # good. See https://github.com/google/jax/blob/b9824d7de3cb30f1df738cc42e486db3e9d915ff/build/build.py#L322 # for upstream's version. lib.optionalString (effectiveStdenv.hostPlatform.avxSupport && effectiveStdenv.hostPlatform.isUnix) '' build --config=avx_posix '' + lib.optionalString mklSupport '' build --config=mkl_open_source_only '' + '' CFG ''; </ins> # Make sure Bazel knows about our configuration flags during fetching so that the # relevant dependencies can be downloaded. bazelFlags = [ "-c opt" <del> ] ++ lib.optionals stdenv.cc.isClang [ </del> <ins> # See https://bazel.build/external/advanced#overriding-repositories for # information on --override_repository flag. "--override_repository=xla=${xla}" ] ++ lib.optionals effectiveStdenv.cc.isClang [ </ins> # bazel depends on the compiler frontend automatically selecting these flags based on file # extension but our clang doesn't. # https://github.com/NixOS/nixpkgs/issues/150655 <del> "--cxxopt=-x" "--cxxopt=c++" "--host_cxxopt=-x" "--host_cxxopt=c++" </del> <ins> "--cxxopt=-x" "--cxxopt=c++" "--host_cxxopt=-x" "--host_cxxopt=c++" </ins> ]; # We intentionally overfetch so we can share the fetch derivation across all the different configurations


bazelTargets = [ bazelRunTarget "@mkl_dnn_v1//:mkl_dnn" ]; bazelFlags = bazelFlags ++ [ "--config=avx_posix" <ins> "--config=mkl_open_source_only" </ins> ] ++ lib.optionals cudaSupport [ # ideally we'd add this unconditionally too, but it doesn't work on darwin # we make this conditional on `cudaSupport` instead of the system, so that the hash for both # the cuda and the non-cuda deps can be computed on linux, since a lot of contributors don't # have access to darwin machines "--config=cuda" <del> ] ++ [ "--config=mkl_open_source_only" </del> ]; sha256 = (if cudaSupport then { <del> x86_64-linux = "sha256-c0avcURLAYNiLASjIeu5phXX3ze5TR812SW5SCG/iwk="; </del> <ins> x86_64-linux = "sha256-IEKoHjCOtKZKvU/DUUjbvXldORFJuyO1R3F6CZZDXxM="; </ins> } else { <del> x86_64-linux = "sha256-1hrQ9ehFy3vBJxKNUzi/T0l+eZxo26Th7i5VRd/9U+0="; aarch64-linux = "sha256-3QVYJOj1lNHgYVV9rOzVdfhq5q6GDwpcWCjKNrSZ4aU="; }).${stdenv.system} or (throw "jaxlib: unsupported system: ${stdenv.system}"); </del> <ins> x86_64-linux = "sha256-IE4+Tk4llo85u3NjakvY04tPw4R1bidyecPpQ4gknR8="; aarch64-linux = "sha256-NehnpA4m+Fynvh0S6WKy/v9ab81487NE9ahvbS70wjY="; }).${effectiveStdenv.system} or (throw "jaxlib: unsupported system: ${effectiveStdenv.system}"); </ins> }; buildAttrs = { outputs = [ "out" ]; <del> TF_SYSTEM_LIBS = lib.concatStringsSep "," (tf_system_libs ++ lib.optionals (!stdenv.isDarwin) [ </del> <ins> TF_SYSTEM_LIBS = lib.concatStringsSep "," (tf_system_libs ++ lib.optionals (!effectiveStdenv.isDarwin) [ </ins> "nsync" # fails to build on darwin ]); <del> # Note: we cannot do most of this patching at `patch` phase as the deps are not available yet. # 1) Link protobuf from nixpkgs (through TF_SYSTEM_LIBS when using gcc) to prevent crashes on #    loading multiple extensions in the same python program due to duplicate protobuf DBs. # 2) Patch python path in the compiler driver. preBuild = lib.optionalString cudaSupport '' patchShebangs ../output/external/xla/third_party/gpus/crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc.tpl '' + lib.optionalString stdenv.isDarwin '' # Framework search paths aren't added by bintools hook # https://github.com/NixOS/nixpkgs/pull/41914 </del> <ins> # Note: we cannot do most of this patching at `patch` phase as the deps # are not available yet. Framework search paths aren't added by bintools # hook. See https://github.com/NixOS/nixpkgs/pull/41914. preBuild = lib.optionalString effectiveStdenv.isDarwin '' </ins> export NIX_LDFLAGS+=" -F${IOKit}/Library/Frameworks" substituteInPlace ../output/external/rules_cc/cc/private/toolchain/osx_cc_wrapper.sh.tpl  --replace "/usr/bin/install_name_tool" "${cctools}/bin/install_name_tool"


inherit meta; }; platformTag = <del> if stdenv.hostPlatform.isLinux then </del> <ins> if effectiveStdenv.hostPlatform.isLinux then </ins> "manylinux2014_${arch}" <del> else if stdenv.system == "x86_64-darwin" then </del> <ins> else if effectiveStdenv.system == "x86_64-darwin" then </ins> "macosx_10_9_${arch}" <del> else if stdenv.system == "aarch64-darwin" then </del> <ins> else if effectiveStdenv.system == "aarch64-darwin" then </ins> "macosx_11_0_${arch}" <del> else throw "Unsupported target platform: ${stdenv.hostPlatform}"; </del> <ins> else throw "Unsupported target platform: ${effectiveStdenv.hostPlatform}"; </ins> in buildPythonPackage {


let cp = "cp${builtins.replaceStrings ["."] [""] python.pythonVersion}"; in "${bazel-build}/jaxlib-${version}-${cp}-${cp}-${platformTag}.whl"; <del> # Note that cudatoolkit is necessary since jaxlib looks for "ptxas" in $PATH. # See https://github.com/NixOS/nixpkgs/pull/164176#discussion_r828801621 for # more info. </del> <ins> # Note that jaxlib looks for "ptxas" in $PATH. See https://github.com/NixOS/nixpkgs/pull/164176#discussion_r828801621 # for more info. </ins> postInstall = lib.optionalString cudaSupport '' mkdir -p $out/bin <del> ln -s ${cudatoolkit}/bin/ptxas $out/bin/ptxas </del> <ins> ln -s ${cudaPackagesGoogle.cuda_nvcc.bin}/bin/ptxas $out/bin/ptxas </ins> find $out -type f ( -name '*.so' -or -name '*.so.*' ) | while read lib; do <del> addOpenGLRunpath "$lib" patchelf --set-rpath "${cudatoolkit}/lib:${cudatoolkit.lib}/lib:${cudnn}/lib:${nccl}/lib:$(patchelf --print-rpath "$lib")" "$lib" </del> <ins> patchelf --add-rpath "${lib.makeLibraryPath [cuda_libs_joined cudnn nccl]}" "$lib" </ins> done ''; <del> nativeBuildInputs = lib.optional cudaSupport addOpenGLRunpath; </del> <ins> nativeBuildInputs = lib.optionals cudaSupport [ autoAddOpenGLRunpathHook ]; </ins> propagatedBuildInputs = [ absl-py


{ stdenv, lib, fetchurl, makeWrapper, which, zlib, libGL, glib, xorg, libxkbcommon , xdg-utils, libXrender, fontconfig, freetype, systemd, libpulseaudio <ins> , cairo, gdk-pixbuf, gtk3, pixman </ins> # For glewinfo , libXmu, libXi, libXext }:


freetype systemd libpulseaudio <ins> cairo gdk-pixbuf gtk3 pixman </ins> ]; libPath = lib.makeLibraryPath packages; in


sha256 = "sha256-CS1A9udt47bhgnYJqqkCG3z4XaPVHmz417VTsY2ccOA="; }; <del> nativeBuildInputs = [ makeWrapper ]; buildInputs = [ which xdg-utils ]; </del> <ins> nativeBuildInputs = [ makeWrapper which xdg-utils ]; </ins> unpackPhase = '' mkdir -p phony-home $out/share/applications


patchExecutable genymotion patchExecutable player <ins> patchExecutable qemu/x86_64/bin/qemu-img patchExecutable qemu/x86_64/bin/qemu-system-x86_64 </ins> patchTool adb patchTool aapt