From 82b8da0e9a7509c159055ddeaed745a409e0196a Mon Sep 17 00:00:00 2001 From: Christian Fredrik Kalager Schaller Date: Thu, 27 Apr 2017 13:42:59 -0400 Subject: [PATCH 01/20] Adding files for yum repo testing --- Remarkable.spec | 94 ++++++++++++++++++++++++++++++++++++++++++ remarkable.appdata.xml | 24 +++++++++++ 2 files changed, 118 insertions(+) create mode 100644 Remarkable.spec create mode 100644 remarkable.appdata.xml diff --git a/Remarkable.spec b/Remarkable.spec new file mode 100644 index 0000000..aa27590 --- /dev/null +++ b/Remarkable.spec @@ -0,0 +1,94 @@ +Summary: Markdown editor +Name: Remarkable +Version: 1.87 +Release: 1 + +Source: https://github.com/jamiemcg/Remarkable/archive/Remarkable-1.87.zip +Packager: uraeus@gnome.org +License: MIT +Group: Applications/Productivity +URL: https://remarkableapp.github.io/ +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) + +Requires: python3 + +BuildArch: noarch + +%description +Remarkable markdown editor application. Allows you to edit in Markdown format for use with Wikis. + +%prep +%setup -q Remarkable + +# %build + +%install +mkdir -p %{buildroot} +rm -rf $RPM_BUILD_ROOT +mkdir -p $RPM_BUILD_ROOT%{_bindir}/ +mkdir -p $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/markdown/extensions +mkdir -p $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/pdfkit +mkdir -p $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/remarkable +mkdir -p $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/remarkable_lib +mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/scaleable/apps/ +mkdir -p $RPM_BUILD_ROOT%{_datadir}/appdata/ +mkdir -p $RPM_BUILD_ROOT%{_datadir}/remarkable/ui +mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications +mkdir -p $RPM_BUILD_ROOT%{_datadir}/appdata/ + + +cp bin/remarkable $RPM_BUILD_ROOT%{_bindir} +cp markdown/extensions/Highlighting.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/markdown/extensions +cp markdown/extensions/Strikethrough.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/markdown/extensions +cp markdown/extensions/markdown_checklist.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/markdown/extensions +cp markdown/extensions/mathjax.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/markdown/extensions +cp markdown/extensions/subscript.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/markdown/extensions +cp markdown/extensions/superscript.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/markdown/extensions +cp markdown/extensions/urlize.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/markdown/extensions +cp pdfkit/__init__.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/pdfkit +cp pdfkit/api.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/pdfkit +cp pdfkit/configuration.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/pdfkit +cp pdfkit/pdfkit.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/pdfkit +cp pdfkit/source.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/pdfkit +cp remarkable/AboutRemarkableDialog.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/remarkable +cp remarkable/RemarkableWindow.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/remarkable +cp remarkable/__init__.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/remarkable +cp remarkable/configuration.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/remarkable +cp remarkable/styles.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/remarkable +cp remarkable/undobuffer.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/remarkable +cp remarkable_lib/AboutDialog.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/remarkable_lib +cp remarkable_lib/Builder.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/remarkable_lib +cp remarkable_lib/Window.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/remarkable_lib +cp remarkable_lib/__init__.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/remarkable_lib +cp remarkable_lib/helpers.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/remarkable_lib +cp remarkable_lib/remarkableconfig.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/remarkable_lib +cp data/media/remarkable.svg $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/scaleable/apps/remarkable.svg +cp data/ui/* $RPM_BUILD_ROOT%{_datadir}/remarkable/ui +cp remarkable.desktop $RPM_BUILD_ROOT/%{_datadir}/applications +cp remarkable.appdata.xml $RPM_BUILD_ROOT%{_datadir}/appdata + + +desktop-file-validate remarkable.desktop + +%post +gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : + +%clean +rm -rf %{buildroot} + +%files +%defattr(-,root,root,-) +%doc +%{_bindir}/remarkable +%{_libdir}/python3/dist-packages/markdown/extensions +%{_libdir}/python3/dist-packages/pdfkit +%{_libdir}/python3/dist-packages/remarkable +%{_libdir}/python3/dist-packages/remarkable_lib +%{_datadir}/remarkable/ui/*.* +%{_datadir}/icons/hicolor/scaleable/apps/remarkable.svg +%{_datadir}/appdata/remarkable.appdata.xml +%{_datadir}/applications/remarkable.desktop + +%changelog +* Thu Apr 27 2017 Christian F.K. Schaller +- Initial release diff --git a/remarkable.appdata.xml b/remarkable.appdata.xml new file mode 100644 index 0000000..3276218 --- /dev/null +++ b/remarkable.appdata.xml @@ -0,0 +1,24 @@ + + + remarkable.desktop + CC-BY-3.0 + MIT + Remarkable Markdown Editor + Remarkable is a powerful markdown editor available for Linux. It is fully featured and customizable. + +

+Remarkable is a full featured and powerful markdown editor that allows you to quickly edit and work with documents in markdown format. +

+
+ + + https://remarkableapp.github.io/images/main_screenshot.png + + + https://remarkableapp.github.io + https://github.com/jamiemcg/Remarkable/issues + https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=B5PJTSJNFYGT2 + GNOME + Jamie McGowan - jamiemcgowan.dev@gmail.com + None +
From 2448a8f9130f6120bbb620d0771e404f771733fc Mon Sep 17 00:00:00 2001 From: Christian Fredrik Kalager Schaller Date: Mon, 1 May 2017 13:30:14 -0400 Subject: [PATCH 02/20] Add Meson build system --- bin/meson.build | 2 + data/glib-2.0/schemas/meson.build | 12 ++++ data/media/meson.build | 7 +++ data/meson.build | 7 +++ meson.build | 42 ++++++++++++++ meson_install.sh | 8 +++ remarkable.spec | 94 +++++++++++++++++++++++++++++++ 7 files changed, 172 insertions(+) create mode 100644 bin/meson.build create mode 100644 data/glib-2.0/schemas/meson.build create mode 100644 data/media/meson.build create mode 100644 data/meson.build create mode 100644 meson.build create mode 100644 meson_install.sh create mode 100644 remarkable.spec diff --git a/bin/meson.build b/bin/meson.build new file mode 100644 index 0000000..22422d2 --- /dev/null +++ b/bin/meson.build @@ -0,0 +1,2 @@ +message('Preparing init file') +install_data('remarkable', install_dir: 'bin') diff --git a/data/glib-2.0/schemas/meson.build b/data/glib-2.0/schemas/meson.build new file mode 100644 index 0000000..0168822 --- /dev/null +++ b/data/glib-2.0/schemas/meson.build @@ -0,0 +1,12 @@ +gnome = import('gnome') + + + + +message('Compiling schemas') +gnome.compile_schemas() +install_data( + 'net.launchpad.remarkable.gschema.xml', + install_dir : 'share/glib-2.0/schemas') + + diff --git a/data/media/meson.build b/data/media/meson.build new file mode 100644 index 0000000..50aa0f4 --- /dev/null +++ b/data/media/meson.build @@ -0,0 +1,7 @@ +message('Installing Tutorial data') +install_data('MarkdownTutorial.md', install_dir : 'share/remarkable/media/') + + +message('Installing desktop icon') +install_data('remarkable.png', install_dir : 'share/icons/hicolor/256x256/apps') +install_data('remarkable.svg', install_dir : 'share/icons/hicolor/scaleable/apps/') diff --git a/data/meson.build b/data/meson.build new file mode 100644 index 0000000..ea2098a --- /dev/null +++ b/data/meson.build @@ -0,0 +1,7 @@ + +install_subdir('ui', install_dir: 'share/remarkable/ui/') + +message('Preparing appdata') +install_data('remarkable.appdata.xml', install_dir : 'share/appdata') + + diff --git a/meson.build b/meson.build new file mode 100644 index 0000000..a761ae9 --- /dev/null +++ b/meson.build @@ -0,0 +1,42 @@ +project('remarkable', 'c') + +version = '1.87' + +# Configuration params +conf = configuration_data() +conf.set('PACKAGE_VERSION', version) +conf.set('PACKAGE_URL', 'https://remarkableapp.github.io/') + +message('Looking for dependencies') +py3 = find_program('python3') +glib = dependency('glib-2.0') +gobject = dependency('gobject-2.0') +gir = dependency('gobject-introspection-1.0') +gtk = dependency('gtk+-3.0', version : '>=3.13.2') + +message('Getting python install dir') +r = run_command(py3, '-c', 'from distutils.sysconfig import get_python_lib; print(get_python_lib())') +if r.returncode() != 0 + error('Cannot find python install dir') +endif +python_dir = r.stdout().strip() + +subdir('data/glib-2.0/schemas') +subdir('data/media') +subdir('data') +subdir('bin') + +message('Install source code medata') +install_data('LICENSE', install_dir : 'share/doc/remarkable') +install_data('README.md', install_dir : 'share/doc/remarkable') + +message('Installing Python files') +install_subdir('markdown', install_dir: python_dir) +install_subdir('pdfkit', install_dir: python_dir) +install_subdir('remarkable', install_dir: python_dir) +install_subdir('remarkable_lib', install_dir: python_dir) + +message('Installing .desktop file') +install_data('remarkable.desktop', install_dir : 'share/applications') + +meson.add_install_script('meson_install.sh') diff --git a/meson_install.sh b/meson_install.sh new file mode 100644 index 0000000..1a8542d --- /dev/null +++ b/meson_install.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +# Update icon caches +gtk-update-icon-cache -f -t ${DESTDIR}/${MESON_INSTALL_PREFIX}/share/icons/hicolor +gtk-update-icon-cache -f -t ${DESTDIR}/${MESON_INSTALL_PREFIX}/share/icons/HighContrast + +# Install new schemas +glib-compile-schemas ${DESTDIR}/${MESON_INSTALL_PREFIX}/share/glib-2.0/schemas/ \ No newline at end of file diff --git a/remarkable.spec b/remarkable.spec new file mode 100644 index 0000000..aa27590 --- /dev/null +++ b/remarkable.spec @@ -0,0 +1,94 @@ +Summary: Markdown editor +Name: Remarkable +Version: 1.87 +Release: 1 + +Source: https://github.com/jamiemcg/Remarkable/archive/Remarkable-1.87.zip +Packager: uraeus@gnome.org +License: MIT +Group: Applications/Productivity +URL: https://remarkableapp.github.io/ +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) + +Requires: python3 + +BuildArch: noarch + +%description +Remarkable markdown editor application. Allows you to edit in Markdown format for use with Wikis. + +%prep +%setup -q Remarkable + +# %build + +%install +mkdir -p %{buildroot} +rm -rf $RPM_BUILD_ROOT +mkdir -p $RPM_BUILD_ROOT%{_bindir}/ +mkdir -p $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/markdown/extensions +mkdir -p $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/pdfkit +mkdir -p $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/remarkable +mkdir -p $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/remarkable_lib +mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/scaleable/apps/ +mkdir -p $RPM_BUILD_ROOT%{_datadir}/appdata/ +mkdir -p $RPM_BUILD_ROOT%{_datadir}/remarkable/ui +mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications +mkdir -p $RPM_BUILD_ROOT%{_datadir}/appdata/ + + +cp bin/remarkable $RPM_BUILD_ROOT%{_bindir} +cp markdown/extensions/Highlighting.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/markdown/extensions +cp markdown/extensions/Strikethrough.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/markdown/extensions +cp markdown/extensions/markdown_checklist.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/markdown/extensions +cp markdown/extensions/mathjax.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/markdown/extensions +cp markdown/extensions/subscript.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/markdown/extensions +cp markdown/extensions/superscript.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/markdown/extensions +cp markdown/extensions/urlize.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/markdown/extensions +cp pdfkit/__init__.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/pdfkit +cp pdfkit/api.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/pdfkit +cp pdfkit/configuration.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/pdfkit +cp pdfkit/pdfkit.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/pdfkit +cp pdfkit/source.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/pdfkit +cp remarkable/AboutRemarkableDialog.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/remarkable +cp remarkable/RemarkableWindow.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/remarkable +cp remarkable/__init__.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/remarkable +cp remarkable/configuration.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/remarkable +cp remarkable/styles.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/remarkable +cp remarkable/undobuffer.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/remarkable +cp remarkable_lib/AboutDialog.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/remarkable_lib +cp remarkable_lib/Builder.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/remarkable_lib +cp remarkable_lib/Window.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/remarkable_lib +cp remarkable_lib/__init__.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/remarkable_lib +cp remarkable_lib/helpers.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/remarkable_lib +cp remarkable_lib/remarkableconfig.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/remarkable_lib +cp data/media/remarkable.svg $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/scaleable/apps/remarkable.svg +cp data/ui/* $RPM_BUILD_ROOT%{_datadir}/remarkable/ui +cp remarkable.desktop $RPM_BUILD_ROOT/%{_datadir}/applications +cp remarkable.appdata.xml $RPM_BUILD_ROOT%{_datadir}/appdata + + +desktop-file-validate remarkable.desktop + +%post +gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : + +%clean +rm -rf %{buildroot} + +%files +%defattr(-,root,root,-) +%doc +%{_bindir}/remarkable +%{_libdir}/python3/dist-packages/markdown/extensions +%{_libdir}/python3/dist-packages/pdfkit +%{_libdir}/python3/dist-packages/remarkable +%{_libdir}/python3/dist-packages/remarkable_lib +%{_datadir}/remarkable/ui/*.* +%{_datadir}/icons/hicolor/scaleable/apps/remarkable.svg +%{_datadir}/appdata/remarkable.appdata.xml +%{_datadir}/applications/remarkable.desktop + +%changelog +* Thu Apr 27 2017 Christian F.K. Schaller +- Initial release From b18ef952731d6f7c402a5645b606b8f312fd90e3 Mon Sep 17 00:00:00 2001 From: Christian Fredrik Kalager Schaller Date: Mon, 1 May 2017 13:34:55 -0400 Subject: [PATCH 03/20] commit final changes and tarball build script --- Remarkable.spec | 94 ------------------- .../remarkable.appdata.xml | 0 make_release.sh | 26 +++++ meson.build | 2 +- 4 files changed, 27 insertions(+), 95 deletions(-) delete mode 100644 Remarkable.spec rename remarkable.appdata.xml => data/remarkable.appdata.xml (100%) create mode 100755 make_release.sh diff --git a/Remarkable.spec b/Remarkable.spec deleted file mode 100644 index aa27590..0000000 --- a/Remarkable.spec +++ /dev/null @@ -1,94 +0,0 @@ -Summary: Markdown editor -Name: Remarkable -Version: 1.87 -Release: 1 - -Source: https://github.com/jamiemcg/Remarkable/archive/Remarkable-1.87.zip -Packager: uraeus@gnome.org -License: MIT -Group: Applications/Productivity -URL: https://remarkableapp.github.io/ -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) - -Requires: python3 - -BuildArch: noarch - -%description -Remarkable markdown editor application. Allows you to edit in Markdown format for use with Wikis. - -%prep -%setup -q Remarkable - -# %build - -%install -mkdir -p %{buildroot} -rm -rf $RPM_BUILD_ROOT -mkdir -p $RPM_BUILD_ROOT%{_bindir}/ -mkdir -p $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/markdown/extensions -mkdir -p $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/pdfkit -mkdir -p $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/remarkable -mkdir -p $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/remarkable_lib -mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/scaleable/apps/ -mkdir -p $RPM_BUILD_ROOT%{_datadir}/appdata/ -mkdir -p $RPM_BUILD_ROOT%{_datadir}/remarkable/ui -mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications -mkdir -p $RPM_BUILD_ROOT%{_datadir}/appdata/ - - -cp bin/remarkable $RPM_BUILD_ROOT%{_bindir} -cp markdown/extensions/Highlighting.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/markdown/extensions -cp markdown/extensions/Strikethrough.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/markdown/extensions -cp markdown/extensions/markdown_checklist.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/markdown/extensions -cp markdown/extensions/mathjax.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/markdown/extensions -cp markdown/extensions/subscript.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/markdown/extensions -cp markdown/extensions/superscript.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/markdown/extensions -cp markdown/extensions/urlize.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/markdown/extensions -cp pdfkit/__init__.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/pdfkit -cp pdfkit/api.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/pdfkit -cp pdfkit/configuration.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/pdfkit -cp pdfkit/pdfkit.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/pdfkit -cp pdfkit/source.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/pdfkit -cp remarkable/AboutRemarkableDialog.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/remarkable -cp remarkable/RemarkableWindow.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/remarkable -cp remarkable/__init__.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/remarkable -cp remarkable/configuration.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/remarkable -cp remarkable/styles.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/remarkable -cp remarkable/undobuffer.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/remarkable -cp remarkable_lib/AboutDialog.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/remarkable_lib -cp remarkable_lib/Builder.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/remarkable_lib -cp remarkable_lib/Window.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/remarkable_lib -cp remarkable_lib/__init__.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/remarkable_lib -cp remarkable_lib/helpers.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/remarkable_lib -cp remarkable_lib/remarkableconfig.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/remarkable_lib -cp data/media/remarkable.svg $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/scaleable/apps/remarkable.svg -cp data/ui/* $RPM_BUILD_ROOT%{_datadir}/remarkable/ui -cp remarkable.desktop $RPM_BUILD_ROOT/%{_datadir}/applications -cp remarkable.appdata.xml $RPM_BUILD_ROOT%{_datadir}/appdata - - -desktop-file-validate remarkable.desktop - -%post -gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : - -%clean -rm -rf %{buildroot} - -%files -%defattr(-,root,root,-) -%doc -%{_bindir}/remarkable -%{_libdir}/python3/dist-packages/markdown/extensions -%{_libdir}/python3/dist-packages/pdfkit -%{_libdir}/python3/dist-packages/remarkable -%{_libdir}/python3/dist-packages/remarkable_lib -%{_datadir}/remarkable/ui/*.* -%{_datadir}/icons/hicolor/scaleable/apps/remarkable.svg -%{_datadir}/appdata/remarkable.appdata.xml -%{_datadir}/applications/remarkable.desktop - -%changelog -* Thu Apr 27 2017 Christian F.K. Schaller -- Initial release diff --git a/remarkable.appdata.xml b/data/remarkable.appdata.xml similarity index 100% rename from remarkable.appdata.xml rename to data/remarkable.appdata.xml diff --git a/make_release.sh b/make_release.sh new file mode 100755 index 0000000..698cdfa --- /dev/null +++ b/make_release.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +set -e + +test -n "$srcdir" || srcdir=$1 +test -n "$srcdir" || srcdir=. + +cd $srcdir + +VERSION=$(git describe --abbrev=0) +NAME="remarkable-$VERSION" + +echo "Creating git tree archive…" +git archive --prefix="${NAME}/" --format=tar HEAD > remarkable.tar + + +cd ../.. + +rm -f "${NAME}.tar" + +tar -Af "${NAME}.tar" remarkable.tar + +rm -f nautilus.tar + +echo "Compressing archive…" +xz --verbose -f "${NAME}.tar" diff --git a/meson.build b/meson.build index a761ae9..33e86fe 100644 --- a/meson.build +++ b/meson.build @@ -31,7 +31,7 @@ install_data('LICENSE', install_dir : 'share/doc/remarkable') install_data('README.md', install_dir : 'share/doc/remarkable') message('Installing Python files') -install_subdir('markdown', install_dir: python_dir) +install_subdir('markdown/extensions', install_dir: python_dir) install_subdir('pdfkit', install_dir: python_dir) install_subdir('remarkable', install_dir: python_dir) install_subdir('remarkable_lib', install_dir: python_dir) From f9ebac5e0e895682ef972c8f1c8afcf2401f8536 Mon Sep 17 00:00:00 2001 From: Christian Fredrik Kalager Schaller Date: Mon, 1 May 2017 13:41:28 -0400 Subject: [PATCH 04/20] Update release script --- make_release.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/make_release.sh b/make_release.sh index 698cdfa..80da58c 100755 --- a/make_release.sh +++ b/make_release.sh @@ -4,10 +4,13 @@ set -e test -n "$srcdir" || srcdir=$1 test -n "$srcdir" || srcdir=. +echo 'Done testing for src dir' cd $srcdir +echo 'Getting version number from git' VERSION=$(git describe --abbrev=0) +echo 'Setting name' NAME="remarkable-$VERSION" echo "Creating git tree archive…" From a0b31441d0b0271f1ade20616028b85f031ed942 Mon Sep 17 00:00:00 2001 From: Christian Fredrik Kalager Schaller Date: Mon, 1 May 2017 14:23:04 -0400 Subject: [PATCH 05/20] Temporary commit of release script --- make_release.sh | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/make_release.sh b/make_release.sh index 80da58c..db893b5 100755 --- a/make_release.sh +++ b/make_release.sh @@ -9,21 +9,12 @@ echo 'Done testing for src dir' cd $srcdir echo 'Getting version number from git' -VERSION=$(git describe --abbrev=0) +VERSION=$(git describe --tags) echo 'Setting name' -NAME="remarkable-$VERSION" +NAME="remarkable-${VERSION}" echo "Creating git tree archive…" -git archive --prefix="${NAME}/" --format=tar HEAD > remarkable.tar - - -cd ../.. - -rm -f "${NAME}.tar" - -tar -Af "${NAME}.tar" remarkable.tar - -rm -f nautilus.tar +git archive --prefix="${NAME}/" --format=tar HEAD > remarkable-${VERSION}.tar echo "Compressing archive…" xz --verbose -f "${NAME}.tar" From 1807b120e7bbb0ccda8319a9175d9f2c51739e57 Mon Sep 17 00:00:00 2001 From: Christian Fredrik Kalager Schaller Date: Mon, 1 May 2017 14:23:35 -0400 Subject: [PATCH 06/20] Add updated spec file --- remarkable.spec | 55 +++++++------------------------------------------ 1 file changed, 7 insertions(+), 48 deletions(-) diff --git a/remarkable.spec b/remarkable.spec index aa27590..914ba1f 100644 --- a/remarkable.spec +++ b/remarkable.spec @@ -3,12 +3,12 @@ Name: Remarkable Version: 1.87 Release: 1 -Source: https://github.com/jamiemcg/Remarkable/archive/Remarkable-1.87.zip +Source: https://github.com/jamiemcg/Remarkable/archive/remarkable-1.87-1-gf9ebac5.tar.xz Packager: uraeus@gnome.org License: MIT Group: Applications/Productivity URL: https://remarkableapp.github.io/ -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +BuildRoot: %{_tmppath}/remarkable-%{version}-%{release}-root-%(%{__id_u} -n) Requires: python3 @@ -18,55 +18,14 @@ BuildArch: noarch Remarkable markdown editor application. Allows you to edit in Markdown format for use with Wikis. %prep -%setup -q Remarkable - -# %build +%setup %install -mkdir -p %{buildroot} -rm -rf $RPM_BUILD_ROOT -mkdir -p $RPM_BUILD_ROOT%{_bindir}/ -mkdir -p $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/markdown/extensions -mkdir -p $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/pdfkit -mkdir -p $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/remarkable -mkdir -p $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/remarkable_lib -mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/scaleable/apps/ -mkdir -p $RPM_BUILD_ROOT%{_datadir}/appdata/ -mkdir -p $RPM_BUILD_ROOT%{_datadir}/remarkable/ui -mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications -mkdir -p $RPM_BUILD_ROOT%{_datadir}/appdata/ - - -cp bin/remarkable $RPM_BUILD_ROOT%{_bindir} -cp markdown/extensions/Highlighting.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/markdown/extensions -cp markdown/extensions/Strikethrough.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/markdown/extensions -cp markdown/extensions/markdown_checklist.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/markdown/extensions -cp markdown/extensions/mathjax.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/markdown/extensions -cp markdown/extensions/subscript.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/markdown/extensions -cp markdown/extensions/superscript.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/markdown/extensions -cp markdown/extensions/urlize.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/markdown/extensions -cp pdfkit/__init__.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/pdfkit -cp pdfkit/api.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/pdfkit -cp pdfkit/configuration.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/pdfkit -cp pdfkit/pdfkit.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/pdfkit -cp pdfkit/source.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/pdfkit -cp remarkable/AboutRemarkableDialog.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/remarkable -cp remarkable/RemarkableWindow.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/remarkable -cp remarkable/__init__.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/remarkable -cp remarkable/configuration.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/remarkable -cp remarkable/styles.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/remarkable -cp remarkable/undobuffer.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/remarkable -cp remarkable_lib/AboutDialog.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/remarkable_lib -cp remarkable_lib/Builder.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/remarkable_lib -cp remarkable_lib/Window.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/remarkable_lib -cp remarkable_lib/__init__.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/remarkable_lib -cp remarkable_lib/helpers.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/remarkable_lib -cp remarkable_lib/remarkableconfig.py $RPM_BUILD_ROOT%{_libdir}/python3/dist-packages/remarkable_lib -cp data/media/remarkable.svg $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/scaleable/apps/remarkable.svg -cp data/ui/* $RPM_BUILD_ROOT%{_datadir}/remarkable/ui -cp remarkable.desktop $RPM_BUILD_ROOT/%{_datadir}/applications -cp remarkable.appdata.xml $RPM_BUILD_ROOT%{_datadir}/appdata +xz -d remarkable-1.87-1-gf9ebac5.tar.xz +tar -xvf remarkable-1.87-1-gf9ebac5.tar +cd remarkable-1.87-1-gf9ebac5 +meson install desktop-file-validate remarkable.desktop From 65ce7c519646d311920b23d8bc9fef25750ac098 Mon Sep 17 00:00:00 2001 From: Christian Fredrik Kalager Schaller Date: Mon, 1 May 2017 15:27:12 -0400 Subject: [PATCH 07/20] Update build files with fixes --- data/meson.build | 2 +- make_release.sh | 4 ++-- remarkable.spec | 32 ++++++++++++++++---------------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/data/meson.build b/data/meson.build index ea2098a..b5b46dd 100644 --- a/data/meson.build +++ b/data/meson.build @@ -1,5 +1,5 @@ -install_subdir('ui', install_dir: 'share/remarkable/ui/') +install_subdir('ui', install_dir: 'share/remarkable') message('Preparing appdata') install_data('remarkable.appdata.xml', install_dir : 'share/appdata') diff --git a/make_release.sh b/make_release.sh index db893b5..32ebdb3 100755 --- a/make_release.sh +++ b/make_release.sh @@ -9,12 +9,12 @@ echo 'Done testing for src dir' cd $srcdir echo 'Getting version number from git' -VERSION=$(git describe --tags) +VERSION=$(git describe --tags --abbrev=0) echo 'Setting name' NAME="remarkable-${VERSION}" echo "Creating git tree archive…" -git archive --prefix="${NAME}/" --format=tar HEAD > remarkable-${VERSION}.tar +git archive --prefix="${NAME}/" --format=tar HEAD > ${NAME}.tar echo "Compressing archive…" xz --verbose -f "${NAME}.tar" diff --git a/remarkable.spec b/remarkable.spec index 914ba1f..cd96c01 100644 --- a/remarkable.spec +++ b/remarkable.spec @@ -1,9 +1,9 @@ Summary: Markdown editor -Name: Remarkable +Name: remarkable Version: 1.87 Release: 1 -Source: https://github.com/jamiemcg/Remarkable/archive/remarkable-1.87-1-gf9ebac5.tar.xz +Source: https://github.com/jamiemcg/Remarkable/archive/remarkable-%{version}.tar.xz Packager: uraeus@gnome.org License: MIT Group: Applications/Productivity @@ -11,6 +11,8 @@ URL: https://remarkableapp.github.io/ BuildRoot: %{_tmppath}/remarkable-%{version}-%{release}-root-%(%{__id_u} -n) Requires: python3 +BuildRequires: python3-devel +BuildRequires: meson BuildArch: noarch @@ -18,16 +20,13 @@ BuildArch: noarch Remarkable markdown editor application. Allows you to edit in Markdown format for use with Wikis. %prep -%setup - -%install - -xz -d remarkable-1.87-1-gf9ebac5.tar.xz -tar -xvf remarkable-1.87-1-gf9ebac5.tar -cd remarkable-1.87-1-gf9ebac5 -meson install +%autosetup +%build +%meson +%meson_build desktop-file-validate remarkable.desktop +%meson_install %post gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : @@ -37,13 +36,14 @@ rm -rf %{buildroot} %files %defattr(-,root,root,-) -%doc +%do LICENSE README.md %{_bindir}/remarkable -%{_libdir}/python3/dist-packages/markdown/extensions -%{_libdir}/python3/dist-packages/pdfkit -%{_libdir}/python3/dist-packages/remarkable -%{_libdir}/python3/dist-packages/remarkable_lib -%{_datadir}/remarkable/ui/*.* +%{python3_sitelib}/remarkable +%{python3_sitelib}/remarkable_lib +%{python3_sitelib}/extensions +%{python3_sitelib}/pdfkit +%{_datadir}/glib-2.0/schemas +%{_datadir}/icons/hicolor/256x256/apps/remarkable.png %{_datadir}/icons/hicolor/scaleable/apps/remarkable.svg %{_datadir}/appdata/remarkable.appdata.xml %{_datadir}/applications/remarkable.desktop From 8f2c49f1ba4b92219c456c5b87e0672d0b5ee5ca Mon Sep 17 00:00:00 2001 From: Christian Fredrik Kalager Schaller Date: Mon, 1 May 2017 15:29:02 -0400 Subject: [PATCH 08/20] Comment out icon cache generation --- meson_install.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/meson_install.sh b/meson_install.sh index 1a8542d..0139a94 100644 --- a/meson_install.sh +++ b/meson_install.sh @@ -1,8 +1,8 @@ #!/bin/sh # Update icon caches -gtk-update-icon-cache -f -t ${DESTDIR}/${MESON_INSTALL_PREFIX}/share/icons/hicolor -gtk-update-icon-cache -f -t ${DESTDIR}/${MESON_INSTALL_PREFIX}/share/icons/HighContrast +#gtk-update-icon-cache -f -t ${DESTDIR}/${MESON_INSTALL_PREFIX}/share/icons/hicolor +#gtk-update-icon-cache -f -t ${DESTDIR}/${MESON_INSTALL_PREFIX}/share/icons/HighContrast # Install new schemas -glib-compile-schemas ${DESTDIR}/${MESON_INSTALL_PREFIX}/share/glib-2.0/schemas/ \ No newline at end of file +glib-compile-schemas ${DESTDIR}/${MESON_INSTALL_PREFIX}/share/glib-2.0/schemas/ From 5d938530608fecf3a82ccb3ebdf1e4257f98b584 Mon Sep 17 00:00:00 2001 From: Christian Fredrik Kalager Schaller Date: Mon, 1 May 2017 15:34:49 -0400 Subject: [PATCH 09/20] Update build file and spec file with further fixes --- meson.build | 2 +- remarkable.spec | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/meson.build b/meson.build index 33e86fe..c7e0d47 100644 --- a/meson.build +++ b/meson.build @@ -31,7 +31,7 @@ install_data('LICENSE', install_dir : 'share/doc/remarkable') install_data('README.md', install_dir : 'share/doc/remarkable') message('Installing Python files') -install_subdir('markdown/extensions', install_dir: python_dir) +install_subdir('markdown/extensions', install_dir: python_dir/markdown) install_subdir('pdfkit', install_dir: python_dir) install_subdir('remarkable', install_dir: python_dir) install_subdir('remarkable_lib', install_dir: python_dir) diff --git a/remarkable.spec b/remarkable.spec index cd96c01..42693dc 100644 --- a/remarkable.spec +++ b/remarkable.spec @@ -36,15 +36,17 @@ rm -rf %{buildroot} %files %defattr(-,root,root,-) -%do LICENSE README.md +%doc LICENSE README.md %{_bindir}/remarkable %{python3_sitelib}/remarkable %{python3_sitelib}/remarkable_lib -%{python3_sitelib}/extensions +%{python3_sitelib}/markdown/extensions %{python3_sitelib}/pdfkit %{_datadir}/glib-2.0/schemas +%{_datadir}/remarkable/ui %{_datadir}/icons/hicolor/256x256/apps/remarkable.png %{_datadir}/icons/hicolor/scaleable/apps/remarkable.svg +%{_datadir}/remarkable/media/MarkdownTutorial.md %{_datadir}/appdata/remarkable.appdata.xml %{_datadir}/applications/remarkable.desktop From de917541653114b57cad3a7aede14032e453c554 Mon Sep 17 00:00:00 2001 From: Christian Fredrik Kalager Schaller Date: Mon, 1 May 2017 15:40:06 -0400 Subject: [PATCH 10/20] update meson.build to hopefully fix build issue --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index c7e0d47..f36bf93 100644 --- a/meson.build +++ b/meson.build @@ -31,8 +31,8 @@ install_data('LICENSE', install_dir : 'share/doc/remarkable') install_data('README.md', install_dir : 'share/doc/remarkable') message('Installing Python files') -install_subdir('markdown/extensions', install_dir: python_dir/markdown) install_subdir('pdfkit', install_dir: python_dir) +install_subdir('markdown', install_dir: python_dir) install_subdir('remarkable', install_dir: python_dir) install_subdir('remarkable_lib', install_dir: python_dir) From 1f9d0e23700417fa572b24ddb400716aec6920cf Mon Sep 17 00:00:00 2001 From: Christian Fredrik Kalager Schaller Date: Mon, 1 May 2017 22:01:53 -0400 Subject: [PATCH 11/20] Try to fix build to set python directory properly --- bin/build/meson-logs/meson-log.txt | 11 +++++++++++ bin/meson.build | 19 ++++++++++++++++++- bin/{remarkable => remarkable.in} | 18 ++++-------------- remarkable.spec | 1 + 4 files changed, 34 insertions(+), 15 deletions(-) create mode 100644 bin/build/meson-logs/meson-log.txt rename bin/{remarkable => remarkable.in} (85%) diff --git a/bin/build/meson-logs/meson-log.txt b/bin/build/meson-logs/meson-log.txt new file mode 100644 index 0000000..be02525 --- /dev/null +++ b/bin/build/meson-logs/meson-log.txt @@ -0,0 +1,11 @@ +Build started at 2017-05-01T21:52:57.292575 +Python binary: /usr/bin/python3 +Python system: Linux +The Meson build system +Version: 0.40.0 +Source dir: /home/cschalle/devel/remarkable/bin +Build dir: /home/cschalle/devel/remarkable/bin/build +Build type: native build + +Meson encountered an error: +First statement must be a call to project diff --git a/bin/meson.build b/bin/meson.build index 22422d2..95a5459 100644 --- a/bin/meson.build +++ b/bin/meson.build @@ -1,2 +1,19 @@ +version = '1.87' + +# Configuration params +conf = configuration_data() +conf.set('PACKAGE_VERSION', version) +conf.set('PACKAGE_URL', 'https://remarkableapp.github.io/') + +message('Getting python install dir') +r = run_command(py3, '-c', 'from distutils.sysconfig import get_python_lib; print(get_python_lib())') +if r.returncode() != 0 + error('Cannot find python install dir') +endif +python_dir = r.stdout().strip() +conf.set('PYTHONDIR', 'python_dir') +message('Python Directory is :' + python_dir) message('Preparing init file') -install_data('remarkable', install_dir: 'bin') +configure_file(input : 'remarkable.in', output : 'remarkable', configuration : conf, install_dir : 'bin') +message('generated binary') + diff --git a/bin/remarkable b/bin/remarkable.in similarity index 85% rename from bin/remarkable rename to bin/remarkable.in index 84bf059..6fdf6a9 100755 --- a/bin/remarkable +++ b/bin/remarkable.in @@ -27,20 +27,10 @@ import os import locale locale.textdomain('remarkable') -try: - if os.path.exists("/usr/lib/python3/"): - sys.path.append("/usr/lib/python3/dist-packages/") - sys.path.append("/usr/lib/python3/dist-packages/remarkable") - else: - sys.path.append("/usr/lib/python/dist-packages/") - sys.path.append("/usr/lib/python/dist-packages/remarkable") -except: - pass - -try: - sys.path.append("/usr/lib64/python3/dist-packages/") -except: - pass +# Make sure we'll find the pygobject module, even in JHBuild +sys.path.insert(1, '@pyexecdir@') +# Make sure we'll find the gnomemusic module, even in JHBuild +sys.path.insert(1, '@pythondir@') # Add project root directory (enable symlink and trunk execution) PROJECT_ROOT_DIRECTORY = os.path.abspath( diff --git a/remarkable.spec b/remarkable.spec index 42693dc..328dfa0 100644 --- a/remarkable.spec +++ b/remarkable.spec @@ -23,6 +23,7 @@ Remarkable markdown editor application. Allows you to edit in Markdown format fo %autosetup %build + %meson %meson_build desktop-file-validate remarkable.desktop From 3ab8c9eb7b5614d45bfa757414134cacce7cbd67 Mon Sep 17 00:00:00 2001 From: Christian Fredrik Kalager Schaller Date: Tue, 2 May 2017 11:07:47 -0400 Subject: [PATCH 12/20] Add some fixes that should hopefully allow correct python location testing --- bin/meson.build | 58 +++++++++++++++++++++++++++------- bin/remarkable.in | 4 +-- scripts/pythondetector | 71 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 119 insertions(+), 14 deletions(-) create mode 100644 scripts/pythondetector diff --git a/bin/meson.build b/bin/meson.build index 95a5459..666b097 100644 --- a/bin/meson.build +++ b/bin/meson.build @@ -1,19 +1,53 @@ version = '1.87' -# Configuration params -conf = configuration_data() -conf.set('PACKAGE_VERSION', version) -conf.set('PACKAGE_URL', 'https://remarkableapp.github.io/') - -message('Getting python install dir') -r = run_command(py3, '-c', 'from distutils.sysconfig import get_python_lib; print(get_python_lib())') -if r.returncode() != 0 - error('Cannot find python install dir') + +message('Getting python directiories') + +python = find_program('python3') +pythondetector = find_program('../scripts/pythondetector') +python_dep = dependency('python3') + +cres = run_command(pythondetector, '--sosuffix') +if cres.returncode() != 0 + error('Could not detect python sosuffix' + cres.stdout() + cres.stderr()) +endif +py_so_suffix = cres.stdout().strip() + +cres = run_command(pythondetector, '--abiflags') +if cres.returncode() != 0 + error('Could not detect python abiflags' + cres.stdout() + cres.stderr()) +endif +python_abi_flags = cres.stdout().strip() + +cres = run_command(pythondetector, '--libloc') +if cres.returncode() != 0 + error('Could not detect python library location' + cres.stdout() + cres.stderr()) endif -python_dir = r.stdout().strip() -conf.set('PYTHONDIR', 'python_dir') +pylib_loc = cres.stdout().strip() + +assert(pylib_loc != 'None', 'Python dynamic library path could not be determined') + +pylib_suffix = 'so' +if host_machine.system() == 'windows' + pylib_suffix = 'dll' +elif host_machine.system() == 'darwin' + pylib_suffix = 'dylib' +endif +# Configuration params + +cdata = configuration_data() +cdata.set('PACKAGE', '"Remarkable"') +# Configuration params +cdata.set('PACKAGE_URL', 'https://remarkableapp.github.io/') +cdata.set('VERSION', version) +cdata.set('PY_LIB_LOC', '"@0@"'.format(pylib_loc)) +cdata.set('PY_ABI_FLAGS', '"@0@"'.format(python_abi_flags)) +cdata.set('PY_LIB_SUFFIX', '"@0@"'.format(pylib_suffix)) +cdata.set('PYTHON_VERSION', '"@0@"'.format(python_dep.version())) + + message('Python Directory is :' + python_dir) message('Preparing init file') -configure_file(input : 'remarkable.in', output : 'remarkable', configuration : conf, install_dir : 'bin') +configure_file(input : 'remarkable.in', output : 'remarkable', configuration : cdata, install_dir : 'bin') message('generated binary') diff --git a/bin/remarkable.in b/bin/remarkable.in index 6fdf6a9..c21ff6a 100755 --- a/bin/remarkable.in +++ b/bin/remarkable.in @@ -28,9 +28,9 @@ import locale locale.textdomain('remarkable') # Make sure we'll find the pygobject module, even in JHBuild -sys.path.insert(1, '@pyexecdir@') +sys.path.insert(1, PY_LIB_LOC) # Make sure we'll find the gnomemusic module, even in JHBuild -sys.path.insert(1, '@pythondir@') +sys.path.insert(1, PY_LIB_SUFFIX) # Add project root directory (enable symlink and trunk execution) PROJECT_ROOT_DIRECTORY = os.path.abspath( diff --git a/scripts/pythondetector b/scripts/pythondetector new file mode 100644 index 0000000..2671e27 --- /dev/null +++ b/scripts/pythondetector @@ -0,0 +1,71 @@ +#!/usr/bin/env python3 +import os +import platform +import subprocess +import sys + +from distutils import sysconfig + + +def get_python_abiflags(): + return sysconfig.get_config_var("ABIFLAGS") + +def get_python_libloc(): + # OSX is a pain. Python as shipped by apple installs libpython in /usr/lib + # so we hardcode that. Other systems can use --with-libpython-dir to + # override this. + if platform.system().lower() == 'darwin': + return '/usr/lib' + + pylib_loc = sysconfig.get_config_var("LIBPL") + pylib_ldlibrary = sysconfig.get_config_var("LDLIBRARY") + + py_sharedlib = os.path.join(pylib_loc, pylib_ldlibrary) + if os.path.exists(py_sharedlib): + return pylib_loc + + # Workaround for Fedora + pylib_loc = sysconfig.get_config_var("LIBDIR") + pylib_ldlibrary = sysconfig.get_config_var("LDLIBRARY") + + py_sharedlib = os.path.join(pylib_loc, pylib_ldlibrary) + if os.path.exists(py_sharedlib): + return pylib_loc + + return "None" + + +if __name__ == "__main__": + if len(sys.argv) > 3: + print("At most 2 arguments accepted") + exit(1) + + if sys.argv[1] == '--abiflags': + print(get_python_abiflags()) + elif sys.argv[1] == '--sosuffix': + get = sysconfig.get_config_var + suffix = get("EXT_SUFFIX") or get("SO") or ".so" + print(suffix[1:]) + elif sys.argv[1] == '--pygi-overridedir': + prefix = sys.argv[2] + version = sys.version_info + + # If we are installing in the same prefix as PyGobject + # make sure to install in the right place. + import gi + if os.path.commonprefix([gi._overridesdir, prefix]) == prefix: + print(gi._overridesdir) + exit(0) + + # Otherwise follow python's way of install site packages inside + # the provided prefix + if os.name == 'posix': + print(os.path.join( + prefix, 'lib', 'python%d.%d' % (version.major, version.minor), + 'site-packages', 'gi', 'overrides')) + else: + print(os.path.join( + prefix, 'Lib', 'Python%d%d' % (version.major, version.minor), + 'site-packages', 'gi', 'overrides')) + elif sys.argv[1] == '--libloc': + print(get_python_libloc()) From 7b5b2ab0f030795aea6b1e0239eda0c2d9ec4120 Mon Sep 17 00:00:00 2001 From: Christian Fredrik Kalager Schaller Date: Tue, 2 May 2017 11:20:13 -0400 Subject: [PATCH 13/20] More updates --- bin/remarkable.in | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/bin/remarkable.in b/bin/remarkable.in index c21ff6a..8b5b256 100755 --- a/bin/remarkable.in +++ b/bin/remarkable.in @@ -27,10 +27,9 @@ import os import locale locale.textdomain('remarkable') -# Make sure we'll find the pygobject module, even in JHBuild -sys.path.insert(1, PY_LIB_LOC) -# Make sure we'll find the gnomemusic module, even in JHBuild -sys.path.insert(1, PY_LIB_SUFFIX) + +sys.path.insert(1, @PY_LIB_LOC@) +sys.path.insert(1, @PY_LIB_SUFFIX@) # Add project root directory (enable symlink and trunk execution) PROJECT_ROOT_DIRECTORY = os.path.abspath( From 46490df0c2eb8818f214a1d663ec1e8b6842a254 Mon Sep 17 00:00:00 2001 From: Christian Fredrik Kalager Schaller Date: Tue, 2 May 2017 11:46:04 -0400 Subject: [PATCH 14/20] update with even further fixes :) --- bin/meson.build | 40 +++++++++++----------------------------- bin/remarkable.in | 3 +-- 2 files changed, 12 insertions(+), 31 deletions(-) diff --git a/bin/meson.build b/bin/meson.build index 666b097..f1732ce 100644 --- a/bin/meson.build +++ b/bin/meson.build @@ -3,36 +3,22 @@ version = '1.87' message('Getting python directiories') -python = find_program('python3') -pythondetector = find_program('../scripts/pythondetector') -python_dep = dependency('python3') +py3_mod = import('python3') +py3 = py3_mod.find_python() -cres = run_command(pythondetector, '--sosuffix') -if cres.returncode() != 0 - error('Could not detect python sosuffix' + cres.stdout() + cres.stderr()) +py3_version = py3_mod.language_version() +if py3_version.version_compare('< 3.2') + error('Invalid python version!?') endif -py_so_suffix = cres.stdout().strip() -cres = run_command(pythondetector, '--abiflags') -if cres.returncode() != 0 - error('Could not detect python abiflags' + cres.stdout() + cres.stderr()) +py3_purelib = py3_mod.sysconfig_path('purelib') +if not py3_purelib.endswith('site-packages') + error('Python3 purelib path seems invalid?') endif -python_abi_flags = cres.stdout().strip() -cres = run_command(pythondetector, '--libloc') -if cres.returncode() != 0 - error('Could not detect python library location' + cres.stdout() + cres.stderr()) -endif -pylib_loc = cres.stdout().strip() - -assert(pylib_loc != 'None', 'Python dynamic library path could not be determined') +message('Python version installed : ' + py3_version) +message('Python library path : ' + py3_purelib) -pylib_suffix = 'so' -if host_machine.system() == 'windows' - pylib_suffix = 'dll' -elif host_machine.system() == 'darwin' - pylib_suffix = 'dylib' -endif # Configuration params cdata = configuration_data() @@ -40,13 +26,9 @@ cdata.set('PACKAGE', '"Remarkable"') # Configuration params cdata.set('PACKAGE_URL', 'https://remarkableapp.github.io/') cdata.set('VERSION', version) -cdata.set('PY_LIB_LOC', '"@0@"'.format(pylib_loc)) -cdata.set('PY_ABI_FLAGS', '"@0@"'.format(python_abi_flags)) -cdata.set('PY_LIB_SUFFIX', '"@0@"'.format(pylib_suffix)) -cdata.set('PYTHON_VERSION', '"@0@"'.format(python_dep.version())) +cdata.set('PYTHON_LIB_PATH', py3_purelib) -message('Python Directory is :' + python_dir) message('Preparing init file') configure_file(input : 'remarkable.in', output : 'remarkable', configuration : cdata, install_dir : 'bin') message('generated binary') diff --git a/bin/remarkable.in b/bin/remarkable.in index 8b5b256..3bf8c99 100755 --- a/bin/remarkable.in +++ b/bin/remarkable.in @@ -28,8 +28,7 @@ import locale locale.textdomain('remarkable') -sys.path.insert(1, @PY_LIB_LOC@) -sys.path.insert(1, @PY_LIB_SUFFIX@) +sys.path.insert(1, @PYTHON_LIB_PATH@) # Add project root directory (enable symlink and trunk execution) PROJECT_ROOT_DIRECTORY = os.path.abspath( From 3ebac967f0d0e19245d29d3ce883583ba7951a26 Mon Sep 17 00:00:00 2001 From: Christian Fredrik Kalager Schaller Date: Tue, 2 May 2017 11:49:09 -0400 Subject: [PATCH 15/20] Add hyphens --- bin/remarkable.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/remarkable.in b/bin/remarkable.in index 3bf8c99..a4ccfaa 100755 --- a/bin/remarkable.in +++ b/bin/remarkable.in @@ -28,7 +28,7 @@ import locale locale.textdomain('remarkable') -sys.path.insert(1, @PYTHON_LIB_PATH@) +sys.path.insert(1, "PYTHON_LIB_PATH@") # Add project root directory (enable symlink and trunk execution) PROJECT_ROOT_DIRECTORY = os.path.abspath( From 4c3670a50a17779b460ef5831ba2725f3137b1a2 Mon Sep 17 00:00:00 2001 From: Christian Fredrik Kalager Schaller Date: Tue, 2 May 2017 11:51:14 -0400 Subject: [PATCH 16/20] Fix stupid typo --- bin/remarkable.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/remarkable.in b/bin/remarkable.in index a4ccfaa..01b90f8 100755 --- a/bin/remarkable.in +++ b/bin/remarkable.in @@ -28,7 +28,7 @@ import locale locale.textdomain('remarkable') -sys.path.insert(1, "PYTHON_LIB_PATH@") +sys.path.insert(1, "@PYTHON_LIB_PATH@") # Add project root directory (enable symlink and trunk execution) PROJECT_ROOT_DIRECTORY = os.path.abspath( From a80f714699468360b8f8e3197fbbcd02f402c7a1 Mon Sep 17 00:00:00 2001 From: Christian Fredrik Kalager Schaller Date: Tue, 2 May 2017 12:33:31 -0400 Subject: [PATCH 17/20] Update path append statement --- bin/remarkable.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/remarkable.in b/bin/remarkable.in index 01b90f8..c433908 100755 --- a/bin/remarkable.in +++ b/bin/remarkable.in @@ -27,8 +27,9 @@ import os import locale locale.textdomain('remarkable') +sys.path.append("@PYTHON_LIB_PATH@") +sys.path.append("@PYTHON_LIB_PATH@/remarkable") -sys.path.insert(1, "@PYTHON_LIB_PATH@") # Add project root directory (enable symlink and trunk execution) PROJECT_ROOT_DIRECTORY = os.path.abspath( From aa1338a086f04fcd114b48123711238e1eb5e39a Mon Sep 17 00:00:00 2001 From: Christian Fredrik Kalager Schaller Date: Tue, 2 May 2017 13:20:02 -0400 Subject: [PATCH 18/20] add prefix to path --- bin/meson.build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/meson.build b/bin/meson.build index f1732ce..93d9b0f 100644 --- a/bin/meson.build +++ b/bin/meson.build @@ -18,7 +18,8 @@ endif message('Python version installed : ' + py3_version) message('Python library path : ' + py3_purelib) - +pythonlibpath=join_paths(get_option('prefix'),py3_purelib) +message('is this it??? ' + pythonlibpath) # Configuration params cdata = configuration_data() From d3ed19fc28075fbc00d59488fbd09434777c3ea6 Mon Sep 17 00:00:00 2001 From: Christian Fredrik Kalager Schaller Date: Tue, 2 May 2017 13:22:03 -0400 Subject: [PATCH 19/20] export full path to application --- bin/meson.build | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bin/meson.build b/bin/meson.build index 93d9b0f..d267af5 100644 --- a/bin/meson.build +++ b/bin/meson.build @@ -19,7 +19,6 @@ endif message('Python version installed : ' + py3_version) message('Python library path : ' + py3_purelib) pythonlibpath=join_paths(get_option('prefix'),py3_purelib) -message('is this it??? ' + pythonlibpath) # Configuration params cdata = configuration_data() @@ -27,7 +26,7 @@ cdata.set('PACKAGE', '"Remarkable"') # Configuration params cdata.set('PACKAGE_URL', 'https://remarkableapp.github.io/') cdata.set('VERSION', version) -cdata.set('PYTHON_LIB_PATH', py3_purelib) +cdata.set('PYTHON_LIB_PATH', pythonlibpath) message('Preparing init file') From c1b9631eca0efa51d1694132139beb6ca6873212 Mon Sep 17 00:00:00 2001 From: Christian Fredrik Kalager Schaller Date: Thu, 4 May 2017 12:28:00 -0400 Subject: [PATCH 20/20] Add .repo file to repository --- remarkable.repo | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 remarkable.repo diff --git a/remarkable.repo b/remarkable.repo new file mode 100644 index 0000000..22ad0ea --- /dev/null +++ b/remarkable.repo @@ -0,0 +1,6 @@ +[remarkable] +name=Remarkable Markdown editor software and updates +baseurl=https://raw.githubusercontent.com/cschalle/hubyum/master/noarch +gpgcheck=0 +enabled=1 +enabled_metadata=1