Commit Graph

3016 Commits

Author SHA1 Message Date
Jussi Pakkanen 415990f1ba Version number bump for new development (again). 2016-12-20 22:26:13 +02:00
Jussi Pakkanen 3d4bfdcb22 Update version number for 0.37.1. 2016-12-20 21:45:01 +02:00
Jussi Pakkanen c7685e8ab3 Merge pull request #1228 from mesonbuild/runcross
Fix cross test and run them if a cross compiler is available.
2016-12-20 21:23:56 +02:00
Jussi Pakkanen 701e393261 Make cross tests use same framework as regular tests. 2016-12-20 20:35:29 +02:00
Jussi Pakkanen 3fc67f4951 Minimal fixes to make tests pass when cross compiling. 2016-12-20 20:33:59 +02:00
Jussi Pakkanen 2b65083463 Fix cross test and run them if a cross compiler is available. 2016-12-20 20:33:59 +02:00
Jussi Pakkanen 4317edca25 Merge pull request #1227 from centricular/ninja-clean-recursive-dir-delete
run_project_tests.py: Also do ninja clean on tests
2016-12-20 00:15:53 +02:00
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
2016-12-20 00:09:02 +02:00
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)
2016-12-20 00:07:00 +02:00
Nirbheek Chauhan a4219760ba clean-ctlist is a forbidden target name
No other target must be called this since we use it for calling the
`cleantrees.py` script.
2016-12-20 02:11:31 +05:30
Nirbheek Chauhan b4cead2763 find_program: Don't leak mutable array in get_command()
In several places in the gnome module, we are getting an array from this
and directly appending to it which changes the original command array
ever since we started caching the find_program results.

We urgently need to move to immutable types for all object properties.

Reported by Alexandor Larsson on IRC.
2016-12-19 21:37:27 +02: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
Nirbheek Chauhan c854ae1801 run_project_tests.py: Also do ninja clean on tests
This will catch things like #1220
2016-12-19 20:52:14 +05:30
Igor Gnatenko 7d71e9f8b2 backend/ninja: pass language name instead of compiler
Traceback (most recent call last):
  File "F:\avian\meson\mesonbuild\mesonmain.py", line 289, in run
    app.generate()
  File "F:\avian\meson\mesonbuild\mesonmain.py", line 179, in generate
    g.generate(intr)
  File "F:\avian\meson\mesonbuild\backend\ninjabackend.py", line 185, in generate
    self.generate_rules(outfile)
  File "F:\avian\meson\mesonbuild\backend\ninjabackend.py", line 745, in generate_rules
    self.generate_compile_rules(outfile)
  File "F:\avian\meson\mesonbuild\backend\ninjabackend.py", line 1530, in generate_compile_rules
    self.generate_llvm_ir_compile_rule(compiler, True, outfile)
  File "F:\avian\meson\mesonbuild\backend\ninjabackend.py", line 1386, in generate_llvm_ir_compile_rule
    ' '.join(self.get_cross_info_lang_args(compiler, is_cross)),
  File "F:\avian\meson\mesonbuild\backend\ninjabackend.py", line 1406, in get_cross_info_lang_args
    return self.environment.cross_info.config['properties'][lang + '_args']
TypeError: unsupported operand type(s) for +: 'ClangCCompiler' and 'str'

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2016-12-19 17:09:35 +02:00
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>
2016-12-19 17:09:35 +02:00
Elliott Sales de Andrade f9c1cc9d93 Fix pkg-config during cross-compile. 2016-12-19 14:07:25 +02:00
Elliott Sales de Andrade 51e6a3986a Fix undefined variables in cross-compile. 2016-12-19 14:07:25 +02:00
Jussi Pakkanen 534066af1a Version update for new development. 2016-12-18 21:54:16 +02:00
Jussi Pakkanen d942243d50 Bump version number for release. 2016-12-18 21:16:09 +02:00
Jussi Pakkanen c8ca2844db Add rewriter to manifest. 2016-12-18 21:11:33 +02:00
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
Jussi Pakkanen 411e88a5ab Fix PGI Fortran compiler detection. 2016-12-18 18:51:09 +02:00
Igor Gnatenko 3b55f6de8c s/Nonexistant/Nonexistent/g
There is basically no such word in english, "nonexistant".
American people use "nonexistent" and British people used
to have "non-existent", but some time ago they did away with
the hyphens, so there is only one option really: "nonexistent".

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2016-12-18 18:32:17 +02:00
Nirbheek Chauhan c693bd9bb4 Allow passing arguments to install scripts
Closes #1213
2016-12-18 18:30:47 +02:00
Igor Gnatenko 9cfdd30789 remove shebang from wraptool
meson.noarch: E: non-executable-script /usr/lib/python3.5/site-packages/mesonbuild/wrap/wraptool.py 644 /usr/bin/python3

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2016-12-18 16:58:02 +01: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
Jussi Pakkanen 67c106a001 Merge pull request #1210 from centricular/qt-fixes-windows
Various Qt and pkg-config fixes for windows
2016-12-18 12:53:50 +02:00
Jussi Pakkanen e918497c78 Merge pull request #1209 from mesonbuild/ignatenko/dirs
Add various directories
2016-12-18 12:38:33 +02:00
Jussi Pakkanen 949c5bb290 Merge pull request #1207 from centricular/has-header-preprocess-only
has_header: Don't compile, only preprocess
2016-12-18 12:35:47 +02:00
Nirbheek Chauhan e3a529886c tests/125 shared module: Run with the VS backend
This was skipped during the PR phase because it was broken, but we fixed
it later.
2016-12-18 12:34:19 +02:00
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
2016-12-18 14:26:18 +05:30
Nirbheek Chauhan ade1f695a6 Fix detection of pkg-config on all platforms
a) Don't search for pkg-config if we're only cross-compiling
b) Don't unconditionally error out while cross-compiling if the
   specified pkg-config is not found and the dependency is optional
