Commit Graph

378 Commits

Author SHA1 Message Date
Jussi Pakkanen 22adda1617 Review fixes. 2017-11-21 23:29:06 +02:00
Jussi Pakkanen 5d51bc79c7 Replaced sys.executable use with the mesonlib equivalent. 2017-11-20 23:08:17 +02:00
Zbigniew Jędrzejewski-Szmek fadce7f9b4 Silence failed restorecon calls when $DESTDIR is set
This avoids hundres of warnings like:
Warning no default label for /var/tmp/instroot.hUbtYJ/path/to/some/binary

$DESTDIR is usually set to a temporary path, in which case the path is
unknown to selinux. For that case we could just skip the restorecon
calls.  But sometimes it is used with a path to container. In that
case, most of the time, selinux has no context for that path. But we
can't rule that out somebody added custom context rules for the
container. So let's still call restorecon, but silence the warning.
2017-11-19 18:26:46 +02:00
Elliott Sales de Andrade f91c4805b1 Pass restorecon file list through stdin.
This should avoid any issues with command-line argument limits.
2017-11-11 03:10:29 -05:00
Elliott Sales de Andrade 5f8b37d0e7 Coalesce restorecon calls into one.
Fixes #2596.
2017-11-09 19:45:28 -05:00
Xavier Claessens 7121eb8c51 gtkdoc: Pass the linker down to gtkdoc-scangobj
Closes #2540
2017-11-07 23:56:18 +02:00
Niklas Claesson 3fcf4ad272 MSI: Fix regenerate with visual studio
Fixes #2461
2017-10-19 20:18:46 +03:00
Corentin Noël 93d2ced31f Create the .po file with the `update_po` subcommand if it doesn't exist 2017-10-07 18:03:22 +03:00
Jussi Pakkanen 876b2475dd Made man page gzip creation deterministic. Closes #2363. 2017-09-23 11:31:59 +03:00
Jussi Pakkanen 19e22ac88a Merge pull request #2216 from ebassi/yelp-linguas
Support LINGUAS for gnome.yelp() languages
2017-09-14 21:35:50 +03:00
Nirbheek Chauhan c63aa0372b install: Also ignore PermissionError for selinux
When the user does not have permissions to run `selinuxenabled`, a
PermissionError is raised instead of FileNotFoundError.

Closes https://github.com/mesonbuild/meson/issues/2257
2017-09-04 19:24:31 +03:00
Gabríel Arthúr Pétursson 24ff7da0d2 Remove leftover debug print statement in meson_install.py 2017-08-20 23:16:42 +03:00
Emmanuele Bassi 0545228fdd Re-use gettext.read_linguas in yelphelper 2017-08-18 19:06:22 +01:00
Emmanuele Bassi 06fdabb7ac Support LINGUAS for gnome.yelp() languages
Listing all languages inside meson.build for the Yelp-based manual
localisation is error-prone, and it also requires parsing and modifying
Meson files from external tools.

Just like we do for i18n, we can use an ancillary `LINGUAS` file in the
help source sub-directory to list all the help languages.
2017-08-18 15:22:37 +01:00
Jussi Pakkanen 50fb7d37ab Make all functionality invokable via the main Meson binary,
which can be a Windows .exe file.
2017-08-18 12:08:20 +03:00
Stefan Sonski 462813f8f1 Exclude system sources from test coverage
Exclude /usr/src/ from code coverage, this is included for e.g. gtest/gmock.
2017-08-11 00:39:59 +03:00
Elliott Sales de Andrade 5cb1d00537 Allow excluding files from `install_subdir`
The install_subdir command now accepts a new `exclude` keyword argument
that allows specified files to be excluded from the installed
subdirectory.
2017-08-06 03:58:35 -04:00
Peter Hutterer d436869a89 Remove directories created by ninja install
Introduce a DirMaker class that disassembles the path up to '/' and stores all
directories in a list. That list is in creation order and pre-existing
directories are ignored, i.e. creating the two paths
'/usr/share/foo/bar/baz' and '/usr/share/foo/bar/boo' is stored as
    [ '/usr/share/foo',
      '/usr/share/foo/bar',
      '/usr/share/foo/bar/baz',
      '/usr/share/foo/bar/boo' ]
This is on the assumption that /usr/share already existed.

After all files have been installed, the list of created directories is
appended in reverse order to the install log. The uninstall script then
triggers rmdir on all directories.

If a custom install script drops files into the directories, removing those
will fail. This matches the current expectation, see the existing warning
"Remember that files created by custom scripts have not been removed."

Unfortunately, this makes the behavior on uninstall inconsistent. Assuming a
non-existing prefix,
        ninja install && ninja uninstall
removes all traces of the install.
However,
        ninja install && ninja install && ninja uninstall
removes the files only, not the directories as they already existed.

This could be fixed by just unconditionally removing any (emtpy) directories
that we drop files into, at the risk of removing system directories if empty.
For example, one could imagine /etc/foo.conf.d/ to be removed in that case if
it is empty.

