Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions doc/release-notes/rl-2511.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@

- `gnome-keyring` no longer ships with an SSH agent anymore because it has been deprecated upstream. You should use `gcr_4` instead, which provides the same features. More information on why this was done can be found on [the relevant GCR upstream PR](https://gitlab.gnome.org/GNOME/gcr/-/merge_requests/67).

- `python3Full` and its versioned attributes (python3xxFull) have been removed. Bluetooth support is now enabled in the default python3 attributes. The X11 support built the tkinter module, which is available as a dedicated attribute on the package set.

- `stdenv.mkDerivation` and other derivation builders that use it no longer allow the value of `env` to be anything but an attribute set, for the purpose of setting environment variables that are available to the [builder](https://nix.dev/manual/nix/latest/store/derivation/#builder) process. An environment variable called `env` can still be provided by means of `mkDerivation { env.env = ...; }`, though we recommend to use a more specific name than "env".

- The default Android NDK version has been raised to 27, and the default SDK version to 35.
Expand Down
44 changes: 44 additions & 0 deletions pkgs/by-name/bl/bluez-headers/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
lib,
stdenv,
fetchurl,
}:

# This package only provides the bluetooth headers from the bluez package
# for consumption in Python, which cannot consume bluez.dev due to multiple
# infinite recursion paths.

stdenv.mkDerivation (finalAttrs: {
pname = "bluez-headers";
version = "5.83";

# This package has the source, because of the emulatorAvailable check in the
# bluez function args, that causes an infinite recursion with Python on cross
# builds.
src = fetchurl {
url = "mirror://kernel/linux/bluetooth/bluez-${finalAttrs.version}.tar.xz";
hash = "sha256-EIUi2QnSIFgTmb/sk9qrYgNVOc7vPdo+eZcHhcY70kw=";
};

dontConfigure = true;
dontBuild = true;

installPhase = ''
mkdir -p $out/include/bluetooth
cp -v lib/*.h "$out/include/bluetooth/"
'';

meta = {
homepage = "https://www.bluez.org/";
description = "Official Linux Bluetooth protocol stack";
changelog = "https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/ChangeLog?h=${finalAttrs.version}";
license = with lib.licenses; [
bsd2
gpl2Plus
lgpl21Plus
mit
];
maintainers = with lib.maintainers; [ ];
platforms = lib.platforms.linux;
};
})
21 changes: 3 additions & 18 deletions pkgs/by-name/bl/bluez/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
stdenv,
alsa-lib,
autoreconfHook,
bluez-headers,
dbus,
docutils,
ell,
Expand All @@ -28,12 +29,7 @@

stdenv.mkDerivation (finalAttrs: {
pname = "bluez";
version = "5.83";

src = fetchurl {
url = "mirror://kernel/linux/bluetooth/bluez-${finalAttrs.version}.tar.xz";
hash = "sha256-EIUi2QnSIFgTmb/sk9qrYgNVOc7vPdo+eZcHhcY70kw=";
};
inherit (bluez-headers) version src;

patches = [
(fetchurl {
Expand Down Expand Up @@ -186,18 +182,7 @@ stdenv.mkDerivation (finalAttrs: {
url = "https://git.kernel.org/pub/scm/bluetooth/bluez.git";
};

meta = {
homepage = "https://www.bluez.org/";
description = "Official Linux Bluetooth protocol stack";
changelog = "https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/ChangeLog?h=${finalAttrs.version}";
license = with lib.licenses; [
bsd2
gpl2Plus
lgpl21Plus
mit
];
meta = bluez-headers.meta // {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This breaks meta.position.

mainProgram = "btinfo";
maintainers = with lib.maintainers; [ ];
platforms = lib.platforms.linux;
};
})
34 changes: 4 additions & 30 deletions pkgs/development/interpreters/python/cpython/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,15 @@
windows,

# optional dependencies
bluezSupport ? false,
bluez,
bluezSupport ? !withMinimalDeps && stdenv.hostPlatform.isLinux,
bluez-headers,
mimetypesSupport ? !withMinimalDeps,
mailcap,
tzdata,
withGdbm ? !withMinimalDeps && !stdenv.hostPlatform.isWindows,
gdbm,
withReadline ? !withMinimalDeps && !stdenv.hostPlatform.isWindows,
readline,
x11Support ? false,
tcl,
tk,
tclPackages,
libX11,
xorgproto,

# splicing/cross
pythonAttr ? "python${sourceVersion.major}${sourceVersion.minor}",
Expand Down Expand Up @@ -114,10 +108,6 @@
# cgit) that are needed here should be included directly in Nixpkgs as
# files.

assert x11Support -> tcl != null && tk != null && xorgproto != null && libX11 != null;

assert bluezSupport -> bluez != null;

assert lib.assertMsg (
enableFramework -> stdenv.hostPlatform.isDarwin
) "Framework builds are only supported on Darwin.";
Expand Down Expand Up @@ -163,8 +153,7 @@ let
passthru =
let
# When we override the interpreter we also need to override the spliced versions of the interpreter
# bluez is excluded manually to break an infinite recursion.
inputs' = lib.filterAttrs (n: v: n != "bluez" && n != "passthruFun" && !lib.isDerivation v) inputs;
inputs' = lib.filterAttrs (n: v: n != "passthruFun" && !lib.isDerivation v) inputs;
# Memoization of the splices to avoid re-evaluating this function for all combinations of splices e.g.
# python3.pythonOnBuildForHost.pythonOnBuildForTarget == python3.pythonOnBuildForTarget by consuming
# __splices as an arg and using the cache if populated.
Expand Down Expand Up @@ -265,7 +254,7 @@ let
zstd
]
++ optionals bluezSupport [
bluez
bluez-headers
]
++ optionals stdenv.hostPlatform.isMinGW [
windows.dlfcn
Expand All @@ -280,12 +269,6 @@ let
++ optionals withReadline [
readline
]
++ optionals x11Support [
libX11
tcl
tk
xorgproto
]
);

hasDistutilsCxxPatch = !(stdenv.cc.isGNU or false);
Expand Down Expand Up @@ -446,11 +429,6 @@ stdenv.mkDerivation (finalAttrs: {
+ optionalString mimetypesSupport ''
substituteInPlace Lib/mimetypes.py \
--replace-fail "@mime-types@" "${mailcap}"
''
+ optionalString (pythonOlder "3.13" && x11Support && ((tclPackages.tix or null) != null)) ''
substituteInPlace "Lib/tkinter/tix.py" --replace-fail \
"os.environ.get('TIX_LIBRARY')" \
"os.environ.get('TIX_LIBRARY') or '${tclPackages.tix}/lib'"
'';

env = {
Expand Down Expand Up @@ -581,10 +559,6 @@ stdenv.mkDerivation (finalAttrs: {
if stdenv.hostPlatform.isAarch64 then "uint128" else "x64"
}'
''
+ optionalString (stdenv.hostPlatform.isDarwin && x11Support && pythonAtLeast "3.11") ''
export TCLTK_LIBS="-L${tcl}/lib -L${tk}/lib -l${tcl.libPrefix} -l${tk.libPrefix}"
export TCLTK_CFLAGS="-I${tcl}/include -I${tk}/include"
''
+ optionalString stdenv.hostPlatform.isWindows ''
export NIX_CFLAGS_COMPILE+=" -Wno-error=incompatible-pointer-types"
''
Expand Down
106 changes: 84 additions & 22 deletions pkgs/development/python-modules/tkinter/default.nix
Original file line number Diff line number Diff line change
@@ -1,34 +1,91 @@
{
lib,
stdenv,
buildPythonPackage,
replaceVars,
setuptools,
python,
py,
isPyPy,
pythonOlder,
tcl,
tclPackages,
tk,
tkinter,
xvfb-run,
}:

buildPythonPackage {
pname = "tkinter";
version = python.version;
src = py;
format = "other";

# tkinter is included in PyPy, making this package a no-op.
installPhase = lib.optionalString (!isPyPy) (
''
# Move the tkinter module
mkdir -p $out/${py.sitePackages}
mv lib/${py.libPrefix}/lib-dynload/_tkinter* $out/${py.sitePackages}/
''
+ lib.optionalString (!stdenv.hostPlatform.isDarwin) ''
# Update the rpath to point to python without x11Support
old_rpath=$(patchelf --print-rpath $out/${py.sitePackages}/_tkinter*)
new_rpath=$(sed "s#${py}#${python}#g" <<< "$old_rpath" )
patchelf --set-rpath $new_rpath $out/${py.sitePackages}/_tkinter*
''
);

meta = py.meta // {
pyproject = true;

src = python.src;

prePatch = ''
mkdir $NIX_BUILD_TOP/tkinter

# copy the module bits and pieces from the python source
cp -v Modules/{_tkinter.c,tkinter.h} ../tkinter/
cp -rv Modules/clinic ../tkinter/
cp -rv Lib/tkinter ../tkinter/

pushd $NIX_BUILD_TOP/tkinter

# install our custom pyproject.toml
cp ${
replaceVars ./pyproject.toml {
python_version = python.version;
python_internal_dir = "${python}/include/${python.libPrefix}/internal";
}
} ./pyproject.toml

''
+ lib.optionalString (pythonOlder "3.13") ''
substituteInPlace "tkinter/tix.py" --replace-fail \
"os.environ.get('TIX_LIBRARY')" \
"os.environ.get('TIX_LIBRARY') or '${tclPackages.tix}/lib'"
'';

build-system = [ setuptools ];

buildInputs = [
tcl
tk
];

env = {
TCLTK_LIBS = toString [
"-L${lib.getLib tcl}/lib"
"-L${lib.getLib tk}/lib"
"-l${tcl.libPrefix}"
"-l${tk.libPrefix}"
];
TCLTK_CFLAGS = toString [
"-I${lib.getDev tcl}/include"
"-I${lib.getDev tk}/include"
];
};

doCheck = false;

nativeCheckInputs = [ xvfb-run ];

preCheck = ''
cd $NIX_BUILD_TOP/Python-*/Lib
export HOME=$TMPDIR
'';

checkPhase = ''
runHook preCheck
xvfb-run -w 10 -s "-screen 0 1920x1080x24" \
python -m unittest test.test_tkinter

runHook postCheck
'';

passthru.tests.unittests = tkinter.overridePythonAttrs { doCheck = true; };

pythonImportsCheck = [ "tkinter" ];

meta = {
# Based on first sentence from https://docs.python.org/3/library/tkinter.html
description = "Standard Python interface to the Tcl/Tk GUI toolkit";
longDescription = ''
Expand All @@ -52,5 +109,10 @@ buildPythonPackage {
these additions and changes, and refer to the official Tcl/Tk
documentation for details that are unchanged.
'';
homepage = "https://docs.python.org/3/library/tkinter.html";
inherit (python.meta)
license
maintainers
;
};
}
16 changes: 16 additions & 0 deletions pkgs/development/python-modules/tkinter/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[project]
name = "tkinter"
version = "@python_version@"
description = "Tkinter."
requires-python = ">=@python_version@"

[tool.setuptools]
packages = ["tkinter"]
ext-modules = [
{ name = "_tkinter", sources = ["_tkinter.c"], libraries = ["tcl9.0", "tcl9tk9.0"], include-dirs = ["@python_internal_dir@/"] }
]

6 changes: 6 additions & 0 deletions pkgs/top-level/aliases.nix
Original file line number Diff line number Diff line change
Expand Up @@ -1985,6 +1985,12 @@ mapAliases {
python = python2; # Added 2022-01-11
python-swiftclient = throw "'python-swiftclient' has been renamed to/replaced by 'swiftclient'"; # Converted to throw 2024-10-17
pythonFull = python2Full; # Added 2022-01-11
python3Full = throw "python3Full has been removed. Bluetooth support is now enabled by default. The tkinter package is available within the package set.";
python310Full = throw "python310Full has been removed. Bluetooth support is now enabled by default. The tkinter package is available within the package set.";
python311Full = throw "python311Full has been removed. Bluetooth support is now enabled by default. The tkinter package is available within the package set.";
python312Full = throw "python312Full has been removed. Bluetooth support is now enabled by default. The tkinter package is available within the package set.";
python313Full = throw "python313Full has been removed. Bluetooth support is now enabled by default. The tkinter package is available within the package set.";
python314Full = throw "python314Full has been removed. Bluetooth support is now enabled by default. The tkinter package is available within the package set.";
pythonPackages = python.pkgs; # Added 2022-01-11
pypy39 = throw "pypy 3.9 has been removed, use pypy 3.10 instead"; # Added 2025-01-03

Expand Down
40 changes: 0 additions & 40 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6202,42 +6202,6 @@ with pkgs;
pythonAttr = "python27Full";
x11Support = true;
};
python3Full = python3.override {
self = python3Full;
pythonAttr = "python3Full";
bluezSupport = lib.meta.availableOn stdenv.hostPlatform bluez;
x11Support = true;
};
python310Full = python310.override {
self = python310Full;
pythonAttr = "python310Full";
bluezSupport = lib.meta.availableOn stdenv.hostPlatform bluez;
x11Support = true;
};
python311Full = python311.override {
self = python311Full;
pythonAttr = "python311Full";
bluezSupport = lib.meta.availableOn stdenv.hostPlatform bluez;
x11Support = true;
};
python312Full = python312.override {
self = python312Full;
pythonAttr = "python312Full";
bluezSupport = lib.meta.availableOn stdenv.hostPlatform bluez;
x11Support = true;
};
python313Full = python313.override {
self = python313Full;
pythonAttr = "python313Full";
bluezSupport = lib.meta.availableOn stdenv.hostPlatform bluez;
x11Support = true;
};
python314Full = python314.override {
self = python314Full;
pythonAttr = "python314Full";
bluezSupport = lib.meta.availableOn stdenv.hostPlatform bluez;
x11Support = true;
};

# https://py-free-threading.github.io
python313FreeThreading = python313.override {
Expand Down Expand Up @@ -15668,10 +15632,6 @@ with pkgs;
flutter = flutter324;
};

openfreebuds = callPackage ../by-name/op/openfreebuds/package.nix {
python3Packages = python3Full.pkgs;
};

davis = callPackage ../by-name/da/davis/package.nix {
php = php83; # https://github.com/tchapi/davis/issues/195
};
Expand Down
Loading
Loading