mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-28 05:06:43 +00:00
Merge pull request #4353 from stefansaraev/mkpkg-binary-addons
add mkpkg_binary-addons-Isengard and clean up mkpkg_kodi*
This commit is contained in:
commit
7b474a11e2
125
tools/mkpkg/mkpkg_binary-addons-Isengard
Executable file
125
tools/mkpkg/mkpkg_binary-addons-Isengard
Executable file
@ -0,0 +1,125 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
################################################################################
|
||||||
|
# This file is part of OpenELEC - http://www.openelec.tv
|
||||||
|
# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv)
|
||||||
|
#
|
||||||
|
# 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
|
||||||
|
# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA.
|
||||||
|
# http://www.gnu.org/copyleft/gpl.html
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
KODI_DIR="kodi-Isengard.git"
|
||||||
|
|
||||||
|
git_clone() {
|
||||||
|
# git_clone https://repo.url branch ./target_dir [githash]
|
||||||
|
echo "[mkpkg] Checking out $1 ..."
|
||||||
|
if [ ! -d "$3" ]; then
|
||||||
|
git clone "$1" -b $2 "$3"
|
||||||
|
else
|
||||||
|
if [ -d "$3" ] ; then
|
||||||
|
cd "$3"
|
||||||
|
git checkout $2 >/dev/null 2>/dev/null
|
||||||
|
git pull
|
||||||
|
cd ..
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
if [ ! -z "$4" ] ; then
|
||||||
|
cd "$3"
|
||||||
|
git fetch >/dev/null 2>/dev/null
|
||||||
|
git branch -D $4 >/dev/null 2>/dev/null
|
||||||
|
git checkout $4 -b ref-$4 >/dev/null 2>/dev/null
|
||||||
|
cd ..
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
copy_sources() {
|
||||||
|
# copy_sources source_dir package_name package_version
|
||||||
|
if [ -d "$1" ] ; then
|
||||||
|
echo "[mkpkg] Copying sources: $2-$3" ...
|
||||||
|
rm -rf "$2-$3"
|
||||||
|
cp -R "$1" "$2-$3"
|
||||||
|
echo "$GIT_HASH" > "$2-$3/VERSION"
|
||||||
|
|
||||||
|
echo "[mkpkg] Cleaning $2-$3 ..."
|
||||||
|
rm -rf "$2-$3/.git"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
package_sources() {
|
||||||
|
# package_sources source_dir
|
||||||
|
if [ -d "$1" ] ; then
|
||||||
|
echo "[mkpkg] Packing $1.tar.xz ..."
|
||||||
|
if [ ! -f "$1.tar.xz" ] ; then
|
||||||
|
tar cvJf "$1.tar.xz" "$1"
|
||||||
|
fi
|
||||||
|
rm -rf "$1"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
resolve_hash() {
|
||||||
|
if [ -d "$1" ] ; then
|
||||||
|
cd "$1"
|
||||||
|
git rev-parse --short $2 2>/dev/null
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
copy_and_package() {
|
||||||
|
REPO="$1"
|
||||||
|
PKG_NAME="$2"
|
||||||
|
GIT_HASH="$3"
|
||||||
|
git_clone $REPO master $PKG_NAME.git $GIT_HASH
|
||||||
|
RESOLVED_HASH=$(resolve_hash $PKG_NAME.git $GIT_HASH)
|
||||||
|
if [ ! -e $PKG_NAME-$RESOLVED_HASH.tar.xz ] ; then
|
||||||
|
copy_sources $PKG_NAME.git $PKG_NAME $RESOLVED_HASH
|
||||||
|
package_sources $PKG_NAME-$RESOLVED_HASH
|
||||||
|
else
|
||||||
|
echo "[mkpkg] $PKG_NAME-$RESOLVED_HASH.tar.xz already exists ..."
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
if [ ! -d $KODI_DIR ] ; then
|
||||||
|
echo "meh.. $KODI_DIR does not exist"
|
||||||
|
exit 127
|
||||||
|
fi
|
||||||
|
|
||||||
|
# kodi-platform
|
||||||
|
REPO=$(cat $KODI_DIR/project/cmake/addons/depends/common/kodi-platform/kodi-platform.txt | awk '{print $2}')
|
||||||
|
GIT_HASH=$(cat $KODI_DIR/project/cmake/addons/depends/common/kodi-platform/kodi-platform.txt | awk '{print $3}')
|
||||||
|
|
||||||
|
copy_and_package $REPO kodi-platform $GIT_HASH
|
||||||
|
|
||||||
|
if [ -f ../../packages/mediacenter/kodi-platform/package.mk ] ; then
|
||||||
|
# update package.mk
|
||||||
|
RESOLVED_HASH=$(resolve_hash $PKG_NAME.git $GIT_HASH)
|
||||||
|
sed -i "s|PKG_VERSION=.*|PKG_VERSION=\"$RESOLVED_HASH\"|g" ../../packages/mediacenter/kodi-platform/package.mk
|
||||||
|
fi
|
||||||
|
|
||||||
|
# addons
|
||||||
|
for addon in $KODI_DIR/project/cmake/addons/addons/*.* ; do
|
||||||
|
ADDON=$(basename $addon)
|
||||||
|
REPO=$(cat $KODI_DIR/project/cmake/addons/addons/$ADDON/$ADDON.txt | awk '{print $2}')
|
||||||
|
GIT_HASH=$(cat $KODI_DIR/project/cmake/addons/addons/$ADDON/$ADDON.txt | awk '{print $3}')
|
||||||
|
|
||||||
|
if ! grep -q all $addon/platforms.txt && ! grep -q linux $addon/platforms.txt ; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
copy_and_package $REPO $ADDON $GIT_HASH
|
||||||
|
|
||||||
|
if [ -f ../../packages/mediacenter/kodi-binary-addons/$ADDON/package.mk ] ; then
|
||||||
|
# update package.mk
|
||||||
|
RESOLVED_HASH=$(resolve_hash $PKG_NAME.git $GIT_HASH)
|
||||||
|
sed -i "s|PKG_VERSION=.*|PKG_VERSION=\"$RESOLVED_HASH\"|g" ../../packages/mediacenter/kodi-binary-addons/$ADDON/package.mk
|
||||||
|
fi
|
||||||
|
done
|
@ -1,120 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
################################################################################
|
|
||||||
# This file is part of OpenELEC - http://www.openelec.tv
|
|
||||||
# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv)
|
|
||||||
#
|
|
||||||
# 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
|
|
||||||
# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA.
|
|
||||||
# http://www.gnu.org/copyleft/gpl.html
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
PKG_NAME="kodi"
|
|
||||||
PKG_VERSION=""
|
|
||||||
BRANCH="master"
|
|
||||||
BRANCH_FOR_ADDONS="master"
|
|
||||||
GIT_REPO="git://github.com/xbmc/xbmc.git"
|
|
||||||
DEST_DIR="$PKG_NAME-$BRANCH"
|
|
||||||
|
|
||||||
git_clone() {
|
|
||||||
# git_clone https://repo.url branch ./target_dir [githash]
|
|
||||||
echo "[mkpkg] Checking out $1 ..."
|
|
||||||
if [ ! -d "$3" ]; then
|
|
||||||
git clone "$1" -b $2 "$3"
|
|
||||||
else
|
|
||||||
if [ -d "$3" ] ; then
|
|
||||||
cd "$3"
|
|
||||||
git checkout $2 >/dev/null 2>/dev/null
|
|
||||||
git pull
|
|
||||||
if [ ! -z "$4" ] ; then
|
|
||||||
git branch -D $4 >/dev/null 2>/dev/null
|
|
||||||
git checkout $4 -b $4 >/dev/null 2>/dev/null
|
|
||||||
fi
|
|
||||||
cd ..
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
copy_sources() {
|
|
||||||
# copy_sources source_dir package_name package_version
|
|
||||||
if [ -d "$1" ] ; then
|
|
||||||
echo "[mkpkg] Copying sources: $2-$3" ...
|
|
||||||
rm -rf "$2-$3"
|
|
||||||
cp -R "$1" "$2-$3"
|
|
||||||
echo "$GIT_HASH" > "$2-$3/VERSION"
|
|
||||||
|
|
||||||
echo "[mkpkg] Cleaning $2-$3 ..."
|
|
||||||
rm -rf "$2-$3/.git"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
package_sources() {
|
|
||||||
# package_sources source_dir
|
|
||||||
if [ -d "$1" ] ; then
|
|
||||||
echo "[mkpkg] Packing $1.tar.xz ..."
|
|
||||||
if [ ! -f "$1.tar.xz" ] ; then
|
|
||||||
tar cvJf "$1.tar.xz" "$1"
|
|
||||||
fi
|
|
||||||
rm -rf "$1"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# kodi
|
|
||||||
git_clone $GIT_REPO $BRANCH $DEST_DIR.git
|
|
||||||
|
|
||||||
# kodi-platform
|
|
||||||
REPO=$(cat $DEST_DIR.git/project/cmake/addons/depends/common/kodi-platform/kodi-platform.txt | awk '{print $2}')
|
|
||||||
GIT_HASH=$(cat $DEST_DIR.git/project/cmake/addons/depends/common/kodi-platform/kodi-platform.txt | awk '{print $3}')
|
|
||||||
if [ ! -e kodi-platform-$GIT_HASH.tar.xz ] ; then
|
|
||||||
git_clone $REPO $BRANCH_FOR_ADDONS kodi-platform.git $GIT_HASH
|
|
||||||
copy_sources kodi-platform.git kodi-platform $GIT_HASH
|
|
||||||
package_sources kodi-platform-$GIT_HASH
|
|
||||||
else
|
|
||||||
echo "[mkpkg] kodi-platform-$GIT_HASH.tar.xz already exists ..."
|
|
||||||
fi
|
|
||||||
|
|
||||||
# addons
|
|
||||||
for addon in $DEST_DIR.git/project/cmake/addons/addons/*.* ; do
|
|
||||||
PVR_ADDON=$(basename $addon)
|
|
||||||
REPO=$(cat $DEST_DIR.git/project/cmake/addons/addons/$PVR_ADDON/$PVR_ADDON.txt | awk '{print $2}')
|
|
||||||
GIT_HASH=$(cat $DEST_DIR.git/project/cmake/addons/addons/$PVR_ADDON/$PVR_ADDON.txt | awk '{print $3}')
|
|
||||||
if [ ! -e $PVR_ADDON-$GIT_HASH.tar.xz ] ; then
|
|
||||||
git_clone $REPO $BRANCH_FOR_ADDONS $PVR_ADDON.git $GIT_HASH
|
|
||||||
copy_sources $PVR_ADDON.git $PVR_ADDON $GIT_HASH
|
|
||||||
package_sources $PVR_ADDON-$GIT_HASH
|
|
||||||
else
|
|
||||||
echo "[mkpkg] $PVR_ADDON-$GIT_HASH.tar.xz already exists ..."
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
cd $DEST_DIR.git
|
|
||||||
GIT_HASH=`git log -n1 --format=%h`
|
|
||||||
VERSION_MAJOR=$(grep ^VERSION_MAJOR version.txt | cut -d" " -f2)
|
|
||||||
VERSION_MINOR=$(grep ^VERSION_MINOR version.txt | cut -d" " -f2)
|
|
||||||
VERSION_TAG=$(grep ^VERSION_TAG version.txt | cut -d" " -f2 | tr A-Z a-z)
|
|
||||||
PKG_VERSION="$VERSION_MAJOR.$VERSION_MINOR-$VERSION_TAG-$GIT_HASH"
|
|
||||||
# hack: empty version tag on release builds:
|
|
||||||
if [ "$VERSION_TAG" = "version_tag" ] ; then
|
|
||||||
PKG_VERSION="$VERSION_MAJOR.$VERSION_MINOR-$GIT_HASH"
|
|
||||||
fi
|
|
||||||
echo $PKG_VERSION
|
|
||||||
cd ..
|
|
||||||
|
|
||||||
copy_sources $PKG_NAME-$BRANCH.git $PKG_NAME $PKG_VERSION
|
|
||||||
|
|
||||||
echo "[mkpkg] Seperating skin.confluence ..."
|
|
||||||
rm -rf $PKG_NAME-theme-Confluence-$PKG_VERSION
|
|
||||||
mv $PKG_NAME-$PKG_VERSION/addons/skin.confluence $PKG_NAME-theme-Confluence-$PKG_VERSION
|
|
||||||
|
|
||||||
package_sources $PKG_NAME-$PKG_VERSION
|
|
||||||
package_sources $PKG_NAME-theme-Confluence-$PKG_VERSION
|
|
@ -22,99 +22,46 @@
|
|||||||
PKG_NAME="kodi"
|
PKG_NAME="kodi"
|
||||||
PKG_VERSION=""
|
PKG_VERSION=""
|
||||||
BRANCH="Isengard"
|
BRANCH="Isengard"
|
||||||
BRANCH_FOR_ADDONS="master"
|
|
||||||
GIT_REPO="git://github.com/xbmc/xbmc.git"
|
GIT_REPO="git://github.com/xbmc/xbmc.git"
|
||||||
DEST_DIR="$PKG_NAME-$BRANCH"
|
DEST_DIR="$PKG_NAME-$BRANCH"
|
||||||
|
|
||||||
git_clone() {
|
echo "getting sources..."
|
||||||
# git_clone https://repo.url branch ./target_dir [githash]
|
if [ ! -d $DEST_DIR.git ]; then
|
||||||
echo "[mkpkg] Checking out $1 ..."
|
git clone $GIT_REPO -b $BRANCH $DEST_DIR.git
|
||||||
if [ ! -d "$3" ]; then
|
|
||||||
git clone "$1" -b $2 "$3"
|
|
||||||
else
|
|
||||||
if [ -d "$3" ] ; then
|
|
||||||
cd "$3"
|
|
||||||
git checkout $2 >/dev/null 2>/dev/null
|
|
||||||
git pull
|
|
||||||
if [ ! -z "$4" ] ; then
|
|
||||||
git branch -D $4 >/dev/null 2>/dev/null
|
|
||||||
git checkout $4 -b $4 >/dev/null 2>/dev/null
|
|
||||||
fi
|
|
||||||
cd ..
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
}
|
|
||||||
|
|
||||||
copy_sources() {
|
cd $DEST_DIR.git
|
||||||
# copy_sources source_dir package_name package_version
|
git pull
|
||||||
if [ -d "$1" ] ; then
|
|
||||||
echo "[mkpkg] Copying sources: $2-$3" ...
|
|
||||||
rm -rf "$2-$3"
|
|
||||||
cp -R "$1" "$2-$3"
|
|
||||||
echo "$GIT_HASH" > "$2-$3/VERSION"
|
|
||||||
|
|
||||||
echo "[mkpkg] Cleaning $2-$3 ..."
|
echo "getting version..."
|
||||||
rm -rf "$2-$3/.git"
|
GIT_HASH=`git log -n1 --format=%h`
|
||||||
|
VERSION_MAJOR=$(grep ^VERSION_MAJOR version.txt | cut -d" " -f2)
|
||||||
|
VERSION_MINOR=$(grep ^VERSION_MINOR version.txt | cut -d" " -f2)
|
||||||
|
VERSION_TAG=$(grep ^VERSION_TAG version.txt | cut -d" " -f2 | tr A-Z a-z)
|
||||||
|
PKG_VERSION="$VERSION_MAJOR.$VERSION_MINOR-$VERSION_TAG-$GIT_HASH"
|
||||||
|
# hack: empty version tag on release builds:
|
||||||
|
if [ "$VERSION_TAG" = "version_tag" ] ; then
|
||||||
|
PKG_VERSION="$VERSION_MAJOR.$VERSION_MINOR-$GIT_HASH"
|
||||||
fi
|
fi
|
||||||
}
|
echo $PKG_VERSION
|
||||||
|
cd ..
|
||||||
|
|
||||||
package_sources() {
|
echo "copying sources..."
|
||||||
# package_sources source_dir
|
rm -rf $PKG_NAME-$PKG_VERSION
|
||||||
if [ -d "$1" ] ; then
|
cp -R $DEST_DIR.git $PKG_NAME-$PKG_VERSION
|
||||||
echo "[mkpkg] Packing $1.tar.xz ..."
|
echo "$GIT_HASH" > $PKG_NAME-$PKG_VERSION/VERSION
|
||||||
if [ ! -f "$1.tar.xz" ] ; then
|
|
||||||
tar cvJf "$1.tar.xz" "$1"
|
|
||||||
fi
|
|
||||||
rm -rf "$1"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# kodi
|
echo "cleaning sources..."
|
||||||
git_clone $GIT_REPO $BRANCH $DEST_DIR.git
|
rm -rf $PKG_NAME-$PKG_VERSION/.git
|
||||||
|
|
||||||
# kodi-platform
|
echo "seperating theme..."
|
||||||
REPO=$(cat $DEST_DIR.git/project/cmake/addons/depends/common/kodi-platform/kodi-platform.txt | awk '{print $2}')
|
rm -rf $PKG_NAME-theme-Confluence-$PKG_VERSION
|
||||||
GIT_HASH=$(cat $DEST_DIR.git/project/cmake/addons/depends/common/kodi-platform/kodi-platform.txt | awk '{print $3}')
|
mv $PKG_NAME-$PKG_VERSION/addons/skin.confluence $PKG_NAME-theme-Confluence-$PKG_VERSION
|
||||||
if [ ! -e kodi-platform-$GIT_HASH.tar.xz ] ; then
|
|
||||||
git_clone $REPO $BRANCH_FOR_ADDONS kodi-platform.git $GIT_HASH
|
|
||||||
copy_sources kodi-platform.git kodi-platform $GIT_HASH
|
|
||||||
package_sources kodi-platform-$GIT_HASH
|
|
||||||
else
|
|
||||||
echo "[mkpkg] kodi-platform-$GIT_HASH.tar.xz already exists ..."
|
|
||||||
fi
|
|
||||||
|
|
||||||
# addons
|
echo "packing sources..."
|
||||||
for addon in $DEST_DIR.git/project/cmake/addons/addons/*.* ; do
|
tar cvJf $PKG_NAME-$PKG_VERSION.tar.xz $PKG_NAME-$PKG_VERSION
|
||||||
PVR_ADDON=$(basename $addon)
|
tar cvJf $PKG_NAME-theme-Confluence-$PKG_VERSION.tar.xz $PKG_NAME-theme-Confluence-$PKG_VERSION
|
||||||
REPO=$(cat $DEST_DIR.git/project/cmake/addons/addons/$PVR_ADDON/$PVR_ADDON.txt | awk '{print $2}')
|
|
||||||
GIT_HASH=$(cat $DEST_DIR.git/project/cmake/addons/addons/$PVR_ADDON/$PVR_ADDON.txt | awk '{print $3}')
|
|
||||||
if [ ! -e $PVR_ADDON-$GIT_HASH.tar.xz ] ; then
|
|
||||||
git_clone $REPO $BRANCH_FOR_ADDONS $PVR_ADDON.git $GIT_HASH
|
|
||||||
copy_sources $PVR_ADDON.git $PVR_ADDON $GIT_HASH
|
|
||||||
package_sources $PVR_ADDON-$GIT_HASH
|
|
||||||
else
|
|
||||||
echo "[mkpkg] $PVR_ADDON-$GIT_HASH.tar.xz already exists ..."
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
cd $DEST_DIR.git
|
echo "remove temporary sourcedir..."
|
||||||
GIT_HASH=`git log -n1 --format=%h`
|
rm -rf $PKG_NAME-$PKG_VERSION
|
||||||
VERSION_MAJOR=$(grep ^VERSION_MAJOR version.txt | cut -d" " -f2)
|
rm -rf $PKG_NAME-theme-Confluence-$PKG_VERSION
|
||||||
VERSION_MINOR=$(grep ^VERSION_MINOR version.txt | cut -d" " -f2)
|
|
||||||
VERSION_TAG=$(grep ^VERSION_TAG version.txt | cut -d" " -f2 | tr A-Z a-z)
|
|
||||||
PKG_VERSION="$VERSION_MAJOR.$VERSION_MINOR-$VERSION_TAG-$GIT_HASH"
|
|
||||||
# hack: empty version tag on release builds:
|
|
||||||
if [ "$VERSION_TAG" = "version_tag" ] ; then
|
|
||||||
PKG_VERSION="$VERSION_MAJOR.$VERSION_MINOR-$GIT_HASH"
|
|
||||||
fi
|
|
||||||
echo $PKG_VERSION
|
|
||||||
cd ..
|
|
||||||
|
|
||||||
copy_sources $PKG_NAME-$BRANCH.git $PKG_NAME $PKG_VERSION
|
|
||||||
|
|
||||||
echo "[mkpkg] Seperating skin.confluence ..."
|
|
||||||
rm -rf $PKG_NAME-theme-Confluence-$PKG_VERSION
|
|
||||||
mv $PKG_NAME-$PKG_VERSION/addons/skin.confluence $PKG_NAME-theme-Confluence-$PKG_VERSION
|
|
||||||
|
|
||||||
package_sources $PKG_NAME-$PKG_VERSION
|
|
||||||
package_sources $PKG_NAME-theme-Confluence-$PKG_VERSION
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user