Commit Graph

266 Commits

Author SHA1 Message Date
Emmanuel Lepage Vallee 62c95d5fe6 build: Move the meta file parser to an helper module
The commit also re-work the build target so if the file are deleted,
then they are created again. Using `file(COPY ...)` and
`file(MAKE_DIRECTORY ...)` as done previously caused some file to be out
of date or not being regenerated at all.

This commit also fixes some broken target that depended on `file(` and
`configure_file` CMake command not being part of any target.

Fix #2342
2018-10-12 14:18:32 -04:00
Uli Schlachter 7db0188cb2 CMake: Use check_symbol_exists instead of check_function_exists
The documentation for the CheckFunctionExists module says that it is
better to use CheckSymbolExists and lists some reasons. For our purpose,
the reason is that check_function_exists is incompatible with -Werror.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-07-26 09:12:40 +02:00
Joseph Herlant d9cc56538f build: man pages: use asciidoctor instead of asciidoc (#2234) 2018-04-04 11:28:50 +02:00
Daniel Hahler 8923df4a5f build: make DO_COVERAGE a CMake variable
Travis: remove CXXFLAGS (not used), LDFLAGS (typo, not used)

Closes https://github.com/awesomeWM/awesome/pull/2001.
2017-08-29 22:24:12 +02:00
Emmanuel Lepage Vallée 2900ea6f01 Merge pull request #1842 from psychon/lgi-check
Port lgi-check.sh to C
2017-08-12 15:59:18 -04:00
Daniel Hahler a5d6f877c5 cmake: remove unused a_find_library (#1921)
The last usage was removed in ea301194.
2017-07-16 15:25:22 +02:00
Daniel Hahler 02ef4f3ce7 cmake: check (and cache) check of required modules (#1920)
This makes the CMake run much faster in general, and does not re-check
the dependencies every time again (since it gets cached).

There are several reports where the reference to the missing module was
not provided, and they all appear to have happened with CMake 3.6.1.

A missing "foobar" module gets reported there, but if you remove
/usr/lib/pkgconfig/libstartup-notification-1.0.pc, this does not get
reported:

    -- Checking for modules '…'
    --
    CMake Error at /tmp/cmake/share/cmake-3.6/Modules/FindPkgConfig.cmake:424 (message):
      A required package was not found

This apparently affects modules that have version requirements. After
removing that from "libstartup-notification-1.0>=0.10", it gets reported
also: "No package 'libstartup-notification-1.0' found".

The workaround is to require the package without version information
before the requirement with the version information.

This reverts https://github.com/awesomeWM/awesome/pull/1253.
2017-07-16 15:24:40 +02:00
Emmanuel Lepage Vallee 20dfff373d release: Change the codename 2017-07-15 15:53:13 +02:00
Uli Schlachter 95b412df19 Move project() call to CMakeLists.txt (#1909)
CMake "fakes" a call to "project(Project C CXX)" if it does not see a
project() call in CMakeLists.txt. Since we had this call in a different
file, this default applied. This meant that CMake unnecessarily required
a C++ compiler.

Fix/work-around this by moving the call to project() into CMakeLists.txt

Reference: https://github.com/awesomeWM/awesome/pull/1907#discussion_r125581273
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-07-09 16:23:56 +02:00
Daniel Hahler 4b4318602c cmake: abort if Lua was not found (#1892)
This will usually result in errors during linking, and the error message
itself is not obvious to find.
Therefore just abort in this case.
2017-07-03 11:55:20 +02:00
Uli Schlachter ddc51cf38c Port lgi-check.sh to C
Previously, the lgi check used the normal Lua interpreter to check if
lgi is installed. However, nothing ensures/requires that awesome is
built against the same Lua version as the Lua interpreter. This means
that if lgi is only available for some Lua version, then the check could
succeed even though awesome would later fail to start. Also, the check
might have failed even though awesome would not have any problems
finding lgi.

This commit replaces lgi-check.sh by a small C program which does the
same thing. This ensures that the same Lua version is used as awesome
will be using.

There are some places that still use the Lua interpreter: Example tests
(run through the Lua interpreter directly) and unit tests (run through
busted). For unit tests, this should not make much of a difference and
example tests might later get similar treatment.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-06-13 15:47:07 +02:00
Uli Schlachter 84080c64c5 spawn: Use CLOEXEC for pipes (#1811)
Fixes: https://github.com/awesomeWM/awesome/issues/1193#issuecomment-305705724
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-06-02 10:13:26 +02:00
Uli Schlachter bcf70f3740 Drop our use of iconv (#1772)
We were only using this for tag names. This means we are assuming that
everything is UTF8, but tag names are provided in the local locale and
need to be translated into UTF8? That makes no sense, so just drop this.

Fixes: https://github.com/awesomeWM/awesome/issues/1753
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-05-07 17:59:53 +02:00
Tomoya Tabuchi 2bb07343c6
Add iconv library detection for FreeBSD by using code for macOS.
The workaround for finding iconv on macOS is also necessary on FreeBSD,
because libiconv needs to be explicitly linked against on this platform.
2017-04-04 21:12:38 +09:00
Uli Schlachter 088584c812 change codename
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-03-18 10:49:46 +01:00
Emmanuel Lepage Vallee 2ddbbfb70c doc: Add the default theme to the sample files
Also add the gears to make this more flexible in the future.
2017-02-25 16:42:55 -05:00
Emmanuel Lepage Vallee b697777498 doc: Add the default rc.lua to the API documentation
Enable the `Sample files` section provided by ldoc but unused
until now.
2017-02-25 16:42:55 -05:00
Uli Schlachter 288e44596f Export build-time paths as entries on awesome
This removes some @EXPANSIONS@ from Lua files and removes a hack that
was needed. All is better now! :-)

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-01-25 09:41:11 +01:00
Daniel Hahler 9f832b95a3 awesomeConfig.cmake: docs/06-appearance.md depends on lgi-check (#1386)
Ref: https://github.com/awesomeWM/awesome/issues/1385
2017-01-12 03:28:56 +01:00
Daniel Hahler 6aee6c2053 ci: overhaul coverage processing
- Execute the tests without compiling, and don't mess with the source
   files when coverage is enabled.
   This ensures that the coverage report lines are correct.
   This disables the doc tests, as their results would be unused.
   Hack: it still expands macros on util.lua, because of
   `util.get_themes_dir()` and `util.get_awesome_icon_dir()`, which might
   be moved later.  Ref:
   https://github.com/awesomeWM/awesome/pull/1239#discussion_r93828178.
 - ensure that BUILD_APIDOC and DO_COVERAGE are not used together
 - awesomeConfig.cmake: add DO_COVERAGE as an option
 - Travis: only install codecov with DO_COVERAGE=codecov
 - Travis: do not use set -v; use set -x with DO_COVERAGE
 - do not use trailing slashes with dirs in tests/examples/CMakeLists.txt / .luacov
 - Use latest luacov (0.12.0-1) again
   This reverts parts of 4cc6a815.
   I think it is better to fix any failure that 4cc6a815 tried to work around.
 - Travis: simplify/fix require('luacov') for functionaltests
 - tests/examples/CMakeLists.txt: resolve ../.. in SOURCE_DIR
 - tests/examples/CMakeLists.txt: add DO_COVERAGE to env
 - Cleanup/simplify .luacov: work with SOURCE_DIRECTORY alone
 - tests/run.sh: pass through / set SOURCE_DIRECTORY when running awesome
 - tests/run.sh: resolve source_dir
 - use DO_COVERAGE from env only
2017-01-08 20:34:13 +01:00
Emmanuel Lepage Vallée a1085b64dd Merge pull request #1358 from Elv13/clear_the_cache
build: Clear the cache when checking if a package is present
2017-01-04 04:45:09 -05:00
Emmanuel Lepage Vallee b26aff3cd0 build: Clear the cache when checking if a package is present
While on Gentoo I get the right error message anyway, apparently
this isn't universal.

Fix #1356
2017-01-03 15:56:58 -05:00
Daniel Hahler fdc93e68da build: use git-describe with just .git / add 'Using version from …' msg (#1302)
With Git submodules there is only a `.git` file typically, e.g.:

> gitdir: /home/user/Vcs/awesome-www/.git/modules/src
2016-12-25 23:17:54 +01:00
Emmanuel Lepage Vallee 58fed31d88 change codename 2016-12-25 22:17:14 +01:00
Emmanuel Lepage Vallee 26c0a3c2c5 cmake: Check dependencies one by one
It was currently done all at once. Therefore, the error message was:

CMake Error at /usr/share/cmake/Modules/FindPkgConfig.cmake:415 (message):
  A required package was not found

With no further information besides the full dependency list.

With this change, it will print the missing package.

Closes https://github.com/awesomeWM/awesome/pull/1253.
2016-12-02 21:55:36 +01:00
Uli Schlachter 8409639d4d Blacklist broken LDoc versions (#1207)
Fixes: https://github.com/awesomeWM/awesome/issues/1098
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-11-06 01:24:25 +01:00
Uli Schlachter 0e81479a3f Use xcb-util-xrm
Instead of using Xlib for parsing resource files, this now uses the
dedicated xcb-based library that is meant for exactly this task.

Fixes: https://github.com/awesomeWM/awesome/issues/1176
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-11-03 13:34:43 +01:00
Emmanuel Lepage Vallee dd959eecd6 build: Fix make install when ldoc is missing 2016-10-03 23:39:14 -04:00
Uli Schlachter 3993388c01 awesomeConfig.cmake: Stop forcing CMAKE_BUILD_TYPE
I don't know why we force CMAKE_BUILD_TYPE to be RELEASE, but I don't think we
should do that.

This also changes the default build type to something which does not contain
-DNDEBUG in CFLAGS. This means that assert()s will start to work.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-09-30 09:36:36 +02:00
Emmanuel Lepage Vallee 63b712e247 doc: Document rc.lua
This meta-lua script takes the "raw" awesomerc.lua and turn it
into the final file and generate a documentation page from its
parsed content. It support

 * Turn {{{ into markdown categories
 * Turn top level comments into documentation
 * Add custom documentation sections
 * Parse the code to add links for each API calls

This helps generate a good entry point for new users wanting to
understand the content of rc.lua without searching the API by
hand.

Over time, this will also become the basis of the documentation.

If `rc.lua` is separated into several files, this will be easy to fix
this script. It could even do the separation itself from a monolitic
file using the already implemented {{{ parser.
2016-09-26 00:40:20 -04:00
Emmanuel Lepage Vallee 5f10e7a74e doc: Begin to document the themes better.
This add a meta-lua file that parses all existing lua files
to generate a list of all beautiful variables.
2016-09-26 00:40:19 -04:00
Uli Schlachter dc0a337aea CMake: Check if we need libm for round()
Fixes: https://github.com/awesomeWM/awesome/issues/969
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-07-05 22:28:33 +02:00
Uli Schlachter 2e6358ca2d Stop checking for __builtin_clz (#985)
Since commit 19137a55 we no longer use this builtin, so we don't have to check
for it anymore either.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-07-05 22:12:26 +02:00
Emmanuel Lepage Vallee de2d6fb521 doc: Add a system to auto-generate widgets list
This system allow containers, widgets and layouts to be listed in
the documentation with an example screenshot.

It uses raw HTML due to ldoc limitations, but as it is autogenerated,
it wont be user visible.
2016-05-30 18:00:58 -04:00
Emmanuel Lepage Vallee ac7ea4c70f tests: Fix coverage data
As the documentation generation insert increasingly large ammount
of code into the lua files, the coverage data is getting less and
less accurate. This try to fix this by only collecting such data
after the `configure_file` calls are done.
2016-05-30 17:51:19 -04:00
Emmanuel Lepage Vallee 44a4eca40e doc: Port the shape images to the doc example system 2016-05-30 17:51:19 -04:00
Emmanuel Lepage Vallee a51d6d3abd doc: Add a system to share ldoc content across multiple files
This avoid copy-pasting
2016-05-09 01:37:47 -04:00
Emmanuel Lepage Vallee e7652a053d tests: Add a new testing framework 2016-03-31 04:45:45 -04:00
Emmanuel Lepage Vallee b6871833c4 cmake: Generate gears.shape SVG and example code 2016-03-16 18:02:41 -04:00
Uli Schlachter 97048de60e Remove useless information from awesome -v
Most of this information isn't interesting. If you are getting awesome from a
distro, then the time, hostname and username of the build are likely 'random
stuff' and if you are building awesome yourself, then the hostname and username
are obviously yours and the time can still be interfered based on the awesome's
binary ctime.

The GCC version shouldn't make any difference at all.

Closes https://github.com/awesomeWM/awesome/pull/566.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-12-01 20:17:21 +01:00
Kazunobu Kuriyama 998a20514a Modify CFLAGS handling
- Remove `-rdynamic` from "CFLAGS" and count on CMake to pass it to
   the compiler at the link phase (Issue #450).
 - Move the definition of "CFLAGS" from `awesomeConfig.cmake` to
   `CMakeLists.txt` and give it a name, `AWESOME_C_FLAGS`, so that the
   relation between the target and the flags is made clearer and
   manageable.
 - Make `AWESOME_C_FLAGS` a cached variable so that the developers can
   tweak the flags promptly in accordance with their necessities without
   changing the prescribed value.
 - Add a logic to cope with the case where CMake fails to set
   `-rdynamic`.

Closes https://github.com/awesomeWM/awesome/pull/453.
2015-09-19 12:02:03 +02:00
Kazunobu Kuriyama 5e4318c15d Fix Mac OS X iconv library linking failure
Add a path to awesomeConfig.cmake for searching an iconv library and the
corresponding header file automatically if the build system is on Mac OS
X which needs to pass the header and library paths explicitly to the
compiler to build Awesome successfully.

Closes https://github.com/awesomeWM/awesome/pull/440.
2015-09-13 14:42:46 +02:00
Daniel Hahler fdc3f2cc17 build: add OVERRIDE_VERSION, used in Travis
Fixes https://github.com/awesomeWM/awesome/issues/160.
2015-07-25 17:59:44 +02:00
Daniel Hahler 768a5b181e Merge pull request #273 from blueyed/cmake-no-recurse-into-build-dir
awesomeConfig.cmake: do not use GLOB_RECURSE with *.c/*.h
2015-07-03 19:11:09 +02:00
actionless cec04b2684 Add DPI support and 'xresources' theme
This makes awesome respect DPI settings, and adds a new theme based on
xrdb and xsettingsd color settings ("xresources").

Closes https://github.com/awesomeWM/awesome/pull/229
2015-06-25 06:40:38 +02:00
Daniel Hahler 1992e1e429 awesomeConfig.cmake: do not use GLOB_RECURSE with *.c/*.h
This fixes "make (cmake)" picking up the files from the build dir itself
(recursively), i.e. "make cmake" would also create
`.build-HOST-x86_64-linux-gnu-4.9.2/.build-HOST-x86_64-linux-gnu-4.9.2/`.

It could also use `${AWE_SRCS}` etc here probably.
2015-06-22 14:04:57 +02:00
Daniel Hahler d2e25c3594 cmake: s/ESCAPE_QUOTE/ESCAPE_QUOTES
This appears to be the correct name for 2.8.12 [1] already, but CMake
3.2.3 complains loud(er) now.

1: http://www.cmake.org/cmake/help/v2.8.12/cmake.html#command:configure_file
2015-06-20 01:56:21 +02:00
Julian Wollrath 26f15a13f3 Document C API directly in the C source code
v2: Add available signals to the docs.

Signed-off-by: Julian Wollrath <jwollrath@web.de>
2015-06-19 23:13:31 +02:00
Julian Wollrath 6cc7be512c Remove the *.in from all files.
Signed-off-b: Julian Wollrath <jwollrath@web.de>
2015-06-19 22:33:32 +02:00
Julian Wollrath 130504a3d0 Rip out useless Doxygen support
Signed-off-by: Julian Wollrath <jwollrath@web.de>
2015-06-19 22:31:13 +02:00