2018-04-27 10:53:45 +02:00
|
|
|
file_path_override() {
|
2018-05-06 00:21:09 +02:00
|
|
|
if [ -e "$SCRIPTDIR/product/$PRODUCT/$BOARD/$1" ]; then
|
|
|
|
echo "$SCRIPTDIR/product/$PRODUCT/$BOARD/$1"
|
2018-02-20 21:30:34 +01:00
|
|
|
return
|
|
|
|
fi
|
2018-05-06 00:21:09 +02:00
|
|
|
if [ -e "$SCRIPTDIR/product/$PRODUCT/$1" ]; then
|
|
|
|
echo "$SCRIPTDIR/product/$PRODUCT/$1"
|
2018-02-20 21:30:34 +01:00
|
|
|
return
|
|
|
|
fi
|
2018-05-06 00:21:09 +02:00
|
|
|
if [ -e "$SCRIPTDIR/board/$BOARD/$1" ]; then
|
|
|
|
echo "$SCRIPTDIR/board/$BOARD/$1"
|
2018-02-20 21:30:34 +01:00
|
|
|
return
|
|
|
|
fi
|
2018-05-06 00:21:09 +02:00
|
|
|
if [ -e "$SCRIPTDIR/product/common/$1" ]; then
|
|
|
|
echo "$SCRIPTDIR/product/common/$1"
|
2018-04-27 10:53:45 +02:00
|
|
|
return
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
cat_file_override() {
|
|
|
|
local path=$(file_path_override "$1")
|
|
|
|
|
|
|
|
if [ ! -z "$path" ]; then
|
|
|
|
cat "$path"
|
2018-02-20 21:30:34 +01:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
cat_file_merge() {
|
2018-05-06 00:21:09 +02:00
|
|
|
if [ -e "$SCRIPTDIR/product/$PRODUCT/$BOARD/$1" ]; then
|
|
|
|
cat "$SCRIPTDIR/product/$PRODUCT/$BOARD/$1"
|
2018-02-20 21:30:34 +01:00
|
|
|
fi
|
2018-05-06 00:21:09 +02:00
|
|
|
if [ -e "$SCRIPTDIR/product/$PRODUCT/$1" ]; then
|
|
|
|
cat "$SCRIPTDIR/product/$PRODUCT/$1"
|
2018-02-20 21:30:34 +01:00
|
|
|
fi
|
2018-05-06 00:21:09 +02:00
|
|
|
if [ -e "$SCRIPTDIR/board/$BOARD/$1" ]; then
|
|
|
|
cat "$SCRIPTDIR/board/$BOARD/$1"
|
2018-02-20 21:30:34 +01:00
|
|
|
fi
|
2018-05-06 00:21:09 +02:00
|
|
|
if [ -e "$SCRIPTDIR/product/common/$1" ]; then
|
|
|
|
cat "$SCRIPTDIR/product/common/$1"
|
2018-02-20 21:30:34 +01:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2018-02-09 18:49:17 +01:00
|
|
|
apply_patches() {
|
|
|
|
local PATCH
|
|
|
|
|
2018-02-15 23:47:54 +01:00
|
|
|
for PATCH in $SCRIPTDIR/pkg/$PKGNAME/*.patch; do
|
|
|
|
if [ -f $PATCH ]; then
|
|
|
|
patch -p1 < $PATCH
|
|
|
|
fi
|
2018-02-09 18:49:17 +01:00
|
|
|
done
|
|
|
|
}
|
2018-02-10 01:57:53 +01:00
|
|
|
|
2018-02-15 14:24:53 +01:00
|
|
|
strip_files() {
|
|
|
|
local f
|
|
|
|
|
|
|
|
for f in $@; do
|
|
|
|
if [ ! -f "$f" ]; then
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
|
|
|
|
if file $f | grep -q -i elf; then
|
|
|
|
${TARGET}-strip --discard-all "$f"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2018-02-10 01:57:53 +01:00
|
|
|
split_dev_deploy() {
|
|
|
|
local lib f
|
|
|
|
|
|
|
|
if [ -d "$1/include" ]; then
|
|
|
|
mv "$1/include" "$2"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -d "$1/lib/pkgconfig" ]; then
|
2018-03-07 16:50:50 +01:00
|
|
|
mkdir -p "$2/lib/pkgconfig"
|
|
|
|
mv $1/lib/pkgconfig/* "$2/lib/pkgconfig"
|
|
|
|
rmdir "$1/lib/pkgconfig"
|
2018-02-10 01:57:53 +01:00
|
|
|
fi
|
|
|
|
|
2018-02-19 12:43:22 +01:00
|
|
|
if [ -d "$1/share/pkgconfig" ]; then
|
2018-03-07 16:50:50 +01:00
|
|
|
mkdir -p "$2/lib/pkgconfig"
|
|
|
|
mv $1/share/pkgconfig/* "$2/lib/pkgconfig"
|
|
|
|
rmdir "$1/share/pkgconfig"
|
2018-02-19 12:43:22 +01:00
|
|
|
fi
|
|
|
|
|
2018-02-15 14:33:55 +01:00
|
|
|
for f in ${1}/lib/*.la; do
|
|
|
|
if [ -e "$f" ]; then
|
|
|
|
rm "$f"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2018-02-10 01:57:53 +01:00
|
|
|
for f in ${1}/lib/*.a; do
|
|
|
|
if [ -f "$f" ]; then
|
|
|
|
mkdir -p "$2/lib"
|
|
|
|
mv ${1}/lib/*.a "$2/lib"
|
|
|
|
fi
|
|
|
|
|
|
|
|
break
|
|
|
|
done
|
|
|
|
}
|