mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 15:03:28 +00:00
bsd: shellcheck setup hook
This commit is contained in:
parent
c0e250354a
commit
88a44bc843
@ -1,3 +1,5 @@
|
|||||||
|
# shellcheck shell=bash disable=SC2154,SC2164
|
||||||
|
|
||||||
# BSD makefiles should be able to detect this
|
# BSD makefiles should be able to detect this
|
||||||
# but without they end up using gcc on Darwin stdenv
|
# but without they end up using gcc on Darwin stdenv
|
||||||
addMakeFlags() {
|
addMakeFlags() {
|
||||||
@ -60,13 +62,13 @@ setBSDSourceDir() {
|
|||||||
sourceRoot=$PWD/$sourceRoot
|
sourceRoot=$PWD/$sourceRoot
|
||||||
export BSDSRCDIR=$sourceRoot
|
export BSDSRCDIR=$sourceRoot
|
||||||
export _SRC_TOP_=$BSDSRCDIR
|
export _SRC_TOP_=$BSDSRCDIR
|
||||||
cd $sourceRoot
|
cd "$sourceRoot"
|
||||||
}
|
}
|
||||||
|
|
||||||
cdBSDPath() {
|
cdBSDPath() {
|
||||||
if [ -d "$COMPONENT_PATH" ]
|
if [ -d "$COMPONENT_PATH" ]
|
||||||
then sourceRoot=$sourceRoot/$COMPONENT_PATH
|
then sourceRoot=$sourceRoot/$COMPONENT_PATH
|
||||||
cd $COMPONENT_PATH
|
cd "$COMPONENT_PATH"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -88,19 +90,19 @@ includesPhase() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
moveUsrDir() {
|
moveUsrDir() {
|
||||||
if [ -d $prefix ]; then
|
if [ -d "$prefix" ]; then
|
||||||
# Remove lingering /usr references
|
# Remove lingering /usr references
|
||||||
if [ -d $prefix/usr ]; then
|
if [ -d "$prefix/usr" ]; then
|
||||||
# Didn't try using rsync yet because per
|
# Didn't try using rsync yet because per
|
||||||
# https://unix.stackexchange.com/questions/127712/merging-folders-with-mv,
|
# https://unix.stackexchange.com/questions/127712/merging-folders-with-mv,
|
||||||
# it's not neessarily better.
|
# it's not neessarily better.
|
||||||
pushd $prefix/usr
|
pushd "$prefix/usr"
|
||||||
find . -type d -exec mkdir -p $out/\{} \;
|
find . -type d -exec mkdir -p "$out/{}" \;
|
||||||
find . \( -type f -o -type l \) -exec mv \{} $out/\{} \;
|
find . \( -type f -o -type l \) -exec mv "{}" "$out/{}" \;
|
||||||
popd
|
popd
|
||||||
fi
|
fi
|
||||||
|
|
||||||
find $prefix -type d -empty -delete
|
find "$prefix" -type d -empty -delete
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user