Jussi Pakkanen
027af6b064
Error out if trying to do gettext without appropriate tools.
8 years ago
Igor Gnatenko
ef3cc6b3fa
style: fix E127 violations
...
E127: continuation line over-indented for visual indent
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
8 years ago
Igor Gnatenko
cdd05aa5dc
style: fix E241 violations
...
E241: multiple spaces after ','
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
8 years ago
Igor Gnatenko
969dc7e995
style: fix E124 violations
...
E124: closing bracket does not match visual indentation
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
8 years ago
Igor Gnatenko
116da33cdd
style: fix E128 violations
...
E128: continuation line under-indented for visual indent
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
8 years ago
Igor Gnatenko
5693758e46
style: fix E231 violations
...
E231: missing whitespace after ','
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
8 years ago
Igor Gnatenko
ef608f217d
style: fix E222 violations
...
E222: multiple spaces after operator
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
8 years ago
Igor Gnatenko
2017d8578a
style: fix E226 violations
...
E226: missing whitespace around arithmetic operator
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
8 years ago
Igor Gnatenko
f0b30baa39
style: fix E225 violations
...
E225: missing whitespace around operator
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
8 years ago
Jussi Pakkanen
b55235dfbd
Fix space before :.
8 years ago
Elliott Sales de Andrade
157549fe72
Add include_directories to windows.compile_resources.
8 years ago
Elliott Sales de Andrade
24b3585318
Move _get_include_args from gnome to modules.
8 years ago
Elliott Sales de Andrade
18c38df875
Add Generator.process_files to reduce code duplication.
8 years ago
Nirbheek Chauhan
0ac965cc10
Fix shared library symlink aliasing on install
...
Set the rules for the symlinking on the target itself, and then reuse
that information while generating aliases during the build, and then
pass it to the install script too.
8 years ago
Nirbheek Chauhan
589a56e78f
Cache the scripts used for postconf and install phases
...
Cache the absolute dir that the script is searched in and the name of
the script. These are the only two things that change.
Update the test to test for both #1235 and the case when a script of the
same name is in a different directory (which also covers the subproject
case).
Closes #1235
8 years ago
Nirbheek Chauhan
9bc07a0941
Fix several more lint errors
...
Found by Igor Gnatenko
************* Module mesonbuild.interpreter
E:1232,33: No value for argument 'interp' in constructor call (no-value-for-parameter)
************* Module mesonbuild.dependencies
E: 68, 4: An attribute defined in mesonbuild.dependencies line 39 hides this method (method-hidden)
************* Module mesonbuild.environment
E: 26, 0: class already defined line 19 (function-redefined)
E: 68,18: Undefined variable 'InterpreterException' (undefined-variable)
E:641,39: Undefined variable 'want_cross' (undefined-variable)
E:850,94: Undefined variable 'varname' (undefined-variable)
E:854,94: Undefined variable 'varname' (undefined-variable)
E:860,102: Undefined variable 'varname' (undefined-variable)
E:863,94: Undefined variable 'varname' (undefined-variable)
************* Module mesonbuild.modules.gnome
E:438,26: Undefined variable 'compilers' (undefined-variable)
8 years ago
Igor Gnatenko
139e020ede
tree-wide: use proper 'not in' notation
...
Let's be more pythonic and 'not is' seems really weird.
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
8 years ago
Igor Gnatenko
8268eb4959
tree-wide: remove unused imports
...
./setup.py:17:1: F401 'os' imported but unused
import os
^
./setup.py:37:1: F401 'stat.ST_MODE' imported but unused
from stat import ST_MODE
^
./run_tests.py:17:1: F401 'os' imported but unused
import subprocess, sys, os
^
./run_tests.py:18:1: F401 'shutil' imported but unused
import shutil
^
./run_unittests.py:23:1: F401 'mesonbuild.dependencies.Qt5Dependency' imported but unused
from mesonbuild.dependencies import PkgConfigDependency, Qt5Dependency
^
./mesonbuild/build.py:15:1: F401 '.coredata' imported but unused
from . import coredata
^
./mesonbuild/interpreter.py:32:1: F401 'subprocess' imported but unused
import os, sys, subprocess, shutil, uuid, re
^
./mesonbuild/interpreter.py:32:1: F401 're' imported but unused
import os, sys, subprocess, shutil, uuid, re
^
./mesonbuild/dependencies.py:23:1: F401 'subprocess' imported but unused
import os, stat, glob, subprocess, shutil
^
./mesonbuild/mesonlib.py:17:1: F401 'sys' imported but unused
import platform, subprocess, operator, os, shutil, re, sys
^
./mesonbuild/modules/qt5.py:15:1: F401 'subprocess' imported but unused
import os, subprocess
^
./mesonbuild/modules/pkgconfig.py:15:1: F401 '..coredata' imported but unused
from .. import coredata, build
^
./mesonbuild/scripts/scanbuild.py:15:1: F401 'sys' imported but unused
import sys, os
^
./mesonbuild/scripts/meson_exe.py:20:1: F401 'subprocess' imported but unused
import subprocess
^
./mesonbuild/scripts/meson_exe.py:22:1: F401 '..mesonlib.MesonException' imported but unused
from ..mesonlib import MesonException, Popen_safe
^
./mesonbuild/scripts/symbolextractor.py:23:1: F401 'subprocess' imported but unused
import os, sys, subprocess
^
./mesonbuild/scripts/symbolextractor.py:25:1: F401 '..mesonlib.MesonException' imported but unused
from ..mesonlib import MesonException, Popen_safe
^
./mesonbuild/scripts/meson_install.py:19:1: F401 '..mesonlib.MesonException' imported but unused
from ..mesonlib import MesonException, Popen_safe
^
./mesonbuild/scripts/yelphelper.py:15:1: F401 'sys' imported but unused
import sys, os
^
./mesonbuild/scripts/yelphelper.py:20:1: F401 '..mesonlib.MesonException' imported but unused
from ..mesonlib import MesonException
^
./mesonbuild/backend/vs2010backend.py:17:1: F401 're' imported but unused
import re
^
./test cases/vala/8 generated sources/src/copy_file.py:3:1: F401 'os' imported but unused
import os
^
./test cases/common/107 postconf/postconf.py:3:1: F401 'sys' imported but unused
import sys, os
^
./test cases/common/129 object only target/obj_generator.py:5:1: F401 'shutil' imported but unused
import sys, shutil, subprocess
^
./test cases/common/57 custom target chain/usetarget/subcomp.py:3:1: F401 'os' imported but unused
import sys, os
^
./test cases/common/95 dep fallback/subprojects/boblib/genbob.py:3:1: F401 'os' imported but unused
import os
^
./test cases/common/98 gen extra/srcgen.py:4:1: F401 'os' imported but unused
import os
^
./test cases/common/113 generatorcustom/gen.py:3:1: F401 'os' imported but unused
import sys, os
^
./test cases/common/113 generatorcustom/catter.py:3:1: F401 'os' imported but unused
import sys, os
^
./test cases/common/59 object generator/obj_generator.py:5:1: F401 'shutil' imported but unused
import sys, shutil, subprocess
^
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
8 years ago
Igor Gnatenko
d5ccd20aac
fix some of pylint's undefined-variable
...
************* Module mesonbuild.modules.rpm
E:106,29: Unsupported format character '{' (0x7b) at index 16 (bad-format-character)
************* Module mesonbuild.modules
E: 12,14: Undefined variable 'MesonException' (undefined-variable)
************* Module mesonbuild.modules.gnome
E:699,69: Undefined variable 'sargs' (undefined-variable)
************* Module mesonbuild.wrap.wrap
E:103,25: Undefined variable 'checkoutdir' (undefined-variable)
************* Module mesonbuild.backend.backends
E: 83,16: Undefined variable 'mlog' (undefined-variable)
************* Module mesonbuild.backend.ninjabackend
E:254,105: Undefined variable 't' (undefined-variable)
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
8 years ago
Nirbheek Chauhan
c693bd9bb4
Allow passing arguments to install scripts
...
Closes #1213
8 years ago
Nirbheek Chauhan
eaafca6f4a
Qt: Allow passing a name arg to preprocess()
...
This sets a unique name for the CustomTarget and the output cpp file.
Closes #959
8 years ago
Nirbheek Chauhan
59b8f11e7e
gnome: Re-use gobject-introspection-1.0 pkg-config dependency
...
Also don't use `dependencies` as a module name since it is commonly used
as a variable name too. Instead, directly import the classes that we use
from that module.
8 years ago
Nirbheek Chauhan
5e5b3f00d8
modules: Cache programs found by find_program
...
This avoids printing several 'Found:' messages during configure, and
also avoids doing several searches for the same binary. This is already
done by the interpreter for `find_program` calls from build files.
Also move it to the module-wide __init__.py file so it can be used by
other modules as-needed.
Also use it for g-ir-scanner where it was missed in one place, also fix
exception name in the same place.
8 years ago
Nirbheek Chauhan
d5f7ba862b
gnome.mkenums: Use absolute paths for all commandline args
...
Closes #973
test cases/vala/8 generated sources/ tests this.
8 years ago
Nirbheek Chauhan
e6f48a03fc
Allow all code to access module target classes
...
It is often useful to be able to check if a specific object is of a type
defined in a module. To that end, define all such targets in
modules/__init__.py so that everyone can refer to them without poking
into module-specific code.
8 years ago
Nirbheek Chauhan
79f6626867
Pass --gresources to valac for each compiled gresource
...
Without this, the user has to both compile the resource with
gnome.compile_resources, pass that to the target sources, and also
pass --gresources=/path/to/gres.xml to vala_args in the target.
With this, we will do that automatically.
8 years ago
Nirbheek Chauhan
7b3d00fee4
Use dict for self.build.compilers instead of list
...
Everywhere we use this object, we end up iterating over it and comparing
compiler.get_language() with something. Using a dict is the obvious
choice and simplifies a lot of code.
8 years ago
Patrick Griffis
c42167dc6f
gnome.gtkdoc(): Include builddir variant of include dirs also
...
This avoids the need for users to constantly join paths themselves
as this is commonly included.
8 years ago
Nirbheek Chauhan
60716fcd6d
Use universal_newlines=True for all Popen calls
...
Instead of adding it everywhere manually, create a wrapper called
mesonlib.Popen_safe and use that everywhere that we call an executable
and extract its output.
This will also allow us to tweak it to do more/different things if
needed for some locales and/or systems.
Closes #1079
8 years ago
Patrick Griffis
c75b5886da
gnome.gtkdoc(): Include -rpath for gtkdoc-scangobj
...
Without libtool it is our job to ensure local libraries are picked up.
8 years ago
Patrick Griffis
e265887ac3
gnome.gtkdoc(): Add keyword to override the mode
...
I'm not entirely sure if you ever want to mix and match but
I can say that glib required none of them to be passed so
this allows for that.
8 years ago
Patrick Griffis
155617e539
i18n: Improve language handling
...
- Fix LINGUAS changes not being picked up
- Fix multiple langs per line in LINGUAS
- Make empty languages acceptable
Fixes #1127
8 years ago
Patrick Griffis
d764c7dc91
gnome.gtkdoc(): Add namespace keyword
8 years ago
Patrick Griffis
a626d1a7bc
gnome.gtkdoc(): Allow passing multiple source dirs
...
This is valid and used by glib for example.
8 years ago
Guillaume Poirier-Morency
ff55e848f6
pkgconfig: Raise an error if 'version' is not specified
8 years ago
Guillaume Poirier-Morency
6389e70c11
pkgconfig: 'Version' must be specified, even if it's empty
8 years ago
Marc-Antoine Perennou
bb3b45a0ec
gnome: use PkgConfigDependency to find gobject-introspection cflags
...
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
8 years ago
Thibault Saunier
9c0997dafd
gnome: Use g-ir-scanner --extra-library option when avalaible
...
When generating the .gir file we need g-ir-scanner to link the
introspector binary against the right dependencies, for that
we used to use the --library option but this has a special meaning
and the libs passed in there end up being the ones in the .gir file
itself, which is not what we want.
A new --extra-library option is beeing added in goject-introspection
(https://bugzilla.gnome.org/show_bug.cgi?id=774625 ) to handle our use case
(ie. not using libtool which allows g-ir-scanner to know about those)
and we should make use of it.
Closes #981
8 years ago
Patrick Griffis
acb0a38aac
i18n: Add preset kwarg
...
Many frameworks, such as glib, provide translation functions and
functions that take format strings. As such every application using
these must duplicate the gettext arguments to function properly.
This reduces that duplication and improves correctness so they are
not left out.
Fixes #1123
8 years ago
Patrick Griffis
7d68715297
i18n: Add merge_file function
...
This is a repeated task that we can simplify
Closes #1120
8 years ago
Thibault Saunier
e933bdd872
gnome: Properly search for programs
...
Otherwise it might just fail on windows and this way
we report a proper error message when not found.
8 years ago
Guillaume Poirier-Morency
bd22c9bdd2
pkgconfig: Add a newline after variable declarations
8 years ago
Patrick Griffis
e4a755ba92
i18n: Read languages from LINGUAS file
...
This avoids duplicating a list and allows the translation
maintainers to not have to modify the build system.
Mentioned in #1115
8 years ago
Patrick Griffis
9a6db2eb2f
gnome.compile_resources(): Add export and install_header kwargs
...
This defaults to not exporting resources as that is generally what
you want but that does make this a breaking change. Along with that
if you export your resources you would want to install the header.
8 years ago
Patrick Griffis
8dd32506f4
gnome.compile_resources(): Add ability to output gresource bundles
...
Closes #1061
8 years ago
Patrick Griffis
587a0bb3d1
gnome: Update required version for glib-compile-resources depfile fixes
...
Note that this version is not yet released
8 years ago
Jussi Pakkanen
a01919976e
Always specify installed data with a File object. Closes #858 .
8 years ago
Elliott Sales de Andrade
996f4d89f3
Disallow some keyword arguments to gnome.mkenums.
...
The install argument is allowed for CustomTargets, but we use
install_header as the setting now. Also, setting a generic template when
specifying the more specific source or header template shouldn't be
allowed.
8 years ago
Jussi Pakkanen
8b05990c13
Disable gresource dependency generation as it breaks Ninja.
8 years ago
Thibault Saunier
85a0cd7635
Add new add_project_[link]_args functions
...
Fixes 979
8 years ago