SHA256
3
0
forked from pool/meson
meson/meson.spec

257 lines
8.5 KiB
RPMSpec
Raw Normal View History

#
# spec file for package meson
#
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "test"
%define name_ext -test
%bcond_without test
%else
%define name_ext %{nil}
%bcond_with test
%endif
%define _name mesonbuild
%{!?vim_data_dir:%global vim_data_dir %{_datadir}/vim}
%bcond_with setuptools
Name: meson%{name_ext}
Accepting request 683606 from home:alois:branches:devel:tools:building - Update to version 0.50.0 New features: * Added `cmake_module_path` and `cmake_args` to dependency The CMake dependency backend can now make use of existing `Find<name>.cmake` files by setting the `CMAKE_MODULE_PATH` with the new `dependency()` property `cmake_module_path`. The paths given to `cmake_module_path` should be relative to the project source directory. Furthermore the property `cmake_args` was added to give CMake additional parameters. * Added PGI compiler support Nvidia / PGI C, C++ and Fortran [no-cost](https://www.pgroup.com/products/community.htm) compilers are now supported. They have been tested on Linux so far. * Fortran Coarray Fortran 2008 / 2018 coarray support was added via `dependency('coarray')` * Libdir defaults to `lib` when cross compiling Previously `libdir` defaulted to the value of the build machine such as `lib/x86_64-linux-gnu`, which is almost always incorrect when cross compiling. It now defaults to plain `lib` when cross compiling. Native builds remain unchanged and will point to the current system's library dir. * Native and Cross File Paths and Directories A new `[paths]` section has been added to native and cross files. This can be used to set paths such a prefix and libdir in a persistent way. * Add warning_level 0 option Adds support for a warning level 0 which does not enable any static analysis checks from the compiler * A builtin target to run clang-format If you have `clang-format` installed and there is a `.clang-format` file in the root of your master project, Meson will generate a run target called `clang-format` so you can reformat all files with one command: ```meson ninja clang-format ``` * Added a .path() method to object return by python.find_installation() `ExternalProgram` objects as well as the object returned by the `python3` module provide this method, but the new python module did not. * Fix ninja console log from generators with multiple output nodes This resolves ticket #4760 where a generator w/ multiple output nodes printed an empty string to the console * `introspect --buildoptions` can now be used without configured build directory It is now possible to run `meson introspect --buildoptions /path/to/meson.build` without a configured build directory. Running `--buildoptions` without a build directory produces the same output as running it with a freshly configured build directory. However, this behavior is not guaranteed if subprojects are present. Due to internal limitations all subprojects are processed even if they are never used in a real meson run. Because of this options for the subprojects can differ. * `include_directories` accepts a string The `include_directories` keyword argument now accepts plain strings rather than an include directory object. Meson will transparently expand it so that a declaration like this: ```meson executable(..., include_directories: 'foo') ``` Is equivalent to this: ```meson foo_inc = include_directories('foo') executable(..., include_directories: inc) ``` * Fortran submodule support Initial support for Fortran ``submodule`` was added, where the submodule is in the same or different file than the parent ``module``. The submodule hierarchy specified in the source Fortran code `submodule` statements are used by Meson to resolve source file dependencies. For example: ```fortran submodule (ancestor:parent) child ``` * Add subproject_dir to --projectinfo introspection output This allows applications interfacing with Meson (such as IDEs) to know about an overridden subproject directory. * Find library with its headers The `find_library()` method can now also verify if the library's headers are found in a single call, using the `has_header()` method internally. ```meson + Aborts if the 'z' library is found but not its header file zlib = find_library('z', has_headers : 'zlib.h') + Returns not-found if the 'z' library is found but not its header file zlib = find_library('z', has_headers : 'zlib.h', required : false) ``` Any keyword argument with the `header_` prefix passed to `find_library()` will be passed to the `has_header()` method with the prefix removed. ```meson libfoo = find_library('foo', has_headers : ['foo.h', 'bar.h'], header_prefix : '#include <baz.h>', header_include_directories : include_directories('.')) ``` * NetCDF NetCDF support for C, C++ and Fortran is added via pkg-config. * added the Flang compiler [Flang](https://github.com/flang-compiler/flang/releases) Fortran compiler support was added. As with other Fortran compilers, flang is specified using `FC=flang meson ..` or similar. * New `not_found_message` for dependency You can now specify a `not_found_message` that will be printed if the specified dependency was not found. The point is to convert constructs that look like this: ```meson d = dependency('something', required: false) if not d.found() message('Will not be able to do something.') endif ``` Into this: ```meson d = dependency('something', required: false, not_found_message: 'Will not be able to do something.') ``` Or constructs like this: ```meson d = dependency('something', required: false) if not d.found() error('Install something by doing XYZ.') endif ``` into this: ```meson d = dependency('something', not_found_message: 'Install something by doing XYZ.') ``` Which works, because the default value of `required` is `true`. * Cuda support Compiling Cuda source code is now supported, though only with the Ninja backend. This has been tested only on Linux for now. Because NVidia's Cuda compiler does not produce `.d` dependency files, dependency tracking does not work. * `run_command` accepts `env` kwarg You can pass [`environment`](Reference-manual.html#environment-object) object to [`run_command`](Reference-manual.html#run-command), just like to `test`: ```meson env = environment() env.set('FOO', 'bar') run_command('command', 'arg1', 'arg2', env: env) ``` * `extract_objects` accepts `File` arguments The `extract_objects` function now supports File objects to tell it what to extract. Previously, file paths could only be passed as strings. * Changed the JSON format of the introspection All paths used in the meson introspection JSON format are now absolute. This affects the `filename` key in the targets introspection and the output of `--buildsystem-files`. Furthermore, the `filename` and `install_filename` keys in the targets introspection are now lists of strings with identical length. The `--target-files` option is now deprecated, since the same information can be acquired from the `--tragets` introspection API. * Meson file rewriter This release adds the functionality to perform some basic modification on the `meson.build` files from the command line. The currently supported operations are: + For build targets: x Add/Remove source files x Add/Remove targets x- Modify a select set of kwargs x Print some JSON information + For dependencies: x Modify a select set of kwargs + For the project function: x Modify a select set of kwargs x Modify the default options list For more information see the rewriter documentation. * `introspect --scan-dependencies` can now be used to scan for dependencies used in a project It is now possible to run `meson introspect --scan-dependencies /path/to/meson.build` without a configured build directory to scan for dependencies. The output format is as follows: ```json [ { "name": "The name of the dependency", "required": true, "conditional": false, "has_fallback": false } ] ``` The `required` keyword specifies whether the dependency is marked as required in the `meson.build` (all dependencies are required by default). The `conditional` key indicates whether the `dependency()` function was called inside a conditional block. In a real meson run these dependencies might not be used, thus they _may_ not be required, even if the `required` key is set. The `has_fallback` key just indicates whether a fallback was directly set in the `dependency()` function. * `introspect --targets` can now be used without configured build directory It is now possible to run `meson introspect --targets /path/to/meson.build` without a configured build directory. The generated output is similar to running the introspection with a build directory. However, there are some key differences: + The paths in `filename` now are _relative_ to the future build directory + The `install_filename` key is completely missing + There is only one entry in `target_sources`: x With the language set to `unknown` x Empty lists for `compiler` and `parameters` and `generated_sources` x The `sources` list _should_ contain all sources of the target There is no guarantee that the sources list in `target_sources` is correct. There might be differences, due to internal limitations. It is also not guaranteed that all targets will be listed in the output. It might even be possible that targets are listed, which won't exist when meson is run normally. This can happen if a target is defined inside an if statement. Use this feature with care. * Added option to introspect multiple parameters at once Meson introspect can now print the results of multiple introspection commands in a single call. The results are then printed as a single JSON object. The format for a single command was not changed to keep backward compatibility. Furthermore the option `-a,--all`, `-i,--indent` and `-f,--force-object-output` were added to print all introspection information in one go, format the JSON output (the default is still compact JSON) and force use the new output format, even if only one introspection command was given. A complete introspection dump is also stored in the `meson-info` directory. This dump will be (re)generated each time meson updates the configuration of the build directory. Additionlly the format of `meson introspect target` was changed: + New: the `sources` key. It stores the source files of a target and their compiler parameters. + New: the `defined_in` key. It stores the meson file where a target is defined + New: the `subproject` key. It stores the name of the subproject where a target is defined. + Added new target types (`jar`, `shared module`). * meson configure can now print the default options of an unconfigured project With this release, it is also possible to get a list of all build options by invoking `meson configure` with the project source directory or the path to the root `meson.build`. In this case, meson will print the default values of all options. * HDF5 HDF5 support is added via pkg-config. * Added the `meson-info.json` introspection file Meson now generates a `meson-info.json` file in the `meson-info` directory to provide introspection information about the latest meson run. This file is updated when the build configuration is changed and the build files are (re)generated. - Refreshed meson-suse-ify-macros.patch OBS-URL: https://build.opensuse.org/request/show/683606 OBS-URL: https://build.opensuse.org/package/show/devel:tools:building/meson?expand=0&rev=131
2019-03-11 12:51:59 +01:00
Version: 0.50.0
Release: 0
Summary: Python-based build system
License: Apache-2.0
Group: Development/Tools/Building
URL: http://mesonbuild.com/
Source: https://github.com/%{_name}/meson/releases/download/%{version}/meson-%{version}.tar.gz
Source1: https://github.com/%{_name}/meson/releases/download/%{version}/meson-%{version}.tar.gz.asc
Source2: meson.keyring
# PATCH-FIX-OPENSUSE meson-suse-ify-macros.patch dimstar@opensuse.org -- Make the macros non-RedHat specific: so far there are no separate {C,CXX,F}FLAGS.
Patch0: meson-suse-ify-macros.patch
# PATCH-FIX-OPENSUSE meson-test-installed-bin.patch dimstar@opensuse.org -- We want the test suite to run against /usr/bin/meson coming from our meson package.
Patch1: meson-test-installed-bin.patch
# PATCH-FIX-OPENSUSE meson-restore-python3.4.patch -- Restore Python 3.4 support (reverts commit 0538009).
Patch2: meson-restore-python3.4.patch
# PATCH-FIX-OPENSUSE meson-suse-fix-llvm-3.8.patch -- Fix LLVM 3.8 tests.
Patch3: meson-suse-fix-llvm-3.8.patch
# PATCH-FIX-OPENSUSE meson-fix-gcc48.patch sor.alexei@meowr.ru -- Fix GCC 4.8 handling for openSUSE Leap 42.x.
Patch4: meson-fix-gcc48.patch
# PATCH-FEATURE-OPENSUSE meson-distutils.patch tchvatal@suse.com -- build and install using distutils instead of full setuptools
Patch5: meson-distutils.patch
BuildRequires: fdupes
BuildRequires: python-rpm-macros
BuildRequires: python3-base
BuildArch: noarch
%if %{with setuptools}
BuildRequires: python3-setuptools
Requires: python3-setuptools
%endif
%if !%{with test}
Requires: ninja
Requires: python3-base
# meson-gui was last used in openSUSE Leap 42.1.
Provides: meson-gui = %{version}
Obsoletes: meson-gui < %{version}
%else
BuildRequires: bison
BuildRequires: clang
BuildRequires: cups-devel
BuildRequires: flex
BuildRequires: gcc-c++
BuildRequires: gcc-fortran
BuildRequires: gcc-obj-c++
BuildRequires: gcc-objc
BuildRequires: gettext
BuildRequires: git
BuildRequires: gnustep-make
BuildRequires: googletest-devel
BuildRequires: itstool
BuildRequires: libjpeg-devel
BuildRequires: libpcap-devel
BuildRequires: libqt5-qtbase-common-devel
BuildRequires: libqt5-qtbase-private-headers-devel
BuildRequires: libwmf-devel
BuildRequires: llvm-devel
BuildRequires: meson = %{version}
BuildRequires: ninja
BuildRequires: pkgconfig
BuildRequires: python2-devel
BuildRequires: python3-gobject
BuildRequires: zlib-devel-static
BuildRequires: cmake(Qt5Core)
BuildRequires: cmake(Qt5Gui)
BuildRequires: cmake(Qt5LinguistTools)
BuildRequires: cmake(Qt5Widgets)
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(gobject-introspection-1.0)
BuildRequires: pkgconfig(gtk+-3.0)
BuildRequires: pkgconfig(gtk-doc)
BuildRequires: pkgconfig(ncurses)
BuildRequires: pkgconfig(python3) >= 3.4
BuildRequires: pkgconfig(sdl2)
BuildRequires: pkgconfig(vapigen)
BuildRequires: pkgconfig(vulkan)
BuildRequires: pkgconfig(zlib)
%if 0%{?suse_version} >= 1500
BuildRequires: java-headless
BuildRequires: libboost_log-devel
BuildRequires: libboost_system-devel
BuildRequires: libboost_test-devel
BuildRequires: libboost_thread-devel
BuildRequires: rust
BuildRequires: rust-std
BuildRequires: wxWidgets-any-devel
# csharp is not on s390 machines
%ifnarch s390x
BuildRequires: mono(csharp)
%endif
%else
BuildRequires: boost-devel
BuildRequires: mono-core
BuildRequires: wxWidgets-devel
%endif
%endif
%description
Meson is a build system designed to optimise programmer productivity.
It aims to do this by providing support for software development
tools and practices, such as unit tests, coverage reports, Valgrind,
CCache and the like. Supported languages include C, C++, Fortran,
Java, Rust. Build definitions are written in a non-turing complete
Domain Specific Language.
%package vim
Summary: Vim support for meson.build files
Group: Productivity/Text/Editors
Requires: vim
Supplements: packageand(vim:%{name})
BuildArch: noarch
%description vim
Meson is a build system designed to optimise programmer productivity.
It aims to do this by providing support for software development
tools and practices, such as unit tests, coverage reports, Valgrind,
CCache and the like. Supported languages include C, C++, Fortran,
Java, Rust. Build definitions are written in a non-turing complete
Domain Specific Language.
This package provides support for meson.build files in Vim.
%prep
%setup -q -n meson-%{version}
%patch0 -p1
%patch1 -p1
%if 0%{?suse_version} < 1500
%patch2 -p1
%patch3 -p1
%patch4 -p1
%endif
%if !%{with setuptools}
%patch5 -p1
%endif
# Remove static boost tests from "test cases/frameworks/1 boost/".
sed -i "/static/d" test\ cases/frameworks/1\ boost/meson.build
# Disable test of llvm-static libs: openSUSE does not package/ship them
sed -i "s/foreach static : \[true, false\]/foreach static : \[false\]/" test\ cases/frameworks/15\ llvm/meson.build
# We do not have gmock available at this moment - can't run the test suite for it
rm -r "test cases/frameworks/3 gmock" \
"test cases/objc/2 nsstring"
# AddressSanitizer fails here because of ulimit.
sed -i "/def test_generate_gir_with_address_sanitizer/s/$/\n raise unittest.SkipTest('ulimit')/" run_unittests.py
Accepting request 535269 from home:badshah400:branches:devel:tools:building - Update to version 0.43.0: + Generator learned capture: Generators can now be configured to capture the standard output. + Can index CustomTarget objects: The CustomTarget object can now be indexed like an array. The resulting object can be used as a source file for other Targets, this will create a dependency on the original CustomTarget, but will only insert the generated file corresponding to the index value of the CustomTarget's output keyword. + The cross file can now be used for overriding the result of find_program. Then issuing the command find_program('objdump') will return the version specified in the cross file. + Easier handling of supported compiler arguments. + Better support for shared libraries in non-system paths: This release adds feature parity to shared libraries that are either in non-standard system paths or shipped as part of your project. On systems that support rpath, Meson automatically adds rpath entries to built targets using manually found external libraries. + The Wrap dependency system now supports Subversion (svn). This support is rudimentary. The repository url has to point to a specific (sub)directory containing the meson.build file (typically trunk/). However, providing a revision is supported. - Rebase meson-test-installed-bin.patch. - Run sed to strip the hashbang from a non-executable file; this prevents an rpmlint warning. - Update to version 0.43.0: + Generator learned capture: Generators can now be configured to OBS-URL: https://build.opensuse.org/request/show/535269 OBS-URL: https://build.opensuse.org/package/show/devel:tools:building/meson?expand=0&rev=65
2017-10-19 17:35:14 +02:00
# Remove hashbang from non-exec script
sed -i '1{/\/usr\/bin\/env/d;}' ./mesonbuild/rewriter.py
# remove gtest check that actually works because our gtest has .pc files
rm -rf test\ cases/failing/85\ gtest\ dependency\ with\ version
%build
%if !%{with test}
%python3_build
%else
# FIXME: you should use %%meson macros
# Ensure we have no mesonbuild / meson in CWD, thus guaranteeing we use meson in $PATH
rm -r meson.py mesonbuild
%endif
%install
# If this is the test suite, we don't need anything else but the meson package
%if !%{with test}
%python3_install
%fdupes %{buildroot}%{python3_sitelib}
install -Dpm 0644 data/macros.meson \
%{buildroot}%{_rpmconfigdir}/macros.d/macros.meson
install -Dpm 0644 data/syntax-highlighting/vim/ftdetect/meson.vim \
-t %{buildroot}%{vim_data_dir}/site/ftdetect/
install -Dpm 0644 data/syntax-highlighting/vim/indent/meson.vim \
-t %{buildroot}%{vim_data_dir}/site/indent/
install -Dpm 0644 data/syntax-highlighting/vim/syntax/meson.vim \
-t %{buildroot}%{vim_data_dir}/site/syntax/
# entry points are not distutils-able
%if !%{with setuptools}
mkdir -p %{buildroot}%{_bindir}
echo """#!%{_bindir}/python3
import sys
from mesonbuild.mesonmain import main
sys.exit(main())
""" > %{buildroot}%{_bindir}/%{name}
chmod +x %{buildroot}%{_bindir}/%{name}
# ensure egg-info is a directory
rm %{buildroot}%{python3_sitelib}/*.egg-info
cp -r meson.egg-info %{buildroot}%{python3_sitelib}/meson-%{version}-py%{python3_version}.egg-info
%endif
%endif
%if %{with test}
%check
export LANG=C.UTF-8
export MESON_EXE=%{_bindir}/meson
python3 run_tests.py --failfast
%endif
%files
%license COPYING
%if !%{with test}
%{_bindir}/meson
%{python3_sitelib}/%{_name}/
%{python3_sitelib}/meson-*
%dir %{_datadir}/polkit-1/
%dir %{_datadir}/polkit-1/actions/
%{_datadir}/polkit-1/actions/com.mesonbuild.install.policy
%{_rpmconfigdir}/macros.d/macros.meson
%{_mandir}/man1/meson.1%{?ext_man}
%files vim
%doc data/syntax-highlighting/vim/README
%dir %{vim_data_dir}/
%dir %{vim_data_dir}/site/
%dir %{vim_data_dir}/site/ftdetect/
%dir %{vim_data_dir}/site/indent/
%dir %{vim_data_dir}/site/syntax/
%{vim_data_dir}/site/ftdetect/meson.vim
%{vim_data_dir}/site/indent/meson.vim
%{vim_data_dir}/site/syntax/meson.vim
%endif
%changelog