unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Andy Patterson <ajpatter@uwaterloo.ca>
To: Pierre Neidhardt <mail@ambrevar.xyz>
Cc: 32769@debbugs.gnu.org
Subject: bug#32769: Packaging Next browser (Common Lisp) [work in progress]
Date: Mon, 15 Oct 2018 02:05:05 -0400	[thread overview]
Message-ID: <20181015020505.2387a8c7@mailservices.uwaterloo.ca> (raw)
In-Reply-To: <878t31kk59.fsf@ambrevar.xyz>

Hi Pierre,

On Sun, 14 Oct 2018 10:27:46 +0200
Pierre Neidhardt <mail@ambrevar.xyz> wrote:

> I won't have time this weekend, so you can go ahead.  Otherwise I'll
> do it next week.

I investigated the problem and I think the build-program procedure is
ok.  It has the option to specify which dependencies you want (maybe
that's what you used?), and I think that's the right option.

You said that you'd tried passing "next" in some way - in this case the
system that the executable will depend on is "next-gtk".  There's a
couple of things here - firstly we need a system for "next" and a
separate one for "next/gtk".  The other is that the resulting systems
will be normalized, so we'll end up with "next-gtk" as the system that
we want to use a dependency for the next-browser executable.

I made these changes and found that I still had problems building
next.  I managed to figure out that it's because next exercises some
less common asd options which makes the bundle that it outputs not
conform to the expectations of the build system.  We'll have to make
some changes to accommodate that, but for now, here's a patch that makes
next build.

I wasn't able to really test whether or not it works - it throws an
exception whenever I press a key.  I was able to find out that its
*active-buffer* variable is nil, which it expects not to be.  If you
want to debug the problems, I recommend doing something like 

$ guix environment --ad-hoc sbcl sbcl-slynk:image next-browser:lib &&
slynk.image
* (slynk:create-server :port 4545)

and then connecting from sly.  You might also pass
(sb-ext:enable-debugger) to the entry program if you prefer that
interface but I haven't tried.  You can then run

|> (asdf:load-system 'next-gtk)
|> (next:start)

to get started.

Hoping that helps,

--
Andy

From 452bb2919ab1db6d819973d655407b1a335b2741 Mon Sep 17 00:00:00 2001
From: Andy Patterson <ajpatter@uwaterloo.ca>
Date: Mon, 15 Oct 2018 01:59:25 -0400
Subject: [PATCH] gnu: next-browser: Fix the build.

* gnu/packages/web-browsers.scm (next-browser-core): New variable.
(next-browser): Inherit from next-browser-core.
---
 gnu/packages/lisp.scm         |  1 +
 gnu/packages/web-browsers.scm | 59 ++++++++++++++++++++++++-----------
 2 files changed, 42 insertions(+), 18 deletions(-)

diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm
index fcd3156a7..1b390b66d 100644
--- a/gnu/packages/lisp.scm
+++ b/gnu/packages/lisp.scm
@@ -30,6 +30,7 @@
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix hg-download)
   #:use-module (guix git-download)
   #:use-module (guix utils)
   #:use-module (guix build-system gnu)
diff --git a/gnu/packages/web-browsers.scm b/gnu/packages/web-browsers.scm
index 0df9180d7..c6844c868 100644
--- a/gnu/packages/web-browsers.scm
+++ b/gnu/packages/web-browsers.scm
@@ -25,6 +25,7 @@
 (define-module (gnu packages web-browsers)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
+  #:use-module (guix utils)
   #:use-module (gnu packages)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages databases)
@@ -324,10 +325,10 @@ access.")
 GUI.  It is based on PyQt5 and QtWebKit.")
     (license license:gpl3+)))
 
-(define-public next-browser
+(define-public next-browser-core
   (let ((commit "ccc289b44610ada4ae9c875910af7720e85b546b"))
     (package
-      (name "next-browser")
+      (name "next-browser-core")
       (version (git-version "0.0.8" "1" commit))
       (source (origin
                 (method git-fetch)
@@ -338,11 +339,11 @@ GUI.  It is based on PyQt5 and QtWebKit.")
                  (search-patches "next-fix-duplicate-function.patch"))
                 (sha256
                  (base32
-                  "1pcpb274zb0qm26rrglgcgzg2d2v7j2aja5685swwyq9rcqlbdf4"))))
+                  "0rccs9w49p577l12kgykccxrjkr03rf1cfz9mvxbjzc8g82dya2k"))
+                (file-name (git-file-name name version))))
       (build-system asdf-build-system/sbcl)
       ;; TODO: Move Common Lisp libraries to "native-inputs"?
       ;; TODO: Does runtime depends on gsettings-desktop-schemas and glib-networking?
