From a9a1606f197a973cc713df67ad224486e0548e91 Mon Sep 17 00:00:00 2001 From: Leif <4603009@qq.com> Date: Thu, 3 Dec 2020 17:11:30 +0800 Subject: [PATCH] Delete build tool --- PPOCRLabel/build-tools/.gitignore | 12 ----- PPOCRLabel/build-tools/README.md | 35 ------------ PPOCRLabel/build-tools/build-for-macos.sh | 30 ----------- PPOCRLabel/build-tools/build-for-pypi.sh | 17 ------ PPOCRLabel/build-tools/build-ubuntu-binary.sh | 24 --------- .../build-tools/build-windows-binary.sh | 32 ----------- PPOCRLabel/build-tools/envsetup.sh | 53 ------------------- PPOCRLabel/build-tools/run-in-container.sh | 13 ----- 8 files changed, 216 deletions(-) delete mode 100644 PPOCRLabel/build-tools/.gitignore delete mode 100644 PPOCRLabel/build-tools/README.md delete mode 100644 PPOCRLabel/build-tools/build-for-macos.sh delete mode 100644 PPOCRLabel/build-tools/build-for-pypi.sh delete mode 100644 PPOCRLabel/build-tools/build-ubuntu-binary.sh delete mode 100644 PPOCRLabel/build-tools/build-windows-binary.sh delete mode 100644 PPOCRLabel/build-tools/envsetup.sh delete mode 100644 PPOCRLabel/build-tools/run-in-container.sh diff --git a/PPOCRLabel/build-tools/.gitignore b/PPOCRLabel/build-tools/.gitignore deleted file mode 100644 index e05bf6bf..00000000 --- a/PPOCRLabel/build-tools/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -*.spec -build -dist -pyinstaller -python-2.* -pywin32* -virtual-wine -venv_wine -PyQt4-* -lxml-* -windows_v* -linux_v* diff --git a/PPOCRLabel/build-tools/README.md b/PPOCRLabel/build-tools/README.md deleted file mode 100644 index 8e4cc5da..00000000 --- a/PPOCRLabel/build-tools/README.md +++ /dev/null @@ -1,35 +0,0 @@ -### Deploy to PyPI - -``` -cd [ROOT] -sh build-tools/build-for-pypi.sh -``` - -### Build for Ubuntu - -``` -cd build-tools -sh run-in-container.sh -sh envsetup.sh -sh build-ubuntu-binary.sh -``` - -### Build for Windows - -``` -cd build-tools -sh run-in-container.sh -sh envsetup.sh -sh build-windows-binary.sh -``` - -### Build for macOS High Sierra -``` -cd build-tools -./build-for-macos.sh -``` - -Note: If there are some problems, try to -``` -sudo rm -rf virtual-wne venv_wine -``` diff --git a/PPOCRLabel/build-tools/build-for-macos.sh b/PPOCRLabel/build-tools/build-for-macos.sh deleted file mode 100644 index dfe926b7..00000000 --- a/PPOCRLabel/build-tools/build-for-macos.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh - -brew install python@2 -pip install --upgrade virtualenv - -# clone labelimg source -rm -rf /tmp/labelImgSetup -mkdir /tmp/labelImgSetup -cd /tmp/labelImgSetup -curl https://codeload.github.com/tzutalin/labelImg/zip/master --output labelImg.zip -unzip labelImg.zip -rm labelImg.zip - -# setup python3 space -virtualenv --system-site-packages -p python3 /tmp/labelImgSetup/labelImg-py3 -source /tmp/labelImgSetup/labelImg-py3/bin/activate -cd labelImg-master - -# build labelImg app -pip install py2app -pip install PyQt5 lxml -make qt5py3 -rm -rf build dist -python setup.py py2app -A -mv "/tmp/labelImgSetup/labelImg-master/dist/labelImg.app" /Applications -# deactivate python3 -deactivate -cd ../ -rm -rf /tmp/labelImgSetup -echo 'DONE' diff --git a/PPOCRLabel/build-tools/build-for-pypi.sh b/PPOCRLabel/build-tools/build-for-pypi.sh deleted file mode 100644 index d5ad5c7c..00000000 --- a/PPOCRLabel/build-tools/build-for-pypi.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh -# Packaging and Release -docker run --workdir=$(pwd)/ --volume="/home/$USER:/home/$USER" tzutalin/py2qt4 /bin/sh -c 'make qt4py2; make test;sudo python setup.py sdist;sudo python setup.py install' - -while true; do - read -p "Do you wish to deploy this to PyPI(twine upload dist/* or pip install dist/*)?" yn - case $yn in - [Yy]* ) docker run -it --rm --workdir=$(pwd)/ --volume="/home/$USER:/home/$USER" tzutalin/py2qt4; break;; - [Nn]* ) exit;; - * ) echo "Please answer yes or no.";; - esac -done -# python setup.py register -# python setup.py sdist upload -# Net pypi: twine upload dist/* - -# Test before upladoing: pip install dist/labelImg.tar.gz diff --git a/PPOCRLabel/build-tools/build-ubuntu-binary.sh b/PPOCRLabel/build-tools/build-ubuntu-binary.sh deleted file mode 100644 index dbe53028..00000000 --- a/PPOCRLabel/build-tools/build-ubuntu-binary.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash -### Ubuntu use pyinstall v3.0 -THIS_SCRIPT_PATH=`readlink -f $0` -THIS_SCRIPT_DIR=`dirname ${THIS_SCRIPT_PATH}` -cd pyinstaller -git checkout v3.2 -cd ${THIS_SCRIPT_DIR} - -rm -r build -rm -r dist -rm labelImg.spec -python pyinstaller/pyinstaller.py --hidden-import=xml \ - --hidden-import=xml.etree \ - --hidden-import=xml.etree.ElementTree \ - --hidden-import=lxml.etree \ - -D -F -n labelImg -c "../labelImg.py" -p ../libs -p ../ - -FOLDER=$(git describe --abbrev=0 --tags) -FOLDER="linux_"$FOLDER -rm -rf "$FOLDER" -mkdir "$FOLDER" -cp dist/labelImg $FOLDER -cp -rf ../data $FOLDER/data -zip "$FOLDER.zip" -r $FOLDER diff --git a/PPOCRLabel/build-tools/build-windows-binary.sh b/PPOCRLabel/build-tools/build-windows-binary.sh deleted file mode 100644 index 566e88f9..00000000 --- a/PPOCRLabel/build-tools/build-windows-binary.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash -### Window requires pyinstall v2.1 -wine msiexec -i python-2.7.8.msi -wine pywin32-218.win32-py2.7.exe -wine PyQt4-4.11.4-gpl-Py2.7-Qt4.8.7-x32.exe -wine lxml-3.7.3.win32-py2.7.exe - -THIS_SCRIPT_PATH=`readlink -f $0` -THIS_SCRIPT_DIR=`dirname ${THIS_SCRIPT_PATH}` -cd pyinstaller -git checkout v2.1 -cd ${THIS_SCRIPT_DIR} -echo ${THIS_SCRIPT_DIR} - -#. venv_wine/bin/activate -rm -r build -rm -r dist -rm labelImg.spec - -wine c:/Python27/python.exe pyinstaller/pyinstaller.py --hidden-import=xml \ - --hidden-import=xml.etree \ - --hidden-import=xml.etree.ElementTree \ - --hidden-import=lxml.etree \ - -D -F -n labelImg -c "../labelImg.py" -p ../libs -p ../ - -FOLDER=$(git describe --abbrev=0 --tags) -FOLDER="windows_"$FOLDER -rm -rf "$FOLDER" -mkdir "$FOLDER" -cp dist/labelImg.exe $FOLDER -cp -rf ../data $FOLDER/data -zip "$FOLDER.zip" -r $FOLDER diff --git a/PPOCRLabel/build-tools/envsetup.sh b/PPOCRLabel/build-tools/envsetup.sh deleted file mode 100644 index 242b0c56..00000000 --- a/PPOCRLabel/build-tools/envsetup.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/sh - -THIS_SCRIPT_PATH=`readlink -f $0` -THIS_SCRIPT_DIR=`dirname ${THIS_SCRIPT_PATH}` -#OS Ubuntu 14.04 -### Common packages for linux/windows -if [ ! -e "pyinstaller" ]; then - git clone https://github.com/pyinstaller/pyinstaller - cd pyinstaller - git checkout v2.1 -b v2.1 - cd ${THIS_SCRIPT_DIR} -fi - -echo "Going to clone and download packages for building windows" -#Pacakges -#> pyinstaller (2.1) -#> wine (1.6.2) -#> virtual-wine (0.1) -#> python-2.7.8.msi -#> pywin32-218.win32-py2.7.exe - -## tool to install on Ubuntu -#$ sudo apt-get install wine - -### Clone a repo to create virtual wine env -if [ ! -e "virtual-wine" ]; then - git clone https://github.com/htgoebel/virtual-wine.git -fi - -apt-get install scons -### Create virtual env -rm -rf venv_wine -./virtual-wine/vwine-setup venv_wine -#### Active virutal env -. venv_wine/bin/activate - -### Use wine to install packages to virtual env -if [ ! -e "python-2.7.8.msi" ]; then - wget "https://www.python.org/ftp/python/2.7.8/python-2.7.8.msi" -fi - -if [ ! -e "pywin32-218.win32-py2.7.exe" ]; then - wget "http://nchc.dl.sourceforge.net/project/pywin32/pywin32/Build%20218/pywin32-218.win32-py2.7.exe" -fi - -if [ ! -e "PyQt4-4.11.4-gpl-Py2.7-Qt4.8.7-x32.exe" ]; then - wget "http://nchc.dl.sourceforge.net/project/pyqt/PyQt4/PyQt-4.11.4/PyQt4-4.11.4-gpl-Py2.7-Qt4.8.7-x32.exe" -fi - -if [ ! -e "lxml-3.7.3.win32-py2.7.exe" ]; then - wget "https://pypi.python.org/packages/a3/f6/a28c5cf63873f6c55a3eb7857b736379229b85ba918261d2e88cf886905e/lxml-3.7.3.win32-py2.7.exe#md5=a0f746355876aca4ca5371cb0f1d13ce" -fi - diff --git a/PPOCRLabel/build-tools/run-in-container.sh b/PPOCRLabel/build-tools/run-in-container.sh deleted file mode 100644 index 980699d6..00000000 --- a/PPOCRLabel/build-tools/run-in-container.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh -docker run -it \ - --user $(id -u) \ - -e DISPLAY=unix$DISPLAY \ - --workdir=$(pwd) \ - --volume="/home/$USER:/home/$USER" \ - --volume="/etc/group:/etc/group:ro" \ - --volume="/etc/passwd:/etc/passwd:ro" \ - --volume="/etc/shadow:/etc/shadow:ro" \ - --volume="/etc/sudoers.d:/etc/sudoers.d:ro" \ - -v /tmp/.X11-unix:/tmp/.X11-unix \ - tzutalin/py2qt4 -