From 71f5fd7e1d657714c3e6358fd6e4a33c9d5b4033 Mon Sep 17 00:00:00 2001 From: Alexander Kapshuna Date: Thu, 7 Jan 2021 01:20:24 +0300 Subject: [PATCH] neovim-gtk: version bump to 0.2.0 --- ...r-issues-due-to-changes-in-pango_1.4.patch | 50 +++++++++++++++++++ ...2.exheres-0 => neovim-gtk-0.2.0.exheres-0} | 15 +++--- .../neovim-gtk/neovim-gtk-scm.exheres-0 | 22 ++------ .../app-editors/neovim-gtk/neovim-gtk.exlib | 23 +++++++-- 4 files changed, 78 insertions(+), 32 deletions(-) create mode 100644 packages/app-editors/neovim-gtk/files/Try-to-fix-render-issues-due-to-changes-in-pango_1.4.patch rename packages/app-editors/neovim-gtk/{neovim-gtk-0.1.1-r2.exheres-0 => neovim-gtk-0.2.0.exheres-0} (58%) diff --git a/packages/app-editors/neovim-gtk/files/Try-to-fix-render-issues-due-to-changes-in-pango_1.4.patch b/packages/app-editors/neovim-gtk/files/Try-to-fix-render-issues-due-to-changes-in-pango_1.4.patch new file mode 100644 index 0000000..41ff11a --- /dev/null +++ b/packages/app-editors/neovim-gtk/files/Try-to-fix-render-issues-due-to-changes-in-pango_1.4.patch @@ -0,0 +1,50 @@ +Upstream: yes +Reason: https://github.com/daa84/neovim-gtk/issues/208 + +From c1dbe9b9549383b22807a2de9c76094ca9204f51 Mon Sep 17 00:00:00 2001 +From: daa +Date: Tue, 26 Nov 2019 19:25:42 +0300 +Subject: [PATCH] Try to fix render issues due to changes in pango_1.44 (#208) + +--- + src/render/context.rs | 20 +++++++++----------- + 1 file changed, 9 insertions(+), 11 deletions(-) + +diff --git a/src/render/context.rs b/src/render/context.rs +index 8168296..0c19437 100644 +--- a/src/render/context.rs ++++ b/src/render/context.rs +@@ -111,21 +111,19 @@ pub struct CellMetrics { + + impl CellMetrics { + fn new(font_metrics: &pango::FontMetrics, line_space: i32) -> Self { ++ let ascent = (f64::from(font_metrics.get_ascent()) / f64::from(pango::SCALE)).ceil(); ++ let descent = (f64::from(font_metrics.get_descent()) / f64::from(pango::SCALE)).ceil(); ++ let underline_position = (f64::from(font_metrics.get_underline_position()) / f64::from(pango::SCALE)).ceil(); + CellMetrics { + pango_ascent: font_metrics.get_ascent(), + pango_descent: font_metrics.get_descent(), + pango_char_width: font_metrics.get_approximate_digit_width(), +- ascent: f64::from(font_metrics.get_ascent()) / f64::from(pango::SCALE), +- line_height: f64::from(font_metrics.get_ascent() + font_metrics.get_descent()) +- / f64::from(pango::SCALE) +- + f64::from(line_space), +- char_width: f64::from(font_metrics.get_approximate_digit_width()) +- / f64::from(pango::SCALE), +- underline_position: f64::from( +- font_metrics.get_ascent() - font_metrics.get_underline_position(), +- ) / f64::from(pango::SCALE), +- underline_thickness: f64::from(font_metrics.get_underline_thickness()) +- / f64::from(pango::SCALE), ++ ascent, ++ line_height: ascent + descent + f64::from(line_space), ++ char_width: (f64::from(font_metrics.get_approximate_digit_width()) ++ / f64::from(pango::SCALE)).ceil(), ++ underline_position: ascent - underline_position, ++ underline_thickness: f64::from(font_metrics.get_underline_thickness()) / f64::from(pango::SCALE), + } + } + +-- +2.30.0 + diff --git a/packages/app-editors/neovim-gtk/neovim-gtk-0.1.1-r2.exheres-0 b/packages/app-editors/neovim-gtk/neovim-gtk-0.2.0.exheres-0 similarity index 58% rename from packages/app-editors/neovim-gtk/neovim-gtk-0.1.1-r2.exheres-0 rename to packages/app-editors/neovim-gtk/neovim-gtk-0.2.0.exheres-0 index b5e8a8b..81da7b4 100644 --- a/packages/app-editors/neovim-gtk/neovim-gtk-0.1.1-r2.exheres-0 +++ b/packages/app-editors/neovim-gtk/neovim-gtk-0.2.0.exheres-0 @@ -11,16 +11,13 @@ DEPENDENCIES=" app-editors/neovim dev-libs/glib:2 x11-libs/cairo - x11-libs/gtk+:3[>=3.10.0] + x11-libs/gtk+:3[>=3.22.0] x11-libs/pango + run: + gnome-desktop/gsettings-desktop-schemas " -src_install() { - ecargo_install +DEFAULT_SRC_PREPARE_PATCHES=( + "${FILES}"/Try-to-fix-render-issues-due-to-changes-in-pango_1.4.patch +) - insinto /usr/share/applications - doins desktop/*.desktop - - insinto /usr/share/icons/hicolor/128x128/apps - doins desktop/nvim-gtk.png -} diff --git a/packages/app-editors/neovim-gtk/neovim-gtk-scm.exheres-0 b/packages/app-editors/neovim-gtk/neovim-gtk-scm.exheres-0 index f7bda1f..35ab385 100644 --- a/packages/app-editors/neovim-gtk/neovim-gtk-scm.exheres-0 +++ b/packages/app-editors/neovim-gtk/neovim-gtk-scm.exheres-0 @@ -1,7 +1,7 @@ # Copyright 2018 Julian Ospald # Distributed under the terms of the GNU General Public License v2 -require neovim-gtk gtk-icon-cache +require neovim-gtk DOWNLOADS="" @@ -15,27 +15,11 @@ DEPENDENCIES=" x11-libs/cairo x11-libs/gtk+:3[>=3.22.0] x11-libs/pango[>=1.38] + run: + gnome-desktop/gsettings-desktop-schemas " src_unpack() { cargo_src_unpack } -src_install() { - ecargo_install - - insinto /usr/share/nvim-gtk - doins -r runtime - - insinto /usr/share/applications - doins desktop/*.desktop - - insinto /usr/share/icons/hicolor/128x128/apps - newins desktop/org.daa.NeovimGtk_128.png org.daa.NeovimGtk.png - insinto /usr/share/icons/hicolor/48x48/apps - newins desktop/org.daa.NeovimGtk_48.png org.daa.NeovimGtk.png - insinto /usr/share/icons/hicolor/scalable/apps - newins desktop/org.daa.NeovimGtk.svg org.daa.NeovimGtk.png - insinto /usr/share/icons/hicolor/symbolic/apps - newins desktop/org.daa.NeovimGtk-symbolic.svg org.daa.NeovimGtk.png -} diff --git a/packages/app-editors/neovim-gtk/neovim-gtk.exlib b/packages/app-editors/neovim-gtk/neovim-gtk.exlib index 2f8fe56..9d663f6 100644 --- a/packages/app-editors/neovim-gtk/neovim-gtk.exlib +++ b/packages/app-editors/neovim-gtk/neovim-gtk.exlib @@ -11,11 +11,26 @@ HOMEPAGE="https://github.com/daa84/neovim-gtk ${HOMEPAGE}" LICENCES="GPL-3.0" MYOPTIONS="" -BUGS_TO="hasufell@posteo.de" +src_install() { + ecargo_install -src_prepare() { - default - export PREFIX=/usr + insinto /usr/share/nvim-gtk + doins -r runtime + + insinto /usr/share/applications + doins desktop/*.desktop + + local s + for s in 48 128; do + insinto /usr/share/icons/hicolor/${s}x${s}/apps + newins desktop/org.daa.NeovimGtk_${s}.png org.daa.NeovimGtk.png + done + + insinto /usr/share/icons/hicolor/scalable/apps + newins desktop/org.daa.NeovimGtk.svg org.daa.NeovimGtk.png + + insinto /usr/share/icons/hicolor/symbolic/apps + newins desktop/org.daa.NeovimGtk-symbolic.svg org.daa.NeovimGtk.png } pkg_postinst() {