Skip to content
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

gettext: add setup hook populating GETTEXTDATADIRS #32299

Merged
merged 1 commit into from Dec 4, 2017

Conversation

orivej
Copy link
Contributor

@orivej orivej commented Dec 4, 2017

Motivation for this change

Fixes #32296: packages expect gettext to be able to find the files they install into $prefex/share/gettext, such as appstream-glib with its /nix/store/…-appstream-glib-0.7.2/share/gettext/its/appdata.loc.

https://www.gnu.org/software/gettext/manual/html_node/Preparing-ITS-Rules.html
https://github.com/autotools-mirror/gettext/blob/981c523ddbd1462970335a1069573ca3bdd3df5e/NEWS#L19

Things done

WIP: needs testing.

  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@orivej orivej requested a review from jtojnar December 4, 2017 04:36
Copy link
Contributor

@jtojnar jtojnar left a comment

Choose a reason for hiding this comment

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

LGTM, but again I still do not fully comprehend envHooks.

@orivej
Copy link
Contributor Author

orivej commented Dec 4, 2017

Most hooks run once during the build, env hooks run once for each native build input (which includes buildInputs unless cross compiling) with the store path to the input as the first argument:

_addToNativeEnv() {
local pkg="$1"
if [[ -n "${crossConfig:-}" ]]; then
local -i depOffset=-1
else
local -i depOffset=0
fi
# Run the package-specific hooks set by the setup-hook scripts.
runHook envHook "$pkg"
}
# Old bash empty array hack
for i in ${nativePkgs+"${nativePkgs[@]}"}; do
_addToNativeEnv "$i"
done

Fixes NixOS#32296

(cherry picked from commit f727aeb4505a9646eb7f7d67ed0fd411900b570c)
@orivej orivej changed the title [wip] gettext: add setup hook populating GETTEXTDATADIRS gettext: add setup hook populating GETTEXTDATADIRS Dec 4, 2017
@orivej orivej merged commit b0311ab into NixOS:staging Dec 4, 2017
@orivej
Copy link
Contributor Author

orivej commented Dec 4, 2017

I have confirmed that this fixes #32296.

@orivej orivej deleted the gettext-datadirs branch December 4, 2017 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants