From 9d800565c2018411bd790eb3294effdabaefdfdc Mon Sep 17 00:00:00 2001 From: Dave Andreoli Date: Sat, 18 Apr 2020 19:11:34 +0200 Subject: [PATCH] Penguins: switch to meson build --- .gitignore | 87 +---------------------------- INSTALL | 28 +++++++--- Makefile.am | 32 ----------- autogen.sh | 17 ------ configure.ac | 75 ------------------------- e_modules-penguins.spec.in | 48 ---------------- m4/.svnignore | 0 meson.build | 83 +++++++++++++++++++++++++++ meson_options.txt | 4 ++ module.desktop.in => module.desktop | 0 po/Makevars | 41 -------------- po/{POTFILES.in => POTFILES} | 0 po/meson.build | 10 ++++ src/Makefile.am | 23 -------- src/e_mod_config.c | 1 - src/e_mod_main.c | 7 +-- src/e_mod_main.h | 7 ++- src/e_mod_penguins.c | 1 - src/meson.build | 13 +++++ themes/Makefile.am | 2 - themes/default/Makefile.am | 21 ------- themes/default/meson.build | 15 +++++ themes/lemmings/Makefile.am | 21 ------- themes/lemmings/meson.build | 15 +++++ themes/meson.build | 4 ++ 25 files changed, 172 insertions(+), 383 deletions(-) delete mode 100644 Makefile.am delete mode 100755 autogen.sh delete mode 100644 configure.ac delete mode 100644 e_modules-penguins.spec.in delete mode 100644 m4/.svnignore create mode 100644 meson.build create mode 100644 meson_options.txt rename module.desktop.in => module.desktop (100%) delete mode 100644 po/Makevars rename po/{POTFILES.in => POTFILES} (100%) create mode 100644 po/meson.build delete mode 100644 src/Makefile.am create mode 100644 src/meson.build delete mode 100644 themes/Makefile.am delete mode 100644 themes/default/Makefile.am create mode 100644 themes/default/meson.build delete mode 100644 themes/lemmings/Makefile.am create mode 100644 themes/lemmings/meson.build create mode 100644 themes/meson.build diff --git a/.gitignore b/.gitignore index 674a169..567609b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,86 +1 @@ -*~ -*swo -*swp -ABOUT-NLS -Makefile -Makefile.in -aclocal.m4 -autom4te.cache/ -config.guess -config.h -config.h.in -config.log -config.rpath -config.status -config.sub -configure -compile -depcomp -e-module-penguins.edj -e_modules-penguins.spec -install-sh -libtool -ltmain.sh -themes/default/default.edj -themes/lemmings/lemmings.edj -m4/codeset.m4 -m4/gettext.m4 -m4/glibc21.m4 -m4/iconv.m4 -m4/intdiv0.m4 -m4/intmax.m4 -m4/inttypes-pri.m4 -m4/inttypes.m4 -m4/inttypes_h.m4 -m4/isc-posix.m4 -m4/lcmessage.m4 -m4/lib-ld.m4 -m4/lib-link.m4 -m4/lib-prefix.m4 -m4/libtool.m4 -m4/longdouble.m4 -m4/longlong.m4 -m4/ltoptions.m4 -m4/ltsugar.m4 -m4/ltversion.m4 -m4/lt~obsolete.m4 -m4/nls.m4 -m4/po.m4 -m4/printf-posix.m4 -m4/progtest.m4 -m4/signed.m4 -m4/size_max.m4 -m4/stdint_h.m4 -m4/uintmax_t.m4 -m4/ulonglong.m4 -m4/wchar_t.m4 -m4/wint_t.m4 -m4/xsize.m4 -missing -mkinstalldirs -module.desktop -po/*.gmo -po/Makefile -po/Makefile.in -po/Makefile.in.in -po/Makevars.template -po/POTFILES -po/Rules-quot -po/boldquot.sed -po/en@boldquot.header -po/en@quot.header -po/insert-header.sin -po/penguins.pot -po/quot.sed -po/remove-potcdate.sed -po/remove-potcdate.sin -po/stamp-po -src/.deps/ -src/.libs/ -src/Makefile -src/Makefile.in -src/*.o -src/*.lo -src/*.la -stamp-h1 - +build/ diff --git a/INSTALL b/INSTALL index 8919fc2..fc64386 100644 --- a/INSTALL +++ b/INSTALL @@ -1,11 +1,23 @@ -COMPILING and INSTALLING: +To build using meson +==================== +meson build +cd build +ninja +ninja install -If you got a official release tar archive do: - ./autogen.sh - -Then to compile: - make -To install: - make install +Or without chdir +================ +meson build +ninja -C build +ninja -C build install + +Uninstall +========= +ninja -C build uninstall + + +Clean build +=========== +rm -rf build/ diff --git a/Makefile.am b/Makefile.am deleted file mode 100644 index dc12ef5..0000000 --- a/Makefile.am +++ /dev/null @@ -1,32 +0,0 @@ -ACLOCAL_AMFLAGS = -I m4 -MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.guess config.h.in \ - config.sub configure depcomp install-sh ltmain.sh \ - missing module.desktop config.rpath mkinstalldirs - -SUBDIRS = src themes - -if HAVE_PO - -SUBDIRS += po - -endif - -EDJE_FLAGS = -v \ - -id $(top_srcdir)/images - -filesdir = $(datadir) -files_DATA = module.desktop e-module-penguins.edj - -EXTRA_DIST = module.desktop.in \ - e_modules-penguins.spec.in \ - e-module-penguins.edc \ - $(wildcard images/*.png) - -%.edj: %.edc - $(EDJE_CC) $(EDJE_FLAGS) $< $@ - -clean-local: - rm -rf e-module-penguins.edj module.desktop e_modules-penguins.spec *~ - -uninstall: - rm -rf $(DESTDIR)$(datadir) diff --git a/autogen.sh b/autogen.sh deleted file mode 100755 index ae01364..0000000 --- a/autogen.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -rm -rf autom4te.cache -rm -f aclocal.m4 ltmain.sh - -touch README - -echo "Running autopoint..." ; autopoint -f || : -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 diff --git a/configure.ac b/configure.ac deleted file mode 100644 index e7eccd6..0000000 --- a/configure.ac +++ /dev/null @@ -1,75 +0,0 @@ -dnl Process this file with autoconf to produce a configure script. - -# get rid of that stupid cache mechanism -rm -f config.cache - -AC_INIT(penguins, 0.19, dave@gurumeditation.it) -AC_PREREQ(2.52) -AC_CONFIG_SRCDIR(configure.ac) -AC_CANONICAL_BUILD -AC_CANONICAL_HOST -AC_ISC_POSIX - -AM_INIT_AUTOMAKE(1.6) -AC_CONFIG_HEADERS(config.h) - -AC_PROG_CC -AC_HEADER_STDC -AC_C_CONST - -define([AC_LIBTOOL_LANG_CXX_CONFIG], [:])dnl -define([AC_LIBTOOL_LANG_F77_CONFIG], [:])dnl -AC_PROG_LIBTOOL - -m4_ifdef([AM_GNU_GETTEXT_VERSION], [ -AM_GNU_GETTEXT_VERSION([0.14]) -]) - -m4_ifdef([AM_GNU_GETTEXT], [ -AM_GNU_GETTEXT([external]) -po_makefile_in=po/Makefile.in -AM_CONDITIONAL([HAVE_PO], [true]) -],[ -AM_CONDITIONAL([HAVE_PO], [false]) -]) -AC_SUBST(LTLIBINTL) - -PKG_CHECK_MODULES(E, [enlightenment >= 0.18.99]) -release=$(pkg-config --variable=release enlightenment) -MODULE_ARCH="$host_os-$host_cpu-$release" -AC_SUBST(MODULE_ARCH) -AC_DEFINE_UNQUOTED(MODULE_ARCH, "$MODULE_ARCH", "Module architecture") - -# Find edje_cc -PKG_CHECK_MODULES(EDJE, [edje >= 1.8]) -AC_ARG_WITH(edje-cc, - AC_HELP_STRING([--with-edje-cc=PATH], [specify a specific path to edje_cc]), - [ - v=$withval; - EDJE_CC=$v - ],[ - EDJE_CC=$(pkg-config --variable=prefix edje)/bin/edje_cc - ] -) -AC_SUBST(EDJE_CC) -AC_MSG_CHECKING([Which edje_cc to use]) -AC_MSG_RESULT(${EDJE_CC}) - -datadir=$(pkg-config --variable=modules enlightenment)/${PACKAGE} -AC_ARG_ENABLE(homedir-install, - AS_HELP_STRING([--enable-homedir-install], [Install module in homedir]), - [ datadir="${HOME}/.e/e/modules/${PACKAGE}" ] -) - -AC_OUTPUT([ -Makefile -src/Makefile -e_modules-penguins.spec -module.desktop -themes/Makefile -themes/default/Makefile -themes/lemmings/Makefile -$po_makefile_in -], [ -]) - diff --git a/e_modules-penguins.spec.in b/e_modules-penguins.spec.in deleted file mode 100644 index e9e581d..0000000 --- a/e_modules-penguins.spec.in +++ /dev/null @@ -1,48 +0,0 @@ -%define module_name penguins -%{!?_rel:%{expand:%%global _rel 0.enl%{?dist}}} - -Summary: %{module_name} module for the Enlightenment window manager -Name: e_modules-%{module_name} -Version: @VERSION@ -Release: %{_rel} -License: BSD -Group: User Interface/Desktops -URL: http://www.enlightenment.org/ -Source: ftp://ftp.enlightenment.org/pub/enlightenment/%{module_name}-%{version}.tar.gz -Packager: %{?_packager:%{_packager}}%{!?_packager:Michael Jennings } -Vendor: %{?_vendorinfo:%{_vendorinfo}}%{!?_vendorinfo:The Enlightenment Project (http://www.enlightenment.org/)} -Distribution: %{?_distribution:%{_distribution}}%{!?_distribution:%{_vendor}} -BuildRequires: ecore-devel, evas-devel, edje-bin -BuildRequires: edje-devel, eet-devel, enlightenment-devel >= 0.16.999 -Requires: enlightenment >= 0.16.999 -BuildRoot: %{_tmppath}/%{name}-%{version}-root - -%description -%{module_name} module for the Enlightenment window manager. - -%prep -%setup -q -n %{module_name}-%{version} - -%build -%{configure} -%{__make} %{?_smp_mflags} %{?mflags} - -%install -%{__make} %{?mflags_install} DESTDIR=$RPM_BUILD_ROOT install -%{find_lang} %{module_name} || true > %{module_name}.lang - -%clean -test "x$RPM_BUILD_ROOT" != "x/" && rm -rf $RPM_BUILD_ROOT - -%post -/sbin/ldconfig - -%postun -/sbin/ldconfig - -%files -f %{module_name}.lang -%defattr(-, root, root) -%doc AUTHORS ChangeLog COPYING* INSTALL NEWS README -%{_libdir}/enlightenment/modules/%{module_name}* - -%changelog diff --git a/m4/.svnignore b/m4/.svnignore deleted file mode 100644 index e69de29..0000000 diff --git a/meson.build b/meson.build new file mode 100644 index 0000000..d5528d9 --- /dev/null +++ b/meson.build @@ -0,0 +1,83 @@ + +#### Project #### +project('penguins', 'c', + license: 'BSD 2 clause', + meson_version: '>= 0.47.0') + +gettext_domain = 'e-module-' + meson.project_name() + + +#### Enlightenemnt #### +dep_e = dependency('enlightenment') +e_modules_dir = dep_e.get_pkgconfig_variable('modules') +e_release = dep_e.get_pkgconfig_variable('release') + + + +#### Host arch #### +host_os = host_machine.system() +if host_os == 'linux' + cc = meson.get_compiler('c') + if cc.has_header_symbol('features.h', '__UCLIBC__') + host_os = 'linux-uclibc' + elif cc.has_header_symbol('features.h', '__dietlibc__') + host_os = 'linux-dietlibc' + else + host_os = 'linux-gnu' + endif +endif +mod_arch = '@0@-@1@-@2@'.format(host_os, host_machine.cpu_family(), e_release) + + +#### Install dirs #### +mod_install_dir = join_paths(e_modules_dir, meson.project_name()) +lib_install_dir = join_paths(mod_install_dir, mod_arch) + + +#### config.h #### +config_h = configuration_data() +config_h.set_quoted('PACKAGE', meson.project_name()) +config_h.set_quoted('LOCALEDIR', join_paths(get_option('prefix'), get_option('localedir'))) +config_h.set_quoted('LOCALEDOMAIN', gettext_domain) +config_dir = include_directories('.') + + +#### i18n #### +dep_intl = [] +if get_option('nls') + config_h.set('HAVE_GETTEXT', '1') + dep_intl = cc.find_library('intl', required : false) + subdir('po') +endif + + +#### Edje cc #### +edje_cc = find_program('edje_cc') + + +#### module sources #### +subdir('src') + + +#### themes #### +subdir('themes') + + +#### write config file #### +configure_file(output: 'penguins_config.h', configuration: config_h) + + +#### Data files #### +install_data('module.desktop', install_dir: mod_install_dir) + +cmd = [ edje_cc, + '-id', join_paths(meson.source_root(), 'images'), + '@INPUT@', '@OUTPUT@'] +custom_target('e-module-penguins.edj', + input : 'e-module-penguins.edc', + output : 'e-module-penguins.edj', + command : cmd, + install_dir: mod_install_dir, + install : true + ) + diff --git a/meson_options.txt b/meson_options.txt new file mode 100644 index 0000000..df2a862 --- /dev/null +++ b/meson_options.txt @@ -0,0 +1,4 @@ +option('nls', + type: 'boolean', + value: true, + description: 'enable localization: (default=true)') diff --git a/module.desktop.in b/module.desktop similarity index 100% rename from module.desktop.in rename to module.desktop diff --git a/po/Makevars b/po/Makevars deleted file mode 100644 index 9275c25..0000000 --- a/po/Makevars +++ /dev/null @@ -1,41 +0,0 @@ -# Makefile variables for PO directory in any package using GNU gettext. - -# Usually the message domain is the same as the package name. -DOMAIN = $(PACKAGE) - -# These two variables depend on the location of this directory. -subdir = po -top_builddir = .. - -# These options get passed to xgettext. -XGETTEXT_OPTIONS = --keyword=N_ --keyword=D_ --from-code=UTF-8 --foreign-user - -# This is the copyright holder that gets inserted into the header of the -# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding -# package. (Note that the msgstr strings, extracted from the package's -# sources, belong to the copyright holder of the package.) Translators are -# expected to transfer the copyright for their translations to this person -# or entity, or to disclaim their copyright. The empty string stands for -# the public domain; in this case the translators are expected to disclaim -# their copyright. -COPYRIGHT_HOLDER = Enlightenment development team - -# This is the email address or URL to which the translators shall report -# bugs in the untranslated strings: -# - Strings which are not entire sentences, see the maintainer guidelines -# in the GNU gettext documentation, section 'Preparing Strings'. -# - Strings which use unclear terms or require additional context to be -# understood. -# - Strings which make invalid assumptions about notation of date, time or -# money. -# - Pluralisation problems. -# - Incorrect English spelling. -# - Incorrect formatting. -# It can be your email address, or a mailing list address where translators -# can write to without being subscribed, or the URL of a web page through -# which the translators can contact you. -MSGID_BUGS_ADDRESS = enlightenment-devel@lists.sourceforge.net - -# This is the list of locale categories, beyond LC_MESSAGES, for which the -# message catalogs shall be used. It is usually empty. -EXTRA_LOCALE_CATEGORIES = diff --git a/po/POTFILES.in b/po/POTFILES similarity index 100% rename from po/POTFILES.in rename to po/POTFILES diff --git a/po/meson.build b/po/meson.build new file mode 100644 index 0000000..69fb40c --- /dev/null +++ b/po/meson.build @@ -0,0 +1,10 @@ +i18n = import('i18n') + +i18n.gettext(gettext_domain, + args: [ + '--keyword=N_', + '--keyword=D_', + '--from-code=UTF-8', + '--foreign-user' + ]) + diff --git a/src/Makefile.am b/src/Makefile.am deleted file mode 100644 index 62c5e1e..0000000 --- a/src/Makefile.am +++ /dev/null @@ -1,23 +0,0 @@ -MAINTAINERCLEANFILES = Makefile.in - -AM_CPPFLAGS = -Wall \ - -I. \ - -I$(top_srcdir) \ - -I$(includedir) \ - @E_CFLAGS@ - -pkgdir = $(datadir)/$(MODULE_ARCH) -pkg_LTLIBRARIES = module.la -module_la_SOURCES = e_mod_main.c \ - e_mod_main.h \ - e_mod_config.c \ - e_mod_config.h \ - e_mod_penguins.c \ - e_mod_penguins.h - -module_la_LIBADD = @E_LIBS@ -module_la_LDFLAGS = -module -avoid-version -module_la_DEPENDENCIES = $(top_builddir)/config.h - -clean-local: - rm -rf *~ diff --git a/src/e_mod_config.c b/src/e_mod_config.c index 1675c86..437cc34 100644 --- a/src/e_mod_config.c +++ b/src/e_mod_config.c @@ -2,7 +2,6 @@ #include "e_mod_main.h" #include "e_mod_config.h" #include "e_mod_penguins.h" -#include "config.h" struct _E_Config_Dialog_Data diff --git a/src/e_mod_main.c b/src/e_mod_main.c index d70e145..ef71507 100644 --- a/src/e_mod_main.c +++ b/src/e_mod_main.c @@ -1,5 +1,4 @@ #include -#include "config.h" #include "e_mod_main.h" #include "e_mod_config.h" #include "e_mod_penguins.h" @@ -17,9 +16,8 @@ e_modapi_init(E_Module *m) char buf[PATH_MAX]; // Set up module's message catalogue - snprintf(buf, sizeof(buf), "%s/locale", e_module_dir_get(m)); - bindtextdomain(PACKAGE, buf); - bind_textdomain_codeset(PACKAGE, "UTF-8"); + bindtextdomain(LOCALEDOMAIN, LOCALEDIR); + bind_textdomain_codeset(LOCALEDOMAIN, "UTF-8"); // Add an item in the config panel snprintf(buf, sizeof(buf), "%s/e-module-penguins.edj", e_module_dir_get(m)); @@ -29,7 +27,6 @@ e_modapi_init(E_Module *m) NULL, buf, e_int_config_penguins_module); penguins_mod = m; - return penguins_init(m); } diff --git a/src/e_mod_main.h b/src/e_mod_main.h index dacc137..26d8ca5 100644 --- a/src/e_mod_main.h +++ b/src/e_mod_main.h @@ -1,9 +1,12 @@ #ifndef E_MOD_MAIN_H #define E_MOD_MAIN_H -#ifdef ENABLE_NLS +#include "penguins_config.h" + + +#ifdef HAVE_GETTEXT # include -# define D_(string) dgettext(PACKAGE, string) +# define D_(string) dgettext(LOCALEDOMAIN, string) #else # define bindtextdomain(domain,dir) # define bind_textdomain_codeset(domain,codeset) diff --git a/src/e_mod_penguins.c b/src/e_mod_penguins.c index 5bf21dd..e24bced 100644 --- a/src/e_mod_penguins.c +++ b/src/e_mod_penguins.c @@ -1,5 +1,4 @@ #include -#include "config.h" #include "e_mod_main.h" #include "e_mod_config.h" #include "e_mod_penguins.h" diff --git a/src/meson.build b/src/meson.build new file mode 100644 index 0000000..3da6c0e --- /dev/null +++ b/src/meson.build @@ -0,0 +1,13 @@ + +module = shared_module( + 'module', + 'e_mod_main.c', + 'e_mod_config.c', + 'e_mod_penguins.c', + + dependencies : [dep_e, dep_intl], + install_dir: lib_install_dir, + include_directories: config_dir, + install: true, + name_prefix: '', +) diff --git a/themes/Makefile.am b/themes/Makefile.am deleted file mode 100644 index 9a3b825..0000000 --- a/themes/Makefile.am +++ /dev/null @@ -1,2 +0,0 @@ -MAINTAINERCLEANFILES = Makefile.in -SUBDIRS = default lemmings diff --git a/themes/default/Makefile.am b/themes/default/Makefile.am deleted file mode 100644 index 911f8ff..0000000 --- a/themes/default/Makefile.am +++ /dev/null @@ -1,21 +0,0 @@ -THEME = default -EDC = $(THEME).edc -EDJ = $(THEME).edj -SUFFIXES = .edc .edj -MAINTAINERCLEANFILES = Makefile.in -CLEANFILES = $(EDJ) - -pkgdatadir = $(datadir) -themedir = $(pkgdatadir)/themes -theme_DATA = $(EDJ) - -all: $(EDJ) - -.edc.edj: - $(EDJE_CC) -v -id $(top_srcdir)/themes/$(THEME) -fd $(top_srcdir)/themes/$(THEME) $< $@ - -EXTRA_DIST = $(EDC) \ - $(wildcard *.png) - -dist-hook: - rm -rf `find $(distdir) -name CVS` diff --git a/themes/default/meson.build b/themes/default/meson.build new file mode 100644 index 0000000..cfe8223 --- /dev/null +++ b/themes/default/meson.build @@ -0,0 +1,15 @@ + +theme_name = 'default' + +command = [edje_cc, + '-id', join_paths(meson.source_root(), 'themes', theme_name), + '@INPUT@', '@OUTPUT@'] + +custom_target(theme_name + '.edj', + install:true, + depend_files: files([theme_name + '.edc']), + install_dir: themes_install_dir, + install_mode: 'rw-r--r--', + command: command, + input: theme_name + '.edc', + output: theme_name + '.edj') diff --git a/themes/lemmings/Makefile.am b/themes/lemmings/Makefile.am deleted file mode 100644 index 6aeb370..0000000 --- a/themes/lemmings/Makefile.am +++ /dev/null @@ -1,21 +0,0 @@ -THEME = lemmings -EDC = $(THEME).edc -EDJ = $(THEME).edj -SUFFIXES = .edc .edj -MAINTAINERCLEANFILES = Makefile.in -CLEANFILES = $(EDJ) - -pkgdatadir = $(datadir) -themedir = $(pkgdatadir)/themes -theme_DATA = $(EDJ) - -all: $(EDJ) - -.edc.edj: - $(EDJE_CC) -v -id $(top_srcdir)/themes/$(THEME) -fd $(top_srcdir)/themes/$(THEME) $< $@ - -EXTRA_DIST = $(EDC) \ - $(wildcard *.png) - -dist-hook: - rm -rf `find $(distdir) -name CVS` diff --git a/themes/lemmings/meson.build b/themes/lemmings/meson.build new file mode 100644 index 0000000..3bcbcea --- /dev/null +++ b/themes/lemmings/meson.build @@ -0,0 +1,15 @@ + +theme_name = 'lemmings' + +command = [edje_cc, + '-id', join_paths(meson.source_root(), 'themes', theme_name), + '@INPUT@', '@OUTPUT@'] + +custom_target(theme_name + '.edj', + install:true, + depend_files: files([theme_name + '.edc']), + install_dir: themes_install_dir, + install_mode: 'rw-r--r--', + command: command, + input: theme_name + '.edc', + output: theme_name + '.edj') diff --git a/themes/meson.build b/themes/meson.build new file mode 100644 index 0000000..96bc7d6 --- /dev/null +++ b/themes/meson.build @@ -0,0 +1,4 @@ +themes_install_dir = join_paths(mod_install_dir, 'themes') + +subdir('default') +subdir('lemmings')