Skip to content

Commit

Permalink
Build wpilibc and wpilibj and include in image
Browse files Browse the repository at this point in the history
This is mainly useful for Shuffleboard and SmartDashboard classes.
  • Loading branch information
PeterJohnson committed Jan 11, 2019
1 parent f533ffc commit 6321d90
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions deps/03-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
3 changes: 3 additions & 0 deletions deps/04-copy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,15 @@ 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}/

sh -c 'cd allwpilib/wpiutil/src/main/native/include && tar czf - uv.h uv wpi' > ${DEST}/wpiutil-include.tar.gz
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
2 changes: 1 addition & 1 deletion deps/examples/cpp-multiCameraServer/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 $<
2 changes: 2 additions & 0 deletions deps/examples/java-multiCameraServer/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ dependencies {
compile name: 'cscore'
compile name: 'cameraserver'
compile name: 'opencv-344'
compile name: 'wpilibj'
compile name: 'wpiHal'
}

wrapper {
Expand Down
3 changes: 3 additions & 0 deletions stage2/01-sys-tweaks/01-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 6321d90

Please sign in to comment.