Browse Source

changes

master
Nareshkumar Rao 3 years ago
parent
commit
5d92f59106
  1. 3
      .gitignore
  2. 29
      build.sh

3
.gitignore

@ -3,5 +3,6 @@ tools/
librealsense/
sysroot-relativelinks.py
toolchain.cmake
output
pirealsense2_1.0-1/usr/
!pirealsense2_1.0-1/DEBIAN/*
librealsense2_pyrealsense2_aarch64.tar.gz

29
build.sh

@ -3,7 +3,8 @@ TOOLCHAIN_URL="https://developer.arm.com/-/media/Files/downloads/gnu-a/10.2-2020
LIBREALSENSE_GIT="https://github.com/IntelRealSense/librealsense.git"
SYSROOT_TOOL_URL="https://raw.githubusercontent.com/riscv/riscv-poky/master/scripts/sysroot-relativelinks.py"
CURDIR=$(pwd)
PI_USER_HOST="naresh@192.168.0.110"
PI_USER_HOST="root@192.168.0.106"
DPKG_NAME="pirealsense2_1.0-1"
# Download the toolchain
mkdir -p ./tools
@ -27,6 +28,11 @@ cd $CURDIR
rsync -avz --rsync-path="sudo rsync" $PI_USER_HOST:/lib sysroot/
rsync -avz --rsync-path="sudo rsync" $PI_USER_HOST:/usr/include sysroot/usr/
rsync -avz --rsync-path="sudo rsync" $PI_USER_HOST:/usr/lib sysroot/usr/
if [ $? == 1 ]
then
echo "Problem getting Raspberry Pi libraries. Please check connection configuration."
exit
fi
#rsync -avz --rsync-path="sudo rsync" $PI_USER_HOST:/opt/vc sysroot/opt/
@ -60,15 +66,22 @@ cmake ../ -DBUILD_EXAMPLES=false \
-DPython_INCLUDE_DIR="${SYSROOT}/usr/include/python3.8" \
-DPython_LIBRARY="${SYSROOT}/usr/lib/aarch64-linux-gnu/libpython3.8.so" \
-DLIBUSB_LIB="${SYSROOT}/usr/lib/aarch64-linux-gnu/libusb-1.0.so.0.2.0" \
-DFORCE_RSUSB_BACKEND=true \
-DCMAKE_TOOLCHAIN_FILE=${CURDIR}/toolchain.cmake
make -j14
make -j12
# Collect built binaries and tar up
mkdir -p $CURDIR/output
make DESTDIR=$CURDIR/output install
mkdir -p $CURDIR/$DPKG_NAME
make DESTDIR=$CURDIR/$DPKG_NAME install
cd $CURDIR/output
tar cvzf $CURDIR/librealsense2_pyrealsense2_aarch64.tar.gz ./*
exit;
cd $CURDIR
rm -rf ./sysroot ./tools ./librealsense ./output ./sysroot-relativelinks.py ./toolchain.cmake
shopt -s globstar
for i in $SYSROOT/**/*cpython*; do
NEW_FILENAME=$(echo "$i" | sed "s/x86_64/aarch64/g")
mv "$i" "$NEW_FILENAME"
done
dpkg-deb --build $DPKG_NAME
# rm -rf ./sysroot ./tools ./librealsense ./output ./sysroot-relativelinks.py ./toolchain.cmake

Loading…
Cancel
Save