https://github.com/mesonbuild/meson/issues/2032
2017-08-01 11:40:28 +01:00
Peter Hutterer 36e58e8865 meson_install: rename 'data' to 'd' for consistency
All other functions call it 'd', let's do it here too
2017-08-01 11:40:28 +01:00
Peter Hutterer 1826872fd2 install: restore the SELinux context on install
Try to restore the context for SELinux. If we fail on running
'selinuxenabled', quietly ignore the error and continue. If we fail on the
actual restorecon call, we print a message but disable SELinux - chances are
high that if one restorecon fails, others will too and that's likely a system
setup issue.

Fixes #1967
2017-07-31 18:45:38 -04:00
Jussi Pakkanen db34a3a701 Close files reliably. 2017-07-18 00:33:08 +02:00
Nirbheek Chauhan 04ac7a4844 gnome.gtkdoc: Handle absolute install_dirs correctly
Must prepend DESTDIR in case it's absolute. Also document that by
default it is relative to the gtk-doc html directory.
2017-07-17 12:40:41 +05:30
Jussi Pakkanen b5db2d3128 Return explicit 0 as it is used in a sys.exit statement (just like every other run function). 2017-07-16 12:06:46 +03:00
Jussi Pakkanen 1617634214 Use sys.exit rather than plain exit. 2017-07-16 12:05:09 +03:00
Jussi Pakkanen 624709bfc1 Merge pull request #1920 from QuLogic/hg-dist
Add Mercurial dist support
2017-06-21 04:48:29 -04:00
Elliott Sales de Andrade 79d005364f Add Mercurial dist support. 2017-06-13 00:32:43 -04:00
Elliott Sales de Andrade 1aa1d0d9ad Remove extraneous os.path.split()s.
Since only one part is needed, they can be replaced by dirname,
basename, or the originally joined file name.
2017-06-13 00:12:19 -04:00
Patrick Griffis 7764c0a7fa gnome.yelp(): Handle file existing on symlink
Fixes #1921
2017-06-09 22:03:28 -04:00
Patrick Griffis b2d9e4c1c0 gnome.yelp(): Handle platforms where symlink not supported 2017-06-09 21:59:45 -04:00
Patrick Griffis cacc8d99ce gnome.yelp(): Make copies of media files when symlink is false 2017-06-09 21:56:34 -04:00
Jussi Pakkanen 4ed68e7934 Merge pull request #1866 from ebassi/mkdb-args
Add mkdb_args support to gnome.gtkdoc()
2017-06-07 21:01:49 +03:00
Rene Lopez 94f46447bb Allow empty extra arguments in gettext script 2017-06-03 21:31:27 +03:00
Alistair Thomas a195b78c8d Whitespace tweaks to reduce Flake8 warnings 2017-05-29 19:32:47 +03:00
Emmanuele Bassi f3aa309fa1 Add mkdb_args support to gnome.gtkdoc()
There are cases where we need to specify arguments to gtkdoc-mkdb, like
telling it to scan extensions that are not '.h' and '.c'. Let's add a
new named argument to gnome.gtkdoc(), as well as the plumbing needed for
the gtk-doc helper script.
2017-05-28 23:58:54 +01:00
Jussi Pakkanen effe4fb134 Create helper function for a rmtree that works reliably on Windows. 2017-05-21 21:47:24 +03:00
Elliott Sales de Andrade c69d82795c Delete the correct directory in dist check. 2017-05-17 19:43:23 -04:00
Elliott Sales de Andrade 34e4d32ac7 Remove dead code paths. 2017-05-17 19:43:23 -04:00
Elliott Sales de Andrade ea636fcd51 Remove unused variables. 2017-05-17 04:41:54 -04:00
Elliott Sales de Andrade 65b1d33931 Remove unused imports. 2017-05-17 03:42:16 -04:00
Jussi Pakkanen 95f8cb93b3 Strip system directories and show coverage for files not executed at all. Closes #1721. 2017-05-13 23:30:54 +03:00
Jussi Pakkanen 111e3df45d Moved coverage commands to a standalone script. 2017-05-13 22:54:08 +03:00
Jussi Pakkanen 8068fc0d1d Add test and release notes. 2017-05-12 14:25:27 +03:00
Jussi Pakkanen 6e59d84534 Initialise submodules. 2017-05-11 19:34:16 +03:00
Jussi Pakkanen a91aed8854 Test created tarball by doing a full build + test + install cycle. 2017-05-11 19:34:16 +03:00
Jussi Pakkanen 255be79e22 Created a dist target. Closes #877. 2017-05-11 19:34:16 +03:00
Peter Hutterer ca924451ac Use American English: behaviour -> behavior 2017-05-04 22:09:27 +03:00
Jussi Pakkanen 0e3aa5a348 Merge pull request #1587 from mesonbuild/tingping/msgfmt-datadir
i18n: Improve data_dirs support
2017-05-03 18:51:55 +03:00
Dylan Baker a8173630ea Don't use len() to test emptiness vs not emptiness
Meson has a common pattern of using 'if len(foo) == 0:' or
'if len(foo) != 0:', however, this is a common anti-pattern in python.
Instead tests for emptiness/non-emptiness should be done with a simple
'if foo:' or 'if not foo:'

