all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#32769: Packaging Next browser (Common Lisp) [work in progress]
@ 2018-09-19  7:15 Pierre Neidhardt
  2018-10-10 13:21 ` Pierre Neidhardt
  0 siblings, 1 reply; 14+ messages in thread
From: Pierre Neidhardt @ 2018-09-19  7:15 UTC (permalink / raw)
  To: 32769

[-- Attachment #1: Type: text/plain, Size: 234 bytes --]

I've started working on packaging a collection of Common Lisp
dependencies for Next browser:

http://next.atlas.engineer/

My progress can be found on the wip-next-browser branch.

-- 
Pierre Neidhardt
https://ambrevar.xyz/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#32769: Packaging Next browser (Common Lisp) [work in progress]
  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
  0 siblings, 1 reply; 14+ messages in thread
From: Pierre Neidhardt @ 2018-10-10 13:21 UTC (permalink / raw)
  To: 32769

[-- Attachment #1: Type: text/plain, Size: 8076 bytes --]

The good news: all Next browser dependencies are now packaged under the
branch wip-nextbrowser.

The bad news: Next browser fails to build.

--8<---------------cut here---------------start------------->8---
; compiling file "/gnu/store/39vh5ghdn9x7zwb6ky7law678wkz20l2-next-browser-0.0.8-1.ccc289b/share/common-lisp/sbcl-source/next/gtk/next/source/document-mode.lisp" (written 10 OCT 2018 01:12:05 PM):
; compiling (IN-PACKAGE :NEXT)
; compiling (DEFVAR *DOCUMENT-MODE-MAP* ...)
; compiling (DEFCLASS DOCUMENT-MODE ...)
; compiling (DEFPARENSTATIC SCROLL-TO-TOP ...)
; compiling (DEFPARENSTATIC SCROLL-TO-BOTTOM ...)
; compiling (DEFPARENSTATIC SCROLL-DOWN ...)
; compiling (DEFPARENSTATIC SCROLL-UP ...)
; compiling (DEFPARENSTATIC SCROLL-LEFT ...)
; compiling (DEFPARENSTATIC SCROLL-RIGHT ...)
; compiling (DEFUN ENSURE-ZOOM-RATIO-RANGE ...)
; compiling (DEFPAREN %ZOOM-IN-PAGE ...)
; compiling (DEFINE-COMMAND ZOOM-IN-PAGE ...)
; compiling (DEFPAREN %ZOOM-OUT-PAGE ...)
; compiling (DEFINE-COMMAND ZOOM-OUT-PAGE ...)
; compiling (DEFPAREN %UNZOOM-PAGE ...)
; compiling (DEFINE-COMMAND UNZOOM-PAGE ...)
; compiling (DEFINE-COMMAND HISTORY-BACKWARDS ...)
; compiling (DEFINE-COMMAND HISTORY-FORWARDS ...)
; compiling (DEFUN HISTORY-FOWARDS-QUERY-COMPLETE ...)
; compiling (DEFINE-COMMAND HISTORY-FORWARDS-QUERY ...)
; compiling (DEFUN ADD-OR-TRAVERSE-HISTORY ...)
; compiling (DEFINE-COMMAND SET-URL-NEW-BUFFER ...)
; compiling (DEFUN SET-URL-BUFFER ...)
; compiling (DEFUN SET-URL-NEW-BUFFER ...)
; file: /gnu/store/39vh5ghdn9x7zwb6ky7law678wkz20l2-next-browser-0.0.8-1.ccc289b/share/common-lisp/sbcl-source/next/gtk/next/source/document-mode.lisp
; in: DEFUN SET-URL-NEW-BUFFER
;     (DEFUN NEXT::SET-URL-NEW-BUFFER
;            (NEXT::INPUT-URL &OPTIONAL NEXT::DISABLE-HISTORY)
;       (LET ((NEXT::NEW-BUFFER (NEXT::GENERATE-NEW-BUFFER "default" #)))
;         (NEXT::SET-VISIBLE-ACTIVE-BUFFER NEXT::NEW-BUFFER)
;         (NEXT::SET-URL-BUFFER NEXT::INPUT-URL NEXT::NEW-BUFFER
;          NEXT::DISABLE-HISTORY)))
; --> PROGN
; ==>
;   (EVAL-WHEN (:COMPILE-TOPLEVEL)
;     (SB-C:%COMPILER-DEFUN 'NEXT::SET-URL-NEW-BUFFER NIL T))
;
; caught WARNING:
;   Duplicate definition for SET-URL-NEW-BUFFER found in one file.
;   See also:
;     The ANSI Standard, Section 3.2.2.3

; compiling (DEFUN SETUP-URL ...)
; compiling (DEFUN SET-URL ...)
; compiling (DEFINE-COMMAND SET-URL-CURRENT-BUFFER ...)
; compiling (DEFINE-COMMAND SET-URL-FROM-BOOKMARK ...)
; compiling (DEFUN SETUP-ANCHOR ...)
; compiling (DEFINE-COMMAND GO-ANCHOR ...)
; compiling (DEFINE-COMMAND GO-ANCHOR-NEW-BUFFER ...)
; compiling (DEFINE-COMMAND GO-ANCHOR-NEW-BUFFER-FOCUS ...)
; compiling (DEFUN DOCUMENT-MODE ...)
; compiling (DEFMETHOD SETUP ...)

; /gnu/store/39vh5ghdn9x7zwb6ky7law678wkz20l2-next-browser-0.0.8-1.ccc289b/lib/sbcl/next/source/document-mode-tmpOPCILR65.fasl written
; compilation finished in 0:00:00.058
Unhandled UIOP/LISP-BUILD:COMPILE-FILE-ERROR in thread #<SB-THREAD:THREAD "main thread" RUNNING
                                                          {10005585B3}>:
  COMPILE-FILE-ERROR while compiling #<CL-SOURCE-FILE "next" "document-mode">

Backtrace for: #<SB-THREAD:THREAD "main thread" RUNNING {10005585B3}>
0: (SB-DEBUG::DEBUGGER-DISABLED-HOOK #<UIOP/LISP-BUILD:COMPILE-FILE-ERROR {1004DDACA3}> #<unused argument> :QUIT T)
1: (SB-DEBUG::RUN-HOOK *INVOKE-DEBUGGER-HOOK* #<UIOP/LISP-BUILD:COMPILE-FILE-ERROR {1004DDACA3}>)
2: (INVOKE-DEBUGGER #<UIOP/LISP-BUILD:COMPILE-FILE-ERROR {1004DDACA3}>)
3: (ERROR UIOP/LISP-BUILD:COMPILE-FILE-ERROR :CONTEXT-FORMAT "~/asdf-action::format-action/" :CONTEXT-ARGUMENTS ((#<ASDF/LISP-ACTION:COMPILE-OP > . #<ASDF/LISP-ACTION:CL-SOURCE-FILE "next" "document-mode">)))
4: (UIOP/LISP-BUILD:CHECK-LISP-COMPILE-RESULTS NIL T T "~/asdf-action::format-action/" ((#<ASDF/LISP-ACTION:COMPILE-OP > . #<ASDF/LISP-ACTION:CL-SOURCE-FILE "next" "document-mode">)))
5: ((SB-PCL::EMF ASDF/ACTION:PERFORM) #<unused argument> #<unused argument> #<ASDF/LISP-ACTION:COMPILE-OP > #<ASDF/LISP-ACTION:CL-SOURCE-FILE "next" "document-mode">)
6: ((LAMBDA NIL :IN ASDF/ACTION:CALL-WHILE-VISITING-ACTION))
7: ((:METHOD ASDF/ACTION:PERFORM-WITH-RESTARTS :AROUND (T T)) #<ASDF/LISP-ACTION:COMPILE-OP > #<ASDF/LISP-ACTION:CL-SOURCE-FILE "next" "document-mode">) [fast-method]
8: ((:METHOD ASDF/PLAN:PERFORM-PLAN (T)) #<ASDF/PLAN:SEQUENTIAL-PLAN {1002497DE3}>) [fast-method]
9: ((FLET SB-C::WITH-IT :IN SB-C::%WITH-COMPILATION-UNIT))
10: ((:METHOD ASDF/PLAN:PERFORM-PLAN :AROUND (T)) #<ASDF/PLAN:SEQUENTIAL-PLAN {1002497DE3}>) [fast-method]
11: ((:METHOD ASDF/OPERATE:OPERATE (ASDF/OPERATION:OPERATION ASDF/COMPONENT:COMPONENT)) #<ASDF/BUNDLE:COMPILE-BUNDLE-OP > #<ASDF/SYSTEM:SYSTEM "next/gtk"> :PLAN-CLASS NIL :PLAN-OPTIONS NIL) [fast-method]
12: ((SB-PCL::EMF ASDF/OPERATE:OPERATE) #<unused argument> #<unused argument> #<ASDF/BUNDLE:COMPILE-BUNDLE-OP > #<ASDF/SYSTEM:SYSTEM "next/gtk">)
13: ((LAMBDA NIL :IN ASDF/OPERATE:OPERATE))
14: ((:METHOD ASDF/OPERATE:OPERATE :AROUND (T T)) #<ASDF/BUNDLE:COMPILE-BUNDLE-OP > #<ASDF/SYSTEM:SYSTEM "next/gtk">) [fast-method]
15: ((SB-PCL::EMF ASDF/OPERATE:OPERATE) #<unused argument> #<unused argument> ASDF/BUNDLE:COMPILE-BUNDLE-OP "next/gtk")
16: ((LAMBDA NIL :IN ASDF/OPERATE:OPERATE))
17: ((:METHOD ASDF/OPERATE:OPERATE :AROUND (T T)) ASDF/BUNDLE:COMPILE-BUNDLE-OP "next/gtk") [fast-method]
18: (ASDF/SESSION:CALL-WITH-ASDF-SESSION #<CLOSURE (LAMBDA NIL :IN ASDF/OPERATE:OPERATE) {1002351FBB}> :OVERRIDE T :KEY NIL :OVERRIDE-CACHE T :OVERRIDE-FORCING NIL)
19: ((LAMBDA NIL :IN ASDF/OPERATE:OPERATE))
20: (ASDF/SESSION:CALL-WITH-ASDF-SESSION #<CLOSURE (LAMBDA NIL :IN ASDF/OPERATE:OPERATE) {1004329D1B}> :OVERRIDE NIL :KEY NIL :OVERRIDE-CACHE NIL :OVERRIDE-FORCING NIL)
21: ((:METHOD ASDF/OPERATE:OPERATE :AROUND (T T)) ASDF/BUNDLE:COMPILE-BUNDLE-OP "next/gtk") [fast-method]
22: (SB-INT:SIMPLE-EVAL-IN-LEXENV (ASDF/OPERATE:OPERATE (QUOTE ASDF/BUNDLE:COMPILE-BUNDLE-OP) "next/gtk") #<NULL-LEXENV>)
23: (EVAL (ASDF/OPERATE:OPERATE (QUOTE ASDF/BUNDLE:COMPILE-BUNDLE-OP) "next/gtk"))
24: (SB-IMPL::PROCESS-EVAL/LOAD-OPTIONS ((:EVAL . "(require :asdf)") (:EVAL . "(let ((*package* (find-package :asdf))) (load \"/gnu/store/39vh5ghdn9x7zwb6ky7law678wkz20l2-next-browser-0.0.8-1.ccc289b/share/common-lisp/sbcl-source/next/gtk/next/next.asd\"))") (:EVAL . "(asdf:operate (quote asdf:compile-bundle-op) \"next/gtk\")") (:QUIT)))
25: (SB-IMPL::TOPLEVEL-INIT)
26: ((FLET SB-UNIX::BODY :IN SAVE-LISP-AND-DIE))
27: ((FLET "WITHOUT-INTERRUPTS-BODY-27" :IN SAVE-LISP-AND-DIE))
28: ((LABELS SB-IMPL::RESTART-LISP :IN SAVE-LISP-AND-DIE))

unhandled condition in --disable-debugger mode, quitting
;
; compilation unit aborted
;   caught 1 fatal ERROR condition
;   caught 1 WARNING condition
;   caught 8 STYLE-WARNING conditions
Backtrace:
           7 (primitive-load "/gnu/store/6v5dy1rnk8m3h154q4c8mjwgq7y…")
In ice-9/eval.scm:
   191:35  6 (_ _)
In ice-9/boot-9.scm:
    152:2  5 (with-fluid* _ _ _)
    152:2  4 (with-fluid* _ _ _)
In srfi/srfi-1.scm:
    640:9  3 (for-each #<procedure 98e3a0 at /gnu/store/k4nbgbgygrv…> …)
In /gnu/store/k4nbgbgygrv0lk97d5phx8fwrxr0ah9r-module-import/guix/build/gnu-build-system.scm:
   799:31  2 (_ _)
In /gnu/store/k4nbgbgygrv0lk97d5phx8fwrxr0ah9r-module-import/guix/build/asdf-build-system.scm:
    124:4  1 (build #:outputs _ #:inputs _ #:asd-file _ # _)
In unknown file:
           0 (scm-error misc-error #f "~A ~S ~S" ("lisp-eval-pro…" …) …)

ERROR: In procedure scm-error:
lisp-eval-program failed! "/gnu/store/rdvy6q3nskb0r01rwjrxj3935d850r2d-sbcl-1.4.4/bin/sbcl" ((require :asdf) (let ((*package* (find-package :asdf))) (load "/gnu/store/39vh5ghdn9x7zwb6ky7law678wkz20l2-next-browser-0.0.8-1.ccc289b/share/common-lisp/sbcl-source/next/gtk/next/next.asd")) (asdf:operate (quote asdf:compile-bundle-op) "next/gtk"))
--8<---------------cut here---------------end--------------->8---

Andy, any clue on this?

--
Pierre Neidhardt
https://ambrevar.xyz/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#32769: Packaging Next browser (Common Lisp) [work in progress]
  2018-10-10 13:21 ` Pierre Neidhardt
