Skip to content

Commit

Permalink
build cleanups and bugfixes
Browse files Browse the repository at this point in the history
- introduce a build-time test for flite support to determine if a
  compatible version of flite is installed
- remove duplicate code from apm_planner.pro
- correct spelling of redhat-release in apm_planner.pro
- make installation of debian menu files only happen on debian/ubuntu
  environments
- move sik firmware into /usr/share
  • Loading branch information
larsks authored and billbonney committed Sep 7, 2017
1 parent 7770d4a commit 89a626a
Show file tree
Hide file tree
Showing 10 changed files with 74 additions and 7,198 deletions.
29 changes: 15 additions & 14 deletions QGCSetup.pri
Original file line number Diff line number Diff line change
Expand Up @@ -67,29 +67,30 @@ LinuxBuild {
DEFINES += DATADIR=\\\"$$DATADIR\\\" PKGDATADIR=\\\"$$PKGDATADIR\\\"

#MAKE INSTALL - copy files
INSTALLS += target radioup datafiles desktopLink menuLink
INSTALLS += target radioup_bin radioup_firmware datafiles desktopLink

target.path =$$BINDIR

radioup.path = $$BINDIR
radioup.files += $$BASEDIR/sik_uploader
radioup_bin.path = $$BINDIR
radioup_bin.files += $$BASEDIR/sik_uploader/sik_uploader.py

radioup_firmware.path = $$DATADIR/sik_uploader
radioup_firmware.files += $$BASEDIR/sik_uploader/firmware

datafiles.path = $$DATADIR/APMPlanner2
datafiles.files += $$BASEDIR/files
datafiles.files += $$BASEDIR/data
datafiles.files += $$BASEDIR/qml

#fix up file permissions. Bit of a hack job
#permFolders.path = $$DATADIR/APMPlanner2
#permFolders.commands += find $$DATADIR -type d -exec chmod 755 {} \\;
#permFiles.path = $$DATADIR/APMPlanner2
#permFiles.commands += find $$DATADIR -type f -exec chmod 644 {} \\;

#create menu links
desktopLink.path = $$DATADIR/menu
desktopLink.files += $$BASEDIR/debian/apmplanner2
menuLink.path = $$DATADIR/applications
menuLink.files += $$BASEDIR/debian/apmplanner2.desktop
desktopLink.path = $$DATADIR/applications
desktopLink.files += $$BASEDIR/common/apmplanner2.desktop
}

DebianIntegration {
INSTALLS += menuLink

menuLink.path = $$DATADIR/menu
menuLink.files += $$BASEDIR/debian/apmplanner2.menu
}