Consider the following:
>>> import timeit
>>> timeit.timeit('if len([]) == 0: pass')
0.10730923599840025
>>> timeit.timeit('if not []: pass')
0.030033907998586074
>>> timeit.timeit('if len(['a', 'b', 'c', 'd']) == 0: pass')
0.1154778649979562
>>> timeit.timeit("if not ['a', 'b', 'c', 'd']: pass")
0.08259823200205574
>>> timeit.timeit('if len("") == 0: pass')
0.089759664999292
>>> timeit.timeit('if not "": pass')
0.02340641999762738
>>> timeit.timeit('if len("foo") == 0: pass')
0.08848102600313723
>>> timeit.timeit('if not "foo": pass')
0.04032287199879647

And for the one additional case of 'if len(foo.strip()) == 0', which can
be replaced with 'if not foo.isspace()'
>>> timeit.timeit('if len("   ".strip()) == 0: pass')
0.15294511600222904
>>> timeit.timeit('if "   ".isspace(): pass')
0.09413968399894657
>>> timeit.timeit('if len("   abc".strip()) == 0: pass')
0.2023209120015963
>>> timeit.timeit('if "   abc".isspace(): pass')
0.09571301700270851

In other words, it's always a win to not use len(), when you don't
actually want to check the length.
2017-05-02 21:57:26 +03:00
Patrick Griffis 82492f5d76 i18n: Add data_dirs kwarg to merge_file()
For parity with gettext()

Fixes #1565
2017-04-29 04:05:20 -04:00
Peter Hutterer 6a4efe8a82 Drop terminating fullstop from "Installing blah to blah" messages
Grammatically, this full stop isn't needed and with file names it has a
potential to be confusing:
    Installing /foo/bar/filename.1 to /foo/bar/dirname.

The full stop caused me to do a double-take more than once, so let's drop it.
2017-04-19 16:11:37 +03:00
Jussi Pakkanen 0e47e74a77 Do not obliterate old rpath because it might be used due to read only data sharing. Closes #1619. 2017-04-17 12:48:54 +03:00
Rafael Fontenelle 7c43edb840 gtkdochelper: Fix type file name option
'gtkdoc-scangobj' script was recently ported to Python (it was Perl), and it now requires providing '--type' option to specify the name of the file to store the types in. Without this option, 'gtkdockelper' will exit with error status 2 and will throw a message "gtkdoc-scangobj: error: unrecognized arguments: <typefile>"
2017-04-13 23:39:22 +03:00
Jussi Pakkanen 761b28371a Merge pull request #1518 from centricular/mesonintrospect-evar
Export MESONINTROSPECT to postconf/install/run_command scripts
2017-04-08 21:25:25 +03:00
Jon Turney 320490cd00 Ignore install as non-existent user or group
'test cases/common/12 data' and 'test cases/common/66 install subdir' both
try to install something as 'root'.  This user doesn't exist on Cygwin.

Perhaps we should automatically convert this to some other user, but it's
not clear which. For real projects, it's possibly better for the meson.build
to explicitly handle this...

'test cases/common/12 data' also tries to install something with GID 0.
There's no guarantee this group exists.
2017-04-06 22:48:02 +01:00
Jon Turney fd47ef3a27 Use '.exe' extension for executables for Cygwin
Use '.exe' extension for executables for Cygwin when building and installing
2017-04-06 22:47:15 +01:00
Nirbheek Chauhan 27f5f0a963 Export MESONINTROSPECT to postconf/install/run_command scripts
Points to the `mesonintrospect.py` script corresponding to the
currently-running version of Meson.

Includes a test for all three methods of running scripts/commands.

