Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

buildsys improvements #4262

Merged
merged 3 commits into from Aug 19, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 10 additions & 3 deletions scripts/build
Expand Up @@ -53,8 +53,14 @@ STAMP=$STAMPS/$PACKAGE_NAME/build_$TARGET

$SCRIPTS/unpack $PACKAGE_NAME

if [ -f $STAMP -a $PKG_DIR/package.mk -nt $STAMP ]; then
rm -f $STAMP
STAMP_DEPENDS="$PKG_DIR $PKG_NEED_UNPACK $PROJECT_DIR/$PROJECT/patches/$PKG_NAME"

if [ -f $STAMP ] ; then
. $STAMP
PKG_DEEPMD5=$(md5deep -r $STAMP_DEPENDS 2>/dev/null | sort | md5sum | cut -d" " -f1)
if [ ! "$PKG_DEEPMD5" = "$STAMP_PKG_DEEPMD5" ] ; then
rm -f $STAMP
fi
fi

if [ ! -f $STAMP ]; then
Expand Down Expand Up @@ -358,7 +364,8 @@ if [ ! -f $STAMP ]; then
$SED "s:\(['= ]\)/usr:\\1$SYSROOT_PREFIX/usr:g" $i; \
done

for i in `sed -n "s/^\([^#].*\)=\".*$/\1/p" $PROJECT_DIR/$PROJECT/options | grep -v "#"`; do
PKG_DEEPMD5=$(md5deep -r $STAMP_DEPENDS 2>/dev/null | sort | md5sum | cut -d" " -f1)
for i in PKG_NAME PKG_DEEPMD5; do
eval val=\$$i
echo "STAMP_$i=\"$val\"" >> $STAMP
done
Expand Down
4 changes: 2 additions & 2 deletions scripts/checkdeps
Expand Up @@ -31,8 +31,8 @@ case $1 in
deps_pkg="wget"
;;
build)
deps="bash bc gcc g++ sed patch touch tar bzip2 gzip perl cp gawk makeinfo gperf zip unzip mkfontscale mkfontdir bdftopcf diff xsltproc java"
deps_pkg="bash bc gcc g++ sed patch fileutils tar bzip2 gzip perl coreutils gawk texinfo gperf zip unzip xfonts-utils xfonts-utils xfonts-utils diff xsltproc default-jre"
deps="bash bc gcc g++ sed patch touch tar bzip2 gzip perl cp gawk makeinfo gperf zip unzip mkfontscale mkfontdir bdftopcf diff xsltproc java md5deep"
deps_pkg="bash bc gcc g++ sed patch fileutils tar bzip2 gzip perl coreutils gawk texinfo gperf zip unzip xfonts-utils xfonts-utils xfonts-utils diff xsltproc default-jre md5deep"
files="/usr/include/stdio.h /usr/include/ncurses.h"
files_pkg="libc6-dev libncurses5-dev"
if [ -f /etc/redhat-release ]; then
Expand Down
46 changes: 46 additions & 0 deletions scripts/skip_unpack
@@ -0,0 +1,46 @@
#!/bin/bash

################################################################################
# This file is part of OpenELEC - http://www.openelec.tv
# Copyright (C) 2009-2014 Stephan Raue (stephan@openelec.tv)
#
# OpenELEC is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# OpenELEC is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenELEC. If not, see <http://www.gnu.org/licenses/>.
################################################################################

. config/options $1

if [ -z "$1" ]; then
echo "usage: $0 package_name"
exit 1
fi

if [ ! -f $PKG_DIR/package.mk ]; then
printf "${boldred}$1: no package.mk file found${endcolor}\n"
exit 1
fi

STAMP=$PKG_BUILD/.openelec-unpack

if [ -f $STAMP ] ; then
printf "%${BUILD_INDENT}c ${boldcyan}SKIP_UNPACK${endcolor} $1\n" ' '>&$SILENT_OUT
export BUILD_INDENT=$((${BUILD_INDENT:-1}+$BUILD_INDENT_SIZE))

rm -f $STAMP
STAMP_DEPENDS="$PKG_DIR $PKG_NEED_UNPACK $PROJECT_DIR/$PROJECT/patches/$PKG_NAME"
PKG_DEEPMD5=$(md5deep -r $STAMP_DEPENDS 2>/dev/null | sort | md5sum | cut -d" " -f1)
for i in PKG_NAME PKG_DEEPMD5; do
eval val=\$$i
echo "STAMP_$i=\"$val\"" >> $STAMP
done
fi
32 changes: 8 additions & 24 deletions scripts/unpack
Expand Up @@ -38,37 +38,20 @@ mkdir -p $BUILD

[ ! -d "$SOURCES/$1" -a ! -d "$PKG_DIR/sources" ] && exit 0

STAMP_DEPENDS="$PKG_DIR $PKG_NEED_UNPACK $PROJECT_DIR/$PROJECT/patches/$PKG_NAME"

for i in $BUILD/$1-*; do
if [ -d $i -a -f "$i/.openelec-unpack" ] ; then
. "$i/.openelec-unpack"
if [ "$STAMP_PKG_NAME" = "$1" ]; then
# trigger unpack / full rebuild on any package.mk change
if [ $PKG_DIR/package.mk -nt "$i/.openelec-unpack" ]; then
CLEAN_SOURCE=yes
break
PKG_DEEPMD5=$(md5deep -r $STAMP_DEPENDS 2>/dev/null | sort | md5sum | cut -d" " -f1)
if [ ! "$PKG_DEEPMD5" = "$STAMP_PKG_DEEPMD5" ] ; then
$SCRIPTS/clean $1
fi
# handle $PKG_NEED_UNPACK
for file in $PKG_NEED_UNPACK; do
if [ -f "$file" -a "$file" -nt "$i/.openelec-unpack" ] ; then
CLEAN_SOURCE=yes
break
fi
done
# trigger unpack / full rebuild on any patch / script / etc.. change
for file in $PKG_DIR/{patches,scripts,config}/* $PKG_DIR/patches/$PKG_VERSION/*.patch $PROJECT_DIR/$PROJECT/patches/$PKG_NAME/*.patch; do
if [ -f "$file" -a "$file" -nt "$i/.openelec-unpack" ]; then
CLEAN_SOURCE=yes
break
fi
done
fi
fi
done

if [ "$CLEAN_SOURCE" = "yes" ]; then
$SCRIPTS/clean $1
fi

[ -f "$STAMP" ] && exit 0

printf "%${BUILD_INDENT}c ${boldcyan}UNPACK${endcolor} $1\n" ' '>&$SILENT_OUT
Expand Down Expand Up @@ -165,7 +148,8 @@ done

rm -f $STAMPS/$1/build_*

for i in PKG_NAME PKG_VERSION PKG_REV PKG_SHORTDESC PKG_LONGDESC PKG_SITE PKG_URL PKG_SECTION; do
PKG_DEEPMD5=$(md5deep -r $STAMP_DEPENDS 2>/dev/null | sort | md5sum | cut -d" " -f1)
for i in PKG_NAME PKG_DEEPMD5; do
eval val=\$$i
echo "STAMP_$i=\"$val"\" >> $STAMP
echo "STAMP_$i=\"$val\"" >> $STAMP
done