From ec5ca77a32b1cf989efbce7c00acf2b896777571 Mon Sep 17 00:00:00 2001 From: Luigi Cruz Date: Thu, 13 Aug 2020 13:51:53 -0300 Subject: [PATCH] Fix PYTHONPATH and install cmake via PIP. --- builder/stage4/04-pisdr-system/03-run.sh | 15 +-------------- builder/stage4/04-pisdr-system/04-run.sh | 8 ++++++++ builder/stage4/04-pisdr-system/patch/export.txt | 4 ++++ builder/stage4/04-pisdr-system/patch/ninja.patch | 6 ------ builder/stage4/05-pisdr-uhd/00-run.sh | 2 +- builder/stage4/06-pisdr-gnuradio/00-run.sh | 2 +- 6 files changed, 15 insertions(+), 22 deletions(-) create mode 100755 builder/stage4/04-pisdr-system/04-run.sh create mode 100644 builder/stage4/04-pisdr-system/patch/export.txt delete mode 100644 builder/stage4/04-pisdr-system/patch/ninja.patch diff --git a/builder/stage4/04-pisdr-system/03-run.sh b/builder/stage4/04-pisdr-system/03-run.sh index 406fc8f..b25e8c8 100755 --- a/builder/stage4/04-pisdr-system/03-run.sh +++ b/builder/stage4/04-pisdr-system/03-run.sh @@ -1,18 +1,5 @@ #!/bin/bash -e -install -m 755 patch/ninja.patch "${ROOTFS_DIR}/etc/" - on_chroot << EOF -cd "/tmp" - -if [ ! -d "ninja" ]; then - git clone https://github.com/ninja-build/ninja.git - cd ninja - patch -u CMakeLists.txt -i /etc/ninja.patch - mkdir -p build - cd build - cmake -DCMAKE_BUILD_TYPE=Release .. - make -j$(nproc) install - ldconfig -fi +pip3 install cmake ninja EOF diff --git a/builder/stage4/04-pisdr-system/04-run.sh b/builder/stage4/04-pisdr-system/04-run.sh new file mode 100755 index 0000000..f2d479c --- /dev/null +++ b/builder/stage4/04-pisdr-system/04-run.sh @@ -0,0 +1,8 @@ +#!/bin/bash -e + +install -m 755 patch/export.txt "${ROOTFS_DIR}/etc/" + +on_chroot << EOF +cat /etc/export.txt >> /home/${FIRST_USER_NAME}/.bashrc +source /home/${FIRST_USER_NAME}/.bashrc +EOF diff --git a/builder/stage4/04-pisdr-system/patch/export.txt b/builder/stage4/04-pisdr-system/patch/export.txt new file mode 100644 index 0000000..1f85f50 --- /dev/null +++ b/builder/stage4/04-pisdr-system/patch/export.txt @@ -0,0 +1,4 @@ + +## PiSDR Variables +export PYTHONPATH="/usr/local/lib/python3/dist-packages:$PYTHONPATH" +export PATH="$HOME/.local/bin:$PATH" \ No newline at end of file diff --git a/builder/stage4/04-pisdr-system/patch/ninja.patch b/builder/stage4/04-pisdr-system/patch/ninja.patch deleted file mode 100644 index 3bf0c96..0000000 --- a/builder/stage4/04-pisdr-system/patch/ninja.patch +++ /dev/null @@ -1,6 +0,0 @@ -@@ -1,4 +1,4 @@ --cmake_minimum_required(VERSION 3.15) -+cmake_minimum_required(VERSION 3.13) - project(ninja) - - # --- optional link-time optimization diff --git a/builder/stage4/05-pisdr-uhd/00-run.sh b/builder/stage4/05-pisdr-uhd/00-run.sh index afe1575..583af63 100755 --- a/builder/stage4/05-pisdr-uhd/00-run.sh +++ b/builder/stage4/05-pisdr-uhd/00-run.sh @@ -15,7 +15,7 @@ cd build cmake -DCMAKE_CXX_FLAGS:STRING="-march=armv7-a -mfloat-abi=hard -mfpu=neon -mtune=cortex-a15 -Wno-psabi" \ -DCMAKE_C_FLAGS:STRING="-march=armv7-a -mfloat-abi=hard -mfpu=neon -mtune=cortex-a15 -Wno-psabi" \ -DCMAKE_ASM_FLAGS:STRING="-march=armv7-a -mfloat-abi=hard -mfpu=neon -mtune=cortex-a15" \ - -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr ../ + -GNinja -DCMAKE_BUILD_TYPE=Release ../ ninja install cp /usr/lib/uhd/utils/uhd-usrp.rules /etc/udev/rules.d/ udevadm control --reload-rules diff --git a/builder/stage4/06-pisdr-gnuradio/00-run.sh b/builder/stage4/06-pisdr-gnuradio/00-run.sh index c164fa9..e53db93 100755 --- a/builder/stage4/06-pisdr-gnuradio/00-run.sh +++ b/builder/stage4/06-pisdr-gnuradio/00-run.sh @@ -13,7 +13,7 @@ git checkout maint-3.8 git submodule update --init --recursive mkdir -p build cd build -cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr .. +cmake -GNinja -DCMAKE_BUILD_TYPE=Release .. ninja install ldconfig EOF \ No newline at end of file