* Make a library installable?
@ 2019-05-12 14:50 HiPhish
2019-05-12 20:18 ` Make a library installable? → conf Arne Babenhauserheide
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: HiPhish @ 2019-05-12 14:50 UTC (permalink / raw)
To: guile-user
Hello Schemers,
A while ago I presented my MessagePack implementation for Guile[1] here and I
want to make it available to users. Guile has no dedicated package manager, so
it's either manual or Guix, and I would like to support both. What it the best
way of doing it?
So far I have a repository that can be used right away with Guile by adding
its path to the load path. This is handy for testing and working where I just
just invoke Guile as `guile -L .`. For more permanent installation I have a
makefile, it "builds" everything into `./build` (i.e. inside the repo) and from
there the user could copy-paste the files into the desired directory.
I was thinking of adding an "install" target to the makefile which would copy
the directory structure of `./build` to the directory given by `$PREFIX`. The
user could then type
make lib doc && make PREFIX=/usr/local install
to get everything installed globally. A package manager like Guix could just
specify a different `PREFIX`.
Is this reasonable? And where exactly should the Guile code be placed? I have
$(PREFIX)/share/guile/site/$(guile_ver)/msgpack
as the directory for now. The value of `$guile_ver` is determined
automatically at build time:
guile_ver = $(shell $(GUILE) -c '(display (effective-version))')
This would only make the module available for Guile 2.2, no other version. Is
there a better directory?
I guess I could use GNU Autotools instead of a manually written makefile, but I
would rather stick to what I know and is simple for such a simple project.
[1] https://gitlab.com/HiPhish/guile-msgpack
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Make a library installable? → conf
2019-05-12 14:50 Make a library installable? HiPhish
@ 2019-05-12 20:18 ` Arne Babenhauserheide
2019-05-12 20:50 ` Arne Babenhauserheide
2019-05-12 22:23 ` Make a library installable? amirouche
2019-05-15 17:31 ` Catonano
2 siblings, 1 reply; 7+ messages in thread
From: Arne Babenhauserheide @ 2019-05-12 20:18 UTC (permalink / raw)
To: guile-user
[-- Attachment #1: Type: text/plain, Size: 1643 bytes --]
HiPhish <hiphish@posteo.de> writes:
> Hello Schemers,
>
> A while ago I presented my MessagePack implementation for Guile[1] here and I
> want to make it available to users. Guile has no dedicated package manager, so
> it's either manual or Guix, and I would like to support both. What it the best
> way of doing it?
…
> I guess I could use GNU Autotools instead of a manually written makefile, but I
> would rather stick to what I know and is simple for such a simple project.
The best way I see is actually the full autotools toolchain. If you
write the simple thing, you’ll eventually be implementing all the
autotools stuff yourself, down to cross-compilation and other dark
corners, which is likely to be more work than going the autotools route.
If you want to avoid going through manual setup, you could give my conf
tool a try: it creates a basic autotools setup you can modify.
conf new myproj --lang guile
cd myproj
./bootstrap.sh && ./configure --prefix ~/.local && make && make install
cd /; guile -c '(import (myproj hello))(hello-world)'; cd -
It isn’t perfect yet, but it should have you set up within minutes.
It also gives the user easy-to-use uninstall:
make uninstall
See https://bitbucket.org/ArneBab/conf/
Get it via
wget https://bitbucket.org/ArneBab/conf/downloads/conf-0.2.2.tar.gz && tar xf conf-0.2.2.tar.gz && cd conf-0.2.2 && ./bootstrap.sh && ./configure --prefix ~/.local && make && make install
> [1] https://gitlab.com/HiPhish/guile-msgpack
Best wishes,
Arne
--
Unpolitisch sein
heißt politisch sein
ohne es zu merken
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 1076 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Make a library installable? → conf
2019-05-12 20:18 ` Make a library installable? → conf Arne Babenhauserheide
@ 2019-05-12 20:50 ` Arne Babenhauserheide
0 siblings, 0 replies; 7+ messages in thread
From: Arne Babenhauserheide @ 2019-05-12 20:50 UTC (permalink / raw)
To: guile-user
[-- Attachment #1: Type: text/plain, Size: 572 bytes --]
Arne Babenhauserheide <arne_bab@web.de> writes:
> wget https://bitbucket.org/ArneBab/conf/downloads/conf-0.2.2.tar.gz && tar xf conf-0.2.2.tar.gz && cd conf-0.2.2 && ./bootstrap.sh && ./configure --prefix ~/.local && make && make install
Better use 0.2.3, that resolves some annoyances:
wget https://bitbucket.org/ArneBab/conf/downloads/conf-0.2.3.tar.gz && tar xf conf-0.2.3.tar.gz && cd conf-0.2.3 && ./bootstrap.sh && ./configure --prefix ~/.local && make && make install
Best wishes,
Arne
--
Unpolitisch sein
heißt politisch sein
ohne es zu merken
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 1076 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Make a library installable?
2019-05-12 14:50 Make a library installable? HiPhish
2019-05-12 20:18 ` Make a library installable? → conf Arne Babenhauserheide
@ 2019-05-12 22:23 ` amirouche
2019-05-13 22:22 ` HiPhish
2019-05-15 17:31 ` Catonano
2 siblings, 1 reply; 7+ messages in thread
From: amirouche @ 2019-05-12 22:23 UTC (permalink / raw)
To: HiPhish; +Cc: guile-user, guile-user
On 2019-05-12 16:50, HiPhish wrote:
> Hello Schemers,
>
> A while ago I presented my MessagePack implementation for Guile[1] here
> and I
> want to make it available to users.
> Guile has no dedicated package manager,
I use guile as my package manager, It is easy enough to install.
And Since I keep GUIX environment variable in a dedicated file
it doesn't interfere with the host environment. Basically, I have
no problem with guix.
> so it's either manual or Guix, and I would like to support both. What
> it the best way of doing it?
Yeah manual is good enough. Also, guix has guile-build-system
that doesn't require autotools.
Here is the package definition for a small single file project
that required to dynamicly load a shared library:
(define-public guile-termbox
(package
(name "guile-termbox")
(version "0.1.1")
(home-page "https://git.sr.ht/~amz3/guile-termbox")
(source (origin
(method git-fetch)
(uri (git-reference
(url home-page)
(commit
"8d43b12799bc1967b12cf0e86b4c323c1e251cb4")))
(sha256
(base32
"1wc2246gg0dg5g7f7djrl0jy7dvzkjhw0idmijwvnd9r1dgksacq"))
(file-name (string-append name "-" version "-checkout"))))
(build-system guile-build-system)
(arguments
'(#:phases (modify-phases %standard-phases
(add-before 'build 'patch
(lambda* (#:key inputs #:allow-other-keys)
(let* ((libtermbox (assoc-ref inputs "termbox")))
(substitute* "termbox.scm"
(("@LIBTERMBOX@")
(format #f "~a/lib/libtermbox.so" libtermbox)))
#t))))))
(inputs
`(("guile" ,guile-2.2)
("termbox" ,termbox-truecolor)))
(propagated-inputs
`(("guile-bytestructures" ,guile-bytestructures)))
(synopsis "GNU Guile bindings for termbox")
(description "GNU Guile bindings for termbox")
(license license:lgpl3+)))
https://git.sr.ht/~amz3/guix-amz3-channel/tree/master/amz3/termbox.scm#L40
Hope This Helps,
Amirouche ~ amz3
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Make a library installable?
2019-05-12 22:23 ` Make a library installable? amirouche
@ 2019-05-13 22:22 ` HiPhish
2019-05-14 10:57 ` Amirouche Boubekki
0 siblings, 1 reply; 7+ messages in thread
From: HiPhish @ 2019-05-13 22:22 UTC (permalink / raw)
To: amirouche; +Cc: guile-user
Oh cool, I did not know about guile-build-system, that one must be new? I am
not seeing anything about it also compiling and installing Info documentation
though.
On Monday, 13 May 2019 00:23:31 CEST you wrote:
> On 2019-05-12 16:50, HiPhish wrote:
> > Hello Schemers,
> >
> > A while ago I presented my MessagePack implementation for Guile[1] here
> > and I
> > want to make it available to users.
> >
> > Guile has no dedicated package manager,
>
> I use guile as my package manager, It is easy enough to install.
> And Since I keep GUIX environment variable in a dedicated file
> it doesn't interfere with the host environment. Basically, I have
> no problem with guix.
>
> > so it's either manual or Guix, and I would like to support both. What
> > it the best way of doing it?
>
> Yeah manual is good enough. Also, guix has guile-build-system
> that doesn't require autotools.
>
> Here is the package definition for a small single file project
> that required to dynamicly load a shared library:
>
> (define-public guile-termbox
> (package
> (name "guile-termbox")
> (version "0.1.1")
> (home-page "https://git.sr.ht/~amz3/guile-termbox")
> (source (origin
> (method git-fetch)
> (uri (git-reference
> (url home-page)
> (commit
> "8d43b12799bc1967b12cf0e86b4c323c1e251cb4")))
> (sha256
> (base32
> "1wc2246gg0dg5g7f7djrl0jy7dvzkjhw0idmijwvnd9r1dgksacq"))
> (file-name (string-append name "-" version "-checkout"))))
> (build-system guile-build-system)
> (arguments
> '(#:phases (modify-phases %standard-phases
> (add-before 'build 'patch
> (lambda* (#:key inputs #:allow-other-keys)
> (let* ((libtermbox (assoc-ref inputs "termbox")))
> (substitute* "termbox.scm"
> (("@LIBTERMBOX@")
> (format #f "~a/lib/libtermbox.so" libtermbox)))
> #t))))))
> (inputs
> `(("guile" ,guile-2.2)
> ("termbox" ,termbox-truecolor)))
> (propagated-inputs
> `(("guile-bytestructures" ,guile-bytestructures)))
> (synopsis "GNU Guile bindings for termbox")
> (description "GNU Guile bindings for termbox")
> (license license:lgpl3+)))
>
> https://git.sr.ht/~amz3/guix-amz3-channel/tree/master/amz3/termbox.scm#L40
>
> Hope This Helps,
>
>
> Amirouche ~ amz3
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Make a library installable?
2019-05-13 22:22 ` HiPhish
@ 2019-05-14 10:57 ` Amirouche Boubekki
0 siblings, 0 replies; 7+ messages in thread
From: Amirouche Boubekki @ 2019-05-14 10:57 UTC (permalink / raw)
To: HiPhish; +Cc: Guile User
Le mar. 14 mai 2019 à 06:42, HiPhish <hiphish@posteo.de> a écrit :
> Oh cool, I did not know about guile-build-system, that one must be new?
Yes, it somewhat new. Here is the code of it
http://git.savannah.gnu.org/cgit/guix.git/tree/guix/build-system/guile.scm
> I am not seeing anything about it also compiling and installing Info
> documentation
> though.
>
AFAIU it must be done in a specific step. Look at
http://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/guile-xyz.scm
for instance guile-pfds as a step that does rename files from .sls to .scm
before building.
Computing is most of the time coding on top of existing infrastructure.
autotools is no different. It has its quirks,
but it works.
[0] I can setup a repository using autotools for bindings and pure guile
modules
> On Monday, 13 May 2019 00:23:31 CEST you wrote:
> > On 2019-05-12 16:50, HiPhish wrote:
> > > Hello Schemers,
> > >
> > > A while ago I presented my MessagePack implementation for Guile[1] here
> > > and I
> > > want to make it available to users.
> > >
> > > Guile has no dedicated package manager,
> >
> > I use guile as my package manager, It is easy enough to install.
> > And Since I keep GUIX environment variable in a dedicated file
> > it doesn't interfere with the host environment. Basically, I have
> > no problem with guix.
> >
> > > so it's either manual or Guix, and I would like to support both. What
> > > it the best way of doing it?
> >
> > Yeah manual is good enough. Also, guix has guile-build-system
> > that doesn't require autotools.
> >
> > Here is the package definition for a small single file project
> > that required to dynamicly load a shared library:
> >
> > (define-public guile-termbox
> > (package
> > (name "guile-termbox")
> > (version "0.1.1")
> > (home-page "https://git.sr.ht/~amz3/guile-termbox")
> > (source (origin
> > (method git-fetch)
> > (uri (git-reference
> > (url home-page)
> > (commit
> > "8d43b12799bc1967b12cf0e86b4c323c1e251cb4")))
> > (sha256
> > (base32
> > "1wc2246gg0dg5g7f7djrl0jy7dvzkjhw0idmijwvnd9r1dgksacq"))
> > (file-name (string-append name "-" version "-checkout"))))
> > (build-system guile-build-system)
> > (arguments
> > '(#:phases (modify-phases %standard-phases
> > (add-before 'build 'patch
> > (lambda* (#:key inputs #:allow-other-keys)
> > (let* ((libtermbox (assoc-ref inputs "termbox")))
> > (substitute* "termbox.scm"
> > (("@LIBTERMBOX@")
> > (format #f "~a/lib/libtermbox.so" libtermbox)))
> > #t))))))
> > (inputs
> > `(("guile" ,guile-2.2)
> > ("termbox" ,termbox-truecolor)))
> > (propagated-inputs
> > `(("guile-bytestructures" ,guile-bytestructures)))
> > (synopsis "GNU Guile bindings for termbox")
> > (description "GNU Guile bindings for termbox")
> > (license license:lgpl3+)))
> >
> >
> https://git.sr.ht/~amz3/guix-amz3-channel/tree/master/amz3/termbox.scm#L40
> >
> > Hope This Helps,
> >
> >
> > Amirouche ~ amz3
>
>
>
>
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Make a library installable?
2019-05-12 14:50 Make a library installable? HiPhish
2019-05-12 20:18 ` Make a library installable? → conf Arne Babenhauserheide
2019-05-12 22:23 ` Make a library installable? amirouche
@ 2019-05-15 17:31 ` Catonano
2 siblings, 0 replies; 7+ messages in thread
From: Catonano @ 2019-05-15 17:31 UTC (permalink / raw)
To: HiPhish; +Cc: Guile User
There's a package called guile-hall
It creates a guile project instrumented with the autotools and it sort of
manages it for you
If your project contains c code guile-hall won't work and you'll need to
edit your autotools files by hand
A project packaged with the autotools can be built on, say, Ubuntu
relatively easily
And in Guix of course
Hope this helps
I can't figure why people here don't bring up the resources of the guile
world
Welcoming people is important in order to grow a project
Il dom 12 mag 2019, 17:00 HiPhish <hiphish@posteo.de> ha scritto:
> Hello Schemers,
>
> A while ago I presented my MessagePack implementation for Guile[1] here
> and I
> want to make it available to users. Guile has no dedicated package
> manager, so
> it's either manual or Guix, and I would like to support both. What it the
> best
> way of doing it?
>
> So far I have a repository that can be used right away with Guile by
> adding
> its path to the load path. This is handy for testing and working where I
> just
> just invoke Guile as `guile -L .`. For more permanent installation I have
> a
> makefile, it "builds" everything into `./build` (i.e. inside the repo) and
> from
> there the user could copy-paste the files into the desired directory.
>
> I was thinking of adding an "install" target to the makefile which would
> copy
> the directory structure of `./build` to the directory given by `$PREFIX`.
> The
> user could then type
>
> make lib doc && make PREFIX=/usr/local install
>
> to get everything installed globally. A package manager like Guix could
> just
> specify a different `PREFIX`.
>
> Is this reasonable? And where exactly should the Guile code be placed? I
> have
>
> $(PREFIX)/share/guile/site/$(guile_ver)/msgpack
>
> as the directory for now. The value of `$guile_ver` is determined
> automatically at build time:
>
> guile_ver = $(shell $(GUILE) -c '(display (effective-version))')
>
> This would only make the module available for Guile 2.2, no other version.
> Is
> there a better directory?
>
> I guess I could use GNU Autotools instead of a manually written makefile,
> but I
> would rather stick to what I know and is simple for such a simple project.
>
> [1] https://gitlab.com/HiPhish/guile-msgpack
>
>
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2019-05-15 17:31 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-12 14:50 Make a library installable? HiPhish
2019-05-12 20:18 ` Make a library installable? → conf Arne Babenhauserheide
2019-05-12 20:50 ` Arne Babenhauserheide
2019-05-12 22:23 ` Make a library installable? amirouche
2019-05-13 22:22 ` HiPhish
2019-05-14 10:57 ` Amirouche Boubekki
2019-05-15 17:31 ` Catonano
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).