-
Notifications
You must be signed in to change notification settings - Fork 129
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
Allow optional installation of rust-docs component #253
Closed
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -131,10 +131,10 @@ let | |
in | ||
map (tuple: { name = tuple.name; src = (getFetchUrl pkgs tuple.name tuple.target stdenv fetchurl); }) pkgsTuplesToInstall; | ||
|
||
installComponents = stdenv: namesAndSrcs: | ||
installComponents = { stdenv, namesAndSrcs, installDoc }: | ||
let | ||
inherit (builtins) map; | ||
installComponent = name: src: | ||
installComponent = installDoc: { name, src }: | ||
stdenv.mkDerivation { | ||
inherit name; | ||
inherit src; | ||
|
@@ -147,7 +147,7 @@ let | |
# This code is inspired by patchelf/setup-hook.sh to iterate over all binaries. | ||
installPhase = '' | ||
patchShebangs install.sh | ||
CFG_DISABLE_LDCONFIG=1 ./install.sh --prefix=$out --verbose | ||
CFG_DISABLE_LDCONFIG=1 ./install.sh --prefix=$out --verbose ${self.lib.optionalString (!installDoc) "--without=rust-docs"} | ||
|
||
setInterpreter() { | ||
local dir="$1" | ||
|
@@ -159,7 +159,7 @@ let | |
if [[ "$i" =~ .build-id ]]; then continue; fi | ||
if ! isELF "$i"; then continue; fi | ||
echo "setting interpreter of $i" | ||
|
||
if [[ -x "$i" ]]; then | ||
# Handle executables | ||
patchelf \ | ||
|
@@ -223,7 +223,7 @@ let | |
dontStrip = true; | ||
}; | ||
in | ||
map (nameAndSrc: (installComponent nameAndSrc.name nameAndSrc.src)) namesAndSrcs; | ||
map (installComponent installDoc) namesAndSrcs; | ||
|
||
# Manifest files are organized as follow: | ||
# { date = "2017-03-03"; | ||
|
@@ -261,12 +261,12 @@ let | |
pkgs = fromTOML (builtins.readFile manifest); | ||
in | ||
flip mapAttrs pkgs.pkg (name: pkg: | ||
makeOverridable ({extensions, targets, targetExtensions}: | ||
makeOverridable ({extensions, targets, targetExtensions, installDoc ? false}: | ||
let | ||
version' = builtins.match "([^ ]*) [(]([^ ]*) ([^ ]*)[)]" pkg.version; | ||
version = "${elemAt version' 0}-${elemAt version' 2}-${elemAt version' 1}"; | ||
namesAndSrcs = getComponents pkgs.pkg name targets extensions targetExtensions stdenv fetchurl; | ||
components = installComponents stdenv namesAndSrcs; | ||
components = installComponents { inherit stdenv namesAndSrcs installDoc; }; | ||
componentsOuts = builtins.map (comp: (super.lib.strings.escapeNixString (super.lib.getOutput "out" comp))) components; | ||
in | ||
super.pkgs.symlinkJoin { | ||
|
@@ -314,8 +314,9 @@ rec { | |
|
||
rustChannelOf = { sha256 ? null, ... } @ manifest_args: fromManifest | ||
sha256 (manifest_v2_url manifest_args) | ||
{ inherit (self) stdenv lib fetchurl patchelf; } | ||
; | ||
{ | ||
inherit (self) stdenv fetchurl patchelf; | ||
}; | ||
Comment on lines
-317
to
+319
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This revert a change from a previous patch which should cause this patch to not work as expected. |
||
|
||
# Set of packages which are automagically updated. Do not rely on these for | ||
# reproducible builds. | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
nit: There is no need to add
installDoc
as argument ofinstallComponent
(nos
), as it would be captured likestdenv
is.