Merge branch 'setuptools' into 'master'

Use Setuptools to build gajim

Closes #8633

See merge request !128
This commit is contained in:
Yann Leboulanger 2017-09-25 11:15:40 +02:00
commit 81a6be74ad
95 changed files with 338 additions and 547 deletions

4
.gitignore vendored
View File

@ -8,11 +8,11 @@ syntax: glob
*.pyo
*~
autom4te.cache
data/defs.py
data/org.gajim.Gajim.appdata.xml
data/org.gajim.Gajim.desktop
libtool
po/.intltool-merge-cache
po/gajim.pot
po/POTFILES
po/stamp-it
stamp-h1
@ -25,3 +25,5 @@ syntax: regexp
^config\.*
^config\/
^scripts\/gajim.*
!MANIFEST.in

View File

@ -9,8 +9,7 @@ stages:
run-test:
stage: test
script:
- ./autogen.sh
- make test_nogui
- python3 setup.py test_nogui
run-pylint:
stage: test
@ -20,8 +19,8 @@ run-pylint:
run-build:
stage: build
script:
- ./autogen.sh
- make dist
- python3 setup.py sdist
- cd dist
- export FN="gajim-default-"$(date +%F)".tar"
- mv gajim-*.tar.gz $FN.gz
- mkdir tmp_add_plugins
@ -30,11 +29,12 @@ run-build:
- tar xzf $FN.gz
- rm $FN.gz
- export GF=$(find . -maxdepth 1 -type d -name 'gajim-*')
- cd $GF/plugins/
- mkdir -p $GF/gajim/data/plugins/
- cd $GF/gajim/data/plugins/
- curl -O https://ftp.gajim.org/plugins_1/plugin_installer.zip
- unzip plugin_installer.zip
- rm plugin_installer.zip
- cd ../..
- cd ../../../..
- tar czf ../$FN.gz gajim-*
- cd ..
- rm -rf tmp_add_plugins

5
MANIFEST.in Normal file
View File

@ -0,0 +1,5 @@
include COPYING
recursive-include po *.po
recursive-include data *.1 *.in
recursive-include test *.py
recursive-exclude * *.pyc

View File

@ -1,62 +0,0 @@
SUBDIRS = gajim data po icons plugins
ACLOCAL_AMFLAGS = -I m4
bin_SCRIPTS = scripts/gajim scripts/gajim-history-manager scripts/gajim-remote
EXTRA_DIST = \
autogen.sh \
intltool-extract.in \
intltool-merge.in \
intltool-update.in \
win \
scripts/gajim.in \
scripts/gajim-history-manager.in \
scripts/gajim-remote.in
DISTCLEANFILES = \
intltool-extract \
intltool-merge \
intltool-update \
scripts/gajim \
scripts/gajim-remote \
scripts/gajim-history-manager
MAINTAINERCLEANFILES = \
configure \
Makefile.in \
intltool-extract.in \
intltool-update.in \
intltool-merge.in \
ltmain.sh \
missing \
mkinstalldirs \
install-sh \
compile \
depcomp \
config.guess \
config.log \
config.sub \
config.status \
aclocal.m4 \
libtool \
po/POTFILES.in \
m4/intltool.m4
MAINTAINERCLEANDIRS = \
autom4te.cache \
build \
dist
test:
${PYTHON} test/runtests.py
.PHONY: test
test_nogui:
${PYTHON} test/runtests.py -n
.PHONY: test_nogui
doc:
epydoc --config=doc/epydoc.conf
.PHONY: doc

View File