-      (outputs '("out" "lib"))
       (inputs
        `(("alexandria" ,sbcl-alexandria)
          ("cl-strings" ,sbcl-cl-strings)
@@ -352,26 +353,48 @@ GUI.  It is based on PyQt5 and QtWebKit.")
          ("cl-sqlite" ,sbcl-cl-sqlite)
          ("parenscript" ,sbcl-parenscript)
          ("cl-json" ,sbcl-cl-json)
-         ("unix-opts" ,sbcl-unix-opts)
-         ("cl-cffi-gtk" ,sbcl-cl-cffi-gtk)
-         ("cl-webkit" ,sbcl-cl-webkit)
-         ("lparallel" ,sbcl-lparallel)))
+         ("unix-opts" ,sbcl-unix-opts)))
       (arguments
        `( ;; #:tests? #f
          #:asd-file "next/next.asd"
-         #:asd-system-name "next/gtk"
-         #:phases
-         (modify-phases %standard-phases
-           (add-after 'create-symlinks 'build-program
-             (lambda* (#:key outputs #:allow-other-keys)
-               (build-program
-                (string-append (assoc-ref outputs "out") "/bin/next-browser")
-                outputs
-                #:entry-program '((next:start) 0)))))
-         ))
+         #:asd-system-name "next"))
       (home-page "http://next.atlas.engineer/")
       (synopsis "Emacs-inspired web browser in extensible in Common Lisp")
       (description "Next is a keyboard-oriented, extensible web-browser inspired
 by Emacs and designed for power users.  The application has familiar
 key-bindings, is fully configurable and extensible in Lisp.")
       (license license:expat))))
+
+(define-public next-browser
+  (package
+    (inherit next-browser-core)
+    (name "next-browser")
+    (outputs '("out" "lib"))
+    (inputs
+     `(("next" ,next-browser-core)
+       ("cl-cffi-gtk" ,sbcl-cl-cffi-gtk)
+       ("cl-webkit" ,sbcl-cl-webkit)
+       ("lparallel" ,sbcl-lparallel)))
+    (arguments
+     (substitute-keyword-arguments (package-arguments next-browser-core)
+       ((#:asd-system-name _ #f) "next/gtk")
+       ((#:phases phases '%standard-phases)
+        `(modify-phases ,phases
+           (add-before 'cleanup 'move-bundle
+             (lambda* (#:key outputs #:allow-other-keys)
+               (define lib (assoc-ref outputs "lib"))
+               (define actual-fasl (string-append
+                                    lib
+                                    "/lib/sbcl/next/source/next-gtk.fasl"))
+               (define expected-fasl (string-append
+                                      lib
+                                      "/lib/sbcl/gtk--system.fasl"))
+               (copy-file actual-fasl expected-fasl)
+               #t))
+           (add-after 'create-symlinks 'build-program
+             (lambda* (#:key outputs #:allow-other-keys)
+               (build-program
+                (string-append (assoc-ref outputs "out") "/bin/next-browser")
+                outputs
+                #:entry-program '((next:start) 0)
+                #:dependencies '("next-gtk"))))))))))
-- 
2.19.1

  reply	other threads:[~2018-10-15  6:06 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-19  7:15 bug#32769: Packaging Next browser (Common Lisp) [work in progress] Pierre Neidhardt
2018-10-10 13:21 ` Pierre Neidhardt
2018-10-11  7:16   ` Andy Patterson
2018-10-11  8:50     ` Pierre Neidhardt
2018-10-11 10:44       ` Pierre Neidhardt
2018-10-12  5:51         ` Andy Patterson
2018-10-12  6:44           ` Pierre Neidhardt
2018-10-12 22:25             ` Andy Patterson
2018-10-14  8:27               ` Pierre Neidhardt
2018-10-15  6:05                 ` Andy Patterson [this message]
2018-10-15  9:34                   ` Pierre Neidhardt
2018-10-15 10:04                     ` Pierre Neidhardt
2018-10-16  3:11                     ` Andy Patterson
2018-10-19 16:05                       ` Pierre Neidhardt

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=20181015020505.2387a8c7@mailservices.uwaterloo.ca \
    --to=ajpatter@uwaterloo.ca \
    --cc=32769@debbugs.gnu.org \
    --cc=mail@ambrevar.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).