Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactoring: project structure #4

Closed
wants to merge 5 commits into from

Conversation

shegeley
Copy link
Contributor

@shegeley shegeley commented Aug 15, 2023

Accomplishments:

  1. Changed project structure:
  • Moved all .c code to libguile-wayland and all .scm to /modules as in other .scm + .c projects (see guile-ssh, guile-xosd ...)
  • Partitioned makefiles accordingly
  1. Changed guix.scm and a way that load extension (coped from guile-ssh). Now it can be build successfully with guix build -f guix.scm
  2. example/... are now ....scm.in and included in configure.ac

Problems: after build with guix build -f guix.scm I couldn't load (bytestructure-class) extension.

shegeley@zone51 ~/Projects/guile-wayland$ guix build -f guix.scm 
/gnu/store/5m4y8mfxdb4bsbmjy6gjxmkaqmbra8i3-guile-wayland-0.0.2
...
shegeley@zone51 /gnu/store/5m4y8mfxdb4bsbmjy6gjxmkaqmbra8i3-guile-wayland-0.0.2$ tree .
.
├── lib
│   ├── guile
│   │   └── 3.0
│   │       └── site-ccache
│   │           ├── wayland
│   │           │   ├── argument.go
│   │           │   ├── base.go
│   │           │   ├── client
│   │           │   │   ├── display.go
│   │           │   │   └── protocol
│   │           │   │       ├── wayland.go
│   │           │   │       └── xdg-shell.go
│   │           │   ├── config.go
│   │           │   ├── cursor.go
│   │           │   ├── egl.go
│   │           │   ├── event-loop.go
│   │           │   ├── interface.go
│   │           │   ├── list.go
│   │           │   ├── proxy.go
│   │           │   ├── scanner.go
│   │           │   ├── server
│   │           │   │   ├── client.go
│   │           │   │   ├── display.go
│   │           │   │   ├── global.go
│   │           │   │   ├── listener.go
│   │           │   │   ├── protocol
│   │           │   │   │   └── wayland.go
│   │           │   │   └── resource.go
│   │           │   ├── shm.go
│   │           │   ├── signal.go
│   │           │   └── util.go
│   │           └── wayland.go
│   ├── libguile-wayland.la
│   ├── libguile-wayland.so -> libguile-wayland.so.0.0.0
│   ├── libguile-wayland.so.0 -> libguile-wayland.so.0.0.0
│   └── libguile-wayland.so.0.0.0
└── share
    ├── doc
    │   └── guile-wayland-0.0.2
    │       └── COPYING
    └── guile
        └── site
            └── 3.0
                ├── wayland
                │   ├── argument.scm
                │   ├── base.scm
                │   ├── client
                │   │   ├── display.scm
                │   │   └── protocol
                │   │       ├── wayland.scm
                │   │       └── xdg-shell.scm
                │   ├── config.scm
                │   ├── cursor.scm
                │   ├── egl.scm
                │   ├── event-loop.scm
                │   ├── interface.scm
                │   ├── list.scm
                │   ├── proxy.scm
                │   ├── scanner.scm
                │   ├── server
                │   │   ├── client.scm
                │   │   ├── display.scm
                │   │   ├── global.scm
                │   │   ├── listener.scm
                │   │   ├── protocol
                │   │   │   └── wayland.scm
                │   │   └── resource.scm
                │   ├── shm.scm
                │   ├── signal.scm
                │   └── util.scm
                └── wayland.scm