@ -1,35 +0,0 @@
#!/usr/bin/env bash
AM_ARGS="--add-missing --gnu --copy -Wno-portability"
CONF_ARGS=""
echo "[encoding: UTF-8]" > po/POTFILES.in \
&& for p in `ls gajim/data/gui/*.ui`; do echo "[type: gettext/glade]$p" >> \
po/POTFILES.in; done \
&& ls -1 data/org.gajim.Gajim.appdata.xml.in data/org.gajim.Gajim.desktop.in.in data/gajim-remote.desktop.in.in \
gajim/*.py gajim/common/*.py gajim/command_system/*.py gajim/command_system/implementation/*.py gajim/common/zeroconf/*.py gajim/plugins/*.py | grep -v ipython_view.py >> \
po/POTFILES.in \
&& echo -e "data/org.gajim.Gajim.desktop.in\ndata/gajim-remote.desktop.in\ngajim/ipython_view.py" > po/POTFILES.skip || exit 1
if [ $(find plugins/ -name '*.py' | wc -l) -gt 0 ];then
ls -1 plugins/*/*.py plugins/*/*.ui >> po/POTFILES.skip
fi
if test -z `which pkg-config 2>/dev/null`;then
echo "***Error: pkg-config not found***"
echo "See README.html for build requirements."
exit 1
fi
which glibtoolize >/dev/null 2>&1 && LIBTOOLIZE="glibtoolize" || LIBTOOLIZE="libtoolize"
mkdir -p config
if [ "$NO_AUTOTOOLS_RUN" ]; then
exit 0
fi
intltoolize --force --automake \
&& aclocal -I ./m4 \
&& $LIBTOOLIZE --copy --force --automake \
&& autoheader \
&& autoconf \
&& automake ${AM_ARGS} \
&& ./configure ${CONF_ARGS} $@

View File

@ -1,86 +0,0 @@
AC_INIT([Gajim - A Jabber Instant Messager],
m4_esyscmd_s([python -c "import os;os.chdir('gajim');from common import defs; print(defs.version)"]),[https://dev.gajim.org/gajim/gajim],[gajim])
AC_PREREQ([2.59])
AC_CONFIG_HEADER(config.h)
AC_CONFIG_AUX_DIR(config)
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([1.9 tar-pax])
AM_MAINTAINER_MODE
IT_PROG_INTLTOOL([0.35.0])
PKG_PROG_PKG_CONFIG([0.19])
AM_DISABLE_STATIC
AC_ENABLE_SHARED(yes)
AC_ENABLE_STATIC(no)
AC_ISC_POSIX
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_PROG_LIBTOOL
AC_C_CONST
AC_CHECK_HEADERS([libintl.h])
AC_PATH_X
GETTEXT_PACKAGE=gajim
AC_SUBST([GETTEXT_PACKAGE])
AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"], [Gettext package])
AM_GLIB_GNU_GETTEXT
AM_NLS
ACLOCAL_AMFLAGS="\${ACLOCAL_FLAGS}"
AC_SUBST(ACLOCAL_AMFLAGS)
AM_PATH_PYTHON([3.5])
AC_SUBST([gajim_srcdir], [\${pkgpythondir}])
AC_SUBST([gajim_pluginsdir], [\${datadir}/\${PACKAGE}/plugins])
AS_AC_EXPAND(PY_SITEDIR, "${pythondir}")
AS_AC_EXPAND(GAJIM_SRCDIR, "${gajim_srcdir}")
AS_AC_EXPAND(PKGDATADIR, "${datadir}/${PACKAGE}")
AS_AC_EXPAND(DOCDIR, "${docdir}")
AS_AC_EXPAND(LOCALEDIR, "${localedir}")
AS_AC_EXPAND(GAJIM_PLUGINSDIR, "${gajim_pluginsdir}")
AC_SUBST(VERSION)
AC_SUBST(PACKAGE)
AC_CONFIG_FILES([
Makefile
data/Makefile
gajim/data/Makefile
gajim/data/gui/Makefile
gajim/data/emoticons/Makefile
data/pixmaps/Makefile
gajim/data/iconsets/Makefile
gajim/data/moods/Makefile
gajim/data/activities/Makefile
icons/Makefile
data/org.gajim.Gajim.appdata.xml
data/org.gajim.Gajim.desktop.in
data/gajim-remote.desktop.in
data/defs.py
gajim/Makefile
scripts/gajim
scripts/gajim-history-manager
scripts/gajim-remote
po/Makefile.in
plugins/Makefile
])
AC_OUTPUT
echo "
*****************************
Installation:
Prefix ........... ${prefix}
Python modules ... ${GAJIM_SRCDIR}
Plugins .. ....... ${GAJIM_PLUGINSDIR}
Documentation .... ${DOCDIR}
Others ........... ${PKGDATADIR}
*****************************"

View File

@ -1,33 +0,0 @@
SUBDIRS = pixmaps
@INTLTOOL_DESKTOP_RULE@
appstreamdir = $(datadir)/metainfo/
appstream_in_files = org.gajim.Gajim.appdata.xml.in
appstream_DATA = $(appstream_in_files:.xml.in=.xml)
@INTLTOOL_XML_RULE@
desktopdir = $(datadir)/applications
desktop_in_files = org.gajim.Gajim.desktop.in.in gajim-remote.desktop.in.in
desktop_DATA = $(desktop_in_files:.desktop.in.in=.desktop)
installdefsdir = $(gajim_srcdir)/common
installdefs_DATA = defs.py
man_MANS = gajim.1 gajim-remote.1 gajim-history-manager.1
EXTRA_DIST = $(appstream_in_files) \
$(desktop_in_files) \
$(man_MANS) \
defs.py.in
DISTCLEANFILES = $(desktop_DATA) \
$(installdefs_DATA)
CLEANFILES = $(appstream_DATA) \
org.gajim.Gajim.desktop \
gajim-remote.desktop
MAINTAINERCLEANFILES = Makefile.in

View File

@ -1,9 +0,0 @@
# this file is automatically generate by configure
# do not edit it!
docdir = "@DOCDIR@"
basedir = "@PKGDATADIR@"
version = "@VERSION@"
localedir = "@LOCALEDIR@"

View File

@ -1,7 +1,7 @@
[Desktop Entry]
Categories=Network;InstantMessaging;RemoteAccess;ConsoleOnly;
_Name=Open URI using Gajim
_Keywords=chat;messaging;im;jabber;xmpp;bonjour;voip;
Name=Open URI using Gajim
Keywords=chat;messaging;im;jabber;xmpp;bonjour;voip;
Version=1.0
Exec=gajim-remote handle_uri %u
TryExec=gajim-remote

View File

@ -1,9 +1,9 @@
[Desktop Entry]
Categories=Network;InstantMessaging;GTK;GNOME;
_Name=Gajim
_GenericName=Jabber IM Client
_Comment=A GTK+ Jabber client
_Keywords=chat;messaging;im;xmpp;bonjour;voip;
Name=Gajim
GenericName=Jabber IM Client
Comment=A GTK+ Jabber client
Keywords=chat;messaging;im;xmpp;bonjour;voip;
Version=1.0
Exec=gajim
Icon=org.gajim.Gajim

View File

@ -1,5 +0,0 @@
pixmapsdir = $(pkgdatadir)/data/pixmaps
nobase_dist_pixmaps_DATA = \
$(srcdir)/gajim.ico
MAINTAINERCLEANFILES = Makefile.in

View File

@ -1,20 +0,0 @@
SUBDIRS = data
INCLUDES = \
$(PYTHON_INCLUDES)
export MACOSX_DEPLOYMENT_TARGET=10.4
gajimsrcdir = $(gajim_srcdir)
nobase_dist_gajimsrc_PYTHON = \
$(srcdir)/*.py \
$(srcdir)/common/*.py \
$(srcdir)/common/protocol/*.py \
$(srcdir)/common/zeroconf/*.py \
$(srcdir)/command_system/*.py \
$(srcdir)/command_system/implementation/*.py \
$(srcdir)/plugins/*.py
dist-hook:
rm -f $(distdir)/ipython_view.py
MAINTAINERCLEANFILES = Makefile.in

View File

@ -0,0 +1,12 @@
import subprocess
__version__ = "0.16.11"
try:
node = subprocess.Popen('git rev-parse --short=12 HEAD', shell=True,
stdout=subprocess.PIPE).communicate()[0]
if node:
__version__ += '-' + node.decode('utf-8').strip()
except Exception:
pass

View File

@ -33,10 +33,11 @@
import re
from gajim.common import defs
from gi.repository import GLib
from enum import IntEnum, unique
import gajim
@unique
class Option(IntEnum):
TYPE = 0
@ -188,7 +189,7 @@ class Config:
'send_on_ctrl_enter': [opt_bool, False, _('Send message on Ctrl+Enter and with Enter make new line (Mirabilis ICQ Client default behaviour).')],
'last_roster_visible': [opt_bool, True],
'key_up_lines': [opt_int, 25, _('How many lines to store for Ctrl+KeyUP.')],
'version': [ opt_str, defs.version ], # which version created the config
'version': [ opt_str, gajim.__version__ ], # which version created the config
'search_engine': [opt_str, 'https://www.google.com/search?&q=%s&sourceid=gajim'],
'dictionary_url': [opt_str, 'WIKTIONARY', _("Either custom url with %%s in it where %%s is the word/phrase or 'WIKTIONARY' which means use wiktionary.")],
'always_english_wikipedia': [opt_bool, False],

View File

@ -25,7 +25,6 @@
import os
import sys
import tempfile
from gajim.common import defs
from enum import Enum, unique
@unique
@ -102,10 +101,9 @@ class ConfigPaths:
basedir = pkg_resources.resource_filename("gajim", ".")
self.add('DATA', None, os.path.join(basedir, 'data'))
self.add('GUI', None, os.path.join(basedir, 'data', 'gui'))
basedir = os.environ.get('GAJIM_BASEDIR', defs.basedir)
self.add('ICONS', None, os.path.join(basedir, 'icons'))
self.add('ICONS', None, os.path.join(basedir, 'data', 'icons'))
self.add('HOME', None, os.path.expanduser('~'))
self.add('PLUGINS_BASE', None, os.path.join(basedir, 'plugins'))
self.add('PLUGINS_BASE', None, os.path.join(basedir, 'data', 'plugins'))
def add(self, name, type_, path):
self.paths[name] = (type_, path)

View File

@ -1,44 +0,0 @@
# -*- coding:utf-8 -*-
## src/common/defs.py
##
## Copyright (C) 2006 Nikos Kouremenos <kourem AT gmail.com>
## Copyright (C) 2006-2014 Yann Leboulanger <asterix AT lagaule.org>
## Copyright (C) 2006-2008 Jean-Marie Traissard <jim AT lapin.org>
## Copyright (C) 2007 Brendan Taylor <whateley AT gmail.com>
## Tomasz Melcer <liori AT exroot.org>
## Copyright (C) 2008 Jonathan Schleifer <js-gajim AT webkeks.org>
##
## This file is part of Gajim.
##
## Gajim is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published
## by the Free Software Foundation; version 3 only.
##
## Gajim is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Gajim. If not, see <http://www.gnu.org/licenses/>.
##
import subprocess
import sys
import os.path
docdir = '../'
basedir = './'
localedir = '../po'
version = '0.16.11'
try:
node = subprocess.Popen('git rev-parse --short=12 HEAD', shell=True,
stdout=subprocess.PIPE).communicate()[0]
if node:
version += '-' + node.decode('utf-8').strip()
except Exception:
pass
for base in ('.', 'common'):
sys.path.append(os.path.join(base, '.libs'))

View File

@ -24,7 +24,6 @@
import locale
import gettext
import os
from gajim.common import defs
import unicodedata
# May be changed after GTK is imported
@ -47,7 +46,6 @@ def paragraph_direction_mark(text):
return '\u200E'
APP = 'gajim'
DIR = defs.localedir
# set '' so each part of the locale that should be modified is set
# according to the environment variables
@ -64,7 +62,23 @@ if os.name == 'nt':
if lang:
os.environ['LANG'] = lang
gettext.install(APP, DIR)
localedir = "../po"
else:
# try to find domain in localedir
path = gettext.find(APP)
if path:
# extract localedir from localedir/language/LC_MESSAGES/domain.mo
path, tail = os.path.split(path)
path, tail = os.path.split(path)
localedir, tail = os.path.split(path)
else: # fallback to user locale
base = os.getenv('XDG_DATA_HOME')
if base is None or base[0] != '/':
base = os.path.expanduser('~/.local/share')
localedir = os.path.join(base, "locale")
locale.bindtextdomain(APP, localedir)
gettext.install(APP, localedir)
if gettext._translations:
_translation = list(gettext._translations.values())[0]
else:

View File

@ -1,19 +0,0 @@
SUBDIRS = gui emoticons iconsets moods activities
@INTLTOOL_DESKTOP_RULE@
soundsdir = $(gajim_srcdir)/data/sounds
sounds_DATA = $(srcdir)/sounds/*.wav
styledir = $(gajim_srcdir)/data/style
style_DATA = $(srcdir)/style/*.css
otherdir = $(gajim_srcdir)/data/other
other_DATA = other/servers.xml other/dh4096.pem
# other/cacert.pem is used only on Windows. On Unix platforms
# use CA certificates installed in /etc/ssl/certs
EXTRA_DIST = $(sounds_DATA) \
$(style_DATA) \
$(other_DATA)
MAINTAINERCLEANFILES = Makefile.in

View File

@ -1,4 +0,0 @@
activitiesdir = $(gajim_srcdir)/data/activities
nobase_dist_activities_DATA = $(srcdir)/*/*/*
MAINTAINERCLEANFILES = Makefile.in

View File

@ -1,7 +0,0 @@
emoticonsdir = $(gajim_srcdir)/data/emoticons
nobase_dist_emoticons_DATA = \
$(srcdir)/*/*.png \
$(srcdir)/*/LICENSE \
$(srcdir)/*/emoticons_theme.py
MAINTAINERCLEANFILES = Makefile.in