MacBuild {
Expand Down
52 changes: 30 additions & 22 deletions apm_planner.pro
Original file line number Diff line number Diff line change
Expand Up @@ -25,44 +25,48 @@

message(Qt version $$[QT_VERSION])

# Setup our supported build types. We do this once here and then use the defined config scopes
# to allow us to easily modify suported build types in one place instead of duplicated throughout
# the project file.
# Setup our supported build types. We do this once here and then use the
# defined config scopes to allow us to easily modify suported build types in
# one place instead of duplicated throughout the project file.

DEFINES+=DISABLE_3DMOUSE # Disable 3D mice support for now
#DEFINES+=ENABLE_CAMRAVIEW # Example to include camraview

linux-g++-64 {
message(Linux build x64_86)
load(configure)

linux-g++-64 | linux-g++ {
CONFIG += LinuxBuild
DEFINES += Q_LINUX_64
DEFINES += FLITE_AUDIO_ENABLED

DISTRO = $$system(lsb_release -i)
REDHAT_RELEASE = $$system(cat /etc/redhat-release)

contains( DISTRO, "Ubuntu" ) {
message(Ubuntu Build)
DEFINES += Q_UBUNTU
}
qtCompileTest(has_flite)

contains( DISTRO, "Arch" ) {
message(ArchLinux Build)
DEFINES += Q_ARCHLINUX
INCLUDEPATH += /usr/include/openssl-1.0
LIBRARYPATH += /usr/lib/openssl-1.0
linux-g++-64 {
message(Linux build x86_64)
DEFINES += Q_LINUX_64
}

} else: linux-g++ {
message(Linux build x86)
CONFIG += LinuxBuild
DEFINES += Q_LINUX_32
DEFINES += FLITE_AUDIO_ENABLED
linux-g++ {
message(Linux build x86)
DEFINES += Q_LINUX_32
}

DISTRO = $$system(lsb_release -i)
CONFIG(config_has_flite) {
message(Enabling flite audio support)
DEFINES += FLITE_AUDIO_ENABLED
}

contains( DISTRO, "Ubuntu" ) {
message(Ubuntu Build)
DEFINES += Q_UBUNTU
CONFIG += DebianIntegration
}

contains ( Distro, "Debian" ) {
message(Debian Build)
DEFINES += Q_DEBIAN
CONFIG += DebianIntegration
}

contains( DISTRO, "Arch" ) {
Expand All @@ -72,6 +76,10 @@ linux-g++-64 {
LIBRARYPATH += /usr/lib/openssl-1.0
}

contains( REDHAT_RELEASE, "Fedora" ) {
message(Fedora Build)
DEFINES += Q_FEDORA
}
} else : win32-msvc2012 | win32-msvc2013 {
message(Windows build)
CONFIG += WindowsBuild
Expand Down
4 changes: 2 additions & 2 deletions debian/apmplanner2.desktop → common/apmplanner2.desktop
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
Type=Application
Name=APM Planner 2
GenericName=apmplanner2
Exec=apmplanner2.sh
Exec=/usr/bin/apmplanner2
Terminal=false
Categories=Education;Robotics;
Comment=A UAV Ground Station
Comment=An open-source ground station application for MAVlink based autopilots
Icon=/usr/share/APMPlanner2/files/APMIcons/ap_rc.png

11 changes: 11 additions & 0 deletions common/apmplanner2.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh

# On Intel graphics chipsets, the primary flight display can hog the
# CPU leading to poor system performance. For more details, see:
# https://github.com/ArduPilot/apm_planner/issues/646
#
# To use this wrapper, rename apmplanner2 to apmplanner2.bin and install
# this script as apmplanner2.

export QSG_RENDER_LOOP=threaded
exec ${0}.bin "$@"
2 changes: 2 additions & 0 deletions config.tests/has_flite/has_flite.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SOURCES = main.cpp
LIBS += -lflite
9 changes: 9 additions & 0 deletions config.tests/has_flite/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
* check if flite includes the flite_voices_list variable.
*/

#include <flite/flite.h>

int main() {
flite_voice_list;
}
File renamed without changes.
4 changes: 0 additions & 4 deletions debian/apmplanner2.sh

This file was deleted.

Loading

4 comments on commit 89a626a

@dcarpy
Copy link
Contributor

@dcarpy dcarpy commented on 89a626a Sep 18, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems debuild requires the changelog in debian dir in order to build the package (it exits with a fatal error). Can one of you guys put it back? :-)

@Arne-W
Copy link
Contributor

@Arne-W Arne-W commented on 89a626a Sep 19, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@larsks did you remove the log accidentally or on purpose?? @dcarpy I will see what I can do this evening.... the changelog could be updated too - really outdated

@Arne-W
Copy link
Contributor

@Arne-W Arne-W commented on 89a626a Sep 19, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dcarpy All right, after having a look I do understand. In the debian dir you will find a pearl scrip called "gitlog-to-changelog.pl" if you call it it generates the changelog from the Git history - perfect nobody has to maintain it. As long as we can generate the file we should not put it in the repo.
@larsks Seems removing was on purpose.

@dcarpy
Copy link
Contributor

@dcarpy dcarpy commented on 89a626a Sep 19, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Arne-W Thank you sir--sorry for the confusion. I will call that bad boy before I do a build next time and we will be good.

Please sign in to comment.