Skip to content

Commit

Permalink
remove obsolete workarounds for ancient Ubuntu
Browse files Browse the repository at this point in the history
  • Loading branch information
stronnag committed Apr 4, 2017
1 parent 8477839 commit 3c32b1d
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 106 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ chromebook running Arch Linux.

The tools are designed to be portable and as far as possible platform
and architecure agnostic. The suite is developed on Arch Linux and is
tested on Ubuntu, Fedora and FreeBSD (current release); building and running on
any platform that supports (recent versions of):
tested on Ubuntu (latest and most recent LTS), Fedora (current) and
FreeBSD (current release); building and running on any platform that
supports (recent versions of):

* gtk+3.0 (3.8 or later);
* gtk+3.0 (3.18 or later);
* vala and gcc;
* Clutter (software GL is fine);
* libchamplain;
Expand Down
32 changes: 2 additions & 30 deletions common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,8 @@ ifeq ($(XOS),Linux)
DOPTS += -D HAVE_FIONREAD
endif

PKG_INFO := $(shell pkg-config --atleast-version=2.48 libsoup-2.4; echo $$?)
ifneq ($(PKG_INFO),0)
DOPTS += -D BADSOUP
QPROXY = yes
endif

PKG_INFO := $(shell pkg-config --atleast-version=0.12.3 champlain-0.12; echo $$?)
ifneq ($(PKG_INFO),0)
DOPTS += -D NOBB
endif


VAPI := $(shell valac --api-version)
PKG_INFO := $(shell pkg-config --atleast-version=0.30 libvala-$(VAPI) && pkg-config --atleast-version=2.46 glib-2.0; echo $$?)
ifneq ($(PKG_INFO),0)
DOPTS += -D NOPUSHFRONT
TARGET=2.36
else
TARGET=2.46
endif

PKG_INFO := $(shell pkg-config --exists vte-2.91; echo $$?)
ifeq ($(PKG_INFO),0)
VTEVERS=2.91
else
PKG_INFO := $(shell pkg-config --exists vte-2.90; echo $$?)
ifeq ($(PKG_INFO),0)
VTEVERS=2.90
endif
endif
TARGET=2.46
VTEVERS=2.91

OPTS += -X -O2 -X -s --thread --target-glib=$(TARGET)

Expand Down
10 changes: 5 additions & 5 deletions common/serial-device.vala
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ public class MWSerial : Object
if(fd != -1)
serial_lost();
MWPLog.message("Close on condition %x (fd=%d)\n", cond, fd);
return /* Source.REMOVE */ false;
return Source.REMOVE;
}
else if (fd != -1)
{
Expand All @@ -444,14 +444,14 @@ public class MWSerial : Object
avb = 256;
res = Posix.read(fd,buf,avb);
if(res == 0)
return /* Source.CONTINUE */ true;
return Source.CONTINUE;
}
else
return /* Source.CONTINUE */ true;
return Source.CONTINUE;
#else
res = Posix.read(fd,buf,256);
if(res == 0)
return /* Source.CONTINUE */ true;
return Source.CONTINUE;
#endif
}
else
Expand Down Expand Up @@ -737,7 +737,7 @@ public class MWSerial : Object
}
}
}
return /* Source.CONTINUE */ true;
return Source.CONTINUE;
}

private void mavlink_meta(uint8 id)
Expand Down
11 changes: 2 additions & 9 deletions docs/ubuntu-deps.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,13 @@ libgudev-1.0-dev
libgstreamer1.0-dev
libvala-dev # optional, recommended (optimisation)

libvte-2.91-dev (prferred) or
libvte-2.90-dev (14.04 LTS)

On some unsupported Ubuntu forks (e.g. Mint 17), you may also need to
explicitly add

libegl1-mesa-dev
libvte-2.91-dev

and for replay_bbox_ltm.rb

ruby version 2 or later, e.g.

ruby2.0 (14.04)
ruby2.2 (15.10)
ruby2.2

You must install the blackbox utilities
https://github.com/cleanflight/blackbox-tools/ in order to replay
Expand Down
5 changes: 0 additions & 5 deletions mwp/dialogs.vala
Original file line number Diff line number Diff line change
Expand Up @@ -1639,12 +1639,7 @@ public class AudioThread : Object {
msgs.push(c);
else
{
#if NOPUSHFRONT
// less efficient work around for Ubuntu (again)
msgs.push_sorted(c, () => { return 1; });
#else
msgs.push_front(c);
#endif
}
}

Expand Down
5 changes: 0 additions & 5 deletions mwp/mapsources.vala
Original file line number Diff line number Diff line change
Expand Up @@ -297,10 +297,6 @@ public class JsonMapDef : Object

public static void run_proxy(string uri, bool offline=false)
{
#if BADSOUP
string cmd = string.join(" ", "qproxy", uri, port.to_string());
spawn_proxy(cmd);
#else
var pt = JsonMapDef.port;
MWPLog.message("Starting proxy thread %s\n", (offline) ? "(offline)" : "");
new Thread<int>("proxy",() => {
Expand All @@ -313,6 +309,5 @@ public class JsonMapDef : Object
}
return 0;
});
#endif
}
}
10 changes: 5 additions & 5 deletions mwp/mwp.ui
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.20.0 -->
<interface>
<requires lib="gtk+" version="3.8"/>
<requires lib="gtk+" version="3.18"/>
<object class="GtkAboutDialog" id="aboutdialog1">
<property name="can_focus">False</property>
<property name="type_hint">dialog</property>
Expand Down Expand Up @@ -2670,10 +2670,10 @@ Use the min and max zoom to select the zoom levels and then click "Apply". Stati
<object class="GtkLabel" id="rssi_pct">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">end</property>
<property name="label" translatable="yes">0%</property>
<property name="use_markup">True</property>
<property name="justify">right</property>
<property name="xalign">1</property>
</object>
<packing>
<property name="left_attach">0</property>
Expand All @@ -2684,18 +2684,18 @@ Use the min and max zoom to select the zoom levels and then click "Apply". Stati
<object class="GtkLabel" id="rssi_val">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">end</property>
<property name="label" translatable="yes">0</property>
<property name="use_markup">True</property>
<property name="justify">right</property>
<property name="xalign">1</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="__fix_obsolete__1491322421.169895__">
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">&lt;span size='xx-small'&gt;RSSI&lt;/span&gt;</property>
Expand All @@ -2707,7 +2707,7 @@ Use the min and max zoom to select the zoom levels and then click "Apply". Stati
</packing>
</child>
<child>
<object class="GtkLabel" id="__fix_obsolete__1491322421.1699097__">
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">&lt;span size='xx-small'&gt;%&lt;/span&gt;</property>
Expand Down
56 changes: 12 additions & 44 deletions mwp/mwp.vala
Original file line number Diff line number Diff line change
Expand Up @@ -1517,16 +1517,14 @@ public class MWPlanner : Gtk.Application {
}
Timeout.add(250, () => {
fbox.allow_resize(false);
return /* Source.REMOVE */ false;
return Source.REMOVE;
});
return /* Source.REMOVE */ false;
return Source.REMOVE;
});

window.size_allocate.connect((a) => {
if(((a.width != conf.window_w) || (a.height != conf.window_h))
#if !BADSOUP
&& (!window.is_maximized)
#endif
)
{
conf.window_w = a.width;
Expand All @@ -1551,7 +1549,7 @@ public class MWPlanner : Gtk.Application {
}
Timeout.add(500, () => {
fbox.allow_resize(false);
return /* Source.REMOVE */ false;
return Source.REMOVE;
});
return false;
});
Expand Down Expand Up @@ -1726,9 +1724,9 @@ public class MWPlanner : Gtk.Application {
if(!msp.available)
connect_serial();
Timeout.add_seconds(5, () => { return try_connect(); });
return /* Source.REMOVE */ false;
return Source.REMOVE;
}
return /* Source.CONTINUE */ true;
return Source.CONTINUE;
}

private void set_error_status(string? e)
Expand Down Expand Up @@ -1857,15 +1855,6 @@ public class MWPlanner : Gtk.Application {
}
}

#if NOPUSHFRONT
/* The above test is not entirely true, but I'm not sure if the issue is
related to the gtk version or libchamplain version. Anyway, it's close
enough the otherwise failed OS (Ubuntu 14.02, Freebsd c. 2016-02)
*/
if((nticks % ANIMINTVL) == 0)
anim_cb();
#endif

if((nticks % STATINTVL) == 0)
{
gen_serial_stats();
Expand Down Expand Up @@ -1900,7 +1889,7 @@ public class MWPlanner : Gtk.Application {
Process.spawn_command_line_async(conf.heartbeat);
} catch {}
}
return /* Source.CONTINUE */ true;
return Source.CONTINUE;
});
}

Expand Down Expand Up @@ -3675,7 +3664,7 @@ public class MWPlanner : Gtk.Application {
MWPLog.message("Reconnecting\n");
connect_serial();
}
return /* Source.REMOVE */ false;
return Source.REMOVE;
});
break;

Expand Down Expand Up @@ -4075,7 +4064,7 @@ public class MWPlanner : Gtk.Application {
MWPLog.message("WP upload probably failed\n");
mwp_warning_box("WP upload timeout.\nThe upload has probably failed",
Gtk.MessageType.ERROR);
return /* Source.REMOVE */ false;
return Source.REMOVE;
});

uint8 wtmp[64];
Expand Down Expand Up @@ -4162,7 +4151,7 @@ public class MWPlanner : Gtk.Application {
(cmd == MSP.Cmds.FC_VERSION))
cmd = MSP.Cmds.BOXNAMES;
send_cmd(cmd,buf,len);
return /* Source.CONTINUE */ true;
return Source.CONTINUE;
});
send_cmd(cmd,buf,len);
}
Expand All @@ -4176,7 +4165,7 @@ public class MWPlanner : Gtk.Application {
navstatus.logspeak_init(conf.evoice, (conf.uilang == "ev"));
spktid = Timeout.add_seconds(conf.speakint, () => {
navstatus.announce(sflags, conf.recip);
return /* Source.CONTINUE */ true;
return Source.CONTINUE;
});
gps_alert(0);
navstatus.announce(sflags,conf.recip);
Expand Down Expand Up @@ -4342,7 +4331,7 @@ public class MWPlanner : Gtk.Application {
Timeout.add(timeo, () =>
{
add_cmd(MSP.Cmds.IDENT,null,0, 1500);
return /* Source.REMOVE */ false;
return Source.REMOVE;
});
}
menumwvar.sensitive = false;
Expand Down Expand Up @@ -4373,32 +4362,11 @@ public class MWPlanner : Gtk.Application {
{
double plat,plon;
craft.get_pos(out plat, out plon);
/*
* Older Champlain versions don't have full bbox
* work around it
*/
#if NOBB
double vypix = view.latitude_to_y(plat);
double vxpix = view.longitude_to_x(plon);
bool outofview = ((int)vypix < 0 || (int)vxpix < 0);
if(outofview == false)
{
var ww = embed.get_window();
var wd = ww.get_width();
var ht = ww.get_height();
outofview = ((int)vypix > ht || (int)vxpix > wd);
}
if (outofview == true)
{
craft.park();
}
#else
var bbox = view.get_bounding_box();
if (bbox.covers(plat, plon) == false)
{
craft.park();
}
#endif
}
}
}
Expand Down Expand Up @@ -4686,7 +4654,7 @@ public class MWPlanner : Gtk.Application {
{
Timeout.add_seconds(timeout, () => {
msg.destroy();
return /* Source.CONTINUE */ true;
return Source.CONTINUE;
});
}
msg.response.connect ((response_id) => {
Expand Down

0 comments on commit 3c32b1d

Please sign in to comment.