aboutsummarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorDonald Carr2016-06-07 17:30:01 -0700
committerDonald Carr2016-06-13 20:29:24 -0700
commit1d5efcdd82cca7ca65f178172021a24940a0b2b0 (patch)
tree5999ad1d68e1ecaf457b98900cef654388bbabb7
parent87d1c3ec903127d95bf34e0150d7fa5d94165831 (diff)
downloadaur-1d5efcdd82cca7ca65f178172021a24940a0b2b0.tar.gz
Simplify install script adjustment
Change-Id: I610607ff5e059dae953a22bb15e025a05ec6c32a
-rw-r--r--PKGBUILD14
-rw-r--r--_qpi.install118
-rw-r--r--qpi.install118
3 files changed, 127 insertions, 123 deletions
diff --git a/PKGBUILD b/PKGBUILD
index d2d7ed0a524e..d7b417fb88f2 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -74,7 +74,8 @@ sha256sums=("SKIP" "d258b7cc0db37f9b5c61467862d4f4a5171bce7b8bbb718be95e02b9b7cd
options=('!strip')
install=qpi.install
-_fully_qualified_install_script="${startdir}/${install}"
+rm $install
+touch $install
_device_configure_flags=""
#Sanity check
@@ -98,7 +99,8 @@ fi
finish() {
if [[ -n ${startdir} ]]; then
cd ${startdir}
- git checkout qpi.install
+ rm $install
+ touch $install
fi
}
trap finish EXIT
@@ -213,9 +215,11 @@ create_install_script()
{
local _install_script_location="${startdir}/${install}"
- sed -i "s/libspiver/${_piver}/" ${_install_script_location} || exit 1
- sed -i "s,libsqmakepath,${_installprefix}/bin/qmake," ${_install_script_location} || exit 1
- sed -i "s,libssysroot,${_sysroot}," ${_install_script_location} || exit 1
+ echo _piver="${_piver}" > ${_install_script_location}
+ echo _qmakepath="${_installprefix}/bin/qmake" >> ${_install_script_location}
+ echo _sysroot="${_sysroot}" >> ${_install_script_location}
+
+ cat "${startdir}/_${install}" >> "${startdir}/${install}"
}
package() {
diff --git a/_qpi.install b/_qpi.install
new file mode 100644
index 000000000000..cc174752cc28
--- /dev/null
+++ b/_qpi.install
@@ -0,0 +1,118 @@
+_piver="libspiver"
+_qmakepath="libsqmakepath"
+_sysroot="libssysroot"
+
+_sdktool="/usr/libexec/qtcreator/sdktool"
+_devicefamily="raspberrypi"
+_devicename="${_devicefamily}${_piver}"
+_familytext="Raspberry Pi"
+_devicetext="${_familytext} ${_piver}"
+
+setup_toolchain() {
+ echo "Registering toolchain with Qt Creator"
+${_sdktool} addTC \
+ --id "ProjectExplorer.ToolChain.Gcc:${_devicefamily}" \
+ --name "${_familytext} toolchain" \
+ --path /opt/arm-sirspuddarch-linux-gnueabihf/bin/arm-sirspuddarch-linux-gnueabihf-gcc \
+ --abi arm-linux-generic-elf-32bit \
+ --supportedAbis arm-linux-generic-elf-32bit
+
+ echo "Registering debugger with Qt Creator"
+${_sdktool} addDebugger \
+ --id "${_devicefamily}_gdb" \
+ --name "${_familytext} gdb" \
+ --binary /opt/arm-sirspuddarch-linux-gnueabihf/bin/arm-sirspuddarch-linux-gnueabihf-gdb \
+ --abis arm-linux-generic-elf-32bit \
+ --engine 1
+}
+
+remove_toolchain() {
+#TODO: Don't remove if the other pi package is present
+#Not used at present
+${_sdktool} rmTC \
+ --id "ProjectExplorer.ToolChain.Gcc:${_devicefamily}"
+
+${_sdktool} rmDebugger \
+ --id "${_devicefamily}_gdb"
+}
+
+remove_kit() {
+${_sdktool} rmQt \
+ --id "${_devicename}_qt"
+
+${_sdktool} rmKit \
+ --id "${_devicename}_kit"
+
+${_sdktool} rmDev \
+ --id "${_devicename}_device"
+}
+
+setup_kit() {
+ remove_kit
+ setup_toolchain
+
+ echo "Registering device with Qt Creator"
+${_sdktool} addDev \
+ --id "${_devicename}_device" \
+ --name "${_devicetext}" \
+ --host "qpi${_piver}.local" \
+ --uname "root" \
+ --password "root" \
+ --osType "GenericLinuxOsType" \
+ --type 0 \
+ --sshPort 22 \
+ --freePorts "10000-10100"
+
+ echo "Registering Qt install with Qt Creator"
+${_sdktool} addQt \
+ --id "${_devicename}_qt" \
+ --name "${_devicetext} Qt" \
+ --qmake ${_qmakepath} \
+ --type RemoteLinux.EmbeddedLinuxQt
+
+ echo "Creating Qt Creator Kit"
+${_sdktool} addKit \
+ --id "${_devicename}_kit" \
+ --name "${_devicetext} Kit" \
+ --debugger "${_devicefamily}_gdb" \
+ --devicetype GenericLinuxOsType \
+ --device "${_devicename}_device" \
+ --sysroot ${_sysroot} \
+ --toolchain "ProjectExplorer.ToolChain.Gcc:${_devicefamily}" \
+ --qt "${_devicename}_qt" \
+ --mkspec "devices/linux-rpi${_piver}-g++"
+}
+
+## arg 1: the new package version
+pre_install() {
+ echo ""
+}
+
+## arg 1: the new package version
+post_install() {
+ setup_kit
+}
+#post_install
+
+## arg 1: the new package version
+## arg 2: the old package version
+pre_upgrade() {
+ echo ""
+}
+
+## arg 1: the new package version
+## arg 2: the old package version
+post_upgrade() {
+ setup_kit
+}
+
+## arg 1: the old package version
+pre_remove() {
+ echo ""
+}
+#pre_remove
+
+## arg 1: the old package version
+post_remove() {
+ remove_kit
+}
diff --git a/qpi.install b/qpi.install
index cc174752cc28..e69de29bb2d1 100644
--- a/qpi.install
+++ b/qpi.install
@@ -1,118 +0,0 @@
-_piver="libspiver"
-_qmakepath="libsqmakepath"
-_sysroot="libssysroot"
-
-_sdktool="/usr/libexec/qtcreator/sdktool"
-_devicefamily="raspberrypi"
-_devicename="${_devicefamily}${_piver}"
-_familytext="Raspberry Pi"
-_devicetext="${_familytext} ${_piver}"
-
-setup_toolchain() {
- echo "Registering toolchain with Qt Creator"
-${_sdktool} addTC \
- --id "ProjectExplorer.ToolChain.Gcc:${_devicefamily}" \
- --name "${_familytext} toolchain" \
- --path /opt/arm-sirspuddarch-linux-gnueabihf/bin/arm-sirspuddarch-linux-gnueabihf-gcc \
- --abi arm-linux-generic-elf-32bit \
- --supportedAbis arm-linux-generic-elf-32bit
-
- echo "Registering debugger with Qt Creator"
-${_sdktool} addDebugger \
- --id "${_devicefamily}_gdb" \
- --name "${_familytext} gdb" \
- --binary /opt/arm-sirspuddarch-linux-gnueabihf/bin/arm-sirspuddarch-linux-gnueabihf-gdb \
- --abis arm-linux-generic-elf-32bit \
- --engine 1
-}
-
-remove_toolchain() {
-#TODO: Don't remove if the other pi package is present
-#Not used at present
-${_sdktool} rmTC \
- --id "ProjectExplorer.ToolChain.Gcc:${_devicefamily}"
-
-${_sdktool} rmDebugger \
- --id "${_devicefamily}_gdb"
-}
-
-remove_kit() {
-${_sdktool} rmQt \
- --id "${_devicename}_qt"
-
-${_sdktool} rmKit \
- --id "${_devicename}_kit"
-
-${_sdktool} rmDev \
- --id "${_devicename}_device"
-}
-
-setup_kit() {
- remove_kit
- setup_toolchain
-
- echo "Registering device with Qt Creator"
-${_sdktool} addDev \
- --id "${_devicename}_device" \
- --name "${_devicetext}" \
- --host "qpi${_piver}.local" \
- --uname "root" \
- --password "root" \
- --osType "GenericLinuxOsType" \
- --type 0 \
- --sshPort 22 \
- --freePorts "10000-10100"
-
- echo "Registering Qt install with Qt Creator"
-${_sdktool} addQt \
- --id "${_devicename}_qt" \
- --name "${_devicetext} Qt" \
- --qmake ${_qmakepath} \
- --type RemoteLinux.EmbeddedLinuxQt
-
- echo "Creating Qt Creator Kit"
-${_sdktool} addKit \
- --id "${_devicename}_kit" \
- --name "${_devicetext} Kit" \
- --debugger "${_devicefamily}_gdb" \
- --devicetype GenericLinuxOsType \
- --device "${_devicename}_device" \
- --sysroot ${_sysroot} \
- --toolchain "ProjectExplorer.ToolChain.Gcc:${_devicefamily}" \
- --qt "${_devicename}_qt" \
- --mkspec "devices/linux-rpi${_piver}-g++"
-}
-
-## arg 1: the new package version
-pre_install() {
- echo ""
-}
-
-## arg 1: the new package version
-post_install() {
- setup_kit
-}
-#post_install
-
-## arg 1: the new package version
-## arg 2: the old package version
-pre_upgrade() {
- echo ""
-}
-
-## arg 1: the new package version
-## arg 2: the old package version
-post_upgrade() {
- setup_kit
-}
-
-## arg 1: the old package version
-pre_remove() {
- echo ""
-}
-#pre_remove
-
-## arg 1: the old package version
-post_remove() {
- remove_kit
-}