From 78f99637b9182e609780c84cc954c5e9eb19e0cd Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 30 Nov 2018 21:05:14 -0800 Subject: [PATCH] Add pynetworktables and robotpy-cscore --- copyextfiles.sh | 11 +++++++++++ stage2/01-sys-tweaks/01-run.sh | 4 ++++ tools/Makefile | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 49 insertions(+) diff --git a/copyextfiles.sh b/copyextfiles.sh index 9de32ef..e8ac933 100755 --- a/copyextfiles.sh +++ b/copyextfiles.sh @@ -6,6 +6,7 @@ mkdir -p stage2/01-sys-tweaks/extfiles # tools # cp tools/setuidgids stage2/01-sys-tweaks/extfiles/ +cp tools/_cscore.so stage2/01-sys-tweaks/extfiles/_cscore.cpython-35m-arm-linux-gnueabihf.so # # openjdk @@ -24,6 +25,16 @@ cp ../thirdparty-opencv/buildShared/linux-raspbian/bin/opencv-*.jar stage2/01-sy # of the target platform, so rename it cp ../thirdparty-opencv/buildShared/linux-raspbian/lib/python3/cv2.*.so stage2/01-sys-tweaks/extfiles/cv2.cpython-35m-arm-linux-gnueabihf.so +# +# robotpy-cscore +# +sh -c 'cd ../robotpy-cscore/ && tar czf - cscore' > stage2/01-sys-tweaks/extfiles/robotpy-cscore.tar.gz + +# +# pynetworktables +# +sh -c 'cd ../pynetworktables/ && tar czf - networktables ntcore' > stage2/01-sys-tweaks/extfiles/pynetworktables.tar.gz + # # allwpilib # diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index 7e7ba10..64dcab8 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -86,6 +86,10 @@ cat extfiles/libopencv.tar.gz | sh -c "cd ${ROOTFS_DIR}/usr/local/frc/lib/ && ta install -m 755 extfiles/cv2.*.so "${ROOTFS_DIR}/usr/local/lib/python3.5/dist-packages/" +cat extfiles/pynetworktables.tar.gz | sh -c "cd ${ROOTFS_DIR}/usr/local/lib/python3.5/dist-packages/ && tar xzf -" +cat extfiles/robotpy-cscore.tar.gz | sh -c "cd ${ROOTFS_DIR}/usr/local/lib/python3.5/dist-packages/ && tar xzf -" +install -m 755 extfiles/_cscore.*.so "${ROOTFS_DIR}/usr/local/lib/python3.5/dist-packages/cscore/" + install -m 755 extfiles/libwpiutil*.so* "${ROOTFS_DIR}/usr/local/frc/lib/" install -m 755 extfiles/libcscore*.so* "${ROOTFS_DIR}/usr/local/frc/lib/" install -m 755 extfiles/libntcore*.so* "${ROOTFS_DIR}/usr/local/frc/lib/" diff --git a/tools/Makefile b/tools/Makefile index 87882c9..86ded4e 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -1,2 +1,36 @@ +ALL: setuidgids _cscore.so + setuidgids: setuidgids.c arm-raspbian9-linux-gnueabihf-gcc -O -Wall -D_GNU_SOURCE -o $@ $< + +_cscore.so: ../../robotpy-cscore/src/_cscore.cpp ../../robotpy-cscore/src/ndarray_converter.cpp + arm-raspbian9-linux-gnueabihf-g++ -O -Wall -shared -fPIC -o $@ \ + -I../../thirdparty-opencv/opencv/include \ + -I../../thirdparty-opencv/opencv/modules/core/include \ + -I../../thirdparty-opencv/opencv/modules/calib3d/include \ + -I../../thirdparty-opencv/opencv/modules/features2d/include \ + -I../../thirdparty-opencv/opencv/modules/flann/include \ + -I../../thirdparty-opencv/opencv/modules/highgui/include \ + -I../../thirdparty-opencv/opencv/modules/imgcodecs/include \ + -I../../thirdparty-opencv/opencv/modules/imgproc/include \ + -I../../thirdparty-opencv/opencv/modules/ml/include \ + -I../../thirdparty-opencv/opencv/modules/objdetect/include \ + -I../../thirdparty-opencv/opencv/modules/photo/include \ + -I../../thirdparty-opencv/opencv/modules/shape/include \ + -I../../thirdparty-opencv/opencv/modules/stitching/include \ + -I../../thirdparty-opencv/opencv/modules/superres/include \ + -I../../thirdparty-opencv/opencv/modules/video/include \ + -I../../thirdparty-opencv/opencv/modules/videoio/include \ + -I../../thirdparty-opencv/opencv/modules/videostab/include \ + -I../../thirdparty-opencv/buildShared/linux-raspbian \ + -I../../allwpilib/wpiutil/src/main/native/include \ + -I../../allwpilib/cscore/src/main/native/include \ + -I/usr/local/arm-raspbian9-linux-gnueabihf/usr/include/python3.5 \ + -L../../allwpilib/cscore/build/libs/cscore/shared/raspbian/release \ + -L../../allwpilib/wpiutil/build/libs/wpiutil/shared/raspbian/release \ + -L../../thirdparty-opencv/buildShared/linux-raspbian/lib \ + ../../robotpy-cscore/src/_cscore.cpp \ + ../../robotpy-cscore/src/ndarray_converter.cpp \ + -lcscore \ + -lwpiutil \ + -lopencv_calib3d -lopencv_features2d -lopencv_flann -lopencv_highgui -lopencv_imgcodecs -lopencv_imgproc -lopencv_ml -lopencv_objdetect -lopencv_photo -lopencv_shape -lopencv_stitching -lopencv_superres -lopencv_video -lopencv_videoio -lopencv_videostab -lopencv_core