Skip to content

gettext: add setup hook populating GETTEXTDATADIRS - #32299

Merged
orivej merged 1 commit into
NixOS:stagingfrom
orivej:gettext-datadirs
Dec 4, 2017
Merged

orivej merged 1 commit into
NixOS:stagingfrom
orivej:gettext-datadirs

Conversation

@orivej

@orivej orivej commented Dec 4, 2017 •

Copy link
Copy Markdown
Contributor
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

@jtojnar jtojnar left a comment

Copy link
Copy Markdown
Member

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.

@GrahamcOfBorg GrahamcOfBorg added 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild on Darwin and must target a staging branch. 10.rebuild-linux-stdenv This PR causes stdenv to rebuild on Linux and must target a staging branch. 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. labels Dec 4, 2017
@orivej

orivej commented Dec 4, 2017 •

Copy link
Copy Markdown
Contributor Author

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

orivej commented Dec 4, 2017

Copy link
Copy Markdown
Contributor Author

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

Labels

10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild on Darwin and must target a staging branch. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux-stdenv This PR causes stdenv to rebuild on Linux and must target a staging branch.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants