From 8726c95e2b1f779653d15965f902a84621f90111 Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Thu, 20 Jul 2017 14:08:05 +0900 Subject: [PATCH] replace autofoo with meson... learning how meson works. may not be the cleanest or nicest... but it's not too bad. it does work. ninja dist works. build times improved. for a full autogen.sh, make etc. -> 5.205s to 0.759s --- .gitignore | 32 +++--------------- ChangeLog | 0 INSTALL | 42 +++++++++++++++++++----- Makefile.am | 34 ------------------- NEWS | 0 README | 22 ++++++------- autogen.sh | 17 ++-------- configure.ac | 60 --------------------------------- data/desktop/meson.build | 2 ++ data/icons/meson.build | 2 ++ data/meson.build | 3 ++ data/themes/meson.build | 13 ++++++++ data/themes/perms.sh | 3 ++ m4/ac_attribute.m4 | 47 -------------------------- m4/efl_beta.m4 | 5 --- m4/efl_binary.m4 | 71 ---------------------------------------- m4/efl_eo.m4 | 6 ---- meson.build | 64 ++++++++++++++++++++++++++++++++++++ meson_options.txt | 3 ++ src/bin/meson.build | 30 +++++++++++++++++ src/bin/thumb.c | 2 +- src/meson.build | 1 + 22 files changed, 175 insertions(+), 284 deletions(-) delete mode 100644 ChangeLog delete mode 100644 Makefile.am delete mode 100644 NEWS delete mode 100644 configure.ac create mode 100644 data/desktop/meson.build create mode 100644 data/icons/meson.build create mode 100644 data/meson.build create mode 100644 data/themes/meson.build create mode 100755 data/themes/perms.sh delete mode 100644 m4/ac_attribute.m4 delete mode 100644 m4/efl_beta.m4 delete mode 100644 m4/efl_binary.m4 delete mode 100644 m4/efl_eo.m4 create mode 100644 meson.build create mode 100644 meson_options.txt create mode 100644 src/bin/meson.build create mode 100644 src/meson.build diff --git a/.gitignore b/.gitignore index c80954a..ac6aab1 100644 --- a/.gitignore +++ b/.gitignore @@ -2,33 +2,11 @@ *.o *.swo *.swp -Makefile -Makefile.in -/aclocal.m4 -/compile -/config.log -/config.status -/configure -/depcomp -/install-sh -/ltmain.sh -/missing -/stamp-h1 /rage_config.h -/rage_config.h.in /rage.spec -/autom4te.cache/ /data/themes/default.edj -/m4/libtool.m4 -/m4/ltoptions.m4 -/m4/ltsugar.m4 -/m4/ltversion.m4 -/m4/lt~obsolete.m4 -/src/bin/.deps/ -/src/bin/rage -/src/bin/rage_thumb -pkgbuild/PKGBUILD -pkgbuild/pkg -pkgbuild/src -pkgbuild/*.tar.xz -.dirstamp +/pkgbuild/PKGBUILD +/pkgbuild/pkg +/pkgbuild/src +/pkgbuild/*.tar.xz +/build diff --git a/ChangeLog b/ChangeLog deleted file mode 100644 index e69de29..0000000 diff --git a/INSTALL b/INSTALL index f67815a..c07185d 100644 --- a/INSTALL +++ b/INSTALL @@ -1,11 +1,37 @@ -COMPILING and INSTALLING: +COMPILING and INSTALLING +------------------------ -If you got a official release tar archive do: - ./configure - -Then to compile: - make +Meson is the build system used for this project. For more information please +see: -To install (run this as root, or the user who handles installs): - make install + http://mesonbuild.com + +---- + +Normal compilation in /usr/local: + + meson . build + cd build + ninja + sudo ninja install + +For meson build generic options: + + meson --help + +For a list of project specific options supported: + + cat meson_options.txt + +To set 1 or more project specific options: + + meson -Doption=value [-Dother=value2] ... + +To display current configuration: + + mesonconf build + +The above will only work after at least the following is done: + + meson . build diff --git a/Makefile.am b/Makefile.am deleted file mode 100644 index ccc377d..0000000 --- a/Makefile.am +++ /dev/null @@ -1,34 +0,0 @@ -ACLOCAL_AMFLAGS = -I m4 - -SUBDIRS = src data - -MAINTAINERCLEANFILES = \ -Makefile.in \ -$(PACKAGE_TARNAME)-$(PACKAGE_VERSION).tar.gz \ -$(PACKAGE_TARNAME)-$(PACKAGE_VERSION).tar.bz2 \ -aclocal.m4 \ -config.guess \ -rage_config.h.in \ -config.sub \ -configure \ -compile \ -depcomp \ -install-sh \ -ltconfig \ -ltmain.sh \ -missing \ -mkinstalldirs \ -stamp-h.in \ -stamp-h \ -m4/libtool.m4 \ -m4/lt~obsolete.m4 \ -m4/ltoptions.m4 \ -m4/ltsugar.m4 \ -m4/ltversion.m4 - -EXTRA_DIST = README AUTHORS COPYING autogen.sh rage.spec pkgbuild/PKGBUILD - -.PHONY: doc - -doc: - @echo "Empty doc target until we have real documentation." diff --git a/NEWS b/NEWS deleted file mode 100644 index e69de29..0000000 diff --git a/README b/README index 81c51a2..4b032ec 100644 --- a/README +++ b/README @@ -121,15 +121,15 @@ F7 - DVD nav menu 7 Requirements: ------------- - * elementary (>= 1.18.0) - * eina (>= 1.18.0) - * eet (>= 1.18.0) - * evas (>= 1.18.0) - * ecore (>= 1.18.0) - * edje (>= 1.18.0) - * emotion (>= 1.18.0) - * ecore-imf (>= 1.18.0) - * ecore-imf-evas (>= 1.18.0) - * ecore-input (>= 1.18.0) - * ethumb (>= 1.18.0) + * elementary (>= 1.19.0) + * eina (>= 1.19.0) + * eet (>= 1.19.0) + * evas (>= 1.19.0) + * ecore (>= 1.19.0) + * edje (>= 1.19.0) + * emotion (>= 1.19.0) + * ecore-imf (>= 1.19.0) + * ecore-imf-evas (>= 1.19.0) + * ecore-input (>= 1.19.0) + * ethumb (>= 1.19.0) diff --git a/autogen.sh b/autogen.sh index 31ccda0..6531487 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,16 +1,5 @@ #!/bin/sh -rm -rf autom4te.cache -rm -f aclocal.m4 ltmain.sh - -touch README - -echo "Running aclocal..." ; aclocal -I m4 $ACLOCAL_FLAGS || exit 1 -echo "Running autoheader..." ; autoheader || exit 1 -echo "Running autoconf..." ; autoconf || exit 1 -echo "Running libtoolize..." ; (libtoolize --copy --automake || glibtoolize --automake) || exit 1 -echo "Running automake..." ; automake --add-missing --copy --gnu || exit 1 - -if [ -z "$NOCONFIGURE" ]; then - ./configure "$@" -fi +rm -rf build +meson $@ . build +mesonconf build diff --git a/configure.ac b/configure.ac deleted file mode 100644 index 20f5229..0000000 --- a/configure.ac +++ /dev/null @@ -1,60 +0,0 @@ -# get rid of that stupid cache mechanism -rm -f config.cache - -AC_INIT([rage], [0.2.1], [enlightenment-devel@lists.sourceforge.net]) -AC_PREREQ([2.60]) -AC_CONFIG_SRCDIR([configure.ac]) -AC_CONFIG_MACRO_DIR([m4]) - -AC_CONFIG_HEADERS([rage_config.h]) - -AM_INIT_AUTOMAKE([1.6 dist-bzip2 dist-xz]) -m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) - -AC_USE_SYSTEM_EXTENSIONS -AC_PROG_CC -AM_PROG_CC_C_O -AC_C___ATTRIBUTE__ - -efl_version="1.18.0" -requirements="\ - elementary >= ${efl_version} \ - edje >= ${efl_version} \ - emotion >= ${efl_version} \ - eio >= ${efl_version} \ - eina >= ${efl_version} \ - ecore >= ${efl_version} \ - evas >= ${efl_version} \ - " -PKG_CHECK_MODULES([RAGE], [${requirements}]) - -EFL_WITH_BIN([edje], [edje-cc], [edje_cc]) - -AC_CONFIG_FILES([ -Makefile -rage.spec -src/Makefile -src/bin/Makefile -data/Makefile -data/desktop/Makefile -data/icons/Makefile -data/themes/Makefile -data/themes/images/Makefile -pkgbuild/PKGBUILD -]) -AC_OUTPUT - -echo -echo -echo -echo "------------------------------------------------------------------------" -echo "$PACKAGE $VERSION" -echo "------------------------------------------------------------------------" -echo -echo "Compilation................: make (or gmake)" -echo " CPPFLAGS.................: $CPPFLAGS" -echo " CFLAGS...................: $CFLAGS" -echo " LDFLAGS..................: $LDFLAGS" -echo -echo "Installation...............: make install (as root if needed, with 'su' or 'sudo')" -echo " prefix...................: $prefix" diff --git a/data/desktop/meson.build b/data/desktop/meson.build new file mode 100644 index 0000000..8fa561b --- /dev/null +++ b/data/desktop/meson.build @@ -0,0 +1,2 @@ +install_data('rage.desktop', + install_dir: join_paths(dir_data, 'applications')) diff --git a/data/icons/meson.build b/data/icons/meson.build new file mode 100644 index 0000000..d7de06a --- /dev/null +++ b/data/icons/meson.build @@ -0,0 +1,2 @@ +install_data('rage.png', + install_dir: join_paths(dir_data, 'icons')) diff --git a/data/meson.build b/data/meson.build new file mode 100644 index 0000000..2f97830 --- /dev/null +++ b/data/meson.build @@ -0,0 +1,3 @@ +subdir('themes') +subdir('desktop') +subdir('icons') diff --git a/data/themes/meson.build b/data/themes/meson.build new file mode 100644 index 0000000..e895488 --- /dev/null +++ b/data/themes/meson.build @@ -0,0 +1,13 @@ +cmd = [ edje_cmd, + '-id', join_paths(meson.source_root(), 'data' , 'themes', 'images'), + '@INPUT@', '@OUTPUT@' + ] +src = 'default' +custom_target(src + '.edj', + input : src + '.edc', + output : src + '.edj', + command : cmd, + install_dir: join_paths(dir_data, proj, 'themes'), + install : true + ) +meson.add_install_script('perms.sh') diff --git a/data/themes/perms.sh b/data/themes/perms.sh new file mode 100755 index 0000000..9aa2a99 --- /dev/null +++ b/data/themes/perms.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +chmod a+r "${DESTDIR}/${MESON_INSTALL_PREFIX}/share/rage/themes/default.edj" diff --git a/m4/ac_attribute.m4 b/m4/ac_attribute.m4 deleted file mode 100644 index 23479a9..0000000 --- a/m4/ac_attribute.m4 +++ /dev/null @@ -1,47 +0,0 @@ -dnl Copyright (C) 2004-2008 Kim Woelders -dnl Copyright (C) 2008 Vincent Torri -dnl That code is public domain and can be freely used or copied. -dnl Originally snatched from somewhere... - -dnl Macro for checking if the compiler supports __attribute__ - -dnl Usage: AC_C___ATTRIBUTE__ -dnl call AC_DEFINE for HAVE___ATTRIBUTE__ and __UNUSED__ -dnl if the compiler supports __attribute__, HAVE___ATTRIBUTE__ is -dnl defined to 1 and __UNUSED__ is defined to __attribute__((unused)) -dnl otherwise, HAVE___ATTRIBUTE__ is not defined and __UNUSED__ is -dnl defined to nothing. - -AC_DEFUN([AC_C___ATTRIBUTE__], -[ - -AC_MSG_CHECKING([for __attribute__]) - -AC_CACHE_VAL([ac_cv___attribute__], - [AC_TRY_COMPILE( - [ -#include - -int func(int x); -int foo(int x __attribute__ ((unused))) -{ - exit(1); -} - ], - [], - [ac_cv___attribute__="yes"], - [ac_cv___attribute__="no"] - )]) - -AC_MSG_RESULT($ac_cv___attribute__) - -if test "x${ac_cv___attribute__}" = "xyes" ; then - AC_DEFINE([HAVE___ATTRIBUTE__], [1], [Define to 1 if your compiler has __attribute__]) - AC_DEFINE([__UNUSED__], [__attribute__((unused))], [Macro declaring a function argument to be unused]) - else - AC_DEFINE([__UNUSED__], [], [Macro declaring a function argument to be unused]) -fi - -]) - -dnl End of ac_attribute.m4 diff --git a/m4/efl_beta.m4 b/m4/efl_beta.m4 deleted file mode 100644 index c804729..0000000 --- a/m4/efl_beta.m4 +++ /dev/null @@ -1,5 +0,0 @@ -dnl use: EFL_ENABLE_BETA_API_SUPPORT -AC_DEFUN([EFL_ENABLE_BETA_API_SUPPORT], -[ - AC_DEFINE([EFL_BETA_API_SUPPORT], [1], [Enable access to unstable EFL API that are still in beta]) -]) diff --git a/m4/efl_binary.m4 b/m4/efl_binary.m4 deleted file mode 100644 index c774688..0000000 --- a/m4/efl_binary.m4 +++ /dev/null @@ -1,71 +0,0 @@ -dnl Copyright (C) 2010 Vincent Torri -dnl That code is public domain and can be freely used or copied. - -dnl Macro that check if a binary is built or not - -dnl Usage: EFL_ENABLE_BIN(binary) -dnl Call AC_SUBST(BINARY_PRG) (BINARY is the uppercase of binary, - being transformed into _) -dnl Define have_binary (- is transformed into _) -dnl Define conditional BUILD_BINARY (BINARY is the uppercase of binary, - being transformed into _) - -AC_DEFUN([EFL_ENABLE_BIN], -[ - -m4_pushdef([UP], m4_translit([[$1]], [-a-z], [_A-Z]))dnl -m4_pushdef([DOWN], m4_translit([[$1]], [-A-Z], [_a-z]))dnl - -have_[]m4_defn([DOWN])="yes" - -dnl configure option - -AC_ARG_ENABLE([$1], - [AC_HELP_STRING([--disable-$1], [disable building of ]DOWN)], - [ - if test "x${enableval}" = "xyes" ; then - have_[]m4_defn([DOWN])="yes" - else - have_[]m4_defn([DOWN])="no" - fi - ]) - -AC_MSG_CHECKING([whether to build ]DOWN[ binary]) -AC_MSG_RESULT([$have_[]m4_defn([DOWN])]) - -if test "x$have_[]m4_defn([DOWN])" = "xyes"; then - UP[]_PRG=DOWN[${EXEEXT}] -fi - -AC_SUBST(UP[]_PRG) - -AM_CONDITIONAL(BUILD_[]UP, test "x$have_[]m4_defn([DOWN])" = "xyes") - -AS_IF([test "x$have_[]m4_defn([DOWN])" = "xyes"], [$2], [$3]) - -]) - - -dnl Macro that check if a binary is built or not - -dnl Usage: EFL_WITH_BIN(package, binary, default_value) -dnl Call AC_SUBST(_binary) (_binary is the lowercase of binary, - being transformed into _ by default, or the value set by the user) - -AC_DEFUN([EFL_WITH_BIN], -[ - -m4_pushdef([DOWN], m4_translit([[$2]], [-A-Z], [_a-z]))dnl - -dnl configure option - -AC_ARG_WITH([$2], - [AC_HELP_STRING([--with-$2=PATH], [specify a specific path to ]DOWN[ @<:@default=$3@:>@])], - [_efl_with_binary=${withval}], - [_efl_with_binary=$(pkg-config --variable=prefix $1)/bin/$3]) - -DOWN=${_efl_with_binary} -AC_MSG_NOTICE(DOWN[ set to ${_efl_with_binary}]) - -with_binary_[]m4_defn([DOWN])=${_efl_with_binary} - -AC_SUBST(DOWN) - -]) diff --git a/m4/efl_eo.m4 b/m4/efl_eo.m4 deleted file mode 100644 index 864baf5..0000000 --- a/m4/efl_eo.m4 +++ /dev/null @@ -1,6 +0,0 @@ -dnl use: EFL_ENABLE_EO_API_SUPPORT -AC_DEFUN([EFL_ENABLE_EO_API_SUPPORT], -[ - AC_DEFINE([EFL_EO_API_SUPPORT], [1], [Enable access to unstable EFL Eo API]) -]) - diff --git a/meson.build b/meson.build new file mode 100644 index 0000000..216849e --- /dev/null +++ b/meson.build @@ -0,0 +1,64 @@ +##### project +project('rage', 'c', + version : '0.2.1', + license : 'BSD 2 clause', + default_options: [ 'c_std=gnu99' ], + meson_version : '>= 0.40.0') +base_url = 'https://www.enlightenment.org/about-' + +##### convenience variables for later +proj = meson.project_name() +ver = meson.project_version() + +##### dependencies +efl_version = '>= 1.19.0' +deps = dependency('elementary', version: efl_version) +edje = dependency('edje', version: efl_version) + +##### edje_cc binary compiler tool +edje_cmd = get_option('edje-cc') +if edje_cmd == '' + edje_cmd = join_paths(edje.get_pkgconfig_variable('prefix'), + 'bin', 'edje_cc') +endif + +##### dir locations +dir_prefix = get_option('prefix') +dir_bin = join_paths(dir_prefix, get_option('bindir')) +dir_lib = join_paths(dir_prefix, get_option('libdir')) +dir_data = join_paths(dir_prefix, get_option('datadir')) +dir_locale = join_paths(dir_prefix, get_option('localedir')) + +##### config.h +cfg = configuration_data() +cfg.set_quoted('PACKAGE' , proj) +cfg.set_quoted('PACKAGE_NAME' , proj) +cfg.set_quoted('PACKAGE_VERSION' , ver) +cfg.set_quoted('PACKAGE_STRING' , proj + ' ' + ver) +cfg.set_quoted('PACKAGE_URL' , base_url + proj) +cfg.set_quoted('PACKAGE_BIN_DIR' , dir_bin) +cfg.set_quoted('PACKAGE_LIB_DIR' , dir_lib) +cfg.set_quoted('PACKAGE_DATA_DIR' , join_paths(dir_data, proj)) +cfg.set_quoted('LOCALEDIR' , dir_locale) +cfg.set ('_GNU_SOURCE' , 1) +cfg.set ('__EXTENSIONS__' , 1) +cfg.set ('_POSIX_PTHREAD_SEMANTICS', 1) +cfg.set ('_ALL_SOURCE' , 1) +cfg.set ('_POSIX_SOURCE' , 1) +cfg.set ('_POSIX_1_SOURCE' , 1) +configure_file(output: 'rage_config.h', configuration: cfg) + +##### packaging files for distro packages +pkg = configuration_data() +pkg.set('PACKAGE', proj) +pkg.set('VERSION', ver) +configure_file(input : proj + '.spec.in', + output : proj + '.spec', + configuration: pkg) +configure_file(input : join_paths('pkgbuild', 'PKGBUILD.in'), + output : 'PKGBUILD', + configuration: pkg) + +##### subdirs +subdir('src') +subdir('data') diff --git a/meson_options.txt b/meson_options.txt new file mode 100644 index 0000000..460359b --- /dev/null +++ b/meson_options.txt @@ -0,0 +1,3 @@ +option('edje-cc', + type : 'string', + description: 'A path to a edje_cc. Defaults to system edje_cc') diff --git a/src/bin/meson.build b/src/bin/meson.build new file mode 100644 index 0000000..c97dca4 --- /dev/null +++ b/src/bin/meson.build @@ -0,0 +1,30 @@ +inc = include_directories('.', '../..') +executable('rage', [ + 'controls.c', 'controls.h', + 'dnd.c', 'dnd.h', + 'gesture.c', 'gesture.h', + 'key.c', 'key.h', + 'main.c', 'main.h', + 'video.c', 'video.h', + 'winvid.c', 'winvid.h', + 'win.c', 'win.h', + 'winlist.c', 'winlist.h', + 'config.c', 'config.h', + 'sha1.c', 'sha1.h', + 'videothumb.c', 'videothumb.h', + 'albumart.c', 'albumart.h', + 'browser.c', 'browser.h' + ], + include_directories: inc, + dependencies : deps, + gui_app : true, + install : true) +executable('rage_thumb', [ + 'thumb.c', + 'sha1.c', 'sha1.h', + 'albumart.c', 'albumart.h' + ], + include_directories: inc, + dependencies : deps, + install_dir : join_paths(dir_lib, proj, 'utils'), + install : true) diff --git a/src/bin/thumb.c b/src/bin/thumb.c index cd2b38d..deddeef 100644 --- a/src/bin/thumb.c +++ b/src/bin/thumb.c @@ -2,7 +2,7 @@ #include #include "sha1.h" #include "albumart.h" - +#include "rage_config.h" static Evas_Object *win = NULL, *subwin = NULL, *image = NULL, *vid = NULL; static Evas_Object *vidimage = NULL; diff --git a/src/meson.build b/src/meson.build new file mode 100644 index 0000000..2ca5545 --- /dev/null +++ b/src/meson.build @@ -0,0 +1 @@ +subdir('bin')