In preparation for the deprecation of `stdenv.isX`.
These shorthands are not conducive to cross-compilation because they
hide the platforms.
Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way
One example of why this is bad and especially affects compiler packages
https://www.github.com/NixOS/nixpkgs/pull/343059
There are too many files to go through manually but a treewide should
get users thinking when they see a `hostPlatform.isX` in a place where it
doesn't make sense.
```
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is"
fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is"
```
This was achieved using the following command:
sd 'wrapGAppsHook\b' wrapGAppsHook3 (rg -l 'wrapGAppsHook\b')
And then manually reverted the following changes:
- alias in top-level.nix
- function name in wrap-gapps-hook.sh
- comment in postFixup of at-spi2-core
- comment in gtk4
- comment in preFixup of 1password-gui/linux.nix
- comment in postFixup of qgis/unwrapped-ltr.nix and qgis/unwrapped.nix
- comment in postFixup of telegram-desktop
- comment in postFixup of fwupd
- buildCommand of mongodb-compass
- postFixup of xflux-gui
- comment in a patch in kdePackages.kde-gtk-config and plasma5Packages.kde-gtk-config
- description of programs.sway.wrapperFeatures.gtk NixOS option (manual rebuild)
The nixpkgs-unstable channel's programs.sqlite was used to identify
packages producing exactly one binary, and these automatically added
to their package definitions wherever possible.
Many packages have some kind of flag indicating whether or not to build with
systemd support. Most of these default to `stdenv.isLinux`, but systemd does
not build on (and is marked `broken` for) `isStatic`. Only a few packages have
the needed `&& !isStatic` in the default value for their parameter.
This commit moves the logic for the default value of these flags into
`systemd.meta.{platforms,badPlatforms}` and evaluates those conditions using
`lib.meta.availableOn`.
This provides three benefits:
1. The default values are set correctly (i.e. including `&& isStatic`)
2. The default values are set consistently
3. The way is paved for any future non-Linux systemd platforms (FreeBSD is
reported to have experimental systemd support)
Since commit 3871f8be8d
("pulseaudioFull: fix wrapGApp wrapping"), the pulseaudio service files
have been referencing *unwrapped* binaries. This mostly hurts
pulseaudioFull, where using unwrapped binaries means there's no High
Fidelity A2DP profile at all. Plain pulseaudio (not -full) seems able to
use A2DP profile with SBC codec, but not aptX, as the latter requires
gstreamer / wrapper.
Since the wrapping of pulseaudio is a bit complicated (see referenced
commit), let's just fix the service files manually in preFixup.
Ref https://github.com/NixOS/nixpkgs/issues/203919.
Since
7a2605e0f3
the pulseaudio build recipe incorporates the `wrapGAppsHook`
wrapper setup-hook if `advancedBluetoothCodecs` are enabled.
This wrapper setup-hook -- like most wrappers --
wraps binaries in `$out/bin` by first renaming them,
then placing a wrapper script where the original binary was.
Unfortunatelly, pulseaudio doesn't like its
binary moved around after installation:
It records the binaries path during installation time
e5ad31e873/meson.build (L154)
then checks the path in `/proc/self/exe` and complains
> Jun 16 19:06:48 nixosb pulseaudio[2219]: W: [.pulseaudio-wra] main.c: /proc/self/exe does not point to /nix/store/bqfyzxwpxa2ydmyvh3j32xrm4chxbj22-pulseaudio-15.0/bin/pulseaudio, cannot self execute. Are you playing games?
if they don't match
e5ad31e873/src/daemon/main.c (L577)
Somehow, this also results in a real bug:
`pacmd` fails to connect to the pulseaudio server, see
https://github.com/NixOS/nixpkgs/issues/177915
To fix this issue, the commit at hand changes the
installation directory for binaries to `$out/.bin-unwrapped`.
After the installation, `$out/bin` is created by hand and
populated with symlinks to files in `$out/.bin-unwrapped`.
`wrapGAppsHook` doesn't know or care about the `.bin-unwrapped`
directory; it just sees all the symlinks in `bin`,
renames them and places wrapper scripts beside them.
Effectively, this leaves the original
binary in `.bin-unwrapped` unchanged!
So pulseaudio will find itself still in its oritinal place,
and "users" of the package can call pulseaudio
via the wrapper script in `bin` as usual.
The current postInstall removes all of $out/share, which also includes pulse's
vapi/deps files. Certain projects (budgie-desktop, for example) require these
definitions, but do not require the full pulseaudio server. Preserving these
files allows these projects to only depend on libpulseaudio.
Fixes#73463.
The x86_64 and aarch64 SDK attributes are named differently and don't
have the same contents. This was the motivation to try dropping the SDK
dependency altogether, relying only on the Libc and some frameworks.
continuation of #109595
pkgconfig was aliased in 2018, however, it remained in
all-packages.nix due to its wide usage. This cleans
up the remaining references to pkgs.pkgsconfig and
moves the entry to aliases.nix.
python3Packages.pkgconfig remained unchanged because
it's the canonical name of the upstream package
on pypi.
When cross-compiling, pulseaudio seems to not find some m4 macro
providing GSETTINGS_RULES.
However, apart from the obviously missing gsettings support, this works
just fine.