Skip to content

Commit

Permalink
Replace Autotools by Meson build system
Browse files Browse the repository at this point in the history
  • Loading branch information
markuspg committed Dec 22, 2023
1 parent 780e6cb commit a33d35c
Show file tree
Hide file tree
Showing 17 changed files with 82 additions and 265 deletions.
25 changes: 0 additions & 25 deletions Makefile.am

This file was deleted.

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'],
meson_version: '>= 1.1',
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
4 changes: 1 addition & 3 deletions test_bright_pixels.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 <gtk/gtk.h>
Expand Down
4 changes: 1 addition & 3 deletions test_grid.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 a33d35c

Please sign in to comment.