Closes https://github.com/mesonbuild/meson/issues/1385
2017-03-28 00:55:01 +05:30
Jussi Pakkanen 0c957b75c6 Install PDB files. Closes #1442. 2017-03-02 20:31:05 +02:00
Jussi Pakkanen b927468137 Use cross stripper when cross compiling and allow overriding native strip executable. Closes #1414. 2017-02-27 16:49:32 -05:00
Jussi Pakkanen 14e0529a03 Do not strip jar targets. Closes #1343. 2017-02-06 19:09:22 +01:00
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.
2017-01-24 00:20:51 +05:30
Mike Sinkovsky 969be1f679 cleanup: Remove redundant parentheses 2017-01-18 21:22:47 +02:00
Mike Sinkovsky 5b626ab4cb style: [E1**] Indentation 2017-01-11 12:33:27 -05:00
Mike Sinkovsky 77515ee541 style: [E303] too many blank lines (2) 2017-01-11 12:33:27 -05:00
Jussi Pakkanen 56e2c46ce1 Merge pull request #1272 from mesonbuild/ignatenko/lint
fix some linting errors
2017-01-03 16:04:24 -05:00
Mike Sinkovsky 079e43f70b fix 'unreachable code' warnings 2017-01-03 13:34:39 -05:00
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>
2017-01-02 19:16:56 +01:00
Igor Gnatenko f0bc5568a7 style: fix E703 violations
E703: statement ends with a semicolon

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2017-01-01 12:02:05 -05:00
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>
2017-01-01 12:02:05 -05:00
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>
2017-01-01 12:02:05 -05:00
Igor Gnatenko ea570bcb67 style: fix E265 violations
E265: block comment should start with '# '

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2017-01-01 12:02:05 -05:00
Igor Gnatenko 5693758e46 style: fix E231 violations
E231: missing whitespace after ','

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2017-01-01 12:02:05 -05:00
Igor Gnatenko 2017d8578a style: fix E226 violations
E226: missing whitespace around arithmetic operator

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2017-01-01 12:02:05 -05:00
Igor Gnatenko f0b30baa39 style: fix E225 violations
E225: missing whitespace around operator

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2017-01-01 12:02:05 -05:00
Jussi Pakkanen b55235dfbd Fix space before :. 2016-12-31 16:28:15 +02:00
Jussi Pakkanen 0a14ad63de Add simple uninstall target. Closes #753. 2016-12-31 13:55:55 +02:00
Hemmo Nieminen 4ae629d2aa Use the correct directory for scan-build command. 2016-12-31 13:39:28 +02:00
Jussi Pakkanen 4b7c39d9d1 Merge pull request #1247 from centricular/fix-installed-soname-aliases
Fix soname symlinking after installation
2016-12-23 00:28:00 +02:00
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.
2016-12-22 02:27:01 +05:30
Matthieu Gautier 9d1e426bcc Fix installation of statically linked executable for ELF binary.
At installation, if the executable is a ELF file, we try to fix the
dependencies in the binary section.
If a executable has been compiled with the --static flag, there is
no .dynamic section in the ELF binary and so we need to handle this case.
2016-12-21 22:03:18 +02:00
Jussi Pakkanen a2528a8816 Merge pull request #1233 from mesonbuild/wip/ignatenko/code-style
Trivial cleanups in code
2016-12-21 00:09:44 +02:00
Igor Gnatenko 9ffc0d2f89 tree-wide: remove blank lines at EOF
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2016-12-19 18:34:06 +01:00
Igor Gnatenko e611b6748b tree-wide: remove unused variables
./mesonbuild/scripts/regen_checker.py:35:5: F841 local variable 'scriptdir' is assigned to but never used
    scriptdir = os.path.split(__file__)[0]
    ^
./mesonbuild/scripts/yelphelper.py:84:13: F841 local variable 'symfile' is assigned to but never used
            symfile = os.path.join(install_dir, m)
            ^
./mesonbuild/backend/backends.py:164:13: F841 local variable 'lang' is assigned to but never used
            lang = comp.get_language()
            ^
./mesonbuild/backend/ninjabackend.py:1286:9: F841 local variable 'scriptdir' is assigned to but never used
        scriptdir = self.environment.get_script_dir()
        ^
./mesonbuild/backend/vs2010backend.py:736:9: F841 local variable 'additional_options_set' is assigned to but never used
        additional_options_set = True
        ^

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2016-12-19 18:22:20 +01:00
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>
2016-12-19 18:19:35 +01:00
Nirbheek Chauhan 8e06ab6a95 Use a script to clean-up custom-target output dirs
The script will manually delete all custom_target outputs that are
directories instead of files. This is needed because on platforms other
than Windows, Ninja only deletes directories while cleaning if they are
empty.

Closes #1220
2016-12-19 22:31:26 +05:30
Jussi Pakkanen 7851daec7a Merge pull request #1216 from mesonbuild/ignatenko/shebangs
Remove shebangs on files inside module
2016-12-18 20:11:04 +02:00
Nirbheek Chauhan 6b8df9da84 custom_target: Make directory outputs installable
This is useful in many cases where the list of files cannot be known in
advance and is just dumped inside a directory. For example when
generating documentation with doxygen and other tools that we don't have
built-in support for.

Includes a test for the same.

