blob: 01e2f01f335df5efc6b921a5860ec544fd189169 [file] [log] [blame]
#!/usr/bin/env node
/*
*
* Copyright 2013 Canonical Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
*/
var exec = require('child_process').exec;
// FIXME: check for armhf
var deps = "cmake libicu-dev pkg-config qtbase5-dev qtchooser qtdeclarative5-dev qtfeedback5-dev qtlocation5-dev qtmultimedia5-dev qtpim5-dev qtsensors5-dev qtsystems5-dev";
var depsArm = "cmake libicu-dev:armhf pkg-config qtbase5-dev:armhf qtchooser qtdeclarative5-dev:armhf qtfeedback5-dev:armhf qtlocation5-dev:armhf qtmultimedia5-dev:armhf qtpim5-dev:armhf qtsensors5-dev:armhf qtsystems5-dev:armhf";
var series = "trusty";
exec("dpkg-query -Wf'$${db:Status-abbrev}' click " + deps, function(error, stdout, stderr) {
if (error) {
console.error("Error: missing dependency " + deps);
process.exit(error.code);
}
exec("dpkg-query -Wf='${Version}' click", function(error, stdout, stderr) {
//FIXME:
if (error || stdout != "0.4.13") {
console.error("Error: click package too old");
process.exit(error.code);
}
exec("click chroot -aarmhf -s " + series + " run dpkg-query -l " + deps, function(error, stdout, stderr) {
if (error) {
console.error("Error: missing armhf chroot");
// to fix problem click chroot -aarmhf -s trusty maint
// dpkg --force-overwrite --force-conflicts -i /var/cache/apt/archives/qtbase5-dev_5.0.2+dfsg1-7ubuntu13_amd64.deb
// apt-get install -f
console.error("run:\nclick chroot -aarmhf -s " + series + " create\n click chroot -aarmhf -s " + series + " install " + depsArm);
process.exit(error.code);
}
}
})
}