@ 2018-10-11  7:16   ` Andy Patterson
  2018-10-11  8:50     ` Pierre Neidhardt
  0 siblings, 1 reply; 14+ messages in thread
From: Andy Patterson @ 2018-10-11  7:16 UTC (permalink / raw)
  To: Pierre Neidhardt; +Cc: 32769

Hi,

On Wed, 10 Oct 2018 15:21:26 +0200
Pierre Neidhardt <mail@ambrevar.xyz> wrote:

> The good news: all Next browser dependencies are now packaged under
> the branch wip-nextbrowser.
> 
> The bad news: Next browser fails to build.
> 
> [...]
> 
> Andy, any clue on this?

It's probably the

> ; caught WARNING:
> ;   Duplicate definition for SET-URL-NEW-BUFFER found in one file.

since sbcl (at least on guix?) treats some warnings as errors for some
reason.

Hoping that helps,

--
Andy

^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#32769: Packaging Next browser (Common Lisp) [work in progress]
  2018-10-11  7:16   ` Andy Patterson
@ 2018-10-11  8:50     ` Pierre Neidhardt
  2018-10-11 10:44       ` Pierre Neidhardt
  0 siblings, 1 reply; 14+ messages in thread
From: Pierre Neidhardt @ 2018-10-11  8:50 UTC (permalink / raw)
  To: Andy Patterson; +Cc: 32769

[-- Attachment #1: Type: text/plain, Size: 122 bytes --]

I'll try this.  Note that Next builds fine via Quicklisp.  Any idea why?

-- 
Pierre Neidhardt
https://ambrevar.xyz/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#32769: Packaging Next browser (Common Lisp) [work in progress]
  2018-10-11  8:50     ` Pierre Neidhardt