View File

@ -1,7 +0,0 @@
guidir = $(gajim_srcdir)/data/gui
gui_DATA = $(srcdir)/*.ui
EXTRA_DIST = $(gui_DATA)
DISTCLEANFILES = *.h
MAINTAINERCLEANFILES = Makefile.in

View File

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

Before

Width:  |  Height:  |  Size: 780 B

After

Width:  |  Height:  |  Size: 780 B

View File

Before

Width:  |  Height:  |  Size: 988 B

After

Width:  |  Height:  |  Size: 988 B

View File

Before

Width:  |  Height:  |  Size: 963 B

After

Width:  |  Height:  |  Size: 963 B

View File

Before

Width:  |  Height:  |  Size: 189 B

After

Width:  |  Height:  |  Size: 189 B

View File

Before

Width:  |  Height:  |  Size: 788 B

After

Width:  |  Height:  |  Size: 788 B

View File

Before

Width:  |  Height:  |  Size: 773 B

After

Width:  |  Height:  |  Size: 773 B

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 828 B

After

Width:  |  Height:  |  Size: 828 B

View File

Before

Width:  |  Height:  |  Size: 706 B

After

Width:  |  Height:  |  Size: 706 B

View File

Before

Width:  |  Height:  |  Size: 767 B

After

Width:  |  Height:  |  Size: 767 B

View File

Before

Width:  |  Height:  |  Size: 760 B

After

Width:  |  Height:  |  Size: 760 B

View File

Before

Width:  |  Height:  |  Size: 541 B

After

Width:  |  Height:  |  Size: 541 B

View File

Before

Width:  |  Height:  |  Size: 790 B

After

Width:  |  Height:  |  Size: 790 B

View File

Before

Width:  |  Height:  |  Size: 844 B

After

Width:  |  Height:  |  Size: 844 B

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

Before

Width:  |  Height:  |  Size: 994 B

After

Width:  |  Height:  |  Size: 994 B

View File

Before

Width:  |  Height:  |  Size: 874 B

After

Width:  |  Height:  |  Size: 874 B

View File

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

Before

Width:  |  Height:  |  Size: 959 B

After

Width:  |  Height:  |  Size: 959 B

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

Before

Width:  |  Height:  |  Size: 997 B

After

Width:  |  Height:  |  Size: 997 B

View File

Before

Width:  |  Height:  |  Size: 766 B

After

Width:  |  Height:  |  Size: 766 B

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View File

@ -1,10 +0,0 @@
iconsetdir = $(gajim_srcdir)/data/iconsets
nobase_dist_iconset_DATA = \
$(srcdir)/*/16x16/* \
$(srcdir)/*/32x32/* \
$(srcdir)/*/48x48/* \
$(srcdir)/transports/*/16x16/* \
$(srcdir)/transports/*/32x32/* \
$(srcdir)/transports/*/48x48/*
MAINTAINERCLEANFILES = Makefile.in

View File

@ -1,4 +0,0 @@
moodsdir = $(gajim_srcdir)/data/moods
nobase_dist_moods_DATA = $(srcdir)/*/*
MAINTAINERCLEANFILES = Makefile.in

