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

buildEnv: improvements #10308

Closed
wants to merge 1 commit into from

Conversation

jraygauthier
Copy link
Member

Add the possibility to specify arbitrary arguments
(same as with other derivation helpers).

This allows one to use a buildEnv helper to define a
package.

Tests:

  • Using fixed attribute throws an error.
  • Using an arbitrary attribute such as nativeBuildInputs,
    meta, dontPatchELF or dontStrip work fine.

Add the possibility to specify arbitrary arguments
(same as with other derivation helpers).

This allows one to use a buildEnv helper to define a
package.

Tests:

 -  Using fixed attribute throws an error.
 -  Using an arbitrary attribute such as `nativeBuildInputs`,
    `meta`, `dontPatchELF` or `dontStrip` work fine.
@jraygauthier
Copy link
Member Author

An example of improvement it could bring:

was:

runCommand name {
  inherit build;
  inherit meta;

  nativeBuildInputs = [ makeWrapper lndir ];

  dontPatchELF = true;
  dontStrip = true;

} 
(let
  buildWithPlugins = buildEnv {
    name = "thunar-build-with-plugins";
    paths = [ build ] ++ thunarPlugins;
  };

in ''
  mkdir -p $out
  pushd ${buildWithPlugins} > /dev/null
  for d in `find . -maxdepth 1 -name "*" -printf "%f\n" | tail -n+2`; do
    ln -s "${buildWithPlugins}/$d" "$out/$d"
  done
  popd > /dev/null

  ${replaceLnExeListWithWrapped "$out/bin" [ "thunar" "thunar-settings" ] [
    "--set THUNARX_MODULE_DIR \"${buildWithPlugins}/lib/thunarx-2\""
  ]}
'')

now could be:

buildEnv {
  inherit name;
  inherit build;
  inherit meta;

  paths = [ build ] ++ thunarPlugins;

  nativeBuildInputs = [ makeWrapper lndir ];

  dontPatchELF = true;
  dontStrip = true;

  postBuild = ''
    ${replaceLnExeListWithWrapped "$out/bin" [ "thunar" "thunar-settings" ] [
      "--set THUNARX_MODULE_DIR \"$out/lib/thunarx-2\""
    ]}
  '';
}

This was referenced Oct 10, 2015
@jagajaga
Copy link
Member

cc @edolstra @vcunat

@zimbatm
Copy link
Member

zimbatm commented Feb 22, 2016

ping

@jraygauthier jraygauthier deleted the jrg/improve_buildenv branch March 12, 2017 15:25
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

4 participants