Closes #893
2016-12-18 20:00:25 +02:00
Nirbheek Chauhan c693bd9bb4 Allow passing arguments to install scripts
Closes #1213
2016-12-18 18:30:47 +02:00
Igor Gnatenko 4fbaf295f6 remove shebangs from scripts
meson.noarch: E: non-executable-script /usr/lib/python3.5/site-packages/mesonbuild/scripts/regen_checker.py 644 /usr/bin/python3
meson.noarch: E: non-executable-script /usr/lib/python3.5/site-packages/mesonbuild/scripts/meson_test.py 644 /usr/bin/python3
meson.noarch: E: non-executable-script /usr/lib/python3.5/site-packages/mesonbuild/scripts/meson_benchmark.py 644 /usr/bin/python3
meson.noarch: E: non-executable-script /usr/lib/python3.5/site-packages/mesonbuild/scripts/meson_exe.py 644 /usr/bin/python3
meson.noarch: E: non-executable-script /usr/lib/python3.5/site-packages/mesonbuild/scripts/symbolextractor.py 644 /usr/bin/python3
meson.noarch: E: non-executable-script /usr/lib/python3.5/site-packages/mesonbuild/scripts/commandrunner.py 644 /usr/bin/python3
meson.noarch: E: non-executable-script /usr/lib/python3.5/site-packages/mesonbuild/scripts/gtkdochelper.py 644 /usr/bin/python3
meson.noarch: E: non-executable-script /usr/lib/python3.5/site-packages/mesonbuild/scripts/meson_install.py 644 /usr/bin/python3
meson.noarch: E: non-executable-script /usr/lib/python3.5/site-packages/mesonbuild/scripts/depfixer.py 644 /usr/bin/python3
meson.noarch: E: non-executable-script /usr/lib/python3.5/site-packages/mesonbuild/scripts/dirchanger.py 644 /usr/bin/python3
meson.noarch: E: non-executable-script /usr/lib/python3.5/site-packages/mesonbuild/scripts/delwithsuffix.py 644 /usr/bin/python3
meson.noarch: E: non-executable-script /usr/lib/python3.5/site-packages/mesonbuild/scripts/vcstagger.py 644 /usr/bin/python3

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2016-12-18 16:55:34 +01:00
Thibault Saunier 5b5edd6b33 gettext: Respect the --subdir argument before the MESON_SUBDIR var
In the case of subproject we will properly setup the --subdir argument
but the MESON_SUBDIR is never adapted and will point to an empty string
leading to the following backtrace when building `gst-build`:

  msgfmt: error while opening "/home/thiblahute/devel/gstreamer/gst-build/af.po" for reading: No such file or directory
  Traceback (most recent call last):
    File "/home/thiblahute/devel/gstreamer/gst-build/meson/meson.py", line 37, in <module>
      sys.exit(main())
    File "/home/thiblahute/devel/gstreamer/gst-build/meson/meson.py", line 34, in main
      return mesonmain.run(launcher, sys.argv[1:])
    File "/home/thiblahute/devel/gstreamer/gst-build/meson/mesonbuild/mesonmain.py", line 248, in run
      sys.exit(run_script_command(args[1:]))
    File "/home/thiblahute/devel/gstreamer/gst-build/meson/mesonbuild/mesonmain.py", line 236, in run_script_command
      return cmdfunc(cmdargs)
    File "/home/thiblahute/devel/gstreamer/gst-build/meson/mesonbuild/scripts/gettext.py", line 111, in run
      if gen_gmo(src_sub, bld_sub, langs) != 0:
    File "/home/thiblahute/devel/gstreamer/gst-build/meson/mesonbuild/scripts/gettext.py", line 66, in gen_gmo
      '-o', os.path.join(bld_sub, l + '.gmo')])
    File "/usr/lib/python3.5/subprocess.py", line 581, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command '['msgfmt', '/home/thiblahute/devel/gstreamer/gst-build/af.po', '-o', '/home/thiblahute/devel/gstreamer/gst-build/build/af.gmo']' returned non-zero exit status 1
  Failed to run install script: /usr/bin/python3 /home/thiblahute/devel/gstreamer/gst-build/meson/meson.py --internal gettext install --subdir=subprojects/gstreamer/po --localedir=share/locale --pkgname=gstreamer-1.0 --langs=af@@az@@be@@bg@@ca@@cs@@da@@de@@el@@en_GB@@eo@@es@@eu@@fi@@fr@@gl@@hr@@hu@@id@@it@@ja@@lt@@nb@@nl@@pl@@pt_BR@@ro@@ru@@rw@@sk@@sl@@sq@@sr@@sv@@tr@@uk@@vi@@zh_CN@@zh_TW
  FAILED: install
  '/usr/bin/python3' '/home/thiblahute/devel/gstreamer/gst-build/meson/meson.py' '--internal' 'install' '/home/thiblahute/devel/gstreamer/gst-build/build/meson-private/install.dat'
2016-12-17 14:21:27 +02:00
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.
2016-12-12 21:01:49 +02:00
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
2016-12-11 01:59:58 +02:00
Jussi Pakkanen d1501e39d5 Merge pull request #1086 from Keruspe/master
Allow specifying some toolchain executables using env
2016-12-06 23:43:36 +02:00
Jussi Pakkanen c58da4ee52 Merge pull request #1151 from mesonbuild/tingping/gtk-doc
gnome: Various improvements to gtkdoc
2016-12-06 23:27:41 +02:00
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.
2016-12-06 14:07:45 -05:00
Nirbheek Chauhan b9a7c0cf39 misc: Use relative imports everywhere
Using 'mesonbuild' as the module can cause it to use the
system-installed module and can also break if we rename the directory,
so avoid that by always using relative imports.
2016-12-07 00:24:17 +05:30
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
2016-12-06 20:29:20 +02:00
Patrick Griffis d764c7dc91 gnome.gtkdoc(): Add namespace keyword 2016-12-06 13:23:58 -05:00
Patrick Griffis a626d1a7bc gnome.gtkdoc(): Allow passing multiple source dirs
This is valid and used by glib for example.
2016-12-06 12:23:29 -05:00
Patrick Griffis 9b560c29b6 gnome.gtkdoc(): Fix including doc source dir in path 2016-12-06 10:58:18 -05:00
Marc-Antoine Perennou a70f39f815 allow overriding nm with NM
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2016-12-05 10:57:10 +01:00
Marc-Antoine Perennou 4d3cce1532 allow overriding readelf with READELF
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2016-12-05 10:57:10 +01:00
Jussi Pakkanen c7ddce163f All testing is now in mesontest.py, which simplifies a lot of stuff. 2016-11-18 22:10:22 +02:00
Jussi Pakkanen 39df22bf53 Made Meson test into a class rather than abusing global variables and as preparation for moving it elsewhere. 2016-11-18 22:08:07 +02:00
Jussi Pakkanen 077741097a Run all tests if none are specified. 2016-11-18 22:04:29 +02:00
Jussi Pakkanen def68cbc50 Use the same code for tests and benchmarks. 2016-11-18 22:04:29 +02:00
Jussi Pakkanen 951262d759 Removed Valgrind from core. 2016-11-18 22:04:29 +02:00
Jussi Pakkanen ee90ce74e8 New test runner. 2016-11-18 22:04:29 +02:00
Elliott Sales de Andrade 155f163341 Use portable path separator in wrappers.
The semicolon only separates paths on Windows, but the wrapper is
sometimes used on other platforms.
2016-11-13 12:39:03 -05:00
Olexa Bilaniuk 05e217caa5 Fixed SyntaxError in itstool invocation in yelphelper.py during
installation.

