Commit Graph

11 Commits

Author SHA1 Message Date
Adam Joseph bc2d598878 treewide: change pythonForBuild to pythonOnBuildForHost 2023-11-05 17:42:12 -08:00
Artturin 4e3dcf364e treewide: makeSetupHook deps -> propagatedBuildInputs 2023-02-07 21:02:00 +02:00
Artturin 9a9c42e19f makeSetupHook: support depsTargetTargetPropagated 2023-02-07 21:00:18 +02:00
Vladimír Čunát 8a77ed60ac Merge branch 'master' into staging-next 2023-01-27 09:36:55 +01:00
Shawn8901 a59dda942c treewide: remove global with lib; statements in pkgs/development 2023-01-26 18:31:02 +01:00
Alyssa Ross 0ae87d514f treewide: add names to all setup hooks 2023-01-19 15:00:36 +00:00
Frederik Rietdijk 33d12e5f0b pythonPackages: ensure all derivations provide python modules
This adds a test to ensure no new uses of `buildPythonApplication` can
be added to `python-packages.nix`.

Python packages can be grouped into two groups: 1) applications and 2)
packages providing importable modules. In `python-packages.nix` we only
want to have 2). 1) should be in the top-level package set.

To achieve this, all setup hooks need to be marked as being a setup hook.
For the setup hooks in the Python packages set this is done by creating
a new builder, `makePythonHook`.

Because there were issues with splicing, the file importing all the hooks
is converted to an extension. All non-packages were moved out of `python-packages.nix`
into `python-packages-base.nix`. The `keep` argument to `makeScopeWithSplicing
was cleaned up as well; there is no need to keep this one manually in sync
reducing the risk of breaking cross-compilation.
2022-10-27 10:03:16 +02:00
Frederik Rietdijk f665828fa3 Python: improve cross-compilation
This changeset allows for cross-compilation of Python packages. Packages
built with buildPythonPackage are not allowed to refer to the build
machine. Executables that have shebangs will refer to the host.
2019-01-04 10:45:22 +01:00
Jörg Thalheim 855777ad22 wrap-python: fix pypy site-packages path 2018-12-20 14:18:25 +00:00
Frederik Rietdijk d68aba4cfb Python: script names now include full path
Certain programs, like zim, calibre and now also apparently mercurial,
rely on sys.argv[0] providing not just the script name but the full
path.

The Python docs [1] state the following on the matter:

> argv[0] is the script name (it is operating system dependent whether
this is a full pathname or not).

Therefore, scripts should not expect to receive a full path.
Unfortunately some do. While this can be considered a bug, there doesn't
seem any reason not to provide the full path. Therefore we now provide
the full path.

[1]
https://docs.python.org/3.5/library/sys.html?highlight=sys.argv#sys.argv
2017-01-02 11:29:11 +01:00
Frederik Rietdijk 725c37b4d3 Python: move wrapPython into own file 2016-09-01 16:16:31 +02:00