2009-03-18 12:02:53 +00:00
|
|
|
#!/bin/sh
|
2011-01-09 22:32:01 +00:00
|
|
|
|
2011-01-09 20:26:03 +00:00
|
|
|
################################################################################
|
|
|
|
# This file is part of OpenELEC - http://www.openelec.tv
|
2012-02-29 12:11:22 +00:00
|
|
|
# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv)
|
2011-01-09 20:26:03 +00:00
|
|
|
#
|
|
|
|
# This Program 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, or (at your option)
|
|
|
|
# any later version.
|
|
|
|
#
|
|
|
|
# This Program 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.tv; see the file COPYING. If not, write to
|
2012-02-29 12:11:22 +00:00
|
|
|
# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA.
|
2011-01-09 20:26:03 +00:00
|
|
|
# http://www.gnu.org/copyleft/gpl.html
|
|
|
|
################################################################################
|
2009-03-18 12:02:53 +00:00
|
|
|
|
2010-07-21 16:54:45 +00:00
|
|
|
. config/options $1
|
2009-03-18 12:02:53 +00:00
|
|
|
|
|
|
|
if [ -z "$1" ]; then
|
|
|
|
echo "usage: $0 package_name"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
$SCRIPTS/get $1
|
|
|
|
|
|
|
|
mkdir -p $BUILD
|
|
|
|
|
2010-12-18 21:55:20 +00:00
|
|
|
[ ! -d "$SOURCES/$1" -a ! -d "$PKG_DIR/sources" ] && exit 0
|
2009-03-18 12:02:53 +00:00
|
|
|
|
|
|
|
mkdir -p $STAMPS/$1
|
|
|
|
STAMP=$STAMPS/$1/unpack
|
|
|
|
|
2010-12-18 21:55:20 +00:00
|
|
|
[ -f "$STAMP" -a -f "$PKG_DIR/need_unpack" ] && $PKG_DIR/need_unpack $@
|
buildsystem: big rework & cleanup - PART-1: split functions from 'config/path' to an seperate file 'config/functions', rework and cleanup some build scripts, remove references to $TARGET_PLATFORM, add support for more then one downloadurl for $PKG_URL (partially done), remove support for: $PKG_DIR/arch, $PKG_DIR/platform, $PKG_DIR/url files, remove support for *.diff patches, create download-stampfiles in sources/$PKG_NAME, create md5 files after download, add support to download all sources at once with './scripts/get'
Signed-off-by: Stephan Raue <stephan@openelec.tv>
2010-11-19 21:01:08 +00:00
|
|
|
|
2009-03-18 12:02:53 +00:00
|
|
|
for patch in $PKG_DIR/patches/*; do
|
2010-12-18 21:55:20 +00:00
|
|
|
if [ "$patch" -nt "$STAMP" ]; then
|
2009-03-18 12:02:53 +00:00
|
|
|
rm -f $STAMP
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
buildsystem: big rework & cleanup - PART-1: split functions from 'config/path' to an seperate file 'config/functions', rework and cleanup some build scripts, remove references to $TARGET_PLATFORM, add support for more then one downloadurl for $PKG_URL (partially done), remove support for: $PKG_DIR/arch, $PKG_DIR/platform, $PKG_DIR/url files, remove support for *.diff patches, create download-stampfiles in sources/$PKG_NAME, create md5 files after download, add support to download all sources at once with './scripts/get'
Signed-off-by: Stephan Raue <stephan@openelec.tv>
2010-11-19 21:01:08 +00:00
|
|
|
|
2010-12-18 21:55:20 +00:00
|
|
|
[ -f "$STAMP" ] && exit 0
|
2009-03-18 12:02:53 +00:00
|
|
|
|
2012-10-22 00:00:23 +00:00
|
|
|
printf "%${BUILD_INDENT}c UNPACK $1\n" ' '>&$SILENT_OUT
|
|
|
|
export BUILD_INDENT=$((${BUILD_INDENT:-1}+$BUILD_INDENT_SIZE))
|
2009-03-18 12:02:53 +00:00
|
|
|
|
|
|
|
rm -rf $BUILD/$1[-_][0-9]*
|
|
|
|
rm -rf $BUILD/$1[-_]r[0-9]*
|
|
|
|
rm -rf $BUILD/$1[-_]cvs*
|
|
|
|
rm -rf $BUILD/$1[-_]svn*
|
|
|
|
rm -rf $BUILD/$1[-_]git*
|
|
|
|
|
2010-11-19 12:35:11 +00:00
|
|
|
if [ -n "$PKG_URL" ]; then
|
2009-03-18 12:02:53 +00:00
|
|
|
$SCRIPTS/extract $1 "$1*.tar.bz2" $BUILD
|
2011-06-20 19:56:18 +00:00
|
|
|
$SCRIPTS/extract $1 "$1*.tbz" $BUILD
|
2009-03-18 12:02:53 +00:00
|
|
|
$SCRIPTS/extract $1 "$1*.tar.gz" $BUILD
|
2011-06-20 19:56:18 +00:00
|
|
|
$SCRIPTS/extract $1 "$1*.tar.xz" $BUILD
|
|
|
|
$SCRIPTS/extract $1 "$1*.txz" $BUILD
|
2009-03-18 12:02:53 +00:00
|
|
|
$SCRIPTS/extract $1 "$1*.tgz" $BUILD
|
2010-07-17 22:47:00 +00:00
|
|
|
$SCRIPTS/extract $1 "$1*.7z" $BUILD
|
2009-03-18 12:02:53 +00:00
|
|
|
fi
|
|
|
|
|
2011-12-04 07:33:57 +00:00
|
|
|
[ -f "$PKG_DIR/rename" ] && $PKG_DIR/rename $@ >&$VERBOSE_OUT
|
|
|
|
|
2010-12-18 21:55:20 +00:00
|
|
|
if [ -d "$PKG_DIR/sources" ]; then
|
2011-05-06 17:58:46 +00:00
|
|
|
[ ! -d "$BUILD/${PKG_NAME}-${PKG_VERSION}" ] && mkdir -p $BUILD/${PKG_NAME}-${PKG_VERSION}
|
|
|
|
cp -PRf $PKG_DIR/sources/* $BUILD/${PKG_NAME}-${PKG_VERSION}
|
2009-03-18 12:02:53 +00:00
|
|
|
fi
|
|
|
|
|
2013-03-29 13:17:34 +00:00
|
|
|
if [ -d "$BUILD/${PKG_NAME}-${PKG_VERSION}" ]; then
|
|
|
|
PKG_BUILD="$BUILD/${PKG_NAME}-${PKG_VERSION}"
|
|
|
|
elif [ -d "$BUILD/${PKG_NAME}_${PKG_VERSION}" ]; then
|
|
|
|
PKG_BUILD="$BUILD/${PKG_NAME}_${PKG_VERSION}"
|
|
|
|
elif [ -d "$BUILD/${PKG_NAME}.${PKG_VERSION}" ]; then
|
|
|
|
PKG_BUILD="$BUILD/${PKG_NAME}.${PKG_VERSION}"
|
|
|
|
elif [ -d "$BUILD/${PKG_NAME}${PKG_VERSION}" ]; then
|
|
|
|
PKG_BUILD="$BUILD/${PKG_NAME}${PKG_VERSION}"
|
|
|
|
elif [ -d "$BUILD/${PKG_NAME}" ]; then
|
|
|
|
PKG_BUILD="$BUILD/${PKG_NAME}"
|
|
|
|
fi
|
2010-11-25 17:31:01 +00:00
|
|
|
|
2013-01-17 11:40:01 +00:00
|
|
|
for i in $PKG_DIR/patches/$PKG_NAME-*.patch ; do
|
2010-12-18 21:55:20 +00:00
|
|
|
if [ -f "$i" ]; then
|
2009-03-18 12:02:53 +00:00
|
|
|
PATCH=`basename $i`
|
2009-05-31 21:34:46 +00:00
|
|
|
PT=`echo $PATCH | sed 's/.*\.\(.*\)$/\1/'`
|
buildsystem: big rework & cleanup - PART-1: split functions from 'config/path' to an seperate file 'config/functions', rework and cleanup some build scripts, remove references to $TARGET_PLATFORM, add support for more then one downloadurl for $PKG_URL (partially done), remove support for: $PKG_DIR/arch, $PKG_DIR/platform, $PKG_DIR/url files, remove support for *.diff patches, create download-stampfiles in sources/$PKG_NAME, create md5 files after download, add support to download all sources at once with './scripts/get'
Signed-off-by: Stephan Raue <stephan@openelec.tv>
2010-11-19 21:01:08 +00:00
|
|
|
if [ "$PT" != "patch" -a "$PT" != "$TARGET_ARCH" ]; then
|
2013-01-17 11:40:01 +00:00
|
|
|
printf "%${BUILD_INDENT}c SKIP PATCH (common): $i\n" ' '>&$SILENT_OUT
|
2009-03-18 12:02:53 +00:00
|
|
|
continue;
|
|
|
|
else
|
2013-01-17 11:40:01 +00:00
|
|
|
printf "%${BUILD_INDENT}c APPLY PATCH (common): $i\n" ' '>&$SILENT_OUT
|
|
|
|
cat $i | patch -d `echo "$PKG_BUILD" | cut -f1 -d\ ` -p1 >&$VERBOSE_OUT
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
for i in $PKG_DIR/patches/$PKG_VERSION/*.patch ; do
|
|
|
|
if [ -f "$i" ]; then
|
|
|
|
PATCH=`basename $i`
|
|
|
|
PT=`echo $PATCH | sed 's/.*\.\(.*\)$/\1/'`
|
|
|
|
if [ "$PT" != "patch" -a "$PT" != "$TARGET_ARCH" ]; then
|
|
|
|
printf "%${BUILD_INDENT}c SKIP PATCH ($PKG_VERSION): $i\n" ' '>&$SILENT_OUT
|
|
|
|
continue;
|
|
|
|
else
|
|
|
|
printf "%${BUILD_INDENT}c APPLY PATCH ($PKG_VERSION): $i\n" ' '>&$SILENT_OUT
|
2010-12-18 22:44:46 +00:00
|
|
|
cat $i | patch -d `echo "$PKG_BUILD" | cut -f1 -d\ ` -p1 >&$VERBOSE_OUT
|
2009-03-18 12:02:53 +00:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2012-12-27 09:40:15 +00:00
|
|
|
for i in $PROJECT_DIR/$PROJECT/patches/$PKG_NAME/*.patch ; do
|
|
|
|
if [ -f "$i" ]; then
|
|
|
|
PATCH=`basename $i`
|
|
|
|
PT=`echo $PATCH | sed 's/.*\.\(.*\)$/\1/'`
|
|
|
|
if [ "$PT" != "patch" -a "$PT" != "$TARGET_ARCH" ]; then
|
2013-01-17 11:40:01 +00:00
|
|
|
printf "%${BUILD_INDENT}c SKIP PATCH (project): $i\n" ' '>&$SILENT_OUT
|
2012-12-27 09:40:15 +00:00
|
|
|
continue;
|
|
|
|
else
|
2013-01-17 11:40:01 +00:00
|
|
|
printf "%${BUILD_INDENT}c APPLY PATCH (project): $i\n" ' '>&$SILENT_OUT
|
2012-12-27 09:40:15 +00:00
|
|
|
cat $i | patch -d `echo "$PKG_BUILD" | cut -f1 -d\ ` -p1 >&$VERBOSE_OUT
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2010-12-18 21:55:20 +00:00
|
|
|
[ -f "$PKG_DIR/unpack" ] && $PKG_DIR/unpack $@ >&$VERBOSE_OUT
|
2009-03-18 12:02:53 +00:00
|
|
|
|
2011-02-09 10:09:22 +00:00
|
|
|
for config in `find $BUILD/$1* -name config.guess | sed 's/config.guess//'`; do
|
2012-10-22 00:00:23 +00:00
|
|
|
printf "%${BUILD_INDENT}c FIXCONFIG: $config\n" ' '>&$SILENT_OUT
|
2011-02-09 10:09:22 +00:00
|
|
|
|
|
|
|
[ -f "$config/config.guess" ] && cp -f $SCRIPTS/configtools/config.guess $config
|
|
|
|
[ -f "$config/config.sub" ] && cp -f $SCRIPTS/configtools/config.sub $config
|
|
|
|
[ -f "$config/configure.guess" ] && cp -f $SCRIPTS/configtools/config.guess $config/configure.guess
|
|
|
|
[ -f "$config/configure.sub" ] && cp -f $SCRIPTS/configtools/config.sub $config/configure.sub
|
|
|
|
done
|
|
|
|
|
2009-03-18 12:02:53 +00:00
|
|
|
rm -f $STAMPS/$1/build
|
buildsystem: big rework & cleanup - PART-1: split functions from 'config/path' to an seperate file 'config/functions', rework and cleanup some build scripts, remove references to $TARGET_PLATFORM, add support for more then one downloadurl for $PKG_URL (partially done), remove support for: $PKG_DIR/arch, $PKG_DIR/platform, $PKG_DIR/url files, remove support for *.diff patches, create download-stampfiles in sources/$PKG_NAME, create md5 files after download, add support to download all sources at once with './scripts/get'
Signed-off-by: Stephan Raue <stephan@openelec.tv>
2010-11-19 21:01:08 +00:00
|
|
|
|
2009-12-19 00:35:31 +00:00
|
|
|
for i in `sed -n "s/^\([^#].*\)=\".*$/\1/p" $PROJECT_DIR/$PROJECT/options | grep -v "#"`; do
|
2009-03-18 12:02:53 +00:00
|
|
|
eval val=\$$i
|
|
|
|
echo "STAMP_$i=\"$val"\" >> $STAMP
|
|
|
|
done
|