During a `python3.4 setup.py install`, the yelphelper.py script errors
out with: "SyntaxError: can use starred expression only as assignment
target". Fix this problem.
2016-11-12 13:06:16 -05:00
Nirbheek Chauhan 55288b0fcc scripts/gtkdochelper: ignore_headers is a list
Also, only add it if it's defined.

Closes #1020
2016-11-12 11:54:13 -05:00
Nirbheek Chauhan 52eab4b006 vs backend: coredata.meson_script_file was renamed 2016-11-10 00:40:16 +05:30
Jussi Pakkanen f7431fd5db Can specify scan-build executable with an environment variable. Closes #1015. 2016-11-09 10:26:27 -05:00
Nirbheek Chauhan a2262103fb Implement mlog.warning and use it everywhere for warnings
Prepends the string with 'WARNING:' in ANSI yellow.

Closes https://github.com/mesonbuild/meson/issues/961
2016-11-08 17:43:24 -05:00
Patrick Griffis 314eb5110e gettext: Use argparse to handle arguments 2016-11-02 13:54:57 -07:00
Emmanuele Bassi e226d702bc gtkdoc: Add `ignore_headers` positional argument
Not all headers are public, or contain public types. GTK-Doc allows
adding headers to be ignored during the "scan" phase, by passing the
`--ignore-headers` command line argument to gtkdoc-scan.

Currently, you can do something like:

  ignored_headers = [ 'foo-private.h', 'bar-private.h', ]

  gnome.gtkdoc(...
               scan_args: [
                 '--ignore-headers=' + ' '.join(ignored_headers),
               ],
               ...)

But it does not guarantee escaping rules and it's definitely not nice.

We can add a simpler version of that mechanism through a new positional
argument, `ignore_headers`, which behaves like `content_files` or
`html_assets`, and takes an array of header files to ignore:

  gnome.gtkdoc(...
               ignore_headers: ignored_headers,
               ...)
2016-11-01 14:11:48 +00:00
Emmanuele Bassi 6eeecb8585 gtkdochelper: Add 'overrides.txt' to the content files
If a `<modulename>-overrides.txt` file exists in the docs directory it
means it's intended to be used in place of the one gtk-doc generates.

GLib and GTK+, for instance, ship with one because some of the types
they provide — like the thread primitives, or the platform macros —
contain architecture-dependent fields that should not be accessed
directly.

This commit should close the last bit of issue #550.
2016-11-01 14:10:56 +00:00
Aurelien Jarno caa1ef6318 Fix depfixer on MIPS. 2016-10-24 12:14:42 -07:00
Patrick Griffis 423c8dbb40 gettext: Add update-po target
For each project this creates a <project>-update-po target.
When ran this updates the pot file and then merges it back
into the po files in the source directory with `msgmerge`
for project maintainers and translators.

Fixes #819
2016-10-23 08:46:48 -07:00
Patrick Griffis 1781129740 gnome: Add yelp() function
Fixes #881
Mentioned in #295
2016-10-19 18:44:19 -04:00
Patrick Griffis 44690763b0 gnome: Include build dir in gtkdoc-mkhtml path 2016-10-19 21:16:29 +03:00
Hemmo Nieminen c4fabc8ecf Don't mention non-existing log files after testing. 2016-10-19 01:08:54 +03:00
Patrick Griffis f30be6fb92 gettext: Add ability to set GETTEXTDATADIRS
Some projects use this to allow using local its files
2016-10-16 17:54:16 +03:00
Jussi Pakkanen 1f4cce86ad Remove shebangs on files that are not runnable and add execute bits to those that are. 2016-10-07 21:10:33 +03:00
Thibault Saunier bb3823e6f4 gnome: Allow specifying gtkdoc where to install directory 2016-09-26 15:25:59 -03:00
Thibault Saunier f86fbf6ebf gnome: Run gtkdoc-scanobjs and add a way to get assets working
Allowing the object tree to be generated.

We need to add options to allow copying the ncesseary sources and
assets so the HTML generator can work with them (everything is
relative so we need to copy them in the build directory).

