From 63120aee6915749b1f3417d7a7575d775ddf1607 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 11 Jan 2019 13:13:15 -0800 Subject: [PATCH] Build wpilibc and wpilibj and include in image (#54) This is mainly useful for Shuffleboard and SmartDashboard classes. --- deps/03-build.sh | 1 + deps/04-copy.sh | 3 +++ deps/examples/cpp-multiCameraServer/Makefile | 2 +- deps/examples/java-multiCameraServer/build.gradle | 2 ++ stage2/01-sys-tweaks/01-run.sh | 3 +++ 5 files changed, 10 insertions(+), 1 deletion(-) diff --git a/deps/03-build.sh b/deps/03-build.sh index 0b42cd6..80a4482 100755 --- a/deps/03-build.sh +++ b/deps/03-build.sh @@ -93,6 +93,7 @@ popd # always use the release version of opencv jar/jni build_wpilib () { cmake ../../allwpilib \ + -DWITHOUT_ALLWPILIB=OFF \ -DCMAKE_BUILD_TYPE=$1 \ -DCMAKE_TOOLCHAIN_FILE=${PWD}/../../02-extract/arm-pi-gnueabihf.toolchain.cmake \ -DCMAKE_MODULE_PATH=${PWD}/../../02-extract/cmake-modules \ diff --git a/deps/04-copy.sh b/deps/04-copy.sh index 2b73bc1..f86cce7 100755 --- a/deps/04-copy.sh +++ b/deps/04-copy.sh @@ -66,6 +66,7 @@ sh -c 'cd pynetworktables && tar czf - networktables ntcore' > ${DEST}/pynetwork sh -c 'cd 03-build/allwpilib-build/lib && tar czf - lib*' > ${DEST}/wpilib.tar.gz sh -c 'cd 03-build/allwpilib-build-debug/lib && tar czf - lib*' > ${DEST}/wpilib-debug.tar.gz +sh -c 'cd 03-build/allwpilib-build/hal/gen && tar czf - .' > ${DEST}/hal-gen-include.tar.gz cp 03-build/allwpilib-build/jar/*.jar ${DEST}/ @@ -73,5 +74,7 @@ sh -c 'cd allwpilib/wpiutil/src/main/native/include && tar czf - uv.h uv wpi' > sh -c 'cd allwpilib/cscore/src/main/native/include && tar czf - .' > ${DEST}/cscore-include.tar.gz sh -c 'cd allwpilib/ntcore/src/main/native/include && tar czf - .' > ${DEST}/ntcore-include.tar.gz sh -c 'cd allwpilib/cameraserver/src/main/native/include && tar czf - cameraserver vision' > ${DEST}/cameraserver-include.tar.gz +sh -c 'cd allwpilib/hal/src/main/native/include && tar czf - .' > ${DEST}/hal-include.tar.gz +sh -c 'cd allwpilib/wpilibc/src/main/native/include && tar czf - frc' > ${DEST}/wpilibc-include.tar.gz sh -c 'cd 03-build/allwpilib-static/bin && tar czf - cscore_* netconsoleTee*' > ${DEST}/wpilib-bin.tar.gz diff --git a/deps/examples/cpp-multiCameraServer/Makefile b/deps/examples/cpp-multiCameraServer/Makefile index 2e6efbf..bf3af67 100644 --- a/deps/examples/cpp-multiCameraServer/Makefile +++ b/deps/examples/cpp-multiCameraServer/Makefile @@ -12,7 +12,7 @@ clean: rm ${EXE} *.o ${EXE}: main.o - ${CXX} -pthread -o $@ $< -L/usr/local/frc/lib -lcameraserver -lcscore -lntcore -lwpiutil + ${CXX} -pthread -o $@ $< -L/usr/local/frc/lib -lwpilibc -lwpiHal -lcameraserver -lcscore -lntcore -lwpiutil .cpp.o: ${CXX} -pthread -O -c -o $@ -I/usr/local/frc/include $< diff --git a/deps/examples/java-multiCameraServer/build.gradle b/deps/examples/java-multiCameraServer/build.gradle index 811e32e..609e874 100644 --- a/deps/examples/java-multiCameraServer/build.gradle +++ b/deps/examples/java-multiCameraServer/build.gradle @@ -23,6 +23,8 @@ dependencies { compile name: 'cscore' compile name: 'cameraserver' compile name: 'opencv-344' + compile name: 'wpilibj' + compile name: 'wpiHal' } wrapper { diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index 0a80570..ec043bb 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -112,6 +112,9 @@ cat extfiles/wpiutil-include.tar.gz | sh -c "cd ${ROOTFS_DIR}/usr/local/frc/incl cat extfiles/cscore-include.tar.gz | sh -c "cd ${ROOTFS_DIR}/usr/local/frc/include/ && tar xzf -" cat extfiles/ntcore-include.tar.gz | sh -c "cd ${ROOTFS_DIR}/usr/local/frc/include/ && tar xzf -" cat extfiles/cameraserver-include.tar.gz | sh -c "cd ${ROOTFS_DIR}/usr/local/frc/include/ && tar xzf -" +cat extfiles/hal-include.tar.gz | sh -c "cd ${ROOTFS_DIR}/usr/local/frc/include/ && tar xzf -" +cat extfiles/hal-gen-include.tar.gz | sh -c "cd ${ROOTFS_DIR}/usr/local/frc/include/ && tar xzf -" +cat extfiles/wpilibc-include.tar.gz | sh -c "cd ${ROOTFS_DIR}/usr/local/frc/include/ && tar xzf -" cat extfiles/opencv-include.tar.gz | sh -c "cd ${ROOTFS_DIR}/usr/local/frc/include/ && tar xzf -" install -v -d "${ROOTFS_DIR}/usr/local/frc/share/OpenCV"