c) Use the pkg-config binary that was found in check_pkgconfig for the
   actual testing
d) Use shutil.which on the found pkg-config only if it finds it.
   Sometimes shutil.which fails to find it, for instance on Windows
   with absolute paths.
2016-12-18 13:41:56 +05:30
Nirbheek Chauhan ef2c2eeed1 QtDependency: Only use -fPIC on Linux
It is enabled by default on OS X and on it doesn't make sense on
Windows.
2016-12-18 13:40:50 +05:30
Nirbheek Chauhan 361ae8d22b qt: Fix detection of tools on Windows
When you pass an absolute path to shutil.which, it will not implicitly
append any extensions. This is problematic on Windows, so we need to
account for that.

This fixes detection of Qt tools on Windows which are searched with the
full path to the Qt bindir.
2016-12-18 13:38:39 +05:30
Nirbheek Chauhan 6981d29861 compilers: Always pass -pipe to compiler checks
This is obviously much faster. Not sure why we weren't doing it already.

Causes a speed-up of about 10-15%
2016-12-18 10:17:36 +05:30
Nirbheek Chauhan 6292122a19 has_header: Don't compile, only preprocess
Since we're checking for the existence of a header, just running the
preprocessor is enough. According to my benchmarks, doing this makes the
test roughly 2x faster.

I'm sure this will be useful for other checks too in the future.

This shaves off 7% on the configure time for glib on my machine.

This also fixes the issue that we had earlier where you had to specify
any extra headers needed to resolve symbols in the header being checked
for with `prefix`.
2016-12-18 10:17:36 +05:30
Igor Gnatenko 5bf22c5678 add support for $sharedstatedir
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2016-12-18 00:08:45 +01:00
Igor Gnatenko 2962d3a66b add support for $infodir
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2016-12-18 00:01:27 +01:00
Igor Gnatenko 380b362fa4 add support for $sbindir
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2016-12-18 00:01:23 +01:00
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.
2016-12-17 17:53:52 +02: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
Nirbheek Chauhan 2b842de341 compilers: Ignore -pthread in link flags with MSVC
Sometimes .pc files add -pthread in Libs: instead of -lpthread, so
ignore that too when building with MSVC.
2016-12-17 12:56:01 +02:00
Jussi Pakkanen b389f43060 Revert "Merge pull request #1145 from AlexandreFoley/wrap-fix"
This reverts commit 541dd92ef7, reversing
changes made to 155617e539.
2016-12-15 22:33:25 +02:00
Jussi Pakkanen 21e475b64b Merge pull request #1194 from centricular/critical-bugfixes-vala
A bunch of bugfixes for Vala
2016-12-15 22:20:03 +02:00
Thibault Saunier 925f880e6b introspect: Allow listing all installed files 2016-12-15 22:19:43 +02:00
Igor Gnatenko b80f8b2dc2 rpm: use VPATH macro
This is more or less standardized way to have one variable which
will work for all buildsystems defined in redhat-rpm-config.

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2016-12-15 20:45:01 +02:00
Nirbheek Chauhan ff8cdf86f4 tests/vala/14: Disable running of GTK+ test
There's no X on the Travis CI, so disable this for now.
2016-12-16 00:11:27 +05:30
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.
2016-12-16 00:04:38 +05:30
Nirbheek Chauhan d5f7ba862b gnome.mkenums: Use absolute paths for all commandline args
Closes #973

test cases/vala/8 generated sources/ tests this.
2016-12-15 14:58:43 +05:30