Until now the documentation was not generated from the user provided
main sgml file but it was using a generated one, which lead to a broken
documentation. Starting using it revealed the other bugs fixed in that
commit.
2016-09-26 15:25:59 -03:00
Tim-Philipp Müller 5ebc77f722 i18n: use POTFILES.in as fallback if there's no POTFILES in po dir
In autotools POTFILES is generated at configure time from POTFILES.in,
but Meson only looks for a po/POTFILES in the source directory, which
is awkward when trying to maintain both build systems in parallel.
Instead just use POTFILES.in as fallback if it exists but POTFILES
does not. Also print an error if neither exists.

Fixes #818
2016-09-25 20:06:02 +01:00
Thibault Saunier a2e7ebc575 Add a new 'environment' object to be used to build test environment (#781)
Allowing user to fine tune tests environment variables
2016-09-14 23:11:27 +03:00
Thibault Saunier 5d30ea99ea meson_test: Add env variables to the test logs file (#767)
So users can more easily reproduce the test without the
launcher
2016-09-08 21:50:19 +03:00
Jussi Pakkanen 3f62fb788b Remove unneeded shebang line that was triggering some linters. 2016-09-07 22:06:33 +03:00
Jussi Pakkanen cdf0c4f1a9 Merge branch 'QuLogic-context-managers' 2016-09-01 23:12:06 +03:00
Elliott Sales de Andrade 38a2a636b5 Refactor DESTDIR determination into a single function. 2016-08-27 23:07:59 -04:00
Elliott Sales de Andrade 3a593d0aca Always obey DESTDIR even with absolute install_dir.
Passing an absolute path to `install_dir` would previously always
attempt to install there, instead of obeying DESTDIR, since os.path.join
will 'reset' on absolute paths.
2016-08-27 23:07:59 -04:00
Elliott Sales de Andrade fe0aa7daff Convert depfixer.Elf class into a context manager.
This allows for automatic closing of its internal file handle.
2016-08-27 18:29:56 -04:00
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.
2016-08-27 18:29:55 -04:00
Elliott Sales de Andrade b7757189e4 Echo stderr from captured command.
This helps with debugging if the command fails.
2016-08-26 20:46:42 -04:00
Elliott Sales de Andrade 70d94a5550 Allow capturing command output of a custom target.
For commands that always output to stdout and don't have a "-o" or
"--output" or some other similar option, this 'capture' setting allows
the build to capture the result and place it in the output file.
2016-08-26 20:46:42 -04:00
Jussi Pakkanen 3671c40a4b Handle both DT_RPATH as well as DT_RUNPATH when fixing rpath settings. 2016-08-04 21:31:40 +03:00
Nirbheek Chauhan 042e0b3467 gtkdochelper: Add error checking and printing
This helps debug why things are failing
2016-07-24 13:48:12 +05:30
Nirbheek Chauhan 69d9c2228d vs: Fix Meson invocation while doing regen (#646)
The Meson script is not always in $scriptdir/../../ -- for instance if
installed with pip on Windows, the scriptdir is in:

C:/Python35/Lib/site-packages/meson-0.33.0.dev1-py3.5.egg/mesonbuild/scripts

and the meson.py script is in:

C:/Python35/Scripts

So, let's save the path available as Environment().meson_script_file
into the coredata.dat private file and use that to invoke Meson when
doing regen.

Also, let's fetch the backend that was used from the coredata too
instead of hard-coding vs2010.

Both these were causing a hard failure while doing regen with msbuild or
visual studio.
2016-07-19 00:00:17 +03:00
Jussi Pakkanen 64919b1c74 Merge pull request #417 from nirbheek/dll-paths
Fix filenames and paths used in DLL shared library generation
2016-07-13 22:18:50 +03:00
Jussi Pakkanen 38a896ae51 Create a log file of all files installed. 2016-07-12 13:43:49 +03:00
Nirbheek Chauhan 598997bdb5 scripts/install: Also strip '\' from the end of a path
Fixes installation of subdirs on Windows
2016-07-01 20:50:47 +05:30
Nirbheek Chauhan b2fb4f9d66 scripts: Use destdir_join fix for all DESTDIR prefixing (#598) 2016-06-16 20:43:23 +03:00
Hemmo Nieminen 30bbcded23 meson_test: Fix a bug in valgrind argument handling.
Do not modify the wrap command argument from the calling function.
Appending the valgrind arguments to the wrap list argument will cause all
the valgrind arguments to cumulate from all the tests to the wrapper
command itself.
2016-06-06 10:28:00 +03:00
Jussi Pakkanen 205037047f Try to delete target files before installing. Closes #578. 2016-06-05 14:16:01 +03:00
Jussi Pakkanen 0482635c12 Handle case of install_subdirring a subdir. 2016-05-30 23:08:24 +03:00
Jussi Pakkanen beb6827413 Installing subdirs now merges with existing files in the target dir. 2016-05-30 21:48:03 +03:00
Jussi Pakkanen 9dace5fc5e Always initialise final_command. 2016-05-28 23:14:34 +03:00
Jussi Pakkanen aac7f6ef1f Since we only care about shebang line and sane ones use plain ASCII, use an encoding that can not fail. Closes #561. 2016-05-28 23:04:15 +03:00
Jussi Pakkanen 1b78e354a6 Join windows-style destdir paths correctly. Closes #567. 2016-05-28 14:13:01 +03:00
Jussi Pakkanen 3b3c05f6b1 Can pass extra args to xgettext. Closes #554. 2016-05-26 01:09:37 +03:00
Jussi Pakkanen f3fa6c02a7 Merge pull request #556 from ebassi/gtkdoc-fixref
Support passing extra arguments to gtkdoc-fixxref
2016-05-25 18:00:15 +03:00
Jussi Pakkanen babdb27570 Merge pull request #479 from mesonbuild/i18n
Moved gettext into i18n module.
2016-05-25 17:53:35 +03:00
Emmanuele Bassi 8998e44cd9 Support passing extra arguments to gtkdoc-fixxref
The extra arguments are typically used to specified the location of
installed API references that gtk-doc can use to create cross links
for symbols.

Fixes #555
2016-05-25 11:36:33 +01:00
Jussi Pakkanen 1a0938cc25 Automagic scan-build support. 2016-05-22 19:24:59 +03:00
Jussi Pakkanen dc148e0702 Remove all special casing for gettext and use elementary operations instead. 2016-05-21 18:21:23 +03:00
Jussi Pakkanen 2e2df70dd0 Merge branch 'centricular-customtarget-path-windows' 2016-05-01 18:39:45 +03:00
Minijackson cab1c3f2bf Fix argv count requirement in delwithsuffix.py script 2016-04-28 14:10:34 +02:00
Nirbheek Chauhan ed774a68c6 scripts/meson_exe: prepend extra_paths to PATH instead of appending
This way locally-built DLLs and EXEs are preferred over system-wide ones
2016-04-18 22:51:24 +05:30
Nirbheek Chauhan e3bc2e5c68 ninja: Set PATH for CustomTargets with built EXEs on Windows
When a CustomTarget is run with a command that is an executable built
by the project which also has a DLL built in the same project as a
dependency, the EXE can't run on Windows because the DLL can't be found.
On UNIX-like systems, we set the RPATH using the linker so these
dependencies can be found, but on Windows the only way is to set the
PATH environment variable.

The same problem exists for tests, so we reuse that infrastructure by
creating a new meson_exe.py script that can be used as a wrapper to run
CustomTarget commands on Windows. This can later also be extended to add
support for setting an environment while calling the command needed to
generate a CustomTarget: https://github.com/mesonbuild/meson/issues/266
2016-04-15 05:49:42 +05:30
trhd a76693f338 Fix a bug (typo) seen when printing the logs from failed tests. (#513) 2016-04-14 07:49:46 +03:00
Jussi Pakkanen cab5ce4fc0 Merge pull request #438 from trhd/testing_options
New options for controlling test output.
2016-04-06 23:10:20 +03:00
Jussi Pakkanen ea092fefc2 Use individual tempdirs for building and installing in unit tests. 2016-04-01 20:20:48 +03:00
Hemmo Nieminen 5764bee2f4 meson_test: Don't print logs from failing tests that are expected to fail. 2016-04-01 00:51:12 +03:00
Hemmo Nieminen 297749581d meson_test: Add support for --print-errorlogs option.
This option can be used to control whether the logs from failing tests
should be shown to the user after the tests have been executed.
2016-04-01 00:51:12 +03:00
Hemmo Nieminen f2868420ca meson_test: Add support for --no-stdsplit option. 2016-04-01 00:51:12 +03:00
Hemmo Nieminen 457ecb6be7 meson_test: Move "options" to a global variable. 2016-04-01 00:51:12 +03:00
Jussi Pakkanen 67377e69b5 Invoke depfixer in-process to make it faster. Closes #480. 2016-03-30 22:09:36 +03:00
Nirbheek Chauhan d5c9b98cab meson_install.py: Start by checking if the shebang is directly runnable
If it's just runnable as-is, then we don't need to do fancy basename detection
and such to find the interpretor to use for running the script.
2016-03-17 16:16:35 +05:30
Nicolas Schneider 40a7287a59 vs2010: properly check whether solution needs to be regenerated 2016-02-25 23:13:29 +01:00
Nirbheek Chauhan a15e784851 meson_install: os.symlink may be implemented and still not work
Requires Administrator access by default to work
2016-02-20 14:28:28 +02:00
Jussi Pakkanen 091b782e43 Prevent state leaks when running tests in-process. 2016-02-17 23:27:18 +02:00
Jussi Pakkanen edd61dcf81 When killing a frozen process, take all its children with it. Closes #377. 2016-02-14 22:11:48 +02:00
Jussi Pakkanen 58d7db4a6c Some windows fixes. 2016-01-23 17:45:01 +02:00
Jussi Pakkanen b91134b806 Better error message when failing to run install script. Closes #361. 2016-01-23 13:24:30 +02:00
Jussi Pakkanen 84456537da Fix some issues that break pypi installs and bump version to upload new version. 2016-01-16 20:59:34 +02:00
Jussi Pakkanen d6e176f455 Made gtkdoc and run targets work. 2016-01-16 18:04:59 +02:00
Jussi Pakkanen 23b98cd6e6 Renamed meson package to mesonbuild so that we can have a script named meson in the same toplevel dir. 2016-01-16 17:35:29 +02:00