git.iko.soy/typeable/nixpkgs
on master help sign in
chromium/plugins: Use @var@ for passing variables

There is already a pull request from @colemickens, who has just reversed the variable references $flash and $flashVersion but the fix is kinda fragile as he points out himself in #12713. The reason the wrong substition was made is that both variables begin with the same name and we do a simple replace instead of a more complicated one using builtins.match. So staying simple but to still not raising issues with other variables that begin with the same name I'm now using @var@ instead, like we use in substituteAll and other substituters (like the ones in CMake or autotools) deal with it. Note that I'm not using $var$ here to make sure it doesn't get confused with real shell variables. So with this fix in place, the wrapper now has the following flags: --ppapi-flash-path=/nix/store/.../lib/libpepflashplayer.so --ppapi-flash-version=20.0.0.294 Previously we had (#12710): --ppapi-flash-path=/nix/store/.../lib/libpepflashplayer.so --ppapi-flash-version=/nix/store/...-binary-plugins-flashVersion Thanks to @colemickens for reporting and putting up a pull request. Signed-off-by: aszlig <aszlig@redmoonstudios.org> Fixes: #12710 Fixes: #12713

commit61042a5b6ac89166180b9257fa72c478439d3753 authoraszlig <aszlig@redmoonstudios.org> dateTue 2 Feb 2016, 05:19 (11 years ago) parentff90f52
1 file changed+4−4
pkgs/applications/networking/browsers/chromium/plugins.nix+4−4
pkgs/applications/networking/browsers/chromium/plugins.nix+4−4
@@ -16,7 +16,7 @@ let
1616 mkPluginInfo = { output ? "out", allowedVars ? [ output ]
1717 , flags ? [], envVars ? {}
1818 }: let
19− shSearch = ["'"] ++ map (var: "\$${var}") allowedVars;
19+ shSearch = ["'"] ++ map (var: "@${var}@") allowedVars;
2020 shReplace = ["'\\''"] ++ map (var: "'\"\${${var}}\"'") allowedVars;
2121 # We need to triple-escape "val":
2222 # * First because makeWrapper doesn't do any quoting of its arguments by
@@ -94,8 +94,8 @@ let
9494 output = "flash";
9595 allowedVars = [ "flash" "flashVersion" ];
9696 flags = [
97− "--ppapi-flash-path=$flash/lib/libpepflashplayer.so"
98− "--ppapi-flash-version=$flashVersion"
97+ "--ppapi-flash-path=@flash@/lib/libpepflashplayer.so"
98+ "--ppapi-flash-version=@flashVersion@"
9999 ];
100100 }}
101101
@@ -107,7 +107,7 @@ let
107107 ${mkPluginInfo {
108108 output = "widevine";
109109 flags = [ "--register-pepper-plugins=${wvModule}${wvInfo}" ];
110− envVars.NIX_CHROMIUM_PLUGIN_PATH_WIDEVINE = "$widevine/lib";
110+ envVars.NIX_CHROMIUM_PLUGIN_PATH_WIDEVINE = "@widevine@/lib";
111111 }}
112112 '';
113113