Thread View: linux.gentoo.dev
8 messages
8 total messages
Started by Thomas Bracht Laumann Jespersen
Thu, 19 Nov 2026 12:40
[gentoo-dev] [PATCH 0/3] Fix generated dune-package sections
Author: Thomas Bracht Laumann Jespersen
Date: Thu, 19 Nov 2026 12:40
Date: Thu, 19 Nov 2026 12:40
47 lines
3683 bytes
3683 bytes
When running "dune install", a dune-package file is generated that
references different sections of the installed package (libdir, docdir,
etc). These locations are the combined values of the --prefix, --libdir,
and --mandir arguments. However, if these values contain temporary
staging install locations, the generated dune-package will reference
these locations. For example:
(lang dune 3.23)
(name csexp)
(version 1.5.2)
(sections
(lib /var/tmp/portage/dev-ml/csexp-1.5.2-r1/image/usr/lib64/ocaml/csexp)
(libexec /var/tmp/portage/dev-ml/csexp-1.5.2-r1/image/usr/lib64/ocaml/csexp)
(doc /var/tmp/portage/dev-ml/csexp-1.5.2-r1/image/usr/doc/csexp))
... snip ...
Instead we should be setting DESTDIR to the staging install directory in
the src_install phase, and use EPREFIX instead of ED for --prefix and
other arguments, so it ends up like this:
(lang dune 3.23)
(name csexp)
(version 1.5.2)
(sections
(lib /usr/lib64/ocaml/csexp)
(libexec /usr/lib64/ocaml/csexp)
(doc /usr/doc/csexp))
... snip ...
See: https://manual.archlinux.page/package-guidelines/ocaml/#example-pkgbuild-using-dune
Signed-off-by: Thomas Bracht Laumann Jespersen <laumann@gentoo.org>
---
Thomas Bracht Laumann Jespersen (3):
dune.eclass: set DESTDIR as the staging dir for dune-install
dune.eclass: use --docdir for dune install
dune.eclass: support EAPI=9
eclass/dune.eclass | 20 ++++++++------------
1 file changed, 8 insertions(+), 12 deletions(-)
---
base-commit: c2e8a152d6ac3a687f199bdaf4868cb2809c020c
change-id: 20261119-dune-eclass-install-4adbc4bb3e12
Best regards,
--
Thomas Bracht Laumann Jespersen <laumann@gentoo.org>
[gentoo-dev] [PATCH 3/3] dune.eclass: support EAPI=9
Author: Thomas Bracht Laumann Jespersen
Date: Thu, 19 Nov 2026 12:40
Date: Thu, 19 Nov 2026 12:40
31 lines
2614 bytes
2614 bytes
Signed-off-by: Thomas Bracht Laumann Jespersen <laumann@gentoo.org>
---
eclass/dune.eclass | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/eclass/dune.eclass b/eclass/dune.eclass
index 98c508ee43ff..d95589851648 100644
--- a/eclass/dune.eclass
+++ b/eclass/dune.eclass
@@ -15,7 +15,7 @@
# src_install for Dune-based packages.
case ${EAPI} in
- 7|8) ;;
+ 7|8|9) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
@@ -29,7 +29,8 @@ _DUNE_ECLASS=1
# Set before inheriting the eclass.
: "${DUNE_PKG_NAME:=${PN}}"
-inherit edo multiprocessing
+[[ ${EAPI} != 9 ]] && inherit edo
+inherit multiprocessing
# Do not complain about CFLAGS etc since ml projects do not use them.
QA_FLAGS_IGNORED='.*'
--
2.56.1
[gentoo-dev] [PATCH 1/3] dune.eclass: set DESTDIR as the staging dir for dune-install
Author: Thomas Bracht Laumann Jespersen
Date: Thu, 19 Nov 2026 12:40
Date: Thu, 19 Nov 2026 12:40
34 lines
2811 bytes
2811 bytes
If the --prefix, --libdir, and other install locations include the
staging install directory, the sections listed in the generated
dune-package file will incorrectly reference those locations.
Instead we should set DESTDIR, and the install locations should use
EPREFIX.
Signed-off-by: Thomas Bracht Laumann Jespersen <laumann@gentoo.org>
---
eclass/dune.eclass | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/eclass/dune.eclass b/eclass/dune.eclass
index 6cd3ad402230..2bb6d4c3d2a3 100644
--- a/eclass/dune.eclass
+++ b/eclass/dune.eclass
@@ -165,10 +165,11 @@ dune-install() {
[[ ${#pkgs[@]} -eq 0 ]] && pkgs=( "${DUNE_PKG_NAME}" )
+ local -x DESTDIR="${ED}"
local -a myduneopts=(
- --prefix="${ED}/usr"
- --libdir="${D}$(ocamlc -where)"
- --mandir="${ED}/usr/share/man"
+ --prefix="${EPREFIX}/usr"
+ --libdir="$(ocamlc -where)"
+ --mandir="${EPREFIX}/usr/share/man"
)
local pkg
--
2.56.1
[gentoo-dev] [PATCH 2/3] dune.eclass: use --docdir for dune install
Author: Thomas Bracht Laumann Jespersen
Date: Thu, 19 Nov 2026 12:40
Date: Thu, 19 Nov 2026 12:40
36 lines
2953 bytes
2953 bytes
Instead of manually moving files from /usr/doc to /usr/share/doc/${PF},
use the --docdir argument for "dune install". This ensure the generated
dune-package file will reference the correct location of installed docs.
Signed-off-by: Thomas Bracht Laumann Jespersen <laumann@gentoo.org>
---
eclass/dune.eclass | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/eclass/dune.eclass b/eclass/dune.eclass
index 2bb6d4c3d2a3..98c508ee43ff 100644
--- a/eclass/dune.eclass
+++ b/eclass/dune.eclass
@@ -170,18 +170,12 @@ dune-install() {
--prefix="${EPREFIX}/usr"
--libdir="$(ocamlc -where)"
--mandir="${EPREFIX}/usr/share/man"
+ --docdir="${EPREFIX}/usr/share/doc/${PF}"
)
local pkg
for pkg in "${pkgs[@]}" ; do
edune install ${myduneopts[@]} ${pkg}
-
- # Move docs to the appropriate place.
- if [[ -d "${ED}/usr/doc/${pkg}" ]] ; then
- mkdir -p "${ED}/usr/share/doc/${PF}/" || die
- mv "${ED}/usr/doc/${pkg}" "${ED}/usr/share/doc/${PF}/" || die
- rm -rf "${ED}/usr/doc" || die
- fi
done
}
--
2.56.1
Re: [gentoo-dev] [PATCH 2/3] dune.eclass: use --docdir for dune install
Author: Sam James
Date: Thu, 19 Nov 2026 14:10
Date: Thu, 19 Nov 2026 14:10
58 lines
3257 bytes
3257 bytes
--=-=-=
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable
Thomas Bracht Laumann Jespersen <laumann@gentoo.org> writes:
> Instead of manually moving files from /usr/doc to /usr/share/doc/${PF},
> use the --docdir argument for "dune install". This ensure the generated
> dune-package file will reference the correct location of installed docs.
I wonder if maybe --docdir didn't exist for our minimum version of dune,
or at least a minimum version we specified in the past, then we forgot
to add it in?
>
> Signed-off-by: Thomas Bracht Laumann Jespersen <laumann@gentoo.org>
> ---
> eclass/dune.eclass | 8 +-------
> 1 file changed, 1 insertion(+), 7 deletions(-)
>
> diff --git a/eclass/dune.eclass b/eclass/dune.eclass
> index 2bb6d4c3d2a3..98c508ee43ff 100644
> --- a/eclass/dune.eclass
> +++ b/eclass/dune.eclass
> @@ -170,18 +170,12 @@ dune-install() {
> --prefix=3D"${EPREFIX}/usr"
> --libdir=3D"$(ocamlc -where)"
> --mandir=3D"${EPREFIX}/usr/share/man"
> + --docdir=3D"${EPREFIX}/usr/share/doc/${PF}"
> )
>=20=20
> local pkg
> for pkg in "${pkgs[@]}" ; do
> edune install ${myduneopts[@]} ${pkg}
> -
> - # Move docs to the appropriate place.
> - if [[ -d "${ED}/usr/doc/${pkg}" ]] ; then
> - mkdir -p "${ED}/usr/share/doc/${PF}/" || die
> - mv "${ED}/usr/doc/${pkg}" "${ED}/usr/share/doc/${PF}/" || die
> - rm -rf "${ED}/usr/doc" || die
> - fi
> done
> }
--=-=-=
Content-Type: application/pgp-signature; name="signature.asc"
-----BEGIN PGP SIGNATURE-----
iQEBBAEWCgCpFiEEJaa7iN2bdkxrVUHCc4QJ9SDfkZAFAmr/ASEbFIAAAAAABAAO
bWFudTIsMi41KzEuMTIsMiwyXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25z
Lm9wZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQyNUE2QkI4OEREOUI3NjRDNkI1NTQx
QzI3Mzg0MDlGNTIwREY5MTkwDxxzYW1AZ2VudG9vLm9yZwAKCRBzhAn1IN+RkJZq
AP4/yUCjXenjgJQqLxmvSMRStuhELWRXODr4MtwmsjGapAD+M2flQ8cFGw5D/zwX
GNa8KLTMzAcmmBzESiGFsqa17gM=
=PWQY
-----END PGP SIGNATURE-----
--=-=-=--
Re: [gentoo-dev] [PATCH 2/3] dune.eclass: use --docdir for dune install
Author: Thomas Bracht Laumann Jespersen
Date: Thu, 19 Nov 2026 14:20
Date: Thu, 19 Nov 2026 14:20
30 lines
2415 bytes
2415 bytes
--=-=-=
Content-Type: text/plain
Sam James <sam@gentoo.org> writes:
>> Instead of manually moving files from /usr/doc to /usr/share/doc/${PF},
>> use the --docdir argument for "dune install". This ensure the generated
>> dune-package file will reference the correct location of installed docs.
>
> I wonder if maybe --docdir didn't exist for our minimum version of dune,
> or at least a minimum version we specified in the past, then we forgot
> to add it in?
AFAICT --docdir was added in dune 2.9.0 (29-06-2021) and dune.eclass
predates this, so it would seem like that's the case.
--=-=-=
Content-Type: application/pgp-signature; name="signature.asc"
-----BEGIN PGP SIGNATURE-----
iQEFBAEWCgCtFiEEq7SpitE7F8gDwQG+I/uGahf0qDsFAmr/BEcbFIAAAAAABAAO
bWFudTIsMi41KzEuMTIsMiwyXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25z
Lm9wZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRBQkI0QTk4QUQxM0IxN0M4MDNDMTAx
QkUyM0ZCODY2QTE3RjRBODNCExxsYXVtYW5uQGdlbnRvby5vcmcACgkQI/uGahf0
qDthJwEAo4U3Uv7XxbcsXq+m5GdiVEpSoeel062CPUnbmfbyvXwA/i4V+k37aNgX
K2y5pqdqtG2XJc0mRxHUOAo5tVCZeVgD
=lFzv
-----END PGP SIGNATURE-----
--=-=-=--
Re: [gentoo-dev] [PATCH 0/3] Fix generated dune-package sections
Author: Sam James
Date: Thu, 19 Nov 2026 15:10
Date: Thu, 19 Nov 2026 15:10
76 lines
3730 bytes
3730 bytes
--=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Thomas Bracht Laumann Jespersen <laumann@gentoo.org> writes: > When running "dune install", a dune-package file is generated that > references different sections of the installed package (libdir, docdir, > etc). These locations are the combined values of the --prefix, --libdir, > and --mandir arguments. However, if these values contain temporary > staging install locations, the generated dune-package will reference > these locations. For example: > > (lang dune 3.23) > (name csexp) > (version 1.5.2) > (sections > (lib /var/tmp/portage/dev-ml/csexp-1.5.2-r1/image/usr/lib64/ocaml/cs= exp) > (libexec /var/tmp/portage/dev-ml/csexp-1.5.2-r1/image/usr/lib64/ocam= l/csexp) > (doc /var/tmp/portage/dev-ml/csexp-1.5.2-r1/image/usr/doc/csexp)) > ... snip ... > > Instead we should be setting DESTDIR to the staging install directory in > the src_install phase, and use EPREFIX instead of ED for --prefix and > other arguments, so it ends up like this: > > (lang dune 3.23) > (name csexp) > (version 1.5.2) > (sections > (lib /usr/lib64/ocaml/csexp) > (libexec /usr/lib64/ocaml/csexp) > (doc /usr/doc/csexp)) > ... snip ... > > See: https://manual.archlinux.page/package-guidelines/ocaml/#example-pkgb= uild-using-dune > > Signed-off-by: Thomas Bracht Laumann Jespersen <laumann@gentoo.org> For the series:=20 Reviewed-by: Sam James <sam@gentoo.org> Thanks for doing this. We'll need to revbump dune.eclass consumers... > --- > Thomas Bracht Laumann Jespersen (3): > dune.eclass: set DESTDIR as the staging dir for dune-install > dune.eclass: use --docdir for dune install > dune.eclass: support EAPI=3D9 > > eclass/dune.eclass | 20 ++++++++------------ > 1 file changed, 8 insertions(+), 12 deletions(-) > --- > base-commit: c2e8a152d6ac3a687f199bdaf4868cb2809c020c > change-id: 20261119-dune-eclass-install-4adbc4bb3e12 > > Best regards, --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEBBAEWCgCpFiEEJaa7iN2bdkxrVUHCc4QJ9SDfkZAFAmr/ENIbFIAAAAAABAAO bWFudTIsMi41KzEuMTIsMiwyXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25z Lm9wZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQyNUE2QkI4OEREOUI3NjRDNkI1NTQx QzI3Mzg0MDlGNTIwREY5MTkwDxxzYW1AZ2VudG9vLm9yZwAKCRBzhAn1IN+RkIDZ AQCTN6Z7LmwMLXZ+KxAEWxHuWI4mtrBVifN++kxGFO/09gD/VSVLz1oGiBDTSrkB Z5NF5PFYmZEHMokVvpoPfnZ9mgk= =KbU1 -----END PGP SIGNATURE----- --=-=-=--
Re: [gentoo-dev] [PATCH 2/3] dune.eclass: use --docdir for dune install
Author: Sam James
Date: Thu, 19 Nov 2026 15:10
Date: Thu, 19 Nov 2026 15:10
34 lines
2645 bytes
2645 bytes
--=-=-=
Content-Type: text/plain
Thomas Bracht Laumann Jespersen <laumann@gentoo.org> writes:
> Sam James <sam@gentoo.org> writes:
>
>>> Instead of manually moving files from /usr/doc to /usr/share/doc/${PF},
>>> use the --docdir argument for "dune install". This ensure the generated
>>> dune-package file will reference the correct location of installed docs.
>>
>> I wonder if maybe --docdir didn't exist for our minimum version of dune,
>> or at least a minimum version we specified in the past, then we forgot
>> to add it in?
>
> AFAICT --docdir was added in dune 2.9.0 (29-06-2021) and dune.eclass
> predates this, so it would seem like that's the case.
Thanks for checking.
--=-=-=
Content-Type: application/pgp-signature; name="signature.asc"
-----BEGIN PGP SIGNATURE-----
iQEBBAEWCgCpFiEEJaa7iN2bdkxrVUHCc4QJ9SDfkZAFAmr/ELYbFIAAAAAABAAO
bWFudTIsMi41KzEuMTIsMiwyXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25z
Lm9wZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQyNUE2QkI4OEREOUI3NjRDNkI1NTQx
QzI3Mzg0MDlGNTIwREY5MTkwDxxzYW1AZ2VudG9vLm9yZwAKCRBzhAn1IN+RkObl
AQDDcX04GmfKIlHTt4GLTEADT5KXYW42TD5nYsyg8hVfIgD/X0uY9sUosyn/a80N
tj7P+xLBF/gBVQMo9OiQAUcjwgc=
=5wVa
-----END PGP SIGNATURE-----
--=-=-=--
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads