Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
927 additions
and
533 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
#!/bin/bash | ||
set -e -x | ||
|
||
download_cache_curl() { | ||
fname="$1" | ||
key="$2" | ||
url_prefix="$3" | ||
|
||
if [ ! -f $key/$fname ]; then | ||
if [ ! -d $key ]; then | ||
mkdir "$key" | ||
fi | ||
curl -O -L "$url_prefix/$fname" | ||
cp "$fname" "$key" | ||
else | ||
cp "$key/$fname" . | ||
fi | ||
} | ||
|
||
download_cache_aria2() { | ||
fname="$1" | ||
key="$2" | ||
url_prefix="$3" | ||
|
||
if [ ! -f $key/$fname ]; then | ||
if [ ! -d $key ]; then | ||
mkdir "$key" | ||
fi | ||
/usr/local/aria2/bin/aria2c -x 10 "$url_prefix/$fname" | ||
cp "$fname" "$key" | ||
else | ||
cp "$key/$fname" . | ||
fi | ||
} | ||
|
||
install_kivy_test_run_sys_deps() { | ||
download_cache_curl "aria2-$ARIAL2-osx-darwin.dmg" "osx-cache" "https://github.com/aria2/aria2/releases/download/release-$ARIAL2" | ||
hdiutil attach aria2-$ARIAL2-osx-darwin.dmg | ||
sudo installer -package "/Volumes/aria2 $ARIAL2 Intel/aria2.pkg" -target / | ||
|
||
download_cache_curl "SDL2-$SDL2.dmg" "osx-cache" "https://www.libsdl.org/release" | ||
download_cache_curl "SDL2_image-$SDL2_IMAGE.dmg" "osx-cache" "https://www.libsdl.org/projects/SDL_image/release" | ||
download_cache_curl "SDL2_mixer-$SDL2_MIXER.dmg" "osx-cache" "https://www.libsdl.org/projects/SDL_mixer/release" | ||
download_cache_curl "SDL2_ttf-$SDL2_TTF.dmg" "osx-cache" "https://www.libsdl.org/projects/SDL_ttf/release" | ||
|
||
hdiutil attach SDL2-$SDL2.dmg | ||
sudo cp -a /Volumes/SDL2/SDL2.framework /Library/Frameworks/ | ||
hdiutil attach SDL2_image-$SDL2_IMAGE.dmg | ||
sudo cp -a /Volumes/SDL2_image/SDL2_image.framework /Library/Frameworks/ | ||
hdiutil attach SDL2_ttf-$SDL2_TTF.dmg | ||
sudo cp -a /Volumes/SDL2_ttf/SDL2_ttf.framework /Library/Frameworks/ | ||
hdiutil attach SDL2_mixer-$SDL2_MIXER.dmg | ||
sudo cp -a /Volumes/SDL2_mixer/SDL2_mixer.framework /Library/Frameworks/ | ||
|
||
download_cache_aria2 "gstreamer-1.0-$GSTREAMER-x86_64.pkg" "osx-cache" "https://gstreamer.freedesktop.org/data/pkg/osx/$GSTREAMER" | ||
download_cache_aria2 "gstreamer-1.0-devel-$GSTREAMER-x86_64.pkg" "osx-cache-gst-devel" "https://gstreamer.freedesktop.org/data/pkg/osx/$GSTREAMER" | ||
|
||
sudo installer -package gstreamer-1.0-$GSTREAMER-x86_64.pkg -target / | ||
sudo installer -package gstreamer-1.0-devel-$GSTREAMER-x86_64.pkg -target / | ||
} | ||
|
||
install_platypus() { | ||
download_cache_curl "platypus$PLATYPUS.zip" "osx-cache" "http://www.sveinbjorn.org/files/software/platypus" | ||
|
||
unzip platypus$PLATYPUS.zip | ||
gunzip Platypus.app/Contents/Resources/platypus_clt.gz | ||
gunzip Platypus.app/Contents/Resources/ScriptExec.gz | ||
|
||
mkdir -p /usr/local/bin | ||
mkdir -p /usr/local/share/platypus | ||
cp Platypus.app/Contents/Resources/platypus_clt /usr/local/bin/platypus | ||
cp Platypus.app/Contents/Resources/ScriptExec /usr/local/share/platypus/ScriptExec | ||
cp -a Platypus.app/Contents/Resources/MainMenu.nib /usr/local/share/platypus/MainMenu.nib | ||
chmod -R 755 /usr/local/share/platypus | ||
} | ||
|
||
generate_osx_wheels() { | ||
python3 -m pip install git+http://github.com/tito/osxrelocator | ||
python3 -m pip install --upgrade delocate | ||
python3 setup.py bdist_wheel | ||
|
||
delocate-wheel dist/*.whl | ||
zip_dir="$(basename dist/*.whl .whl)" | ||
unzip dist/*.whl -d dist/$zip_dir | ||
rm dist/$zip_dir/kivy/.dylibs/libg* | ||
rm dist/$zip_dir/kivy/.dylibs/GStreamer | ||
|
||
cp /Library/Frameworks/SDL2_mixer.framework/Versions/A/Frameworks/FLAC.framework/Versions/A/FLAC dist/$zip_dir/kivy/.dylibs/ | ||
cp /Library/Frameworks/SDL2_ttf.framework/Versions/A/Frameworks/FreeType.framework/Versions/A/FreeType dist/$zip_dir/kivy/.dylibs/ | ||
cp /Library/Frameworks/SDL2_mixer.framework/Versions/A/Frameworks/Ogg.framework/Versions/A/Ogg dist/$zip_dir/kivy/.dylibs/ | ||
cp /Library/Frameworks/SDL2_mixer.framework/Versions/A/Frameworks/Vorbis.framework/Versions/A/Vorbis dist/$zip_dir/kivy/.dylibs/ | ||
cp /Library/Frameworks/SDL2_mixer.framework/Versions/A/Frameworks/modplug.framework/Versions/A/modplug dist/$zip_dir/kivy/.dylibs/ | ||
cp /Library/Frameworks/SDL2_mixer.framework/Versions/A/Frameworks/mpg123.framework/Versions/A/mpg123 dist/$zip_dir/kivy/.dylibs/ | ||
|
||
python3 -m osxrelocator.__init__ dist/$zip_dir/kivy/.dylibs @rpath/SDL2.framework/Versions/A/SDL2 @loader_path/SDL2 | ||
python3 -m osxrelocator.__init__ dist/$zip_dir/kivy/.dylibs @rpath/FLAC.framework/Versions/A/FLAC @loader_path/FLAC | ||
python3 -m osxrelocator.__init__ dist/$zip_dir/kivy/.dylibs @rpath/modplug.framework/Versions/A/modplug @loader_path/modplug | ||
python3 -m osxrelocator.__init__ dist/$zip_dir/kivy/.dylibs @rpath/mpg123.framework/Versions/A/mpg123 @loader_path/mpg123 | ||
python3 -m osxrelocator.__init__ dist/$zip_dir/kivy/.dylibs @rpath/FreeType.framework/Versions/A/FreeType @loader_path/FreeType | ||
python3 -m osxrelocator.__init__ dist/$zip_dir/kivy/.dylibs @rpath/webp.framework/Versions/A/webp @loader_path/webp | ||
python3 -m osxrelocator.__init__ dist/$zip_dir/kivy/.dylibs @rpath/Vorbis.framework/Versions/A/Vorbis @loader_path/Vorbis | ||
python3 -m osxrelocator.__init__ dist/$zip_dir/kivy/.dylibs @rpath/../../../../SDL2.framework/Versions/A/SDL2 @loader_path/SDL2 | ||
python3 -m osxrelocator.__init__ dist/$zip_dir/kivy/.dylibs @rpath/Ogg.framework/Versions/A/Ogg @loader_path/Ogg | ||
|
||
rm dist/$zip_dir.whl | ||
pushd dist | ||
python3 -c "from delocate import delocating; delocating.dir2zip('$zip_dir', '$zip_dir.whl')" | ||
rm -rf $zip_dir | ||
popd | ||
|
||
delocate-addplat --rm-orig -x 10_9 -x 10_10 dist/*.whl | ||
} | ||
|
||
generate_osx_app() { | ||
py_version="$1" | ||
branch_name="$2" | ||
git clone https://github.com/kivy/kivy-sdk-packager | ||
pushd kivy-sdk-packager/osx | ||
app_date=$(python3 -c "from datetime import datetime; print(datetime.utcnow().strftime('%Y%m%d'))") | ||
git_tag=$(git rev-parse --short HEAD) | ||
|
||
./create-osx-bundle.sh "$branch_name" "$py_version" | ||
app_ver=$(KIVY_NO_CONSOLELOG=1 Kivy.app/Contents/Resources/script -c 'import kivy; print(kivy.__version__)') | ||
mv Kivy.app Kivy3.app | ||
./create-osx-dmg.sh Kivy3.app | ||
mkdir app | ||
cp Kivy3.dmg "app/Kivy-$app_ver-python$py_version.dmg" | ||
mv Kivy3.dmg "app/Kivy-$app_ver-$git_tag-$app_date-python$py_version.dmg" | ||
popd | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
|
||
export ARIAL2=1.35.0 | ||
export SDL2=2.0.10 | ||
export SDL2_IMAGE=2.0.5 | ||
export SDL2_MIXER=2.0.4 | ||
export SDL2_TTF=2.0.15 | ||
export GSTREAMER=1.12.4 | ||
export PLATYPUS=5.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
#!/bin/bash | ||
set -e -x | ||
|
||
install_kivy_test_run_apt_deps() { | ||
sudo apt-get update | ||
sudo apt-get -y install libsdl2-dev libsdl2-ttf-dev libsdl2-image-dev libsdl2-mixer-dev | ||
sudo apt-get -y install libgstreamer1.0-dev gstreamer1.0-alsa gstreamer1.0-plugins-base | ||
sudo apt-get -y install libsmpeg-dev libswscale-dev libavformat-dev libavcodec-dev libjpeg-dev libtiff5-dev libx11-dev libmtdev-dev | ||
sudo apt-get -y install build-essential libgl1-mesa-dev libgles2-mesa-dev | ||
sudo apt-get -y install xvfb pulseaudio xsel | ||
} | ||
|
||
install_python() { | ||
sudo apt-get -y install python3 python3-dev python3-setuptools | ||
} | ||
|
||
install_kivy_test_run_pip_deps() { | ||
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py | ||
python3 get-pip.py --user | ||
|
||
python3 -m pip install --upgrade pip setuptools wheel | ||
CYTHON_INSTALL=$( | ||
KIVY_NO_CONSOLELOG=1 python3 -c \ | ||
"from kivy.tools.packaging.cython_cfg import get_cython_versions; print(get_cython_versions()[0])" \ | ||
--config "kivy:log_level:error" | ||
) | ||
python3 -m pip install -I "$CYTHON_INSTALL" coveralls | ||
} | ||
|
||
prepare_env_for_unittest() { | ||
/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background \ | ||
--exec /usr/bin/Xvfb -- :99 -screen 0 1280x720x24 -ac +extension GLX | ||
} | ||
|
||
install_kivy() { | ||
path="$(pwd)" | ||
ln -s "$path" ~/base_kivy | ||
cd ~/base_kivy | ||
python3 -m pip install -e "$(pwd)[dev,full]" | ||
cd "$path" | ||
} | ||
|
||
test_kivy() { | ||
rm -rf kivy/tests/build || true | ||
KIVY_NO_ARGS=1 python3 -m pytest --cov=kivy --cov-report term --cov-branch "$(pwd)/kivy/tests" | ||
} | ||
|
||
upload_coveralls() { | ||
python3 -m coveralls | ||
} | ||
|
||
validate_pep8() { | ||
make style | ||
} | ||
|
||
generate_docs() { | ||
make html | ||
} | ||
|
||
upload_docs_to_server() { | ||
versions=$1 | ||
branch=$2 | ||
ip=$3 | ||
|
||
if [ ! -d ~/.ssh ]; then | ||
mkdir ~/.ssh | ||
fi | ||
printf "%s" "$UBUNTU_UPLOAD_KEY" > ~/.ssh/id_rsa | ||
chmod 600 ~/.ssh/id_rsa | ||
echo -e "Host $ip\n\tStrictHostKeyChecking no\n" >>~/.ssh/config | ||
|
||
for version in $versions; do | ||
if [ "$version" == "${branch}" ]; then | ||
echo "[$(echo $versions | tr ' ' ', ' | sed -s 's/\([^,]\+\)/"\1"/g')]" > versions.json | ||
rsync --force -e "ssh -p 2457" versions.json root@$ip:/web/doc/ | ||
rsync --delete --force -r -e "ssh -p 2457" ./doc/build/html/ root@$ip:/web/doc/$version | ||
fi | ||
done | ||
} | ||
|
||
generate_manylinux2010_wheels() { | ||
image=$1 | ||
|
||
mkdir dist | ||
chmod +x .ci/build-wheels-linux.sh | ||
docker run --rm -v "$(pwd):/io" "$image" "/io/.ci/build-wheels-linux.sh" | ||
sudo rm dist/*-linux* | ||
} | ||
|
||
rename_wheels() { | ||
wheel_date=$(python3 -c "from datetime import datetime; print(datetime.utcnow().strftime('%Y%m%d'))") | ||
echo "wheel_date=$wheel_date" | ||
git_tag=$(git rev-parse --short HEAD) | ||
echo "git_tag=$git_tag" | ||
tag_name=$(KIVY_NO_CONSOLELOG=1 python3 \ | ||
-c "import kivy; _, tag, n = kivy.parse_kivy_version(kivy.__version__); print(tag + n) if n is not None else print(tag or 'something')" \ | ||
--config "kivy:log_level:error") | ||
echo "tag_name=$tag_name" | ||
wheel_name="$tag_name.$wheel_date.$git_tag-" | ||
echo "wheel_name=$wheel_name" | ||
|
||
ls dist/ | ||
for name in dist/*.whl; do | ||
new_name="${name/$tag_name-/$wheel_name}" | ||
if [ ! -f "$new_name" ]; then | ||
cp -n "$name" "$new_name" | ||
fi | ||
done | ||
ls dist/ | ||
} | ||
|
||
upload_file_to_server() { | ||
ip="$1" | ||
server_path="$2" | ||
file_pat=${3:-*.whl} | ||
file_path=${4:-dist} | ||
|
||
if [ ! -d ~/.ssh ]; then | ||
mkdir ~/.ssh | ||
fi | ||
|
||
printf "%s" "$UBUNTU_UPLOAD_KEY" > ~/.ssh/id_rsa | ||
chmod 600 ~/.ssh/id_rsa | ||
|
||
echo -e "Host $ip\n\tStrictHostKeyChecking no\n" >>~/.ssh/config | ||
rsync -avh -e "ssh -p 2458" --include="*/" --include="$file_pat" --exclude="*" "$file_path/" "root@$ip:/web/downloads/ci/$server_path" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/usr/bin/env bash | ||
pacman -S --noconfirm git rsync openssl | ||
|
||
if [ ! -d ~/.ssh ]; then | ||
mkdir ~/.ssh | ||
fi | ||
printf "%s" "$UBUNTU_UPLOAD_KEY" > ~/.ssh/id_rsa | ||
chmod 600 ~/.ssh/id_rsa | ||
|
||
echo -e "Host $1\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config | ||
echo "copying $3 from $2 to root@$1:/web/downloads/$4" | ||
rsync -avh -e "ssh -p 2458" --include="*/" --include="$3" --exclude="*" "$2/" "root@$1:/web/downloads/$4" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
function Generate-sdist { | ||
python setup.py sdist --formats=gztar | ||
python setup.py bdist_wheel --build_examples --universal | ||
} | ||
|
||
function Generate-windows-wheels { | ||
python setup.py bdist_wheel | ||
} | ||
|
||
function Rename-windows-wheels { | ||
# Set new wheel name, keep default if release (tag) | ||
# release: Kivy-X.Y.Z-cpAB-cpABm-ARCH.whl (Kivy_examples-X.Y.Z-py2.py3-none-any.whl) | ||
# nightly: Kivy-X.Y.Z.dev0-cpAB-cpABm-ARCH.whl (Kivy_examples-X.Y.Z.dev0-py2.py3-none-any.whl) | ||
# archive: Kivy-X.Y.Z.dev0.YYYYMMDD.githash-cpAB-cpABm-ARCH.whl (Kivy_examples-X.Y.Z.dev0.YYYYMMDD.githash-py2.py3-none-any.whl) | ||
|
||
$WHEEL_DATE = python -c "from datetime import datetime;print(datetime.utcnow().strftime('%Y%m%d'))" | ||
echo "Wheel date is: $WHEEL_DATE" | ||
$GIT_TAG = git rev-parse --short HEAD | ||
echo "Git tag is: $GIT_TAG" | ||
# powershell interprets writing to stderr as an error, so only raise error if the return code is none-zero | ||
try { | ||
python -c "import kivy" --config "kivy:log_level:error" | ||
} catch { | ||
if ($LastExitCode -ne 0) { | ||
throw $_ | ||
} else { | ||
echo $_ | ||
} | ||
} | ||
$WHEEL_VERSION = python -c "import kivy;print(kivy.__version__)" --config "kivy:log_level:error" | ||
echo "Kivy version is: $WHEEL_VERSION" | ||
$TAG_NAME = python -c "import kivy; _, tag, n = kivy.parse_kivy_version(kivy.__version__); print(tag + n) if n is not None else print(tag or 'something')" --config "kivy:log_level:error" | ||
echo "Tag is: $TAG_NAME" | ||
$WHEEL_NAME = "$TAG_NAME.$WHEEL_DATE`.$GIT_TAG-" | ||
echo "New wheel name is: $WHEEL_NAME" | ||
|
||
$files = Get-ChildItem dist *.whl -Name | ||
foreach ($WHEEL_DEFAULT in $files){ | ||
$WHEEL_NIGHTLY = $WHEEL_DEFAULT.Replace("$TAG_NAME-", $WHEEL_NAME) | ||
echo "Copying from default $WHEEL_DEFAULT to nightly $WHEEL_NIGHTLY" | ||
Copy-Item "dist\$WHEEL_DEFAULT" "dist\$WHEEL_NIGHTLY" | ||
} | ||
} | ||
|
||
function Upload-windows-wheels-to-server($ip) { | ||
echo "Uploading Kivy*:" | ||
dir dist | ||
C:\tools\msys64\usr\bin\bash --login -c ".ci/windows-server-upload.sh $ip dist 'Kivy*' ci/win/kivy/" | ||
} | ||
|
||
function Install-kivy-test-run-win-deps { | ||
|
||
} | ||
|
||
function Install-kivy-test-run-pip-deps { | ||
python -m pip install pip wheel setuptools cython --upgrade | ||
# workaround for https://github.com/pyinstaller/pyinstaller/issues/4265 until next release | ||
python -m pip install https://github.com/pyinstaller/pyinstaller/archive/develop.zip | ||
} | ||
|
||
function Install-kivy { | ||
$old=(pwd).Path | ||
cmd /c mklink /d "$HOME\kivy" "$old" | ||
cd "$HOME\kivy" | ||
python -m pip install -e .[win_full,win_full_src,dev] | ||
cd "$old" | ||
} | ||
|
||
function Test-kivy { | ||
python -m pytest --cov=kivy --cov-report term --cov-branch "$(pwd)/kivy/tests" | ||
} |
Oops, something went wrong.