[PATCH 0/2] gnu: gpick: Update to 0.3-1.365f605.

  • Open
  • quality assurance status badge
Details
One participant
  • Artyom V. Poptsov
Owner
unassigned
Submitted by
Artyom V. Poptsov
Severity
normal

Debbugs page

Artyom V. Poptsov wrote 3 weeks ago
(address . guix-patches@gnu.org)(name . Artyom V. Poptsov)(address . poptsov.artyom@gmail.com)
cover.1739695296.git.poptsov.artyom@gmail.com
This patchset updates "gpick" to the version 0.3-1.365f605.

Artyom V. Poptsov (2):
gnu: gpick: Improve the package style.
gnu: gpick: Update to 0.3-1.365f605.

gnu/local.mk | 1 +
gnu/packages/image.scm | 83 ++++++-----
.../patches/gpick-fix-segfault-on-start.patch | 141 ++++++++++++++++++
3 files changed, 188 insertions(+), 37 deletions(-)
create mode 100644 gnu/packages/patches/gpick-fix-segfault-on-start.patch


base-commit: dd7a377c38c2a3e0cb80b0e45b32dfbe4577a739
--
2.48.1
Artyom V. Poptsov wrote 3 weeks ago
[PATCH 1/2] gnu: gpick: Improve the package style.
(address . 76326@debbugs.gnu.org)(name . Artyom V. Poptsov)(address . poptsov.artyom@gmail.com)
818b72d701f2bd4ed0349e6d7579e0e59d436029.1739695296.git.poptsov.artyom@gmail.com
* gnu/packages/image.scm (gpick): Improve the package style.
[native-inputs, inputs]: Remove input labels.
[arguments]: Use GEXPs.

Change-Id: I7917381255ab5cd129e6c6133246579fb071a03f
---
gnu/packages/image.scm | 50 +++++++++++++++++++-----------------------
1 file changed, 22 insertions(+), 28 deletions(-)

