Nirbheek Chauhan
bb491735a9
coredata: Use our own implementation of commonpath
...
os.path.commonpath was added in Python 3.5, so just write our own for
now. pathlib was added in Python 3.4, so this should be ok. We need to
use that instead of doing str.split() etc because Windows path handling
has a lot of exceptions and pathlib handles all that for us.
Also adds a unit test for this.
8 years ago
Nirbheek Chauhan
7d6f628ed4
Support file perms for install_data and install_subdir
...
With the 'install_mode' kwarg, you can now specify the file and
directory permissions and the owner and the group to be used while
installing. You can pass either:
* A single string specifying just the permissions
* A list of strings with:
- The first argument a string of permissions
- The second argument a string specifying the owner or
an int specifying the uid
- The third argument a string specifying the group or
an int specifying the gid
Specifying `false` as any of the arguments skips setting that one.
The format of the permissions kwarg is the same as the symbolic
notation used by ls -l with the first character that specifies 'd',
'-', 'c', etc for the file type omitted since that is always obvious
from the context.
Includes unit tests for the same. Sadly these only run on Linux right
now, but we want them to run on all platforms. We do set the mode in the
integration tests for all platforms but we don't check if they were
actually set correctly.
8 years ago
Mike Sinkovsky
969be1f679
cleanup: Remove redundant parentheses
8 years ago
Nirbheek Chauhan
e441a74282
Derive all exceptions correctly from base exceptions
...
Don't need to define __init__ and manually call the parent init. Doing
so messes up the error message you get by doing str(exception) because
it includes the current class name in it repeatedly.
8 years ago
Kseniia Vasilchuk
69e2ef099c
configure_file: Use utf-8 to write configured file
...
as a second part of
https://github.com/mesonbuild/meson/issues/1085
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
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
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
Nirbheek Chauhan
e1c9d94708
Allow many version conditions for pkg-config deps
...
Sometimes we want to restrict the acceptable versions to a list of
versions, or a smallest-version + largest-version, or both. For
instance, GStreamer's opencv plugin is only compatible with
3.1.0 >= opencv >= 2.3.0
8 years ago
Nirbheek Chauhan
03cc991f4f
configure_file: Use utf-8 to write configured file
...
Closes #1085
8 years ago
Jussi Pakkanen
a01919976e
Always specify installed data with a File object. Closes #858 .
8 years ago
Scott D Phillips
ba578db031
mesonlib: close file before (re)moving
...
On windows, attempting to unlink an open file results in a
PermissionError, so close the file and then remove it.
8 years ago
Jussi Pakkanen
5f20b38d44
Force configure input files to be utf-8. Closes #927 .
8 years ago
Patrick Griffis
8b27a48d56
Don't default to lib64 if symlink
...
Some distros, such as Arch, symlink lib64 to lib for compat reasons
and programs shouldn't actually install there.
8 years ago
Jouni Kosonen
1ed3317a8b
Only default to dpkg-architecture output in Debian derivatives
8 years ago
Nirbheek Chauhan
57ce7d4618
Add support for extracting objects in unity builds
...
Not only does extract_all_objects() now work properly again,
extract_objects() also works if you specify a subset of sources all of
which have been compiled into a single unified object.
So, for instance, this allows you to extract all the objects
corresponding to the C sources compiled into a target consisting of
C and C++ sources.
8 years ago
Nirbheek Chauhan
a0551d7d6e
dependencies/boost: Fix 32-bit vs 64-bit on Windows
...
Fixes https://github.com/mesonbuild/meson/issues/526
Also removes useless and incorrect mesonlib.is_32bit() function. We
cannot trust that the architecture that Python is built for is the same
as the one we're targetting.
8 years ago
Tim-Philipp Müller
3aebdb717a
configuration_data: can pass descriptions to setters ( #783 )
...
Add support for passing a description to configuration data
setter methods via a 'description' kwarg. The description
string will be used when meson generates the entire configure
file without a template, autoconf-style.
8 years ago
Jussi Pakkanen
c8213aaf1e
Better file existance checks.
8 years ago
Elliott Sales de Andrade
4c71695e41
Use context manager for file I/O.
...
There are a few cases where a context manager cannot be used, such as
the logger.
8 years ago
Elliott Sales de Andrade
ae12656555
Use global id instead of local for hg tag. ( #710 )
8 years ago
Jussi Pakkanen
e3783f0f59
Check input file for existance. Closes #697 .
8 years ago
Nirbheek Chauhan
4516e8a49f
Add repr() implementations for build targets and File
...
This aids debugging
9 years ago
Jussi Pakkanen
177e286b3c
Can generate config headers without an input file. Closes #549 .
9 years ago
Nirbheek Chauhan
d3e1fe6e1a
mesonlib: Fix typo in version_compare error
9 years ago
Nirbheek Chauhan
8cd359acbb
Regex used for configuration data substitution was too broad ( #520 )
9 years ago
Hemmo Nieminen
af6f4c9b9c
coredata: Centralize builtin option descriptions and definitions.
9 years ago
Hemmo Nieminen
336904b553
Move MesonException from coredata to mesonlib.
9 years ago
Nirbheek Chauhan
11f63105d0
New builtin option: libexecdir for installation of helper executables
9 years ago
Tim-Philipp Müller
48a2b201ea
config file: write commented undef lines same as autoconf
...
For easier diffing to see if anything is missing when porting.
9 years ago
Jussi Pakkanen
f74d6201eb
Guard against ALL THE THINGS!
9 years ago
Jussi Pakkanen
9463c5965e
Swallow stderr of helper process invocation because nobody needs to see it and it causes problems in Debian testing framework.
9 years ago
Jussi Pakkanen
84456537da
Fix some issues that break pypi installs and bump version to upload new version.
9 years ago
Jussi Pakkanen
23b98cd6e6
Renamed meson package to mesonbuild so that we can have a script named meson in the same toplevel dir.
9 years ago
Jussi Pakkanen
8b1039fa30
Organise files into a module structure.
9 years ago
Yoav Alon
a4809cf632
Added support for extended command line to overcome OS command line length limitation
9 years ago
Jussi Pakkanen
8495075cee
Turned builtin options into proper objects.
9 years ago
Jussi Pakkanen
4286bdb86f
Trying to run nonexisting programs can return many different types of exception, so catch everything. Closes #299 .
9 years ago
Jussi Pakkanen
538073a9cf
Created a link test method.
9 years ago
Jussi Pakkanen
0d56955e9c
Created a stringarray option type and added Windows system libs option that uses it.
9 years ago
Jussi Pakkanen
b197d9e279
Can set compiler options with mesonconf.
9 years ago
Jussi Pakkanen
4dff3f9fb3
Refactored option classes to mesonlib.
9 years ago
Jussi Pakkanen
776f899e78
Made boost on windows kinda work.
9 years ago
Jussi Pakkanen
fd78c5a128
Drop non-numeric suffix in version numbers. Closes #258 .
9 years ago
Jussi Pakkanen
9d559b2b39
More robust windows detection and more logs.
9 years ago
Jussi Pakkanen
63572626c6
Copy permission bits from source files and fix a path issue.
9 years ago
Jussi Pakkanen
cd40187d4e
Handle files() in Vala arguments and set up deps correctly.
10 years ago
Jussi Pakkanen
28476aa719
Pass gracefully if dpkg-architecture is not installed.
10 years ago
Jussi Pakkanen
8cecf20404
Create file objects in gtest and gmock.
10 years ago
Jussi Pakkanen
6237695e96
Use File objects for all sources. Fix all basic tests.
10 years ago