From 7db4d6c0cb0c9c70d4cdd7cadca479e2b9a10626 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20H=C3=B6rist?= Date: Tue, 6 Dec 2016 12:50:00 +0100 Subject: [PATCH 1/4] Update files for appveyor Windows build --- appveyor.yml | 42 +++++++++++++++++++++++++----------------- build.bat | 19 ++++++++++--------- download.ps1 | 2 +- setup_win32.py | 21 ++++----------------- src/gajim.py | 2 +- 5 files changed, 41 insertions(+), 45 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 0a97c0aa9..fc9ce0ce6 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -4,38 +4,46 @@ environment: - PYTHON: "C:\\Python34" +branches: + only: + - master + +clone_depth: 1 install: - - hg clone http://hg.gajim.org/gajim-plugins c:\projects\gajim-plugins - - hg clone http://hg.gajim.org/python-nbxmpp c:\projects\python-nbxmpp + - git clone --depth=1 --branch=gtk3 https://dev.gajim.org/gajim/gajim-plugins.git c:\projects\gajim-plugins + - git clone https://dev.gajim.org/gajim/python-nbxmpp.git c:\projects\python-nbxmpp - cd c:\\projects\\python-nbxmpp\\ - - python setup.py install + - "%PYTHON%\\python.exe setup.py install" - ps: c:\\projects\\gajim\\download.ps1 - set PATH=C:\\MinGW\\bin;C:\\Program Files (x86)\\gettext-iconv\\bin;%PATH% - "%PYTHON%\\python.exe -m pip install --upgrade pip" - "%PYTHON%\\python.exe -m pip install protobuf" - ps: Add-Content C:\Python34\Lib\site-packages\google\__init__.py " " - - "%PYTHON%\\python.exe -m pip install pycrypto" + - "%PYTHON%\\python.exe -m pip install pycryptodome" - "%PYTHON%\\python.exe -m pip install cx_freeze" - "%PYTHON%\\python.exe -m pip install pypiwin32" - "%PYTHON%\\python.exe -m pip install pyopenssl" - - "%PYTHON%\\python.exe -m pip install --global-option=build_ext --global-option --compiler=mingw32 python-axolotl" + - "%PYTHON%\\python.exe -m pip install --no-dependencies python-axolotl" + - "%PYTHON%\\python.exe -m pip install --global-option=build_ext --global-option --compiler=mingw32 python-axolotl-curve25519" - cd c:\\projects\\gajim\\ - - build.bat + - xcopy . ..\gajim_built /e /i + - cd .. + - cd gajim_built + - xcopy ..\gajim-plugins\plugin_installer plugins\plugin_installer /e /i + + - cmd: for %%l in (po\*.po) do mkdir po\%%~nl & mkdir po\%%~nl\LC_MESSAGES & msgfmt -o po\%%~nl\LC_MESSAGES\gajim.mo %%l + + - "%PYTHON%\\python.exe setup_win32.py build_exe" + - move build\exe.win32-3.4 . + - rmdir build + - rename exe.win32-3.4 build + + - ps: '& "C:\Program Files (x86)\NSIS\makensis.exe" gajim.nsi' build: off -# artifacts: -# - path: gajim_built\Gajim.exe -# - name: MyApp - on_finish: - - ps: Push-AppveyorArtifact gajim_built\Gajim.exe -FileName "Gajim-16.10.1-$($env:APPVEYOR_REPO_COMMIT).exe" - - -#on_success: -# You can use this step to upload your artifacts to a public website. -# See Appveyor's documentation for more details. Or you can simply -# access your wheels from the Appveyor "artifacts" tab for your build. \ No newline at end of file + - ps: Push-AppveyorArtifact Gajim.exe -FileName "Gajim-16.10.1-$($env:APPVEYOR_REPO_COMMIT).exe" \ No newline at end of file diff --git a/build.bat b/build.bat index 83027adfe..7b4578fd2 100644 --- a/build.bat +++ b/build.bat @@ -1,25 +1,26 @@ -rmdir /S /Q gajim_built +rmdir /S /Q ..\gajim_built -mkdir gajim_built -hg archive gajim_built -xcopy ..\gajim-plugins\plugin_installer gajim_built\plugins\plugin_installer /e /i +xcopy . ..\gajim_built /e /i +cd .. +cd gajim_built + +xcopy ..\gajim-plugins\plugin_installer plugins\plugin_installer /e /i rem copy C:\Python34\Lib\site-packages\gnome\msgfmt.exe gajim_built rem copy C:\Windows\System32\msvcr100.dll gajim_built -cd gajim_built - for %%l in (po\*.po) do mkdir po\%%~nl & mkdir po\%%~nl\LC_MESSAGES & msgfmt -o po\%%~nl\LC_MESSAGES\gajim.mo %%l -c:\python34\python.exe setup_win32.py build_exe +"c:\python34\python.exe" setup_win32.py build_exe move build\exe.win32-3.4 . rmdir build rename exe.win32-3.4 build -rem REM for snarl plugin rem xcopy ..\win32com build\win32com /e /i "C:\Program Files (x86)\NSIS\makensis" gajim.nsi -cd .. \ No newline at end of file +cd .. + +pause \ No newline at end of file diff --git a/download.ps1 b/download.ps1 index b5a4eeefa..41e6befd2 100644 --- a/download.ps1 +++ b/download.ps1 @@ -1,6 +1,6 @@ # Download the file to a specific location $clnt = new-object System.Net.WebClient -$url = "http://www.funkroom.net/files/site-packages.zip" +$url = "https://gajim.org/downloads/snap/win/build/site-packages.zip" $file = "c:\site-packages.zip" $clnt.DownloadFile($url,$file) diff --git a/setup_win32.py b/setup_win32.py index 576b2033e..472bcb9eb 100644 --- a/setup_win32.py +++ b/setup_win32.py @@ -94,15 +94,6 @@ GTK_LIBS = { 'gupnp-dlna-2.0', 'icons', 'ssl', 'themes', 'xml'] } - -# share 'gobject-introspection-1.0' -# , 'enchant' 'gir-1.0', - - -#lib 'gobject-introspection' -# 'aspell-0.60', 'enchant', 'gst-plugins-bad', - - # Create the list of includes as cx_freeze likes INCLUDE_FILES = [] for dll in MISSING_DLL: @@ -124,18 +115,13 @@ for language in next(os.walk('po'))[1]: OPTIONS = { 'build_exe': { - 'compressed': False, - 'includes': ['gi', 'Crypto.PublicKey.DSA', 'Crypto.Hash.HMAC', - 'numbers', 'win32com.client', 'win32com.server', - 'cryptography', 'pkg_resources'], + 'includes': ['gi', 'numbers', 'win32com.client', 'win32com.server'], 'packages': ['gi', 'cffi', 'cryptography', 'google', 'axolotl', - 'pkg_resources'], - 'base': 'Win32GUI', + 'pkg_resources', 'Crypto', 'pycparser'], 'include_files': INCLUDE_FILES, } } - setup( name='Gajim', version='0.16.10', @@ -145,5 +131,6 @@ setup( download_url='http://gajim.org/downloads.php', license='GPL', options=OPTIONS, - executables=[Executable('src/gajim.py', icon='data/pixmaps/gajim.ico')], + executables=[Executable('src/gajim.py', icon='data/pixmaps/gajim.ico', + base='Win32GUI')], ) diff --git a/src/gajim.py b/src/gajim.py index 530432949..bb733dfa7 100644 --- a/src/gajim.py +++ b/src/gajim.py @@ -498,7 +498,7 @@ atexit.register(on_exit) from gui_interface import Interface -if __name__ == '__main__': +if __name__.endswith('__main__'): def sigint_cb(num, stack): sys.exit(5) # ^C exits the application normally to delete pid file From 80e0f8a42586ab293f9c0112b260d9c170491ac5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20H=C3=B6rist?= Date: Fri, 9 Dec 2016 18:16:06 +0100 Subject: [PATCH 2/4] Add .gitignore --- .hgignore => .gitignore | 1 + 1 file changed, 1 insertion(+) rename .hgignore => .gitignore (94%) diff --git a/.hgignore b/.gitignore similarity index 94% rename from .hgignore rename to .gitignore index bca52e545..279cdba58 100644 --- a/.hgignore +++ b/.gitignore @@ -16,6 +16,7 @@ po/POTFILES po/stamp-it stamp-h1 Makefile +__pycache__/ syntax: regexp ^config\.* From acc5baf3537cae1ac8e60ef18e04e28105a5b7ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20H=C3=B6rist?= Date: Fri, 9 Dec 2016 18:17:43 +0100 Subject: [PATCH 3/4] Update AUTHORS --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index 7f4816bae..d8c713c33 100644 --- a/AUTHORS +++ b/AUTHORS @@ -3,6 +3,7 @@ CURRENT DEVELOPERS: Alexander Cherniuk (ts33kr AT gmail.com) Yann Leboulanger (asterix AT lagaule.org) Jonathan Schleifer (js-gajim AT webkeks.org) +Philipp Hörist (philipp AT hoerist.com) PAST DEVELOPERS: From fc0be965f5a2813e14df4f2bd7504c9883490330 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20H=C3=B6rist?= Date: Fri, 9 Dec 2016 18:19:39 +0100 Subject: [PATCH 4/4] Remove demandimport --- src/gajim.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/gajim.py b/src/gajim.py index bb733dfa7..ac068c7be 100644 --- a/src/gajim.py +++ b/src/gajim.py @@ -74,14 +74,6 @@ if not HAS_NBXMPP: print('Gajim needs python-nbxmpp >= %s to run. Quiting...' % MIN_NBXMPP_VER) sys.exit() -#from common import demandimport -#demandimport.enable() -#demandimport.ignore += ['GObject._gobject', 'libasyncns', 'i18n', -# 'logging.NullHandler', 'dbus.service', 'OpenSSL.SSL', 'OpenSSL.crypto', -# 'common.sleepy', 'DLFCN', 'dl', 'xml.sax', 'xml.sax.handler', 'ic', -# 'Crypto.PublicKey', 'IPython', 'contextlib', 'imp', 'monotonic', -# 'gtkexcepthook', 'libxml2', 'libxml2mod'] - if os.name == 'nt': import locale import gettext