Skip to content

Commit

Permalink
Merge pull request #1887 from petrockblog/master
Browse files Browse the repository at this point in the history
Support for Git repositories that use Submodules, drivers module for ControlBlock
  • Loading branch information
joolswills committed Feb 14, 2017
2 parents f5686d8 + 283babc commit baf9710
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scriptmodules/helpers.sh
Expand Up @@ -327,9 +327,10 @@ function gitPullOrClone() {
if [[ -d "$dir/.git" ]]; then
pushd "$dir" > /dev/null
git pull > /dev/null
git submodule update --init --recursive
popd > /dev/null
else
local git="git clone"
local git="git clone --recursive"
if [[ "$__persistent_repos" -ne 1 ]]; then
[[ "$repo" =~ github ]] && git+=" --depth 1"
fi
Expand Down
69 changes: 69 additions & 0 deletions scriptmodules/supplementary/controlblock.sh
@@ -0,0 +1,69 @@
#!/usr/bin/env bash

# This file is part of The RetroPie Project
#
# The RetroPie Project is the legal property of its developers, whose names are
# too numerous to list here. Please refer to the COPYRIGHT.md file distributed with this source.
#
# See the LICENSE.md file at the top-level directory of this distribution and
# at https://raw.githubusercontent.com/RetroPie/RetroPie-Setup/master/LICENSE.md
#

rp_module_id="controlblock"
rp_module_desc="ControlBlock Driver"
rp_module_section="driver"
rp_module_flags="noinstclean"

function depends_controlblock() {
local depends=(cmake doxygen)
isPlatform "rpi" && depends+=(libraspberrypi-dev)

getDepends "${depends[@]}"
}

function sources_controlblock() {
gitPullOrClone "$md_inst" https://github.com/petrockblog/ControlBlockService2.git
}

function build_controlblock() {
cd "$md_inst"
rm -rf "build"
mkdir build
cd build
cmake ..
make
md_ret_require="$md_inst/build/controlblock"
}

function install_controlblock() {
# install from there to system folders
cd "$md_inst/build"
make install
}

function gui_controlblock() {
cmd=(dialog --backtitle "$__backtitle" --menu "Choose an option." 22 86 16)
options=(
1 "Enable ControlBlock driver"
2 "Disable ControlBlock driver"

)
choices=$("${cmd[@]}" "${options[@]}" 2>&1 >/dev/tty)
if [[ -n "$choices" ]]; then
case $choices in
1)
make -C "$md_inst/build" installservice
printMsgs "dialog" "Enabled ControlBlock driver."
;;
2)
make -C "$md_inst/build" uninstallservice
printMsgs "dialog" "Disabled ControlBlock driver."
;;
esac
fi
}

function remove_controlblock() {
make -C "$md_inst/build" uninstallservice
make -C "$md_inst/build" uninstall
}

0 comments on commit baf9710

Please sign in to comment.