New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
navit: add supports, xkdb, and many fixes #45657
Conversation
stdenv.mkDerivation rec { | ||
name = "navit-${version}"; | ||
version = "0.5.1"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "navit-gps"; | ||
repo = "navit"; | ||
rev = "v${version}"; | ||
rev = version; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you change this? Looks like they do tag their releases with v${version}
: https://github.com/navit-gps/navit/releases
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh my bad!
CHECK_INCLUDE_FILES(stdint.h HAVE_STDINT_H) | ||
CHECK_INCLUDE_FILES(byteswap.h HAVE_BYTESWAP_H) | ||
CHECK_LIBRARY_EXISTS(gypsy gypsy_control_get_default "" GYPSY_FOUND) | ||
-CHECK_INCLUDE_FILES(libspeechd.h HAVE_LIBSPEECHD) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this patch necessary? It should either indicate a packaging failure on our side or an insufficiently flexible build script upstream. Either way it should be fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you think we should symlink the headers here like other distros ? i wonder it was the new place and i've fix it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are other distros doing that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or copy https://packages.debian.org/sid/amd64/libspeechd-dev/filelist
@berce : what do you think ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like navit should be able to handle upstream behaviour. Or maybe there is some configure option for libspeechd that tells it to make those symlinks.
However if making those links is a de-facto standard among distributions, we should do it too. And we should notify upstream of that standard so that they can include the links in future releases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still think this should be investigated, even though Mic92 merged already.
#hardeningDisable = [ "format" ]; | ||
NIX_CFLAGS_COMPILE = [ "-I${SDL.dev}/include/SDL" ]; | ||
patches = [ ./CMakeLists.txt.patch ]; | ||
hardeningDisable = [ "format" ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this necessary again?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't understand well and i restore from the original navit since it was not failing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But it was commented out previously.
patches = [ ./CMakeLists.txt.patch ]; | ||
hardeningDisable = [ "format" ]; | ||
|
||
NIX_CFLAGS_COMPILE = [ ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the empty list?
# emulate DSAMPLE_MAP | ||
mkdir -p $out/share/navit/maps/maps | ||
mkdir -p $out/share/navit/maps/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please quote $out
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quoting is not necessary. We do not support spaces in nix store path. Even if would fix all our code we cannot fix all upstream projects. Therefore we keep code simple and do not quote at all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't know that we do not support that, do you have a source on that? I agree that it would probably lead to a multitude of problems and be impractical at the moment, but that doesn't mean that we shouldn't try to do the "right" thing as much as possible.
I also disagree that leaving out the quotes makes the code simpler. It makes it necessary to reason about weather or not this variable may have spaces. It is far simpler in my opinion to always quote variables except in the cases where splitting on whitespace is explicitly wanted. Otherwise it always comes back to bite you in the future. Also quoting unconditionally would allow us to run shellcheck on scripts, as was proposed somewhere before.
So I don't see any disadvantage to quoting but quite some advantages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nix does not allow spaces in its grammar for paths: https://github.com/NixOS/nix/blob/master/src/libexpr/lexer.l#L92
I don't see this will changing in future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, good to know. Thanks. My other points are still valid though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At the moment omitting quotation is common sense:
$ ag 'wrapProgram $out' | wc -l
596
$ ag 'wrapProgram "$out' | wc -l
179
There is also sometimes pitfalls of quoting twice.
If you want to change direction of how we handle quoting in builder scripts it is better to open a new issue. Because otherwise our reviews will become inconsistent which can be annoying for contributors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think "the way it is commonly done" and "common sense" are necessarily the same thing.
Do do that consistently we would need a style guide and automated tooling. Thats a way bigger problem to tackle.
|
||
# we dont want blank screen by defaut | ||
postInstall = '' | ||
# copy a better configuration for nixos desktop | ||
cp "${./navit.xml}" $out/share/navit/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please quote $out/share/navit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see above
# emulate DSAMPLE_MAP | ||
mkdir -p $out/share/navit/maps/maps | ||
mkdir -p $out/share/navit/maps/ | ||
bzcat "${sample_map}" | $out/bin/maptool "$out/share/navit/maps/osm_bbox_11.3,47.9,11.7,48.2.bin" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see above above.
done | ||
wrapProgram $out/bin/navit \ | ||
--prefix PATH : ${makeBinPath ([ espeak xkbd ] ++ optional speechdSupport [ speechd ]) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is [ espeak xkbd ]
necessary now? Should that be optional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't make that optional since i think a gps navitation has to have it. It's forbidden to look at screen when we drive here. i can make it optional, but previously, i didn't.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well if it is an optional dependency according to upstream, I think it is better practice to make it optional. If you think it is essential, you can then default the optional dependency to true
.
Success on x86_64-linux (full log) Attempted: navit Partial log (click to expand)
|
@@ -0,0 +1,7324 @@ | |||
<?xml version="1.0" encoding="UTF-8"?><!-- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you submit this by accident?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'd like to introduce a better config for nixos.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better than what? Does that really need a 7k line xml file? Where does that file come from?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We cannot accept that large files as it would affect the channel and repository size.
Success on aarch64-linux (full log) Attempted: navit Partial log (click to expand)
|
Success on x86_64-linux (full log) Attempted: navit Partial log (click to expand)
|
Success on aarch64-linux (full log) Attempted: navit Partial log (click to expand)
|
Motivation for this change
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)