View File

@ -43,7 +43,6 @@ from gajim import vcard
from gajim import conversation_textview
from gajim import dataforms_widget
from gajim.common import defs
from random import randrange
from gajim.common import pep
from gajim.common import ged

View File

@ -252,8 +252,8 @@ class GajimApplication(Gtk.Application):
if options.contains('config-path'):
self.config_path = options.lookup_value('config-path').get_string()
if options.contains('version'):
from gajim.common.defs import version
print(version)
from gajim import __version__
print(__version__)
return 0
if options.contains('quiet'):
logging_helpers.set_quiet()

View File

@ -119,9 +119,8 @@ def get_image_button(icon_name, tooltip, toggle=False):
button.set_tooltip_text(_(tooltip))
return button
GUI_DIR = os.path.join(app.DATA_DIR, 'gui')
def get_gtk_builder(file_name, widget=None):
file_path = os.path.join(GUI_DIR, file_name)
file_path = os.path.join(configpaths.get('GUI'), file_name)
builder = Gtk.Builder()
builder.set_translation_domain(i18n.APP)
if widget:

View File

@ -2520,7 +2520,7 @@ class Interface:
@staticmethod
def create_ipython_window():
try:
from gajim.ipython_view import IPythonView
from gajim.dev.ipython_view import IPythonView
except ImportError:
print('ipython_view not found')
return