Toggle diff (65 lines)
diff --git a/gnu/packages/image.scm b/gnu/packages/image.scm
index 99face4546..282b6582e8 100644
--- a/gnu/packages/image.scm
+++ b/gnu/packages/image.scm
@@ -2044,36 +2044,30 @@ (define-public gpick
(package
(name "gpick")
(version "0.2.6")
- (source (origin
- (method git-fetch)
- (uri (git-reference
- (url "https://github.com/thezbyg/gpick")
- (commit (string-append name "-" version))))
- (file-name (git-file-name name version))
- (sha256
- (base32
- "0nl89gca5nmbyycv5rl5bm6k7facapdk4pab9pl949aa3cjw9bk7"))))
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/thezbyg/gpick")
+ (commit (string-append name "-" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0nl89gca5nmbyycv5rl5bm6k7facapdk4pab9pl949aa3cjw9bk7"))))
(build-system scons-build-system)
- (native-inputs
- `(("boost" ,boost)
- ("gettext" ,gettext-minimal)
- ("pkg-config" ,pkg-config)
- ("ragel" ,ragel)))
- (inputs
- `(("expat" ,expat)
- ("gtk2" ,gtk+-2)
- ("lua" ,lua-5.2)))
+ (native-inputs (list boost gettext-minimal pkg-config ragel))
+ (inputs (list expat gtk+-2 lua-5.2))
(arguments
- `(#:tests? #f
- #:scons ,scons-python2
- #:scons-flags (list (string-append "DESTDIR=" %output))
- #:phases
- (modify-phases %standard-phases
- (add-before 'build 'fix-lua-reference
- (lambda _
- (substitute* "SConscript"
- (("lua5.2") "lua-5.2"))
- #t)))))
+ (list
+ #:tests? #f
+ #:scons scons-python2
+ #:scons-flags #~(list (string-append "DESTDIR=" #$output))
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-before 'build 'fix-lua-reference
+ (lambda _
+ (substitute* "SConscript"
+ (("lua5.2")
+ "lua-5.2")))))))
(home-page "http://www.gpick.org/")
(synopsis "Color picker")
(description "Gpick is an advanced color picker and palette editing tool.")
--
2.48.1
Artyom V. Poptsov wrote 3 weeks ago
[PATCH 2/2] gnu: gpick: Update to 0.3-1.365f605.
(address . 76326@debbugs.gnu.org)(name . Artyom V. Poptsov)(address . poptsov.artyom@gmail.com)
c45dc7f7e2af05d6eb6ca0b434583bdefb44d4bb.1739695296.git.poptsov.artyom@gmail.com
* gnu/packages/image.scm (gpick): Update to 0.3-1.365f605.
[source]: Apply the patch from
[inputs]: Use gtk+ and lua.
[arguments]<#:scons-flags>: Set "LUA_TYPE".
<#:phases>: Add 'generate-version-file' phase.
Use lua-5.3 in "fix-lua-reference" phase.
* gnu/packages/patches/gpick-fix-segfault-on-start.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register the patch.

Change-Id: I18e5e9dea1b43a3f4f641e2c52b95a17a17429b7
---
gnu/local.mk | 1 +
gnu/packages/image.scm | 77 ++++++----
.../patches/gpick-fix-segfault-on-start.patch | 141 ++++++++++++++++++
3 files changed, 188 insertions(+), 31 deletions(-)
create mode 100644 gnu/packages/patches/gpick-fix-segfault-on-start.patch

Toggle diff (249 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index 9690bbe647..7bfcb43a1e 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1511,6 +1511,7 @@ dist_patch_DATA = \
%D%/packages/patches/go-skip-gc-test.patch \
%D%/packages/patches/gourmet-sqlalchemy-compat.patch \
%D%/packages/patches/gpaste-fix-paths.patch \
+ %D%/packages/patches/gpick-fix-segfault-on-start.patch \
%D%/packages/patches/gpm-glibc-2.26.patch \
%D%/packages/patches/gpodder-disable-updater.patch \
%D%/packages/patches/grantlee-fix-i586-precision.patch \
diff --git a/gnu/packages/image.scm b/gnu/packages/image.scm
index 282b6582e8..04824f23ad 100644
--- a/gnu/packages/image.scm
+++ b/gnu/packages/image.scm
@@ -2041,37 +2041,52 @@ (define-public picket
(license license:gpl3+)))
(define-public gpick
- (package
- (name "gpick")
- (version "0.2.6")
- (source
- (origin
- (method git-fetch)
- (uri (git-reference
- (url "https://github.com/thezbyg/gpick")
- (commit (string-append name "-" version))))
- (file-name (git-file-name name version))
- (sha256
- (base32 "0nl89gca5nmbyycv5rl5bm6k7facapdk4pab9pl949aa3cjw9bk7"))))
- (build-system scons-build-system)
- (native-inputs (list boost gettext-minimal pkg-config ragel))
- (inputs (list expat gtk+-2 lua-5.2))
- (arguments
- (list
- #:tests? #f
- #:scons scons-python2
- #:scons-flags #~(list (string-append "DESTDIR=" #$output))
- #:phases
- #~(modify-phases %standard-phases
- (add-before 'build 'fix-lua-reference
- (lambda _
- (substitute* "SConscript"
- (("lua5.2")
- "lua-5.2")))))))
- (home-page "http://www.gpick.org/")
- (synopsis "Color picker")
- (description "Gpick is an advanced color picker and palette editing tool.")
- (license license:bsd-3)))
+ (let ((commit "365f605d187cb57dc86d3feb166c4636f262ae31")
+ (revision "1")
+ (version "0.3"))
+ (package
+ (name "gpick")
+ (version (git-version version revision commit))
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/thezbyg/gpick")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "1p60pa85mgcbzgd85pvyishw8jr49ciphq6z07yw6v9j97j80iax"))
+ ;; See this pull request:
+ ;; <https://github.com/thezbyg/gpick/pull/225/>
+ (patches (search-patches "gpick-fix-segfault-on-start.patch"))))
+ (build-system scons-build-system)
+ (native-inputs (list boost gettext-minimal pkg-config ragel))
+ (inputs (list expat gtk+ lua))
+ (arguments
+ (list
+ #:tests? #f
+ #:scons scons
+ #:scons-flags #~(list (string-append "DESTDIR=" #$output)
+ "LUA_TYPE=C")
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'unpack 'generate-version-file
+ (lambda _
+ (with-output-to-file ".version"
+ (lambda ()
+ (format #t "0.3~%")
+ (format #t "~a~%" #$revision)
+ (format #t "~a~%" #$commit)
+ (format #t "2023-06-09~%")))))
+ (add-before 'build 'fix-lua-reference
+ (lambda _
+ (substitute* "SConscript"
+ (("lua5.3")
+ "lua-5.3")))))))
+ (home-page "http://www.gpick.org/")
+ (synopsis "Color picker")
+ (description "Gpick is an advanced color picker and palette editing tool.")
+ (license license:bsd-3))))
(define-public libiptcdata
(package
diff --git a/gnu/packages/patches/gpick-fix-segfault-on-start.patch b/gnu/packages/patches/gpick-fix-segfault-on-start.patch
new file mode 100644
index 0000000000..1ecc6012db
--- /dev/null
+++ b/gnu/packages/patches/gpick-fix-segfault-on-start.patch
@@ -0,0 +1,141 @@
+From a55129f534a62e179ae7facd58b75a61b500e387 Mon Sep 17 00:00:00 2001
+From: Trantarius <leborjt@yahoo.com>
+Date: Sat, 18 Nov 2023 19:01:18 -0500
+Subject: [PATCH] fix segfault on start
+
+---
+ source/GlobalState.cpp | 13 ++++--
+ source/common/Span.h | 1 +
+ source/gtk/ColorComponent.cpp | 78 +++++++++++++++++------------------
+ 3 files changed, 49 insertions(+), 43 deletions(-)
+
+diff --git a/source/GlobalState.cpp b/source/GlobalState.cpp
+index 50b3c2a..146c53e 100644
+--- a/source/GlobalState.cpp
++++ b/source/GlobalState.cpp
+@@ -50,9 +50,16 @@ struct ConverterOptions: public Converter::Options, public IEventHandler {
+ }
+ void update() {
+ auto options = m_settings.getMap("gpick.options");
+- upperCaseHex = options->getString("hex_case", "upper") == "upper";
+- cssPercentages = options->getBool("css_percentages", false);
+- cssAlphaPercentage = options->getBool("css_alpha_percentage", false);
++ if(options){
++ upperCaseHex = options->getString("hex_case", "upper") == "upper";
++ cssPercentages = options->getBool("css_percentages", false);
++ cssAlphaPercentage = options->getBool("css_alpha_percentage", false);
++ }
++ else{
++ upperCaseHex=true;
++ cssPercentages=false;
++ cssAlphaPercentage=false;
++ }
+ }
+ virtual ~ConverterOptions() {
+ }
+diff --git a/source/common/Span.h b/source/common/Span.h
+index f5b0552..67c7bde 100644
+--- a/source/common/Span.h
++++ b/source/common/Span.h
+@@ -19,6 +19,7 @@
+ #ifndef GPICK_COMMON_SPAN_H_
+ #define GPICK_COMMON_SPAN_H_
+ #include <type_traits>
++#include <cstdint>
+ #include <iterator>
+ namespace common {
+ template<typename T, typename SizeT = size_t>
+diff --git a/source/gtk/ColorComponent.cpp b/source/gtk/ColorComponent.cpp
+index 7d59fdc..aa626d5 100644
+--- a/source/gtk/ColorComponent.cpp
++++ b/source/gtk/ColorComponent.cpp
+@@ -550,51 +550,49 @@ static gboolean onDraw(GtkWidget *widget, cairo_t *cr) {
+ cairo_set_source_rgb(cr, 0, 0, 0);
+ cairo_set_line_width(cr, 1);
+ cairo_stroke(cr);
+- if (ns->text[i] || ns->label[i]) {
+- PangoLayout *layout;
+- PangoFontDescription *font_description;
+- font_description = pango_font_description_new();
+- layout = pango_cairo_create_layout(cr);
+- pango_font_description_set_family(font_description, "sans");
+- pango_font_description_set_weight(font_description, PANGO_WEIGHT_NORMAL);
+- pango_font_description_set_absolute_size(font_description, 12 * PANGO_SCALE);
+- pango_layout_set_font_description(layout, font_description);
+- pango_layout_set_wrap(layout, PANGO_WRAP_WORD);
+- pango_layout_set_single_paragraph_mode(layout, true);
++ PangoLayout *layout;
++ PangoFontDescription *font_description;
++ font_description = pango_font_description_new();
++ layout = pango_cairo_create_layout(cr);
++ pango_font_description_set_family(font_description, "sans");
++ pango_font_description_set_weight(font_description, PANGO_WEIGHT_NORMAL);
++ pango_font_description_set_absolute_size(font_description, 12 * PANGO_SCALE);
++ pango_layout_set_font_description(layout, font_description);
++ pango_layout_set_wrap(layout, PANGO_WRAP_WORD);
++ pango_layout_set_single_paragraph_mode(layout, true);
+ #if GTK_MAJOR_VERSION >= 3
+- //TODO: GTK3 font color
++ //TODO: GTK3 font color
+ #else
+- gdk_cairo_set_source_color(cr, &widget->style->text[0]);
++ gdk_cairo_set_source_color(cr, &widget->style->text[0]);
+ #endif
+- int width, height;
+- if (ns->text[i]) {
+- pango_layout_set_text(layout, ns->text[i], -1);
+- pango_layout_set_width(layout, 40 * PANGO_SCALE);
+- pango_layout_set_height(layout, 16 * PANGO_SCALE);
+- pango_layout_set_alignment(layout, PANGO_ALIGN_RIGHT);
+- pango_cairo_update_layout(cr, layout);
+- pango_layout_get_pixel_size(layout, &width, &height);
+- cairo_move_to(cr, 200 + offset_x - 5, i * 16);
+- pango_cairo_show_layout(cr, layout);
+- }
+- if (ns->label[i][0] && ns->label[i][1] && offset_x > 10) {
+- if (offset_x > 50) {
+- pango_layout_set_text(layout, ns->label[i][1], -1);
+- } else {
+- pango_layout_set_text(layout, ns->label[i][0], -1);
+- }
+- pango_layout_set_width(layout, (offset_x - 10) * PANGO_SCALE);
+- pango_layout_set_ellipsize(layout, PANGO_ELLIPSIZE_END);
+- pango_layout_set_height(layout, 16 * PANGO_SCALE);
+- pango_layout_set_alignment(layout, PANGO_ALIGN_LEFT);
+- pango_cairo_update_layout(cr, layout);
+- pango_layout_get_pixel_size(layout, &width, &height);
+- cairo_move_to(cr, 5, i * 16);
+- pango_cairo_show_layout(cr, layout);
++ int width, height;
++ if (ns->text[i]) {
++ pango_layout_set_text(layout, ns->text[i], -1);
++ pango_layout_set_width(layout, 40 * PANGO_SCALE);
++ pango_layout_set_height(layout, 16 * PANGO_SCALE);
++ pango_layout_set_alignment(layout, PANGO_ALIGN_RIGHT);
++ pango_cairo_update_layout(cr, layout);
++ pango_layout_get_pixel_size(layout, &width, &height);
++ cairo_move_to(cr, 200 + offset_x - 5, i * 16);
++ pango_cairo_show_layout(cr, layout);
++ }
++ if (ns->label[i][0] && ns->label[i][1] && offset_x > 10) {
++ if (offset_x > 50) {
++ pango_layout_set_text(layout, ns->label[i][1], -1);
++ } else {
++ pango_layout_set_text(layout, ns->label[i][0], -1);
+ }
+- g_object_unref(layout);
+- pango_font_description_free(font_description);
++ pango_layout_set_width(layout, (offset_x - 10) * PANGO_SCALE);
++ pango_layout_set_ellipsize(layout, PANGO_ELLIPSIZE_END);
++ pango_layout_set_height(layout, 16 * PANGO_SCALE);
++ pango_layout_set_alignment(layout, PANGO_ALIGN_LEFT);
++ pango_cairo_update_layout(cr, layout);
++ pango_layout_get_pixel_size(layout, &width, &height);
++ cairo_move_to(cr, 5, i * 16);
++ pango_cairo_show_layout(cr, layout);
+ }
++ g_object_unref(layout);
++ pango_font_description_free(font_description);
+ }
+ return TRUE;
+ }
--
2.48.1
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 76326@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 76326
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help