Build wpilibc and wpilibj and include in image (#54)

This is mainly useful for Shuffleboard and SmartDashboard classes.
This commit is contained in:
Peter Johnson 2019-01-11 13:13:15 -08:00 committed by GitHub
parent f533ffcb59
commit 63120aee69
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 1 deletions

1
deps/03-build.sh vendored
View File

@ -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 \

3
deps/04-copy.sh vendored
View File

@ -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

View File

@ -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 $<

View File

@ -23,6 +23,8 @@ dependencies {
compile name: 'cscore'
compile name: 'cameraserver'
compile name: 'opencv-344'
compile name: 'wpilibj'
compile name: 'wpiHal'
}
wrapper {

View File

@ -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"