View File

@ -1,7 +0,0 @@
iconsdir = $(pkgdatadir)/icons
nobase_dist_icons_DATA = $(srcdir)/*/*/*/*
systemiconsdir = $(datadir)/icons
nobase_dist_systemicons_DATA = $(srcdir)/*/*/*/org.gajim.Gajim.*
MAINTAINERCLEANFILES = Makefile.in

View File

@ -1,4 +1,4 @@
#!/usr/bin/python3 -OO
#!/usr/bin/env python3
import os
import sys

View File

@ -1,49 +0,0 @@
dnl as-ac-expand.m4 0.2.0 -*- autoconf -*-
dnl autostars m4 macro for expanding directories using configure's prefix
dnl (C) 2003, 2004, 2005 Thomas Vander Stichele <thomas at apestaart dot org>
dnl Copying and distribution of this file, with or without modification,
dnl are permitted in any medium without royalty provided the copyright
dnl notice and this notice are preserved.
dnl AS_AC_EXPAND(VAR, CONFIGURE_VAR)
dnl example:
dnl AS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
dnl will set SYSCONFDIR to /usr/local/etc if prefix=/usr/local
AC_DEFUN([AS_AC_EXPAND],
[
EXP_VAR=[$1]
FROM_VAR=[$2]
dnl first expand prefix and exec_prefix if necessary
prefix_save=$prefix
exec_prefix_save=$exec_prefix
dnl if no prefix given, then use /usr/local, the default prefix
if test "x$prefix" = "xNONE"; then
prefix="$ac_default_prefix"
fi
dnl if no exec_prefix given, then use prefix
if test "x$exec_prefix" = "xNONE"; then
exec_prefix=$prefix
fi
full_var="$FROM_VAR"
dnl loop until it doesn't change anymore
while true; do
new_full_var="`eval echo $full_var`"
if test "x$new_full_var" = "x$full_var"; then break; fi
full_var=$new_full_var
done
dnl clean up
full_var=$new_full_var
AC_SUBST([$1], "$full_var")
dnl restore prefix and exec_prefix
prefix=$prefix_save
exec_prefix=$exec_prefix_save
])

View File

@ -1,31 +0,0 @@
# nls.m4 serial 3 (gettext-0.15)
dnl Copyright (C) 1995-2003, 2005-2006 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl
dnl This file can can be used in projects which are not available under
dnl the GNU General Public License or the GNU Library General Public
dnl License but which still want to provide support for the GNU gettext
dnl functionality.
dnl Please note that the actual code of the GNU gettext library is covered
dnl by the GNU Library General Public License, and the rest of the GNU
dnl gettext package package is covered by the GNU General Public License.
dnl They are *not* in the public domain.
dnl Authors:
dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
AC_PREREQ(2.50)
AC_DEFUN([AM_NLS],
[
AC_MSG_CHECKING([whether NLS is requested])
dnl Default is enabled NLS
AC_ARG_ENABLE(nls,
[ --disable-nls do not use Native Language Support],
USE_NLS=$enableval, USE_NLS=yes)
AC_MSG_RESULT($USE_NLS)
AC_SUBST(USE_NLS)
])

View File

@ -1,62 +0,0 @@
## this one is commonly used with AM_PATH_PYTHONDIR ...
dnl AM_CHECK_PYMOD(MODNAME [,SYMBOL [,ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]]])
dnl Check if a module containing a given symbol is visible to python.
AC_DEFUN([AM_CHECK_PYMOD],
[AC_REQUIRE([AM_PATH_PYTHON])
py_mod_var=`echo $1['_']$2 | sed 'y%./+-%__p_%'`
AC_MSG_CHECKING(for ifelse([$2],[],,[$2 in ])python module $1)
AC_CACHE_VAL(py_cv_mod_$py_mod_var, [
ifelse([$2],[], [prog="
import sys
try:
import $1
except ImportError:
sys.exit(1)
except:
sys.exit(0)
sys.exit(0)"], [prog="
import $1
$1.$2"])
if $PYTHON -c "$prog" 1>&AC_FD_CC 2>&AC_FD_CC
then
eval "py_cv_mod_$py_mod_var=yes"
else
eval "py_cv_mod_$py_mod_var=no"
fi
])
py_val=`eval "echo \`echo '$py_cv_mod_'$py_mod_var\`"`
if test "x$py_val" != xno; then
AC_MSG_RESULT(yes)
ifelse([$3], [],, [$3
])dnl
else
AC_MSG_RESULT(no)
ifelse([$4], [],, [$4
])dnl
fi
])
dnl a macro to check for ability to create python extensions
dnl AM_CHECK_PYTHON_HEADERS([ACTION-IF-POSSIBLE], [ACTION-IF-NOT-POSSIBLE])
dnl function also defines PYTHON_INCLUDES
AC_DEFUN([AM_CHECK_PYTHON_HEADERS],
[AC_REQUIRE([AM_PATH_PYTHON])
AC_MSG_CHECKING(for headers required to compile python extensions)
dnl deduce PYTHON_INCLUDES
py_prefix=`$PYTHON -c "import sys; print(sys.prefix)"`
py_exec_prefix=`$PYTHON -c "import sys; print(sys.exec_prefix)"`
PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}"
if test "$py_prefix" != "$py_exec_prefix"; then
PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}"
fi
AC_SUBST(PYTHON_INCLUDES)
dnl check if the headers exist:
save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES"
AC_TRY_CPP([#include <Python.h>],dnl
[AC_MSG_RESULT(found)
$1],dnl
[AC_MSG_RESULT(not found)
$2])
CPPFLAGS="$save_CPPFLAGS"
])

View File

@ -1,15 +0,0 @@
INCLUDES = \
$(PYTHON_INCLUDES)
gajimpluginsdir = $(gajim_pluginsdir)
dist_gajimplugins_PYTHON =
pluginsdirs = ${sort ${dir ${wildcard ${srcdir}/*/ ${srcdir}/*/*/}}}
pluginsfiles = $(wildcard ${p}/*.py ${p}/manifest.ini ${p}/*.ui ${p}/*.png ${p}/*.pem)
nobase_gajimplugins_DATA = $(foreach p, ${pluginsdirs}, $(pluginsfiles))
MAINTAINERCLEANFILES = Makefile.in

View File

@ -1,4 +1,4 @@
#!/usr/bin/python3 -OO
#!/usr/bin/env python3
##
## Copyright (C) 2005 Yann Le Boulanger <asterix AT lagaule.org>
## Copyright (C) 2006 Dimitur Kirov <dkirov AT gmail.com>
@ -27,8 +27,6 @@ if sys.platform != 'win32':
if os.geteuid() == 0:
sys.exit("You must not launch gajim as root, it is insecure.")
sys.path.append("@PY_SITEDIR@")
import gajim.gajim as g
g.GajimApplication().run(sys.argv)

View File

@ -1,4 +1,4 @@
#!/usr/bin/python3 -OO
#!/usr/bin/env python3
##
## Copyright (C) 2005 Yann Le Boulanger <asterix AT lagaule.org>
## Copyright (C) 2006 Dimitur Kirov <dkirov AT gmail.com>
@ -27,8 +27,6 @@ if sys.platform != 'win32':
if os.geteuid() == 0:
sys.exit("You must not launch gajim as root, it is insecure.")
sys.path.append("@PY_SITEDIR@")
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk

View File

@ -1,4 +1,4 @@
#!/usr/bin/python3 -OO
#!/usr/bin/env python3
##
## Copyright (C) 2005 Yann Le Boulanger <asterix AT lagaule.org>
## Copyright (C) 2006 Dimitur Kirov <dkirov AT gmail.com>
@ -26,8 +26,6 @@ import sys
if os.geteuid() == 0:
sys.exit("You must not launch gajim as root, it is insecure.")
sys.path.append("@PY_SITEDIR@")
import gajim.gajim_remote as g
g.GajimRemote()

276
setup.py Executable file
View File

@ -0,0 +1,276 @@
#!/usr/bin/env python3
import os
import sys
if sys.version_info[0] < 3:
sys.exit('Tried to install with Python 2, gajim only supports Python 3.')
import codecs
from setuptools import setup, find_packages
from setuptools import Command
from setuptools.command.build_py import build_py as _build
from distutils import log
from distutils.util import convert_path, newer
import gajim
pos = [x for x in os.listdir('po') if x[-3:] == ".po"]
ALL_LINGUAS = sorted([os.path.split(x)[-1][:-3] for x in pos])
cwd = os.path.dirname(os.path.realpath(__file__))
def update_trans():
'''
Update translation files
'''
template = os.path.join('po', 'gajim.pot')
files = [os.path.join(root, f) for root, d, files in os.walk('gajim') for f in files if os.path.isfile(
os.path.join(root, f)) and (f.endswith('.py') or f.endswith('.ui'))]
files.append(os.path.join("data", "gajim-remote.desktop.in"))
files.append(os.path.join("data", "org.gajim.Gajim.desktop.in"))
files.append(os.path.join("data", "org.gajim.Gajim.appdata.xml.in"))
cmd = 'xgettext --from-code=utf-8 -o %s %s' % (
template, " ".join(files))
if os.system(cmd) != 0:
msg = "ERROR: %s could not be created!\n" % template
raise SystemExit(msg)
for lang in ALL_LINGUAS:
po_file = os.path.join('po', lang + '.po')
cmd = 'msgmerge -U %s %s' % (po_file, template)
if os.system(cmd) != 0:
msg = 'ERROR: Updating language translation file failed.'
ask = msg + '\n Continue updating y/n [n] '
reply = input(ask)
if reply in ['n', 'N']:
raise SystemExit(msg)
log.info('Updating %s', po_file)
def build_trans(build_cmd):
'''
Translate the language files into gajim.mo
'''
data_files = build_cmd.distribution.data_files
for lang in ALL_LINGUAS:
po_file = os.path.join('po', lang + '.po')
mo_file = os.path.join(cwd, 'mo', lang, 'LC_MESSAGES', 'gajim.mo')
mo_dir = os.path.dirname(mo_file)
if not (os.path.isdir(mo_dir) or os.path.islink(mo_dir)):
os.makedirs(mo_dir)
if newer(po_file, mo_file):
cmd = 'msgfmt %s -o %s' % (po_file, mo_file)
if os.system(cmd) != 0:
os.remove(mo_file)
msg = 'ERROR: Building language translation files failed.'
ask = msg + '\n Continue building y/n [n] '
reply = input(ask)
if reply in ['n', 'N']:
raise SystemExit(msg)
log.info('Compiling %s >> %s', po_file, mo_file)
# linux specific piece:
target = 'share/locale/' + lang + '/LC_MESSAGES'
data_files.append((target, [mo_file]))
def build_man(build_cmd):
'''
Compress Gajim manual files
'''
data_files = build_cmd.distribution.data_files
for man in ['gajim.1', 'gajim-history-manager.1', 'gajim-remote.1']:
filename = os.path.join('data', man)
newdir = os.path.join(cwd, 'man')
if not (os.path.isdir(newdir) or os.path.islink(newdir)):
os.makedirs(newdir)
import gzip
man_file_gz = os.path.join(newdir, man + '.gz')
if os.path.exists(man_file_gz):
if newer(filename, man_file_gz):
os.remove(man_file_gz)
else:
filename = False
if filename:
# Binary io, so open is OK
with open(filename, 'rb') as f_in,\
gzip.open(man_file_gz, 'wb') as f_out:
f_out.writelines(f_in)
log.info('Compiling %s >> %s', filename, man_file_gz)
src = cwd + '/man' + '/' + man + '.gz'
target = 'share/man/man1'
data_files.append((target, [src]))
def build_intl(build_cmd):
'''
Merge translation files into desktop and mime files
'''
data_files = build_cmd.distribution.data_files
base = cwd
merge_files = (('data/org.gajim.Gajim.desktop', 'share/applications', '--desktop'),
('data/gajim-remote.desktop', 'share/applications', '--desktop'),
('data/org.gajim.Gajim.appdata.xml', 'share/metainfo', '--xml'))
for filename, target, option in merge_files:
filenamelocal = convert_path(filename)
newfile = os.path.join(base, filenamelocal)
newdir = os.path.dirname(newfile)
if not(os.path.isdir(newdir) or os.path.islink(newdir)):
os.makedirs(newdir)
merge(filenamelocal + '.in', newfile, option)
data_files.append((target, [base + '/' + filename]))
def substitute_variables(filename_in, filename_out, subst_vars):
'''
Substitute variables in a file.
'''
f_in = codecs.open(filename_in, encoding='utf-8')
f_out = codecs.open(filename_out, encoding='utf-8', mode='w')
for line in f_in:
for variable, substitution in subst_vars:
line = line.replace(variable, substitution)
f_out.write(line)
f_in.close()
f_out.close()
def merge(in_file, out_file, option, po_dir='po'):
'''
Run the msgfmt command.
'''
if os.path.exists(in_file):
cmd = (('msgfmt %(opt)s -d %(po_dir)s --template %(in_file)s '
'-o %(out_file)s') %
{'opt': option,
'po_dir': po_dir,
'in_file': in_file,
'out_file': out_file})
if os.system(cmd) != 0:
msg = ('ERROR: %s was not merged into the translation files!\n' %
out_file)
raise SystemExit(msg)
log.info('Compiling %s >> %s', in_file, out_file)
class build(_build):
def run(self):
build_trans(self)
if sys.platform != 'win32':
build_man(self)
build_intl(self)
_build.run(self)
class test(Command):
description = "Run all tests"
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
os.system("./test/runtests.py")
class test_nogui(test):
description = "Run tests without GUI"
def run(self):
os.system("./test/runtests.py -n")
class update_po(Command):
description = "Update po files"
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
update_trans()
package_data_activities = ['data/activities/*/*/*.png']
package_data_emoticons = ['data/emoticons/*/emoticons_theme.py',
'data/emoticons/*/*.png',
'data/emoticons/*/LICENSE']
package_data_gui = ['data/gui/*.ui']
package_data_icons = ['data/icons/hicolor/*/*/*.png',
'data/icons/hicolor/*/*/*.svg']
package_data_iconsets = ['data/iconsets/*/*/*.gif',
'data/iconsets/*/*/*.png',
'data/iconsets/transports/*/*/*.png']
package_data_moods = ['data/moods/*/*.png']
package_data_other = ['data/other/*']
package_data_sounds = ['data/sounds/*.wav']
package_data_style = ['data/style/gajim.css']
package_plugins_data = ['data/plugins/*/*']
package_data = (package_data_activities
+ package_data_emoticons
+ package_data_gui
+ package_data_icons
+ package_data_iconsets
+ package_data_moods
+ package_data_other
+ package_data_sounds
+ package_data_style
+ package_plugins_data)
# only install subdirectories of data
data_files_app_icon = [
("share/icons/hicolor/64x64/apps",
["gajim/data/icons/hicolor/64x64/apps/org.gajim.Gajim.png"]),
("share/icons/hicolor/128x128/apps",
["gajim/data/icons/hicolor/128x128/apps/org.gajim.Gajim.png"]),
("share/icons/hicolor/scalable/apps",
["gajim/data/icons/hicolor/scalable/apps/org.gajim.Gajim.svg"])
]
data_files = data_files_app_icon
setup(
name="gajim",
description='A GTK+ Jabber client',
version=gajim.__version__,
author="Philipp Hörist, Yann Leboulanger",
author_email="gajim-devel@gajim.org",
url='https://gajim.org',
license='GPL v3',
classifiers=[
'Programming Language :: Python :: 3',
],
cmdclass={
'build_py': build,
'test': test,
'test_nogui': test_nogui,
'update_po': update_po,
},
scripts=[
'scripts/gajim',
'scripts/gajim-history-manager',
'scripts/gajim-remote'],
packages=find_packages(exclude=["gajim.dev", "test*"]),
package_data={'gajim': package_data},
data_files=data_files,
install_requires=[
'dbus-python',
'nbxmpp',
'pyOpenSSL'
],
)

0
test/__init__.py Normal file
View File