Commit 06a477da authored by Yann Leboulanger's avatar Yann Leboulanger

ability to compite the installer for gtk3 version

parent b353a072
......@@ -5,35 +5,20 @@ hg archive gajim_built
xcopy ..\gajim-plugins\plugin_installer gajim_built\plugins\plugin_installer /e /i
copy msgfmt.exe gajim_built
copy gettextsrc.dll gajim_built
copy gettextlib.dll gajim_built
copy msvcr90.dll gajim_built
copy msvcr100.dll gajim_built
cd gajim_built
REM for libglade-2.0.0.dll
PATH=..\src\gtk\bin;%PATH%
c:\python27\python.exe setup_win32.py build_exe
for %%l in (po\*.po) do mkdir po\%%~nl & mkdir po\%%~nl\LC_MESSAGES & msgfmt -o po\%%~nl\LC_MESSAGES\gajim.mo %%l
move build\exe.win32-2.7 .
rename exe.win32-2.7 bin
c:\python34\python.exe setup_win32.py build_exe
copy ..\LIBEAY32.dll bin
copy ..\SSLEAY32.dll bin
move build\exe.win32-3.4 .
rmdir build
rename exe.win32-3.4 build
REM for snarl plugin
xcopy ..\win32com bin\win32com /e /i
mkdir bin\gtk
cd ../src/gtk
hg archive ..\..\gajim_built\bin\gtk
cd ../../gajim_built/
REM for msgfmt
PATH=bin\gtk\bin;%PATH%
for %%l in (po\*.po) do mkdir po\%%~nl & mkdir po\%%~nl\LC_MESSAGES & msgfmt -o po\%%~nl\LC_MESSAGES\gajim.mo %%l
xcopy ..\win32com build\win32com /e /i
"C:\Program Files (x86)\NSIS\makensis" gajim.nsi
......
This diff is collapsed.
cd src
gajim.py
python gajim.py
cd ..
......@@ -23,41 +23,120 @@ from cx_Freeze import setup, Executable
import glob
import sys
import os
import site
site_dir = site.getsitepackages()[1]
include_dll_path = os.path.join(site_dir, "gnome")
sys.path.append('src')
# Use local gtk folder instead of the one in PATH that is not latest gtk
if 'gtk' in os.listdir('.'):
sys.path.append('gtk/bin')
# Collect the list of missing dll when cx_freeze builds the app
missing_dll = ['libgtk-3-0.dll',
'libgdk-3-0.dll',
'libatk-1.0-0.dll',
'libcairo-gobject-2.dll',
'libgdk_pixbuf-2.0-0.dll',
'libjpeg-8.dll',
'libpango-1.0-0.dll',
'libpangocairo-1.0-0.dll',
'libpangoft2-1.0-0.dll',
'libpangowin32-1.0-0.dll',
'libgnutls-26.dll',
'libp11-kit-0.dll',
'libaerial-0.dll',
'libgstrtp-1.0-0.dll',
'libcurl-4.dll',
'libgstrtsp-1.0-0.dll',
'libdb-4.8.dll',
'libgstrtspserver-1.0-0.dll',
'libfarstream-0.2-2.dll',
'libgstsdp-1.0-0.dll',
'libfftw3.dll',
'libgsttag-1.0-0.dll',
'libfluidsynth-1.dll',
'libgsturidownloader-1.0-0.dll',
'libgraphene-1.0-0.dll',
'libgstvalidate-1.0-0.dll',
'libgssdp-1.0-3.dll',
'libgstvalidate-default-overrides-1.0-0.dll',
'libgstallocators-1.0-0.dll',
'libgstvideo-1.0-0.dll',
'libgstapp-1.0-0.dll',
'libgupnp-1.0-4.dll',
'libgstaudio-1.0-0.dll',
'libgupnp-igd-1.0-4.dll',
'libgstbadbase-1.0-0.dll',
'libidn-11.dll',
'libgstbadvideo-1.0-0.dll',
'libjack.dll',
'libgstbase-1.0-0.dll',
'libjasper-1.dll',
'libgstbasecamerabinsrc-1.0-0.dll',
'libnice-10.dll',
'libgstcheck-1.0-0.dll',
'libnotify-4.dll',
'libgstcodecparsers-1.0-0.dll',
'libopenexr-2.dll',
'libgstcontroller-1.0-0.dll',
'libopenjp2.dll',
'libgstfft-1.0-0.dll',
'liborc-0.4-0.dll',
'libgstgl-1.0-0.dll',
'liborc-test-0.4-0.dll',
'libgstinsertbin-1.0-0.dll',
'libproxy.dll',
'libgstmpegts-1.0-0.dll',
'librsvg-2-2.dll',
'libgstnet-1.0-0.dll',
'libsoup-2.4-1.dll',
'libgstpbutils-1.0-0.dll',
'libsqlite3-0.dll',
'libgstphotography-1.0-0.dll',
'libvisual-0.4-0.dll',
'libgstreamer-1.0-0.dll',
'libwebp-5.dll',
'libgstriff-1.0-0.dll',
]
# We need to add all the libraries too (for themes, etc..)
gtk_libs = {
'etc': ['dbus-1', 'fonts', 'gtk-3.0', 'pango'],
'lib': ['aspell-0.60', 'enchant', 'farstream-0.2', 'gdbus-2.0', 'gdk-pixbuf-2.0', 'gio', 'girepository-1.0', 'gobject-introspection', 'gstreamer-1.0', 'gtk-3.0', 'libcanberra-0.30'],
'share': ['dbus-1', 'enchant', 'farstream', 'fonts', 'gir-1.0', 'glib-2.0', 'gobject-introspection-1.0', 'gst-plugins-bad', 'gst-plugins-base', 'gstreamer-1.0', 'gupnp-av', 'gupnp-dlna-2.0', 'icons', 'ssl', 'themes', 'xml'],
}
# Create the list of includes as cx_freeze likes
include_files = []
for dll in missing_dll:
include_files.append((os.path.join(include_dll_path, dll), dll))
# Let's add gtk libraries folders and files
for folder in gtk_libs:
for lib in gtk_libs[folder]:
folder_lib = os.path.join(folder, lib)
include_files.append((os.path.join(include_dll_path, folder_lib), folder_lib))
# Let's add gtk locales that we support in Gajim
for language in next(os.walk('po'))[1]:
target_dir = os.path.join('share', 'locale', language)
language_dir = os.path.join(include_dll_path, target_dir)
if os.path.isdir(language_dir):
include_files.append((language_dir, target_dir))
options = {
'build_exe': {
'includes': ['Gdk.KEY_', 'dumbdbm', 'dbhash', 'bsddb', 'new',
'goocanvas', 'Crypto.PublicKey.DSA', 'Crypto.Hash.HMAC',
'numbers', 'win32com.client', 'win32com.server', 'HTMLParser'],
'base': 'Win32GUI',
'packages': ['cffi', 'cryptography'],
'bin_excludes': [
'iconv.dll', 'intl.dll', 'libatk-1.0-0.dll',
'libgdk_pixbuf-2.0-0.dll', 'libgdk-win32-2.0-0.dll',
'libgio-2.0-0.dll',
'libglib-2.0-0.dll', 'libgmodule-2.0-0.dll',
'libgobject-2.0-0.dll', 'libgthread-2.0-0.dll',
'libgtk-win32-2.0-0.dll', 'libpango-1.0-0.dll',
'libpangowin32-1.0-0.dll', 'libcairo-2.dll',
'libpangocairo-1.0-0.dll', 'libpangoft2-1.0-0.dll',
'libfarstream-0.1-0.dll', 'libgcc_s_dw2-1.dll',
'libgstbase-0.10-0.dll', 'libgstcontroller-0.10-0.dll',
'libgstdataprotocol-0.10-0.dll', 'libgstinterfaces-0.10-0.dll',
'libgstnet-0.10-0.dll', 'libgstreamer-0.10-0.dll',
'libiconv-2.dll', 'libxml2.dll', 'libxml2-2.dll',
'build_exe': {
'compressed': False,
'includes': ['gi', 'Crypto.PublicKey.DSA', 'Crypto.Hash.HMAC',
'numbers', 'win32com.client', 'win32com.server'
],
}
'packages': ['gi', 'cffi', 'cryptography'],
'base': 'Win32GUI',
'include_files': include_files,
}
}
setup(
name='Gajim',
version='0.16.5',
version='0.16.10',
description='A full featured Jabber client',
author='Gajim Development Team',
url='http://gajim.org/',
......
......@@ -32,4 +32,4 @@ def remove(sequence, target):
sequence.remove(target)
elif isinstance(sequence, dict):
if target in sequence:
del sequence[target]
del sequence[target]
\ No newline at end of file
......@@ -90,8 +90,8 @@ def add_entropy_sources_OpenSSL():
OpenSSL.rand.add(str(s).encode('utf-8'), 1)
# On Windows add the current contents of the screen to the PRNG state.
if os.name == 'nt':
OpenSSL.rand.screen()
# if os.name == 'nt':
# OpenSSL.rand.screen()
# The /proc filesystem on POSIX systems contains many random variables:
# memory statistics, interrupt counts, network packet counts
if os.name == 'posix':
......
......@@ -198,7 +198,8 @@ class NSLookupResolver(CommonResolver):
if not result:
return []
hosts = []
lines = str(result).replace('\r', '').split('\n')
result = result.decode(sys.stdout.encoding)
lines = result.replace('\r', '').split('\n')
current_host = None
for line in lines:
line = line.lstrip()
......
......@@ -175,8 +175,6 @@ class FeaturesWindow:
return gajim.HAVE_ZEROCONF
def dbus_available(self):
if os.name == 'nt':
return False
from common import dbus_support
return dbus_support.supported
......
......@@ -50,7 +50,7 @@ def send_error(error_message):
try:
import dbus
import dbus.service
import dbus.glib
# import dbus.glib
# test if dbus-x11 is installed
bus = dbus.SessionBus()
except Exception:
......
......@@ -38,6 +38,7 @@
import os
import sys
import warnings
import OpenSSL
if os.name == 'nt':
log_path = os.path.join(os.environ['APPDATA'], 'Gajim')
......@@ -50,26 +51,9 @@ if os.name == 'nt':
warnings.filterwarnings(action='ignore')
if os.path.isdir('gtk'):
# Used to create windows installer with GTK included
paths = os.environ['PATH']
list_ = paths.split(';')
new_list = []
for p in list_:
if p.find('gtk') < 0 and p.find('GTK') < 0:
new_list.append(p)
new_list.insert(0, os.path.join(os.getcwd(), 'gtk', 'lib'))
new_list.insert(0, os.path.join(os.getcwd(), 'gtk', 'bin'))
os.environ['PATH'] = ';'.join(new_list)
# Needs to be imported very early to not crash Gajim on exit.
try:
__import__('libxml2mod')
except ImportError:
pass
HAS_NBXMPP=True
MIN_NBXMPP_VER = "0.5.3"
from gi.repository import GLib
try:
import nbxmpp
except ImportError:
......@@ -109,19 +93,19 @@ if os.name == 'nt':
gettext.textdomain(APP)
gettext.install(APP, DIR)
locale.setlocale(locale.LC_ALL, '')
import ctypes
import ctypes.util
libintl_path = ctypes.util.find_library('intl')
if libintl_path == None:
local_intl = os.path.join('gtk', 'bin', 'intl.dll')
if os.path.exists(local_intl):
libintl_path = local_intl
if libintl_path == None:
raise ImportError('intl.dll library not found')
libintl = ctypes.cdll.LoadLibrary(libintl_path)
libintl.bindtextdomain(APP, DIR)
libintl.bind_textdomain_codeset(APP, 'UTF-8')
# locale.setlocale(locale.LC_ALL, '')
# import ctypes
# import ctypes.util
# libintl_path = ctypes.util.find_library('intl')
# if libintl_path == None:
# local_intl = os.path.join('gtk', 'bin', 'intl.dll')
# if os.path.exists(local_intl):
# libintl_path = local_intl
# if libintl_path == None:
# raise ImportError('intl.dll library not found')
# libintl = ctypes.cdll.LoadLibrary(libintl_path)
# libintl.bindtextdomain(APP, DIR)
# libintl.bind_textdomain_codeset(APP, 'UTF-8')
if os.name == 'nt':
# needed for docutils
......@@ -202,8 +186,8 @@ del profile
if os.name == 'nt':
plugins_locale_dir = os.path.join(common.configpaths.gajimpaths[
'PLUGINS_USER'], 'locale').encode(locale.getpreferredencoding())
libintl.bindtextdomain('gajim_plugins', plugins_locale_dir)
libintl.bind_textdomain_codeset('gajim_plugins', 'UTF-8')
# libintl.bindtextdomain('gajim_plugins', plugins_locale_dir)
# libintl.bind_textdomain_codeset('gajim_plugins', 'UTF-8')
class MyStderr(object):
_file = None
......@@ -316,7 +300,7 @@ if pritext:
del pritext
import gtkexcepthook
#import gtkexcepthook
import signal
import gtkgui_helpers
......
......@@ -265,7 +265,7 @@ class GajimPluginConfig():
except:
log.warning('%s plugin config file not readable. Saving it as '
'%s and creating a new one' % (self.plugin.short_name,
self.FILE_PATH + '.bak'))
self.FILE_PATH.decode(locale.getpreferredencoding()) + '.bak'))
if os.path.exists(self.FILE_PATH + '.bak'):
os.remove(self.FILE_PATH + '.bak')
os.rename(self.FILE_PATH, self.FILE_PATH + '.bak')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment