Continuous output and failure

some attempt at using dpkg for termux package installs instead of
rebuilding from source
This commit is contained in:
Stephen 2017-07-10 09:28:51 -07:00 committed by Fredrik Fornwall
parent dce1a134da
commit 5a89c5e2fd
5 changed files with 46 additions and 13 deletions

View File

@ -1,6 +1,5 @@
language: ruby
sudo: required
services:
- docker
cache: bundler
services: docker
before_script: mkdir debs && chmod 777 debs

View File

@ -1,4 +1,5 @@
require 'rugged'
require 'pty'
task default: %w[build]
@ -6,13 +7,32 @@ task :build do
repo = Rugged::Repository.new('.')
commit = repo.head.target
parent = commit.parents.first
paths = commit.diff(parent).deltas.map { |d| d.new_file[:path] }
paths = paths.map { |p| Pathname.new(p).each_filename.to_a }
# looking for packages/[package]/...
packages = paths.map { |p| p[1] if p.length > 2 and p[0] == "packages" }
packages = packages.flatten.uniq
packages.each do |package|
puts package
printf `./scripts/run-docker.sh ./build-package.sh #{package}`
pkgs = commit.diff(parent).deltas.map { |d| d.new_file[:path] }
# Split paths into arrays
pkgs.map! { |p| Pathname.new(p).each_filename.to_a }
# looking for [disabled-]packages/(package_name)/...
pkgs.select! { |p| p.length > 2 and p[0] =~ /(?<disabled->)packages/ }
# Get package_name
pkgs.map! { |p| p[1] }
# Remove duplicate packages
pkgs.uniq!
pkgs.each do |pkg|
puts "Building #{pkg}"
begin
# Start blocking build loop
PTY.spawn("./scripts/run-docker.sh ./build-package.sh #{pkg}") do |stdout, stdin, pid|
begin
stdout.each { |line| print line }
rescue Errno::EIO
end
end
rescue PTY::ChildExited
puts "Process exited"
end
# Exit if PTY return a non-zero code
if $?.exitstatus != 0
STDERR.puts("Error building #{pkg}")
exit($?.exitstatus)
end
end
end

View File

@ -308,6 +308,21 @@ termux_step_start_build() {
for p in $TERMUX_ALL_DEPS; do
if [ "$p" != "$TERMUX_PKG_NAME" ]; then
echo "Building dependency $p if necessary..."
# TODO use apt and dpkg to install instead of building
# Add apt repository and key, update
# TODO move this install to Dockerfile
sudo apt-get update && sudo apt-get install -y software-properties-common
sudo add-apt-repository "deb [arch=all,$TERMUX_ARCH] http://termux.net stable main"
cat $TERMUX_SCRIPTDIR/packages/apt/trusted.gpg | sudo apt-key add -
sudo apt-get update && sudo dpkg --add-architecture $TERMUX_ARCH
sudo apt-get -d install ${p}:${TERMUX_ARCH}
# TODO delete debug info
echo "SGROAT DEBUG"
ls -lah /var/cache/apt/archives
echo "SGROAT DEBUG"
# TODO figure out what the root is?
sudo dpkg --root $TERMUX_PREFIX --configure -a
sudo dpkg --root $TERMUX_PREFIX -i /var/cache/apt/archives/${p}_*_${TERMUX_ARCH}.deb
./build-package.sh -a $TERMUX_ARCH -s "$p"
fi
done

View File

@ -1,6 +1,6 @@
TERMUX_PKG_HOMEPAGE=https://git-scm.com/
TERMUX_PKG_DESCRIPTION="Distributed version control system designed to handle everything from small to very large projects with speed and efficiency"
# less is required as a pager for git log, and the busybox less does not handle used escape sequences.
# less is required as a pager for git log, and the busybox less does not handle used escape sequences
TERMUX_PKG_DEPENDS="libcurl, less"
TERMUX_PKG_VERSION=2.13.3
TERMUX_PKG_SRCURL=https://www.kernel.org/pub/software/scm/git/git-${TERMUX_PKG_VERSION}.tar.xz

View File

@ -3,7 +3,6 @@ TERMUX_PKG_DESCRIPTION="Support library with a focus on asynchronous I/O"
TERMUX_PKG_VERSION=1.13.1
TERMUX_PKG_SRCURL=http://dist.libuv.org/dist/v${TERMUX_PKG_VERSION}/libuv-v${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=824fe07476a9cab519d2d3e2be6d49f1faa1e7bb59224f0d81a7d6a307ce3937
termux_step_pre_configure () {
export PLATFORM=android
sh autogen.sh