Skip to content

Commit

Permalink
fixing distribute task
Browse files Browse the repository at this point in the history
  • Loading branch information
gutomaia committed Mar 8, 2015
1 parent be1f00f commit 270b9c1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 157 deletions.
163 changes: 7 additions & 156 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,28 +1,7 @@
PLATFORM = $(shell uname)

PYTHON_VERSION = 2.7.3
PYWIN32_VERSION = 218
PYINSTALLER_VERSION = 2.0
SETUPTOOLS_VERSION=0.6c11

MSVCP90 = ${WINE_PATH}/Python27/msvcp90.dll
PYINSTALLER=tools/pyinstaller-${PYINSTALLER_VERSION}/pyinstaller.py
PYWIN32=pywin32-${PYWIN32_VERSION}.win32-py2.7.exe

WINE_PATH=~/.wine/drive_c

NSIS_PATH = ${WINE_PATH}/NSIS

MAKENSIS_EXE = ${NSIS_PATH}/makensis.exe

DOWNLOAD_PATH=deps

PYTHON_MODULES=nesasm

PYTHON_EXE=${WINE_PATH}/Python27/python.exe
EASYINSTALL_EXE=${WINE_PATH}/Python27/Scripts/easy_install.exe
PIP_EXE=${WINE_PATH}/Python27/Scripts/pip.exe

WGET = wget -q

OK=\033[32m[OK]\033[39m
Expand Down Expand Up @@ -69,140 +48,12 @@ report:
tdd:
${VIRTUALENV} tdaemon --ignore-dirs="build,dist,bin,site,pynes.egg-info,venv" --custom-args="-e image_test.py --with-notify --no-start-message"

deps/.done:
@echo "Creating dependencies dir: \c"
@mkdir -p deps
@touch $@
${CHECK}

tools/.done:
@echo "Creating tools dir: \c"
@mkdir -p tools
@touch $@
${CHECK}

deps/pyinstaller-${PYINSTALLER_VERSION}.zip: deps/.done
@echo "Downloading pyinstaller-${PYINSTALLER_VERSION}.zip: \c"
@cd deps && \
${WGET} http://sourceforge.net/projects/pyinstaller/files/${PYINSTALLER_VERSION}/pyinstaller-${PYINSTALLER_VERSION}.zip && \
cd .. && touch $@
${CHECK}

deps/python-${PYTHON_VERSION}.msi: deps/.done
@echo "Downloading python-${PYTHON_VERSION}.msi: \c"
@cd deps && \
${WGET} http://www.python.org/ftp/python/${PYTHON_VERSION}/python-${PYTHON_VERSION}.msi && \
cd .. && touch $@
${CHECK}

deps/${PYWIN32}: deps/.done
@echo "Downloading python-${PYTHON_VERSION}.msi: \c"
@cd deps && \
${WGET} http://downloads.sourceforge.net/project/pywin32/pywin32/Build\%20${PYWIN32_VERSION}/${PYWIN32} && \
touch ${PYWIN32}
${CHECK}


${PYTHON_EXE}: deps/python-${PYTHON_VERSION}.msi
@cd deps && \
msiexec /i python-2.7.3.msi /qb
@touch $@

${WINE_PATH}/Python27/msvcp90.dll: ${WINE_PATH}/windows/system32/msvcp90.dll
@cp $< $@

${WINE_PATH}/Python27/Scripts/pywin32_postinstall.py: ${PYTHON_EXE} deps/${PYWIN32}
@cd deps && \
echo wine deps/${PYWIN32}
@touch $@

deps/distribute_setup.py:
@echo "Downloading distribute_setup.py: \c"
@cd deps && \
${WGET} http://python-distribute.org/distribute_setup.py && \
cd .. && touch $@
${CHECK}

${EASYINSTALL_EXE}: ${PYTHON_EXE} deps/distribute_setup.py
cd deps && \
wine ${PYTHON_EXE} distribute_setup.py
@touch $@

${PIP_EXE}: ${PYTHON_EXE} ${EASYINSTALL_EXE}
wine ${EASYINSTALL_EXE} pip
@touch $@

${PYINSTALLER}: tools/.done deps/pyinstaller-2.0.zip
@echo "Unzipping PyInstaller ${PYINSTALLER_VERSION}: \c"
@cd tools && \
unzip -qq ../deps/pyinstaller-2.0.zip && \
cd .. && touch $@
${CHECK}

tools/env/bin/activate: tools/.done
virtualenv --no-site-packages --distribute tools/env
@touch $@

tools/requirements.windows.check: ${PIP_EXE} requirements.txt
wine ${PIP_EXE} install -r requirements.txt
@touch $@

dependencies_wine: ${PYTHON_EXE} ${PIP_EXE}


windows_binary_dependencies: ${WINE_PATH}/Python27/Scripts/pywin32_postinstall.py

dist/linux/pynes: build ${PYINSTALLER} tools/requirements.windows.check
@rm -rf build/pyi.linux
@rm -rf build/pyi.linux2
@rm -rf dist/linux
python ${PYINSTALLER} pynes.linux.spec
@touch $@

dist/windows/pynes.exe: ${PYINSTALLER} ${PYTHON_EXE} windows_binary_dependencies tools/requirements.windows.check
@rm -rf build/pyi.win32
@rm -rf dist/windows
wine ${PYTHON_EXE} ${PYINSTALLER} --onefile pynes.windows.spec
@touch $@

linux: dist/linux/pynes

windows: dist/windows/pynes.exe

dist: linux windows

deps/nsis-3.0a1-setup.exe:
@echo "Downloading NSIS \c"
@cd deps && \
${WGET} http://downloads.sourceforge.net/project/nsis/NSIS%203%20Pre-release/3.0a1/nsis-3.0a1-setup.exe
@touch "$@"
${CHECK}

${MAKENSIS_EXE}: deps/nsis-3.0a1-setup.exe
@echo "Installing NSIS \c"
@wine deps/nsis-3.0a1-setup.exe /S /D=C:\\NSIS
@touch "$@"
${CHECK}

nsis: ${MAKENSIS_EXE}
@wine ${MAKENSIS_EXE} installer.nsi

installer: nsis

ghpages: deploy download_deps
rm -rf /tmp/ghpages
mkdir -p /tmp/ghpages
cp -Rv static/* /tmp/ghpages
cp -Rv external/* /tmp/ghpages
cp -Rv lib/*.js /tmp/ghpages

cd /tmp/ghpages && \
git init && \
git add . && \
git commit -q -m "Automatic gh-pages"
cd /tmp/ghpages && \
git remote add remote [email protected]:gutomaia/nodeNES.git && \
git push --force remote +master:gh-pages
rm -rf /tmp/ghpages
dist: python_egg python_wheel

register:
${VIRTUALENV} python setup.py register -r pypi

distribute: dist
${VIRTUALENV} python setup.py sdist bdist_wheel upload -r pypi

.PHONY: clean linux windows dist nsis installer run report ghpages
File renamed without changes.
2 changes: 1 addition & 1 deletion requirements_test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ nose-notify==0.4.2
nose==1.3.3
pep8==1.5.7
tdaemon==0.1.1

wheel==0.24.0

0 comments on commit 270b9c1

Please sign in to comment.