unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: "Nicolò Balzarotti" <anothersms@gmail.com>
To: Christopher Baines <mail@cbaines.net>
Cc: 44191@debbugs.gnu.org, nicolo@nixo.xyz
Subject: [bug#44191] gnu: Add kristall
Date: Sun, 25 Oct 2020 17:47:01 +0100	[thread overview]
Message-ID: <87tuui1ce2.fsf@guixSD.i-did-not-set--mail-host-address--so-tickle-me> (raw)
In-Reply-To: <87o8kqab7i.fsf@cbaines.net>

Hi Chris!

Thanks for the review.

I tried, but:
1. breeze is a different package from the ones in the repo (url is
https://github.com/Alexhuszagh/BreezeStyleSheets).  It does not seems to
be compiled, I can try to package it.
2. there are files in lib/cmark that are not present in the cmark
distribution (thei are .h files generated by their .h.in), so I cannot
extract our cmark source directly
   - I tried keeping those files, but build fails [[failed-build]].  Not sure if it's
   a patched version or if it's an older one.  But I can investigate
   probably
3. Should I do the same for fonts file? It depends on Noto (that we have
in the store) and on OpenMoji (I can package it)

Just for reference, I attached the current WIP package definition
([[current-package-definition]] which is getting complex.  Is there a
better way to achieve the "delete a folder, but keep some file"?)


Thanks!
Nicolò

#+name: failed-build
#+begin_example 
../src/renderers/markdownrenderer.cpp: In function ‘QString extractNodeText(const cmark_node&)’:
../src/renderers/markdownrenderer.cpp:102:48: error: ‘const cmark_node {aka const struct cmark_node}’ has no member named ‘data’
     return QString::fromUtf8((char const*)node.data, node.len);
                                                ^~~~
../src/renderers/markdownrenderer.cpp:102:59: error: ‘const cmark_node {aka const struct cmark_node}’ has no member named ‘len’
     return QString::fromUtf8((char const*)node.data, node.len);
                                                           ^~~
../src/renderers/markdownrenderer.cpp: In function ‘void renderNode(RenderState&, const cmark_node&, QTextCharFormat)’:
../src/renderers/markdownrenderer.cpp:262:67: error: invalid cast from type ‘const cmark_chunk’ to type ‘char*’
         QUrl absolute_url = QString::fromUtf8((char*)node.as.link.url);
#+end_example

#+name: current-package-definition
#+begin_src scheme
(define-public kristall
  ;; Fixes to the build system applied after the latest tag
  ;; Use tagged release when updating
  (let ((commit "b684f94f1af9a19c1a6fd70d72097a13b75e1ca6")
        (revision "1"))
    (package
      (name "kristall")
      (version (string-append "0.3-" revision "." (string-take commit 7)))
      (source
       (origin
         (method git-fetch)
         (uri (git-reference
               (url "https://github.com/MasterQ32/kristall")
               (commit commit)))
         (file-name (git-file-name name version))
         (sha256
          (base32
           "0kbn98pn8iplqkg7gxx4nysvgsn1621z95ynfr2f9jhsfsgz4r0z"))
         (modules '((guix build utils) (ice-9 match)))
         (snippet
          '(begin
             ;; /gnu/store/qy99msdihnam407659xdqdb4p99f0ava-font-google-noto-20171025/share/fonts/truetype/NotoColorEmoji.ttf
             ;; Remove bundled programs.
             ;; kristall requires some files in the cmark dir that are not
             ;; available in cmark sources.  Move it away from the directory
             ;; and then back in
             (with-directory-excursion "lib"
               (let ((files-to-keep '(("cmark/cmark.pri" "cmark.pri")
                                      ("cmark/src/config.h" "config.h")
                                      ("cmark/src/cmark.h" "cmark.h")
                                      ("cmark/src/cmark_export.h" "cmark_export.h")
                                      ("cmark/src/cmark_version.h" "cmark_version.h"))))
                 ;; Copy away files to keep
                 (map (match-lambda ((src . (dest)) (rename-file src dest)))
                      files-to-keep)
                 ;; Delete extra (bundled) files
                 (map (lambda (dir) (delete-file-recursively dir))
                      '("cmark" ;; "BreezeStyleSheets"
                        ))
                 ;; Put files to keep back in their original place
                 (mkdir-p "cmark/src")
                 (map (match-lambda ((dest . (src)) (rename-file src dest)))
                      files-to-keep)))
             ;; Remove bundled fonts
             (delete-file-recursively "fonts")
             #t))))
      (build-system gnu-build-system)
      (arguments
       `(#:modules ((guix build gnu-build-system)
                    (guix build qt-utils)
                    (guix build utils))
         #:imported-modules (,@%gnu-build-system-modules
                             (guix build qt-utils))
         #:make-flags
         (list (string-append "PREFIX=" %output))
         #:phases
         (modify-phases %standard-phases
           (delete 'configure)          ; no ./configure script
           (delete 'check)              ; no check target
           (add-after 'unpack 'replace-bundled-libs
             (lambda* (#:key inputs #:allow-other-keys)
               (let ((cmark (assoc-ref inputs "cmark-sources"))
                     ;; (breeze (assoc-ref inputs "breeze-sources"))
                     )
                 ;; (invoke "tar" "-xf" breeze "-C" "./lib/")
                 ;; (rename-file "./lib/breeze-5.19.5" "./lib/BreezeStyleSheets")
                 (invoke "tar" "-xf" cmark "-C" "./lib/cmark" "--strip-components" "1")
                 #t)))
           (add-before 'build 'set-program-version
             ;; runs git describe --tags by default
             (lambda _
               ;; configure.ac relies on ‘git --describe’ to get the version.
               ;; Patch it to just return the real version number directly.
               (substitute* "src/kristall.pro"
                 (("(KRISTALL_VERSION=).*" _ match)
                  (string-append match ,version "\n")))))
           (add-after 'install 'wrap-program
             (lambda* (#:key outputs #:allow-other-keys)
               (let ((out (assoc-ref outputs "out")))
                 (wrap-qt-program out "kristall"))
               #t)))))
      (inputs
       `(("breeze-sources" ,(package-source breeze-assets))
         ("cmark-sources" ,(package-source cmark))
         ("openssl" ,openssl)
         ("qtbase" ,qtbase)
         ("qtmultimedia" ,qtmultimedia)
         ("qtsvg" ,qtsvg)))
      (home-page "https://github.com/MasterQ32/kristall")
      (synopsis "Small-internet graphical client")
      (description "Graphical small-internet client with with many features
including multi-protocol support (gemini, http, https, gopher, finger),
bookmarks, TSL certificates management, outline generation, tabbed interface
and more.")
      (license license:gpl3))))
#+end_src

Christopher Baines <mail@cbaines.net> writes:

> Nicolò Balzarotti <anothersms@gmail.com> writes:
>
>> Hi guix!
>>
>> This patch adds kristall, a qt browser for gemini and gopher.
>>
>> There were some problems with the latest tagged version (V0.3), such as
>> directories that had to be created manually before install.  I preferred
>> to use the latest commit (as the author still does not know when a new
>> release will happen).  Let me know if it's fine.
>>
>> Without the wrap-qt-program icons were missing.
>>
>> guix lint reports no warnings.
>
> Hey!
>
> Thanks for the patch.
>
> I've had a quick look, and spotted one thing. The Git repository
> includes lib/BreezeStyleSheets and lib/cmark, which are both packaged
> for Guix (I'm unsure about luis-l-gist). It would be good to look at
> removing/not using the copied code from kristall and using the Guix
> packages instead.
>
> Does that make sense?
>
> Thanks,
>
> Chris




  reply	other threads:[~2020-10-25 16:48 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-24 13:07 [bug#44191] gnu: Add kristall Nicolò Balzarotti
2020-10-25  9:47 ` Christopher Baines
2020-10-25 16:47   ` Nicolò Balzarotti [this message]
2020-10-26 16:43     ` Christopher Baines
2020-10-26 18:12       ` Nicolò Balzarotti
2020-10-27 13:22         ` Nicolò Balzarotti
2020-10-31 20:26           ` Christopher Baines
2020-11-03 10:14             ` Nicolò Balzarotti
2020-11-10 19:57               ` Christopher Baines
2020-11-14 14:52                 ` Nicolò Balzarotti
2020-11-14 16:23                   ` bug#44191: " Christopher Baines

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87tuui1ce2.fsf@guixSD.i-did-not-set--mail-host-address--so-tickle-me \
    --to=anothersms@gmail.com \
    --cc=44191@debbugs.gnu.org \
    --cc=mail@cbaines.net \
    --cc=nicolo@nixo.xyz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).