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)
Since b2f9cd34e7 ("gobject-introspection: use wrapper.nix for the
native package too so we can propagate the dev output"),
gobject-introspection doesn't need to be included in buildInputs when
it's in nativeBuildInputs, as it's propagated from the setup hook.
Removing the build input fixes evaluation in buildPackages when
cross-compiling to platforms that gobject-introspection is unsupported
on, like ghcjs.
Tested building natively on x86_64-linux, in
pkgsCross.aarch64-multiplatform, and in pkgsCross.ghcjs.buildPackages.
Prior to this commit, builds of `pkgsCross.*.gpsd` were failing.
`gpsd` expects `CCVERSION` to be set, and fails if it is not set.
Scons does not guarantee that `CCVERSION` will be set, nor does it
specify under what circumstances it will or will not be set: "This may
or may not be set, depending on the specific C compiler being used."
https://scons.org/doc/production/HTML/scons-man.html#cv-CCVERSION
Apparently cross-compilation triggers one of those unspecified
circumstances. There are several bug reports to scons relating to
this:
https://github.com/SCons/scons/issues/1723https://github.com/SCons/scons/issues?q=is%3Aissue+ccversion+is%3Aclosed
`gpsd` does not use `CCVERSION` for any purpose other than printing a
log message at the start of the build:
d055863603
This commit modifies the log message, replacing `env['CCVERSION']`
with `env['CC']`, since `CC` is always set when using nixpkgs'
standard builder.
With this commit, `pkgsCross.mips64el-linux-gnuabi64.gpsd` and
`pkgsCross.powernv.gpsd` build correctly on x86_64. Prior to this
commit, they would fail with:
```
scons: Reading SConscript files ...
scons version: 4.1.0
scons is running under Python version: 3.10.5.final.0
gpsd version: 3.23.1
This system is: linux
KeyError: 'CCVERSION':
File "/build/gpsd-3.23.1/SConstruct", line 69:
SConscript('SConscript',
File "/nix/store/0vmqv6f2s8bj2a50gk8g05jcb5scnifb-scons-4.1.0/lib/python3.10/site-packages/SCons/Script/SConscript.py", line 654:
return method(*args, **kw)
File "/nix/store/0vmqv6f2s8bj2a50gk8g05jcb5scnifb-scons-4.1.0/lib/python3.10/site-packages/SCons/Script/SConscript.py", line 591:
return _SConscript(self.fs, *files, **subst_kw)
File "/nix/store/0vmqv6f2s8bj2a50gk8g05jcb5scnifb-scons-4.1.0/lib/python3.10/site-packages/SCons/Script/SConscript.py", line 280:
exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
File "/build/gpsd-3.23.1/gpsd-3.23.1/SConscript", line 883:
announce("cc is %s, version %s" % (env['CC'], env['CCVERSION']))
File "/nix/store/0vmqv6f2s8bj2a50gk8g05jcb5scnifb-scons-4.1.0/lib/python3.10/site-packages/SCons/Environment.py", line 388:
return self._dict[key]
```
The `rm $out/bin/xgps*` command fails because that file is not there in the first place. Let's change it to `rm -f $out/bin/xgps*` so we can build with `guiSupport=false`.
* treewide: http -> https sources
This updates the source urls of all top-level packages from http to
https where possible.
* buildtorrent: fix url and tab -> spaces
Fixes this when building with nix.useChroot = true in configuration.nix:
sh: ./test_maidenhead.py: /usr/bin/env: bad interpreter: No such file or directory
scons: *** [maidenhead-locator-regress] Error 126
scons: building terminated because of errors.
* Don't repeat package name in description
* longDescription re-copied from homepage (gpsd now supports AIS...)
* The homepage has moved
* Add platforms and maintainers
Build system is changed, gpsd uses scons now.
The expressions needs some more work, TODO comments added. (xgps didn't
work before this change either.)
I added an option for the gpsd group, which is set to upstream default:
"dialout". Note that our default gpsd user is "gpsd", while upstream
uses "nobody" by default.
This update broke gpsd because the download url changed and trying to
get version 3.10 from the old url returns an error document with a
timestamp resulting in new hashes on every build.
And more importantly, gpsd 3.10 switched to the scons build system, so
even if the download url was correct it will fail to build until the
expression is updated.
This reverts commit 3f1c26b825.