Penguins: switch to meson build

This commit is contained in:
Davide Andreoli 2020-04-18 19:11:34 +02:00
parent bec991619a
commit 9d800565c2
25 changed files with 172 additions and 383 deletions

87
.gitignore vendored
View File

@ -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/

28
INSTALL
View File

@ -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/

View File

@ -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)

View File

@ -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

View File

@ -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
], [
])

View File

@ -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 <mej@eterm.org>}
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

View File

83
meson.build Normal file
View File

@ -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
)

4
meson_options.txt Normal file
View File

@ -0,0 +1,4 @@
option('nls',
type: 'boolean',
value: true,
description: 'enable localization: (default=true)')

View File

@ -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 =

10
po/meson.build Normal file
View File

@ -0,0 +1,10 @@
i18n = import('i18n')
i18n.gettext(gettext_domain,
args: [
'--keyword=N_',
'--keyword=D_',
'--from-code=UTF-8',
'--foreign-user'
])

View File

@ -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 *~

View File

@ -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

View File

@ -1,5 +1,4 @@
#include <e.h>
#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);
}

View File

@ -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 <libintl.h>
# define D_(string) dgettext(PACKAGE, string)
# define D_(string) dgettext(LOCALEDOMAIN, string)
#else
# define bindtextdomain(domain,dir)
# define bind_textdomain_codeset(domain,codeset)

View File

@ -1,5 +1,4 @@
#include <e.h>
#include "config.h"
#include "e_mod_main.h"
#include "e_mod_config.h"
#include "e_mod_penguins.h"

13
src/meson.build Normal file
View File

@ -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: '',
)

View File

@ -1,2 +0,0 @@
MAINTAINERCLEANFILES = Makefile.in
SUBDIRS = default lemmings

View File

@ -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`

View File

@ -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')

View File

@ -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`

View File

@ -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')

4
themes/meson.build Normal file
View File

@ -0,0 +1,4 @@
themes_install_dir = join_paths(mod_install_dir, 'themes')
subdir('default')
subdir('lemmings')