summaryrefslogtreecommitdiff
path: root/mesonbuild/mesonlib.py
Commit message (Collapse)AuthorAgeFilesLines
...
* | | Don't use -fPIC on Cygwin, eitherJon Turney2017-04-061-0/+4
| | | | | | | | | | | | | | | | | | | | | Identify Cygwin-targetted gcc as sui generis (don't use -fPIC, but don't link with standard Windows libraries, either) Update tests appropriately
* | | Merge pull request #1557 from pitti/fix/configure_data-files-inputJussi Pakkanen2017-04-041-6/+6
|\ \ \ | |_|/ |/| | Fix configure_data files input
| * | Refactor duplicate code in FilePhilipp Ittershagen2017-04-031-6/+6
| |/ | | | | | | | | Increase readability using the File method self.relative_name() to factor out some of the os.path.join(...) commands.
* | Create unity files with the VS backend.Jussi Pakkanen2017-04-021-0/+2
|/
* Rewrite custom_target template string substitutionNirbheek Chauhan2017-02-201-0/+151
| | | | | | | | Factor it out into a function in mesonlib.py. This will allow us to reuse it for generators and for configure_file(). The latter doesn't implement this at all right now. Also includes unit tests.
* coredata: Use our own implementation of commonpathNirbheek Chauhan2017-01-301-0/+25
| | | | | | | | | 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.
* Support file perms for install_data and install_subdirNirbheek Chauhan2017-01-241-1/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Merge pull request #1312 from centricular/print-pkgdep-error-osxJussi Pakkanen2017-01-181-4/+2
|\ | | | | Fix pkg-config error handling on OS X
| * Derive all exceptions correctly from base exceptionsNirbheek Chauhan2017-01-171-4/+2
| | | | | | | | | | | | 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.
* | cleanup: Remove redundant parenthesesMike Sinkovsky2017-01-181-2/+2
|/
* configure_file: Use utf-8 to write configured fileKseniia Vasilchuk2016-12-221-1/+1
| | | | | as a second part of https://github.com/mesonbuild/meson/issues/1085
* Merge pull request #1233 from mesonbuild/wip/ignatenko/code-styleJussi Pakkanen2016-12-211-1/+1
|\ | | | | Trivial cleanups in code
| * tree-wide: remove unused importsIgor Gnatenko2016-12-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ./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>
* | Fix several more lint errorsNirbheek Chauhan2016-12-201-0/+4
|/ | | | | | | | | | | | | | | | | | | 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)
* Use universal_newlines=True for all Popen callsNirbheek Chauhan2016-12-111-0/+7
| | | | | | | | | | | 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
* Allow many version conditions for pkg-config depsNirbheek Chauhan2016-12-031-6/+23
| | | | | | | 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
* configure_file: Use utf-8 to write configured fileNirbheek Chauhan2016-11-231-1/+1
| | | | Closes #1085
* Always specify installed data with a File object. Closes #858.Jussi Pakkanen2016-11-181-0/+9
|
* mesonlib: close file before (re)movingScott D Phillips2016-10-271-3/+6
| | | | | On windows, attempting to unlink an open file results in a PermissionError, so close the file and then remove it.
* Force configure input files to be utf-8. Closes #927.Jussi Pakkanen2016-10-231-3/+3
|
* Merged dpkg-architecture fix for Gentoo.Jussi Pakkanen2016-10-231-9/+11
|\
| * Only default to dpkg-architecture output in Debian derivativesJouni Kosonen2016-10-221-9/+11
| |
* | Merge pull request #938 from centricular/fix-unity-buildsJussi Pakkanen2016-10-221-0/+16
|\ \ | | | | | | Several commits that fix unity builds
| * | Add support for extracting objects in unity buildsNirbheek Chauhan2016-10-211-0/+16
| |/ | | | | | | | | | | | | | | | | | | 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.
* | Don't default to lib64 if symlinkPatrick Griffis2016-10-221-1/+1
|/ | | | | Some distros, such as Arch, symlink lib64 to lib for compat reasons and programs shouldn't actually install there.
* dependencies/boost: Fix 32-bit vs 64-bit on WindowsNirbheek Chauhan2016-09-271-3/+0
| | | | | | | | 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.
* configuration_data: can pass descriptions to setters (#783)Tim-Philipp Müller2016-09-251-3/+5
| | | | | | 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.
* Better file existance checks.Jussi Pakkanen2016-09-011-6/+1
|
* Use context manager for file I/O.Elliott Sales de Andrade2016-08-271-6/+10
| | | | | There are a few cases where a context manager cannot be used, such as the logger.
* Use global id instead of local for hg tag. (#710)Elliott Sales de Andrade2016-08-271-1/+1
|
* Check input file for existance. Closes #697.Jussi Pakkanen2016-08-211-1/+4
|
* Add repr() implementations for build targets and FileNirbheek Chauhan2016-07-011-0/+10
| | | | This aids debugging
* Merge pull request #573 from centricular/dependency-versionsJussi Pakkanen2016-06-051-1/+1
|\ | | | | Several fixes to how versioned dependencies are handled + tests
| * mesonlib: Fix typo in version_compare errorNirbheek Chauhan2016-05-301-1/+1
| |
* | Can generate config headers without an input file. Closes #549.Jussi Pakkanen2016-06-011-0/+21
|/
* Regex used for configuration data substitution was too broad (#520)Nirbheek Chauhan2016-04-171-1/+3
|
* coredata: Centralize builtin option descriptions and definitions.Hemmo Nieminen2016-04-041-0/+3
|
* Move MesonException from coredata to mesonlib.Hemmo Nieminen2016-04-011-1/+3
|
* New builtin option: libexecdir for installation of helper executablesNirbheek Chauhan2016-03-171-0/+4
|
* config file: write commented undef lines same as autoconfTim-Philipp Müller2016-03-121-1/+1
| | | | For easier diffing to see if anything is missing when porting.
* Guard against ALL THE THINGS!Jussi Pakkanen2016-02-211-6/+9
|
* Swallow stderr of helper process invocation because nobody needs to see it ↵Jussi Pakkanen2016-02-211-4/+5
| | | | and it causes problems in Debian testing framework.
* Fix some issues that break pypi installs and bump version to upload new version.Jussi Pakkanen2016-01-161-2/+11
|
* Renamed meson package to mesonbuild so that we can have a script named meson ↵Jussi Pakkanen2016-01-161-0/+284
in the same toplevel dir.