diff options
author | Lyes Saadi <mail@lyes.eu> | 2021-07-22 02:11:00 +0100 |
---|---|---|
committer | Lyes Saadi <mail@lyes.eu> | 2021-07-22 02:11:00 +0100 |
commit | f3a90ca07eb495d65ba0a0810d766c9dfb08a71f (patch) | |
tree | 96e592d1eef94f6e10ffbffd49d4d668dbbb7124 | |
parent | 8c0bbd3499bba1b6b8c5a66cb585a28058f720c4 (diff) | |
download | spec-f3a90ca07eb495d65ba0a0810d766c9dfb08a71f.tar.gz spec-f3a90ca07eb495d65ba0a0810d766c9dfb08a71f.tar.xz spec-f3a90ca07eb495d65ba0a0810d766c9dfb08a71f.zip |
Adding Cambalache
-rw-r--r-- | cambalache/appdata-metainfo.patch | 25 | ||||
-rw-r--r-- | cambalache/cambalache.spec | 92 | ||||
-rw-r--r-- | cambalache/installation-changes.patch | 233 |
3 files changed, 350 insertions, 0 deletions
diff --git a/cambalache/appdata-metainfo.patch b/cambalache/appdata-metainfo.patch new file mode 100644 index 0000000..c5d639b --- /dev/null +++ b/cambalache/appdata-metainfo.patch @@ -0,0 +1,25 @@ +From df650340c40281240bfb49b110503f7145e2324a Mon Sep 17 00:00:00 2001 +From: Lyes Saadi <mail@lyes.eu> +Date: Wed, 21 Jul 2021 18:52:10 +0100 +Subject: [PATCH 1/1] /usr/share/appdata -> /usr/share/metainfo + +--- + data/meson.build | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/data/meson.build b/data/meson.build +index a6f838d..77ef82f 100644 +--- a/data/meson.build ++++ b/data/meson.build +@@ -22,7 +22,7 @@ appstream_file = i18n.merge_file( + output: 'ar.xjuan.Cambalache.appdata.xml', + po_dir: '../po', + install: true, +- install_dir: join_paths(datadir, 'appdata') ++ install_dir: join_paths(datadir, 'metainfo') + ) + + desktop_file_validate = find_program('desktop-file-validate', required: false) +-- +2.31.1 + diff --git a/cambalache/cambalache.spec b/cambalache/cambalache.spec new file mode 100644 index 0000000..13ae1fa --- /dev/null +++ b/cambalache/cambalache.spec @@ -0,0 +1,92 @@ +%global forgeurl https://gitlab.gnome.org/jpu/cambalache +%global commit c91562afbdf460571c109441e38679e5eae3f977 + +%global uuid ar.xjuan.Cambalache + +Name: cambalache +Version: 0.6.0 +Release: %autorelease +Summary: RAD tool for Gtk 4 & 3 with a clear MVC design and data model first philosophy +BuildArch: noarch + +%forgemeta + +# Cambalache is licensed under the LGPLv2 license. +# Tools (in the tools/ directory) are licensed under the GPLv2 license. +# Tools are not installed, so neither will be the GPLv2 license. +License: LGPLv2 AND GPLv2 +URL: %{forgeurl} +Source0: %{forgesource} +Patch0: appdata-metainfo.patch +Patch1: installation-changes.patch + +BuildRequires: gtk4-devel +BuildRequires: python3-devel +BuildRequires: python3-gobject-devel +BuildRequires: desktop-file-utils +BuildRequires: libappstream-glib +BuildRequires: git-core + +Requires: python3-lxml +Requires: merengue + +%package -n merengue +Summary: %{summary} + +Requires: gtk4 +Recommends: gtk3 + + +%global _description %{expand: +Cambalache is a new RAD tool for Gtk 4 and 3 with a clear MVC design and data +model first philosophy. This translates to a wide feature coverage with +minimal/none developer intervention for basic support. + +To support multiple Gtk versions it renders the workspace out of process using +the Gdk broadway backend.} + +%description %{_description} + +%description -n merengue %{_description} + + +%prep +%forgeautosetup -S git + + +%build +%meson +%meson_build + + +%install +%meson_install +%find_lang %{name} + + +%check +appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/*.xml +desktop-file-validate %{buildroot}%{_datadir}/applications/%{uuid}.desktop + + +%files -f %{name}.lang +%license COPYING +%doc README.md +%{_bindir}/%{name} +%{python3_sitelib}/%{name}/ +%{python3_sitelib}/%{name}ui/ +%{_metainfodir}/%{uuid}.appdata.xml +%{_datadir}/applications/%{uuid}.desktop +%{_datadir}/%{name}/ +%{_datadir}/%{name}ui/ +%{_datadir}/icons/hicolor/*/apps/*.svg + +%files -n merengue +%license COPYING +%{_bindir}/merengue +%{python3_sitelib}/merengue/ +%{_datadir}/merengue/ + + +%changelog +%autochangelog diff --git a/cambalache/installation-changes.patch b/cambalache/installation-changes.patch new file mode 100644 index 0000000..77f888f --- /dev/null +++ b/cambalache/installation-changes.patch @@ -0,0 +1,233 @@ +From 16c43a33d67cdbf0be3569c2221b873c9df855f4 Mon Sep 17 00:00:00 2001 +From: Lyes Saadi <mail@lyes.eu> +Date: Thu, 22 Jul 2021 01:21:41 +0100 +Subject: [PATCH 1/1] Conforming to distributions packaging requirements + +This introduces several changes to the installation scripts in +order to account for distributions' requirements (Fedora +specifically). This include the installation of python source +files alongside bytecode cache pyc files as well as the +installation of python files in the standard /usr/lib/python3.9/ +directory as python modules. +--- + cambalacheui/meson.build | 32 +++++++++++++++----------------- + merengue/merengue.in | 5 +---- + merengue/meson.build | 26 ++++++++++++-------------- + run-dev.py | 11 +++++------ + src/cambalache.in | 4 +--- + src/meson.build | 10 ++++------ + 6 files changed, 38 insertions(+), 50 deletions(-) + +diff --git a/cambalacheui/meson.build b/cambalacheui/meson.build +index 5ee9409..b97b173 100644 +--- a/cambalacheui/meson.build ++++ b/cambalacheui/meson.build +@@ -20,24 +20,22 @@ configure_file( + install_dir: moduledir + ) + +-run_command('python3', '-m', 'compileall', '-b', '.') +- + install_data([ +- 'cmb_base.pyc', +- 'cmb_db.pyc', +- 'cmb_objects_base.pyc', +- 'cmb_tree_view.pyc', +- 'cmb_list_store.pyc', +- 'cmb_ui.pyc', +- 'cmb_property.pyc', +- 'cmb_layout_property.pyc', +- 'cmb_type_info.pyc', +- 'cmb_object.pyc', +- 'cmb_view.pyc', +- 'cmb_object_editor.pyc', +- 'cmb_project.pyc', +- 'cmb_signal_editor.pyc', +- '__init__.pyc' ++ 'cmb_base.py', ++ 'cmb_db.py', ++ 'cmb_objects_base.py', ++ 'cmb_tree_view.py', ++ 'cmb_list_store.py', ++ 'cmb_ui.py', ++ 'cmb_property.py', ++ 'cmb_layout_property.py', ++ 'cmb_type_info.py', ++ 'cmb_object.py', ++ 'cmb_view.py', ++ 'cmb_object_editor.py', ++ 'cmb_project.py', ++ 'cmb_signal_editor.py', ++ '__init__.py', + ], + install_dir: moduledir) + +diff --git a/merengue/merengue.in b/merengue/merengue.in +index 7a18d22..a04b010 100755 +--- a/merengue/merengue.in ++++ b/merengue/merengue.in +@@ -12,16 +12,13 @@ import gi + import sys + import signal + +-pkgdatadir = '@pkgdatadir@' +- +-sys.path.insert(1, pkgdatadir) + signal.signal(signal.SIGINT, signal.SIG_DFL) + + from gi.repository import GLib + + if __name__ == "__main__": + if len(sys.argv) != 2: +- print(f"Ussage: {sys.argv[0]} gtkversion", file=sys.stderr) ++ print(f"Usage: {sys.argv[0]} gtkversion", file=sys.stderr) + exit() + + version = sys.argv[1] +diff --git a/merengue/meson.build b/merengue/meson.build +index 05a244b..c7c63c1 100644 +--- a/merengue/meson.build ++++ b/merengue/meson.build +@@ -1,5 +1,5 @@ + pkgdatadir = join_paths(get_option('prefix'), get_option('datadir'), 'merengue') +-moduledir = join_paths(pkgdatadir, 'merengue') ++moduledir = join_paths(get_option('prefix'), python_bin.get_install_dir(), 'merengue') + + gnome.compile_resources('merengue', + 'merengue.gresource.xml', +@@ -29,35 +29,33 @@ configure_file( + install_dir: get_option('bindir') + ) + +-run_command('python3', '-m', 'compileall', '-b', '.') +- + install_data([ +- 'mrg_application.pyc', +- '__init__.pyc', ++ 'mrg_application.py', ++ '__init__.py', + ], + install_dir: moduledir + ) + + install_data([ +- 'controller/__init__.pyc', +- 'controller/mrg_controller.pyc', +- 'controller/mrg_controller_registry.pyc', ++ 'controller/__init__.py', ++ 'controller/mrg_controller.py', ++ 'controller/mrg_controller_registry.py', + ], + install_dir: join_paths(moduledir, 'controller') + ) + + install_data([ +- 'mrg_gtk/__init__.pyc', +- 'mrg_gtk/mrg_selection.pyc', +- 'mrg_gtk/mrg_gtk_widget.pyc', +- 'mrg_gtk/mrg_gtk_window.pyc', ++ 'mrg_gtk/__init__.py', ++ 'mrg_gtk/mrg_selection.py', ++ 'mrg_gtk/mrg_gtk_widget.py', ++ 'mrg_gtk/mrg_gtk_window.py', + ], + install_dir: join_paths(moduledir, 'mrg_gtk') + ) + + install_data([ +- 'utils/__init__.pyc', +- 'utils/utils.pyc', ++ 'utils/__init__.py', ++ 'utils/utils.py', + ], + install_dir: join_paths(moduledir, 'utils') + ) +diff --git a/run-dev.py b/run-dev.py +index b1c9bd2..57f0060 100755 +--- a/run-dev.py ++++ b/run-dev.py +@@ -7,7 +7,6 @@ + # This program is free software; you can redistribute it and/or modify + # it under the terms of the GNU General Public License as + # published by the Free Software Foundation; version 2 of the License. +-# + # This program is distributed in the hope that it will be useful, + # but WITHOUT ANY WARRANTY; without even the implied warranty of + # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +@@ -33,6 +32,7 @@ basedir = os.path.dirname(__file__) + sys.path.insert(1, basedir) + + os.environ['PATH'] = os.path.join(basedir, 'merengue') + ':' + os.environ.get('PATH') ++os.environ['PYTHONPATH'] = basedir + ':' + str(os.environ.get('PYTHONPATH') or '') + + glib_compile_resources = GLib.find_program_in_path ('glib-compile-resources') + +@@ -94,16 +94,15 @@ if __name__ == '__main__': + + # Create config files pointing to source directories + dev_config('cambalacheui/config.py', +- f"VERSION = 'git'\npkgdatadir = '{os.path.abspath('cambalacheui')}'") ++ f"VERSION = 'git'") + dev_config('merengue/config.py', +- f"VERSION = 'git'\npkgdatadir = '{os.path.abspath('merengue')}'") ++ f"VERSION = 'git'") + dev_config('src/config.py', +- f"VERSION = 'git'\npkgdatadir = '{os.path.abspath('src')}'") ++ f"VERSION = 'git'") + + # Create merengue bin script + configure_file('merengue/merengue.in', 'merengue/merengue', { +- 'PYTHON': GLib.find_program_in_path('python3'), +- 'pkgdatadir': os.path.abspath('.') ++ 'PYTHON': GLib.find_program_in_path('python3') + }) + os.chmod('merengue/merengue', stat.S_IREAD | stat.S_IWRITE | stat.S_IEXEC) + +diff --git a/src/cambalache.in b/src/cambalache.in +index c0adbf0..d85f13c 100755 +--- a/src/cambalache.in ++++ b/src/cambalache.in +@@ -11,12 +11,10 @@ import os + import sys + import signal + +-pkgdatadir = '@pkgdatadir@' + localedir = '@localedir@' + +-sys.path.insert(1, pkgdatadir) + signal.signal(signal.SIGINT, signal.SIG_DFL) +-print(pkgdatadir, localedir) ++print(localedir) + + import locale + locale.bindtextdomain("cambalache", localedir) +diff --git a/src/meson.build b/src/meson.build +index 683cdff..81f3ea9 100644 +--- a/src/meson.build ++++ b/src/meson.build +@@ -1,5 +1,5 @@ + pkgdatadir = join_paths(get_option('prefix'), get_option('datadir'), 'cambalache') +-moduledir = join_paths(pkgdatadir, 'cambalache') ++moduledir = join_paths(get_option('prefix'), python_bin.get_install_dir(), 'cambalache') + + gnome.compile_resources('cambalache', + 'cambalache.gresource.xml', +@@ -30,12 +30,10 @@ configure_file( + install_dir: moduledir + ) + +-run_command('python3', '-m', 'compileall', '-b', '.') +- + install_data([ +- '__init__.pyc', +- 'cmb_application.pyc', +- 'cmb_window.pyc' ++ '__init__.py', ++ 'cmb_application.py', ++ 'cmb_window.py', + ], + install_dir: moduledir) + +-- +2.31.1 + |