@ 2018-10-11 10:44       ` Pierre Neidhardt
  2018-10-12  5:51         ` Andy Patterson
  0 siblings, 1 reply; 14+ messages in thread
From: Pierre Neidhardt @ 2018-10-11 10:44 UTC (permalink / raw)
  To: Andy Patterson; +Cc: 32769

[-- Attachment #1: Type: text/plain, Size: 1902 bytes --]

You were right, this was the issue.  I've posted a patch upstream, it should be
fixed soon.

Now Next compiles.  Hurray!!! :D

There is one last step though: the .asd bunble works, but not the
"build-program".
See the wip-nextbrowser for what I've tried.  I've re-used the code from
Stumpwm.

I narrowed down the issue to the "generate-executable" function:

--8<---------------cut here---------------start------------->8---
define* (generate-executable out-file #:key
                              dependencies
                              dependency-prefixes
                              entry-program
                              type
                              #:allow-other-keys)
  "Generate an executable by using asdf operation TYPE, containing whithin the
image all DEPENDENCIES, and running ENTRY-PROGRAM in the case of an
executable.  Link in any asd files from DEPENDENCY-PREFIXES to ensure
references to those libraries are retained."
  let* ((bin-directory (dirname out-file))
         (name (basename out-file)))
    (mkdir-p bin-directory)
    (with-directory-excursion bin-directory
      (generate-executable-wrapper-system name dependencies)
      (generate-executable-entry-point name entry-program))
			...
--8<---------------cut here---------------end--------------->8---

The problem is that Next's system is called "next/gtk", but we cannot use that
as an out-file.  If I use something else, say "next", then compilation fails
with

--8<---------------cut here---------------start------------->8---
  Component :NEXT not found, required by #<SYSTEM "next-exec">
--8<---------------cut here---------------end--------------->8---

I guess there is a flaw in the logic here.  The system name should be

	#:asd-system-name

and not

	(name (basename out-file))

What shall we do?

-- 
Pierre Neidhardt
https://ambrevar.xyz/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#32769: Packaging Next browser (Common Lisp) [work in progress]
  2018-10-11 10:44       ` Pierre Neidhardt
@ 2018-10-12  5:51         ` Andy Patterson
  2018-10-12  6:44           ` Pierre Neidhardt
  0 siblings, 1 reply; 14+ messages in thread
From: Andy Patterson @ 2018-10-12  5:51 UTC (permalink / raw)
  To: Pierre Neidhardt; +Cc: 32769

Hi Pierre,

On Thu, 11 Oct 2018 12:44:43 +0200
Pierre Neidhardt <mail@ambrevar.xyz> wrote:

> You were right, this was the issue.  I've posted a patch upstream, it
> should be fixed soon.
> 
> Now Next compiles.  Hurray!!! :D

Nice.

> 
> There is one last step though: the .asd bunble works, but not the
> "build-program".
> See the wip-nextbrowser for what I've tried.  I've re-used the code
> from Stumpwm.
> 
> I narrowed down the issue to the "generate-executable" function:
> 
> [...]
> 
> The problem is that Next's system is called "next/gtk", but we cannot
> use that as an out-file.  If I use something else, say "next", then
> compilation fails with
> 
> --8<---------------cut here---------------start------------->8---
>   Component :NEXT not found, required by #<SYSTEM "next-exec">
> --8<---------------cut here---------------end--------------->8---
> 
> I guess there is a flaw in the logic here.  The system name should be
> 
> 	#:asd-system-name
> 
> and not
> 
> 	(name (basename out-file))
> 
> What shall we do?
> 

That seems right.  I guess we'll need to update that and then maybe
also normalize the generated asd.  Doesn't seem like it'd be too
difficult; there just weren't enough examples of program-generating
systems for this to get caught.

Thanks for the update,

--
Andy

^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#32769: Packaging Next browser (Common Lisp) [work in progress]
  2018-10-12  5:51         ` Andy Patterson
@ 2018-10-12  6:44           ` Pierre Neidhardt
  2018-10-12 22:25             ` Andy Patterson
  0 siblings, 1 reply; 14+ messages in thread
From: Pierre Neidhardt @ 2018-10-12  6:44 UTC (permalink / raw)
  To: Andy Patterson; +Cc: 32769

[-- Attachment #1: Type: text/plain, Size: 117 bytes --]

Let me know if you'd like to do it or if I should give it a shot :)

-- 
Pierre Neidhardt
https://ambrevar.xyz/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#32769: Packaging Next browser (Common Lisp) [work in progress]
  2018-10-12  6:44           ` Pierre Neidhardt
@ 2018-10-12 22:25             ` Andy Patterson
  2018-10-14  8:27               ` Pierre Neidhardt
  0 siblings, 1 reply; 14+ messages in thread
From: Andy Patterson @ 2018-10-12 22:25 UTC (permalink / raw)
  To: Pierre Neidhardt; +Cc: 32769

Hi,

On Fri, 12 Oct 2018 08:44:35 +0200
Pierre Neidhardt <mail@ambrevar.xyz> wrote:

> Let me know if you'd like to do it or if I should give it a shot :)
> 

Please feel free.  I'll probably get around to it this weekend if you
don't have time before then, if that's ok with you.

Thanks,

--
Andy

^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#32769: Packaging Next browser (Common Lisp) [work in progress]
  2018-10-12 22:25             ` Andy Patterson
@ 2018-10-14  8:27               ` Pierre Neidhardt
  2018-10-15  6:05                 ` Andy Patterson
  0 siblings, 1 reply; 14+ messages in thread
From: Pierre Neidhardt @ 2018-10-14  8:27 UTC (permalink / raw)
  To: Andy Patterson; +Cc: 32769

[-- Attachment #1: Type: text/plain, Size: 147 bytes --]

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

Cheers!

-- 
Pierre Neidhardt
https://ambrevar.xyz/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#32769: Packaging Next browser (Common Lisp) [work in progress]
  2018-10-14  8:27               ` Pierre Neidhardt
@ 2018-10-15  6:05                 ` Andy Patterson
  2018-10-15  9:34                   ` Pierre Neidhardt
  0 siblings, 1 reply; 14+ messages in thread
From: Andy Patterson @ 2018-10-15  6:05 UTC (permalink / raw)
  To: Pierre Neidhardt; +Cc: 32769

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

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* bug#32769: Packaging Next browser (Common Lisp) [work in progress]
  2018-10-15  6:05                 ` Andy Patterson
@ 2018-10-15  9:34                   ` Pierre Neidhardt
  2018-10-15 10:04                     ` Pierre Neidhardt
  2018-10-16  3:11                     ` Andy Patterson
  0 siblings, 2 replies; 14+ messages in thread
From: Pierre Neidhardt @ 2018-10-15  9:34 UTC (permalink / raw)
  To: Andy Patterson; +Cc: 32769

[-- Attachment #1: Type: text/plain, Size: 677 bytes --]

Hi Andy!

Thanks for the hard work, this is pretty elegant indeed!

Question: do we need both "out" and "lib" outputs?
My understanding is that "lib" is useful when one wants to start the program
from a REPL.  Correct?

> I wasn't able to really test whether or not it works - it throws an
> exception whenever I press a key.

Same here.  It does not do that when built manually with Quicklisp.  Although I
recall seeing something similar when building manually with the wrong arguments.

I also suspect that some CFFI dependency (gtk?) is not packaged correctly and
some paths are missing.

I'll look into it.

-- 
Pierre Neidhardt
https://ambrevar.xyz/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#32769: Packaging Next browser (Common Lisp) [work in progress]
  2018-10-15  9:34                   ` Pierre Neidhardt
@ 2018-10-15 10:04                     ` Pierre Neidhardt
  2018-10-16  3:11                     ` Andy Patterson
  1 sibling, 0 replies; 14+ messages in thread
From: Pierre Neidhardt @ 2018-10-15 10:04 UTC (permalink / raw)
  To: Andy Patterson; +Cc: 32769

[-- Attachment #1: Type: text/plain, Size: 139 bytes --]

It could also be a dependency version that's different from the one pulled by
Quicklisp.

-- 
Pierre Neidhardt
https://ambrevar.xyz/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#32769: Packaging Next browser (Common Lisp) [work in progress]
  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
  1 sibling, 1 reply; 14+ messages in thread
From: Andy Patterson @ 2018-10-16  3:11 UTC (permalink / raw)
  To: Pierre Neidhardt; +Cc: 32769

Hi Pierre,

On Mon, 15 Oct 2018 11:34:14 +0200
Pierre Neidhardt <mail@ambrevar.xyz> wrote:

> Question: do we need both "out" and "lib" outputs?
> My understanding is that "lib" is useful when one wants to start the
> program from a REPL.  Correct?

"out" will always depend on "lib" for programs.  We want to build it
the same way as other systems so that all of the source for the
program remains inspect-able at run-time, even if it's just a
one-liner.

--
Andy

^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#32769: Packaging Next browser (Common Lisp) [work in progress]
  2018-10-16  3:11                     ` Andy Patterson
@ 2018-10-19 16:05                       ` Pierre Neidhardt
  0 siblings, 0 replies; 14+ messages in thread
From: Pierre Neidhardt @ 2018-10-19 16:05 UTC (permalink / raw)
  To: Andy Patterson; +Cc: 32769

[-- Attachment #1: Type: text/plain, Size: 620 bytes --]

I haven't managed to figure what's happening.  According to John Mercouris (Next
developer), the state of CFFI-GTK is rather poor and it will be hard to track
down exactly what's wrong.

Next browser will soon move to another interface which does not rely on cffi-gtk
so it won't be a problem.

Andy, if you have an immediate solution, feel free to chime in, otherwise Next
will have to wait a few more weeks before hitting the Guix repository.

I've merged all the 78 (?) new Lisp packages onto master.
I've moved the Next package draft to wip-next-browser3.

-- 
Pierre Neidhardt
https://ambrevar.xyz/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2018-10-19 16:06 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.