21 directories, 51 files
shegeley@zone51 /gnu/store/5m4y8mfxdb4bsbmjy6gjxmkaqmbra8i3-guile-wayland-0.0.2$ guile -L share/guile/site/3.0/
GNU Guile 3.0.9
Copyright (C) 1995-2023 Free Software Foundation, Inc.

Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
This program is free software, and you are welcome to redistribute it
under certain conditions; type `,show c' for details.

Enter `,help' for help.
scheme@(guile-user)> ,m (bytestructures guile)
scheme@(bytestructures guile)> ,b
cstring-pointer         #<variable 7f9f3008ab60 value: #<bytestructure-descriptor 0x7f9f2ffc30c0>>
scheme@(bytestructures guile)> ,m (wayland)
;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0
;;;       or pass the --no-auto-compile argument to disable.
;;; compiling share/guile/site/3.0/wayland.scm
;;; compiling share/guile/site/3.0/wayland/config.scm
;;; compiled /home/shegeley/.cache/guile/ccache/3.0-LE-8-4.6/gnu/store/5m4y8mfxdb4bsbmjy6gjxmkaqmbra8i3-guile-wayland-0.0.2/share/guile/site/3.0/wayland/config.scm.go
;;; compiling share/guile/site/3.0/wayland/cursor.scm
;;; compiled /home/shegeley/.cache/guile/ccache/3.0-LE-8-4.6/gnu/store/5m4y8mfxdb4bsbmjy6gjxmkaqmbra8i3-guile-wayland-0.0.2/share/guile/site/3.0/wayland/cursor.scm.go
;;; compiling share/guile/site/3.0/wayland/egl.scm
;;; compiled /home/shegeley/.cache/guile/ccache/3.0-LE-8-4.6/gnu/store/5m4y8mfxdb4bsbmjy6gjxmkaqmbra8i3-guile-wayland-0.0.2/share/guile/site/3.0/wayland/egl.scm.go
;;; compiling share/guile/site/3.0/wayland/event-loop.scm
;;; compiling share/guile/site/3.0/wayland/base.scm
;;; WARNING: compilation of share/guile/site/3.0/wayland/base.scm failed:
;;; no code for module (bytestructure-class)
;;; WARNING: compilation of share/guile/site/3.0/wayland/event-loop.scm failed:
;;; no code for module (bytestructure-class)
;;; compiling share/guile/site/3.0/wayland/util.scm
;;; WARNING: compilation of share/guile/site/3.0/wayland/util.scm failed:
;;; no code for module (bytestructure-class)
;;; WARNING: compilation of share/guile/site/3.0/wayland.scm failed:
;;; no code for module (bytestructure-class)
;;; compiling share/guile/site/3.0/wayland/interface.scm
;;; WARNING: compilation of share/guile/site/3.0/wayland/interface.scm failed:
;;; no code for module (bytestructure-class)
While executing meta-command:
no code for module (bytestructure-class)

@Z572
Copy link
Member

Z572 commented Aug 15, 2023

push at 08a5b82 ,
and change some:

  • guix.scm phase no end with #t
  • Makefile.am build libguile-wayland before modules/wayland
  • pre-inst-env.in not $(abs_top_builddir), just $abs_top_builddir
  • examples add --no-auto-compile -e main at head
  • configure.ac chmod +x for exampels.

Problems: after build with guix build -f guix.scm I couldn't load (bytestructure-class) extension.

because it is propagated-inputs, so just use guix shell guile -f guix.scm -- guile , guix will add guile-bytestructure-class to profile,and then you can use ,use (wayland).

@Z572 Z572 closed this Aug 15, 2023
@Z572
Copy link
Member

Z572 commented Aug 15, 2023

(bytestructures guile) beacuse guix propagated guile-git , guile-git propagated guile-bytestructures

@shegeley
Copy link
Contributor Author

shegeley commented Aug 15, 2023

Excuse me. I didn't «get and change some...». Would you like me to change all the listed back?

Makefile.am build libguile-wayland before modules/wayland

Yes. It is how it works in some other modules I saw (guile-ssh, guile-xosd). First the build libguile-x.la and then uses it in modules

@shegeley
Copy link
Contributor Author

shegeley commented Aug 15, 2023

Are you sure that (bytestructure-class) is packed properly?
On the latest master (with propagated-inputs) I get

shegeley@zone51 ~/Projects/guile-wayland$ guix shell guile -f guix.scm -- guile
GNU Guile 3.0.9
Copyright (C) 1995-2023 Free Software Foundation, Inc.

Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
This program is free software, and you are welcome to redistribute it
under certain conditions; type `,show c' for details.

Enter `,help' for help.
scheme@(guile-user)> ,m (wayland)
While executing meta-command:
no code for module (bytestructure-class)

@Z572
Copy link
Member

Z572 commented Aug 15, 2023

I didn't get and change some.... Would you like me to change all the listed back?

no, I added these changes at commit time.

@Z572
Copy link
Member

Z572 commented Aug 15, 2023

emm, it works for me, maybe need guix shell guile -f guix.scm --rebuild-cache -- guile
图片

@shegeley
Copy link
Contributor Author

guix shell guile -f guix.scm --rebuild-cache -- guile

Absolutely. Thanks a lot. The problem was in cache.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants