Skip to content

Commit

Permalink
Merge pull request #9 from markuspg/meson
Browse files Browse the repository at this point in the history
Replace Autotools by Meson build system
  • Loading branch information
TobiX authored Dec 24, 2023
2 parents 780e6cb + c8c6ecb commit 192a2df
Show file tree
Hide file tree
Showing 19 changed files with 89 additions and 267 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/compile.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: Compile
on:
- push
Expand All @@ -16,9 +17,9 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
- name: Install requirements
run: sudo apt-get install automake intltool libgtk2.0-dev libtool-bin
run: sudo apt-get install intltool libgtk2.0-dev libtool-bin meson

- name: Build
env:
CC: ${{ matrix.compiler }}
run: ./autogen.sh && make
run: meson setup builddir && ninja -C builddir
25 changes: 0 additions & 25 deletions Makefile.am

This file was deleted.

4 changes: 4 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Version 2.2 (Work in Progress)

* Switch build system from Autotools to Meson

Version 2.1

* Switches from Glade to GtkBuilder
Expand Down
4 changes: 1 addition & 3 deletions NEW_TESTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ the file with copyright notice and #include statements from another source file
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/

#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <config.h>

#include <stdio.h>
#include <gtk/gtk.h>
Expand Down
159 changes: 0 additions & 159 deletions autogen.sh

This file was deleted.

4 changes: 1 addition & 3 deletions callbacks.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/

#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <config.h>

#include <stdio.h>
#include <stdlib.h>
Expand Down
47 changes: 0 additions & 47 deletions configure.ac

This file was deleted.

6 changes: 2 additions & 4 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/

#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <config.h>

#include <stdlib.h>
#include <gtk/gtk.h>
Expand All @@ -42,7 +40,7 @@ int main(int argc, char *argv[])
gtk_init(&argc, &argv);

builder = gtk_builder_new();
err = gtk_builder_add_from_file(builder, DATADIR "/screentest.ui", NULL);
err = gtk_builder_add_from_file(builder, DATADIR "/screentest/screentest.ui", NULL);
if (err == 0)
err = gtk_builder_add_from_file(builder, "screentest.ui", NULL);
if (err == 0) {
Expand Down
61 changes: 61 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
project(
'screentest',
'c',
license: 'GPL-2.0-only',
# license_files: ['COPYING'], -- needs Meson 1.1, Ubuntu 22.04 is too old
meson_version: '>= 0.61',
version: '2.2-dev',
)

i18n = import('i18n')

gmodule_dep = dependency('gmodule-2.0', version: '>= 1.1.3')
gtk_dep = dependency('gtk+-2.0', version: '>= 2.24')
screentest_deps = [
gmodule_dep,
gtk_dep,
]

prefix = get_option('prefix')
datadir = join_paths(prefix, get_option('datadir'))
localdir = join_paths(datadir, 'local')

config_h = configuration_data()
config_h.set_quoted('DATADIR', datadir)
config_h.set_quoted('LOCALEDIR', localdir)
config_h.set_quoted('PACKAGE', meson.project_name())
config_h.set_quoted('PACKAGE_NAME', meson.project_name())
config_h.set_quoted('VERSION', meson.project_version())

configure_file(
configuration: config_h,
output: 'config.h',
)

subdir('po')

screentest_srcs = [
'callbacks.c',
'test_basic.c',
'test_blink.c',
'test_bright_pixels.c',
'test_grid.c',
'test_horizontal.c',
'test_lcdalign.c',
'test_text.c',
'test_vertical.c',
]

executable(
meson.project_name(),
'main.c',
dependencies: screentest_deps,
install: true,
sources: screentest_srcs,
)

uidir = datadir / meson.project_name()
install_data(
'screentest.ui',
install_dir: uidir,
)
5 changes: 5 additions & 0 deletions po/LINGUAS
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
cs
da
de
fi
fr
4 changes: 4 additions & 0 deletions po/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
i18n.gettext(
meson.project_name(),
preset: 'glib',
)
4 changes: 1 addition & 3 deletions test_basic.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/

#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <config.h>

#include <stdio.h>
#include <gtk/gtk.h>
Expand Down
4 changes: 1 addition & 3 deletions test_blink.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/

#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <config.h>

#include <gtk/gtk.h>

Expand Down
Loading

0 comments on commit 192a2df

Please sign in to comment.