GNU bug report logs - #36043
[PATCH] Add Geany

Previous Next

Package: guix-patches;

Reported by: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>

Date: Sat, 1 Jun 2019 21:45:02 UTC

Severity: normal

Tags: patch

Done: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>

Bug is archived. No further changes may be made.

Full log


Message #23 received at 36043 <at> debbugs.gnu.org (full text, mbox):

From: Arun Isaac <arunisaac <at> systemreboot.net>
To: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
Cc: 36043 <at> debbugs.gnu.org
Subject: Re: [bug#36043] [PATCH] Add Geany
Date: Sat, 15 Jun 2019 12:51:33 +0530
[Message part 1 (text/plain, inline)]
> I actually packaged scintilla

Nice!

> but I failed unbundling it from Geany.  I attach the three patches I
> put up so far.

The scintilla package is not producing a shared library
(libscintilla.so). That is why you were not able to link it to geany. It
took a bit of substitute* surgery of the makefiles, but I managed to get
this working. Please see my attached patches. Ideally, we should get
scintilla and geany upstreams to support unbundling. Could you raise
these issues upstream?

> Subject: [PATCH 1/3] gnu: Add scintilla license.
>
> * guix/licenses.scm (scintilla): New variable.

The scintilla license is the ISC license. See
https://directory.fsf.org/wiki/License:ISC

> +         (replace 'build
> +           (lambda _ (invoke "make" "GTK3=1" "CC=gcc" "-Cgtk")))

This can be done by specifying #:make-flags. No need to replace the
build phase.

> +         (replace 'install
> +           (lambda* (#:key outputs #:allow-other-keys)
> +             (let* ((out (assoc-ref outputs "out"))
> +                    (lib (string-append out "/lib/scintilla"))
> +                    (include (string-append out "/include/scintilla")))
> +               (install-file "bin/scintilla.a" lib)
> +               (for-each (lambda (f) (install-file f include))
> +                         (find-files "include/" "."))
> +               #t))))))

The headers should be installed in /include, not in
/include/scintilla. The libraries should be installed in /lib, not in
/lib/scintilla.

The changes specified in the comments above are also included in the
attached patches. Please feel free to refine my patches as required.

Thanks!

[0001-gnu-Add-scintilla.patch (text/x-patch, inline)]
From 7e9a2b92b9bcf948b8c286a1269f6c2bd42a00eb Mon Sep 17 00:00:00 2001
From: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
Date: Thu, 13 Jun 2019 00:13:27 +0200
Subject: [PATCH 1/2] gnu: Add scintilla.

* gnu/packages/text-editors.scm (scintilla): New variable.
---
 gnu/packages/text-editors.scm | 63 +++++++++++++++++++++++++++++++++++
 1 file changed, 63 insertions(+)

diff --git a/gnu/packages/text-editors.scm b/gnu/packages/text-editors.scm
index 534934dfd1..16f867184d 100644
--- a/gnu/packages/text-editors.scm
+++ b/gnu/packages/text-editors.scm
@@ -7,6 +7,7 @@
 ;;; Copyright © 2014 Taylan Ulrich Bayırlı/Kammer <taylanbayirli <at> gmail.org>
 ;;; Copyright © 2017, 2018, 2019 Tobias Geerinckx-Rice <me <at> tobias.gr>
 ;;; Copyright © 2019 Efraim Flashner <efraim <at> flashner.co.il>
+;;; Copyright © 2019 Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -389,3 +390,65 @@ projects.  The EditorConfig project maintains a file format and plugins for
 various text editors which allow this file format to be read and used by those
 editors.")
     (license license:bsd-2)))
+
+(define-public scintilla
+  (package
+    (name "scintilla")
+    (version "4.1.5")
+    (source (origin
+              (method url-fetch)
+              (uri (let ((v (apply string-append (string-split version #\.))))
+                     (string-append
+                      "https://www.scintilla.org/scintilla" v ".tgz")))
+              (sha256
+               (base32
+                "1c24hfrl0wzb8674bjjql5105nlp6h31gj7axjaf7akkf8yisyab"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:make-flags (list "GTK3=1" "CC=gcc" "-Cgtk")
+       #:tests? #f                      ;require un-packaged Pyside
+       #:phases
+       (modify-phases %standard-phases
+         (delete 'configure)            ;no configure script
+         (add-after 'unpack 'build-shared-library
+           (lambda _
+             (substitute* "gtk/makefile"
+               (("scintilla\\.a") "libscintilla.so")
+               (("\\$\\(AR\\) \\$\\(ARFLAGS\\) \\$@ \\$\\^")
+                "$(CC) -shared $^ -o $@")
+               (("\\$\\(RANLIB\\) \\$@") ""))
+             #t))
+         (add-before 'build 'expand-C++-include-path
+           (lambda* (#:key inputs #:allow-other-keys)
+             ;; Make <gcc>/include/c++/ext/string_conversions.h find
+             ;; <stdlib.h>.
+             (let* ((path "CPLUS_INCLUDE_PATH")
+                    (gcc  (assoc-ref inputs "gcc"))
+                    (c++  (string-append gcc "/include/c++")))
+               (setenv path (string-append c++ ":" (getenv path))))
+             #t))
+         (replace 'install
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (lib (string-append out "/lib"))
+                    (include (string-append out "/include")))
+               (install-file "bin/libscintilla.so" lib)
+               (for-each (lambda (f) (install-file f include))
+                         (find-files "include/" "."))
+               #t))))))
+    (native-inputs
+     `(("gcc" ,gcc-7)                   ;require GCC 7.1+
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("gtk+" ,gtk+)))
+    (home-page "https://www.scintilla.org/")
+    (synopsis "Code editor for GTK+")
+    (description "Scintilla is a source code editing component for
+GTK+.  It has the usual features found in text editing components, as
+well as some that are especially useful for editing and debugging
+source code; these include support for syntax styling, error
+indicators, code completion and call tips.  Styling choices are more
+open than with many editors: Scintilla lets you use proportional
+fonts, bold and italics, multiple foreground and background colours,
+and multiple fonts.")
+    (license license:isc)))
-- 
2.22.0

[0002-gnu-Add-geany.patch (text/x-patch, inline)]
From 738e1b31ad695e54e1ab5fca199679003c2a9129 Mon Sep 17 00:00:00 2001
From: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
Date: Sat, 1 Jun 2019 23:37:24 +0200
Subject: [PATCH 2/2] gnu: Add geany.

* gnu/packages/text-editors.scm (geany): New variable.
---
 gnu/packages/text-editors.scm | 68 +++++++++++++++++++++++++++++++++++
 1 file changed, 68 insertions(+)

diff --git a/gnu/packages/text-editors.scm b/gnu/packages/text-editors.scm
index 16f867184d..c143c06e3b 100644
--- a/gnu/packages/text-editors.scm
+++ b/gnu/packages/text-editors.scm
@@ -35,6 +35,7 @@
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (gnu packages)
   #:use-module (gnu packages assembly)
+  #:use-module (gnu packages autotools)
   #:use-module (gnu packages boost)
   #:use-module (gnu packages documentation)
   #:use-module (gnu packages gcc)
@@ -46,6 +47,7 @@
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages pcre)
   #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages qt)
   #:use-module (gnu packages regex)
   #:use-module (gnu packages ruby)
@@ -452,3 +454,69 @@ open than with many editors: Scintilla lets you use proportional
 fonts, bold and italics, multiple foreground and background colours,
 and multiple fonts.")
     (license license:isc)))
+
+(define-public geany
+  (package
+    (name "geany")
+    (version "1.35")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://download.geany.org/"
+                                  "geany-" version ".tar.bz2"))
+              (sha256
+               (base32
+                "179xfnvhcxsv54v2mlrhykqv2j7klniln5sffvqqpjmdvwyivvim"))
+              (modules '((guix build utils)))
+              (snippet '(begin
+                          (delete-file-recursively "scintilla")
+                          #t))))
+    (build-system gnu-build-system)
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("doxygen" ,doxygen)
+       ("glib" ,glib "bin")
+       ("intltool" ,intltool)
+       ("libtool" ,libtool)
+       ("pkg-config" ,pkg-config)
+       ("python-docutils" ,python-docutils))) ;for rst2html
+    (inputs
+     `(("gtk+" ,gtk+)
+       ("scintilla" ,scintilla)))
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'use-scintilla-shared-library
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "configure.ac"
+               (("scintilla/Makefile") "")
+               (("scintilla/include/Makefile") ""))
+             (substitute* "Makefile.am"
+               (("scintilla ") ""))
+             (substitute* "src/Makefile.am"
+               (("\\$\\(top_builddir\\)/scintilla/libscintilla.la") "")
+               (("geany_LDFLAGS =" all) (string-append all " -lscintilla")))
+             (substitute* "doc/Makefile.am"
+               (("\\$\\(INSTALL_DATA\\) \\$\\(top_srcdir\\)/scintilla/License.txt \\$\\(DOCDIR\\)/ScintillaLicense.txt") ""))
+             (for-each delete-file (list "autogen.sh" "configure" "Makefile.in"))
+             #t)))))
+    (home-page "https://www.geany.org")
+    (synopsis "Fast and lightweight IDE")
+    (description "Geany is a small and fast Integrated Development
+Environment (IDE) that only has a few dependencies on other packages and is as
+independent as possible from special desktop environments like KDE or GNOME.
+
+The basic features of Geany are:
+@itemize
+@item syntax highlighting
+@item code completion
+@item auto completion of often constructed constructs like if, for and while
+@item auto completion of XML and HTML tags
+@item call tips
+@item folding
+@item many supported filetypes like C, Java, PHP, HTML, Python, Perl, Pascal
+@item symbol lists
+@item embedded terminal emulation
+@item extensibility through plugins
+@end itemize")
+    (license (list license:gpl2+))))
-- 
2.22.0

[signature.asc (application/pgp-signature, inline)]

This bug report was last modified 5 years and 301 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.