[-- Attachment #1: Type: text/plain, Size: 1521 bytes --] There is a new pull request by Marie-Joseph against master on the void-packages repository https://github.com/Marie-Joseph/void-packages racket https://github.com/void-linux/void-packages/pull/34853 racket: re-enable cross-compilation * remove nocross * expound precise arch support (based on Racket's Chez Scheme support) * remove unneeded musl deps * put documentation behind a switch (builds fine, takes too long for CI) #### Testing the changes - I tested the changes in this PR: **YES** #### Local build testing - I built this PR locally for these architectures: - aarch64-musl - native and cross - x86_64-musl - native ### Notes Racket's architecture support is limited only by Chez Scheme. The Chez Scheme it uses supports all the architectures we do except MIPS and PowerPC64. However, when trying to cross-compile for PowerPC 32-bit musl, I found that an absolute boat load of dependencies had to be compiled first. This would make CI take way too long, so I've simply omitted all PowerPC platforms. It wasn't supported before anyway, so this is still progress. I don't actually know for sure that building documentation would cause this to time out. However, I didn't want to risk it (it does take a really long time, I just didn't time it), and this still makes local Racket documentation more accessible than it was before. (I used local documentation heavily, so this is important to me.) A patch file from https://github.com/void-linux/void-packages/pull/34853.patch is attached [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: github-pr-racket-34853.patch --] [-- Type: text/x-diff, Size: 3466 bytes --] From 479eed894101ac9728ecfea5afd13a9882e0fe71 Mon Sep 17 00:00:00 2001 From: jts <jtsims@pm.me> Date: Tue, 4 Jan 2022 21:18:42 +0000 Subject: [PATCH] racket: re-enable cross-compilation * remove nocross * expound precise arch support (based on Racket's ChezScheme support) * remove unneeded musl deps * put documentation behind a switch (builds fine, takes too long) --- srcpkgs/racket/template | 59 ++++++++++++++++++++++++++--------------- 1 file changed, 37 insertions(+), 22 deletions(-) diff --git a/srcpkgs/racket/template b/srcpkgs/racket/template index fa837398b7c9..94699fa05eb3 100644 --- a/srcpkgs/racket/template +++ b/srcpkgs/racket/template @@ -1,10 +1,14 @@ # Template file for 'racket' pkgname=racket version=8.3 -revision=1 +revision=2 +archs="~mips* ~ppc*" +wrksrc=${pkgname}-${version} build_wrksrc=src build_style=gnu-configure -configure_args="--enable-useprefix --disable-docs" +build_options="docs" +desc_option_docs="Build documentation. Disabled by default for time." +configure_args="--enable-useprefix $(vopt_enable docs)" hostmakedepends="gsfonts" makedepends="sqlite-devel gtk+3-devel" depends="gtk+3 libssl1.1" @@ -15,28 +19,38 @@ homepage="http://racket-lang.org/" distfiles="http://mirror.racket-lang.org/installers/${version}/${pkgname}-${version}-src.tgz" checksum=33dd0c20846c7c5fdf84af2dc250f765104ed33b5091be152a9f68f1e2541457 nostrip=yes -nocross=yes if [ "$CROSS_BUILD" ]; then - configure_args+=" --enable-racket=/usr/bin/racket" + _chezscheme_path="${XBPS_BUILDDIR}/${wrksrc}/${build_wrksrc}" + + configure_args+=" --enable-racket=/usr/bin/racket + --enable-scheme=${_chezscheme_path}" hostmakedepends+=" racket sqlite-devel" -fi -case "$XBPS_TARGET_MACHINE" in -ppc*) - broken="hangs or segfaults";; -*-musl) - makedepends+=" libucontext-devel";; -esac + # Build ChezScheme for the host so we can use it to build Racket + # Using "--enable-racket=auto" above selects the wrong compiler toolchain + pre_build() { + _correct_position=$(pwd) # Make sure we don't get lost + cd ${_chezscheme_path}/ChezScheme -pre_configure() { - case "$XBPS_TARGET_MACHINE" in - *-musl) - export CFLAGS+=" -D_GNU_SOURCE" - export LIBS+=" -lucontext" - ;; - esac -} + # If this builds the wrong arch, Racket's automatic + # arch detection for the ChezScheme build has failed. + # See <Racket sourcedir>/src/ChezScheme/IMPLEMENTATION.md "Build System" + # and <Racket sourcedir>/src/ChezScheme/s/cmacros.ss "define-machine-types" + # for the "machine-type" variable that needs to be passed to rktboot/main.rkt + racket rktboot/main.rkt + env CC="gcc" \ # Make sure Chez builds natively + AR="ar" \ + ARFLAGS="rc" \ + RANLIB="ranlib" \ + CFLAGS="-m64 -O2 -D_REENTRANT -pthread" \ + -LDFLAGS="-Wl,-z,relro -Wl,-z,now -Wl,--as-needed -L/usr/lib -rdynamic" \ + ./configure --disable-curses --disable-x11 + make + + cd ${_correct_position} + } +fi post_install() { vlicense LICENSE-libscheme.txt @@ -47,9 +61,10 @@ racket-doc_package() { short_desc+=" - documentation" depends="racket>=${version}_${revision}" pkg_install() { - # Remove once --disable-doc can be removed - echo "Documentation currently not available." \ - > ${DESTDIR}/usr/share/doc/racket/no-doc.txt + if [ ! "$build_option_docs" ]; then + echo "Build using xbps-src with '-o docs' for documentation." \ + > ${DESTDIR}/usr/share/doc/racket/no-doc.txt + fi vmove usr/share/doc/racket } }
[-- Attachment #1: Type: text/plain, Size: 335 bytes --] New comment by Marie-Joseph on void-packages repository https://github.com/void-linux/void-packages/pull/34853#issuecomment-1005525059 Comment: I was afraid this would fail a couple tests, but this is just embarrassing. And I forgot to lint! I always forget to lint... It may be a day or two before I can get to this, but I will.
[-- Attachment #1: Type: text/plain, Size: 1526 bytes --] There is an updated pull request by Marie-Joseph against master on the void-packages repository https://github.com/Marie-Joseph/void-packages racket https://github.com/void-linux/void-packages/pull/34853 racket: re-enable cross-compilation * remove nocross * expound precise arch support (based on Racket's Chez Scheme support) * remove unneeded musl deps * put documentation behind a switch (builds fine, takes too long for CI) #### Testing the changes - I tested the changes in this PR: **YES** #### Local build testing - I built this PR locally for these architectures: - aarch64-musl - native and cross - x86_64-musl - native ### Notes Racket's architecture support is limited only by Chez Scheme. The Chez Scheme it uses supports all the architectures we do except MIPS and PowerPC64. However, when trying to cross-compile for PowerPC 32-bit musl, I found that an absolute boat load of dependencies had to be compiled first. This would make CI take way too long, so I've simply omitted all PowerPC platforms. It wasn't supported before anyway, so this is still progress. I don't actually know for sure that building documentation would cause this to time out. However, I didn't want to risk it (it does take a really long time, I just didn't time it), and this still makes local Racket documentation more accessible than it was before. (I used local documentation heavily, so this is important to me.) A patch file from https://github.com/void-linux/void-packages/pull/34853.patch is attached [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: github-pr-racket-34853.patch --] [-- Type: text/x-diff, Size: 3476 bytes --] From 86c917a3adcacfbb5e7dbe2b2ddec3bf5153c0eb Mon Sep 17 00:00:00 2001 From: jts <jtsims@pm.me> Date: Tue, 4 Jan 2022 21:18:42 +0000 Subject: [PATCH] racket: re-enable cross-compilation * remove nocross * expound precise arch support (based on Racket's ChezScheme support) * remove unneeded musl deps * put documentation behind a switch (builds fine, takes too long) --- srcpkgs/racket/template | 64 ++++++++++++++++++++++++++--------------- 1 file changed, 41 insertions(+), 23 deletions(-) diff --git a/srcpkgs/racket/template b/srcpkgs/racket/template index fa837398b7c9..28f9d8c4cc50 100644 --- a/srcpkgs/racket/template +++ b/srcpkgs/racket/template @@ -1,10 +1,12 @@ # Template file for 'racket' pkgname=racket version=8.3 -revision=1 +revision=2 +archs="~mips* ~ppc*" +wrksrc=${pkgname}-${version} build_wrksrc=src build_style=gnu-configure -configure_args="--enable-useprefix --disable-docs" +configure_args="--enable-useprefix $(vopt_enable docs)" hostmakedepends="gsfonts" makedepends="sqlite-devel gtk+3-devel" depends="gtk+3 libssl1.1" @@ -15,28 +17,43 @@ homepage="http://racket-lang.org/" distfiles="http://mirror.racket-lang.org/installers/${version}/${pkgname}-${version}-src.tgz" checksum=33dd0c20846c7c5fdf84af2dc250f765104ed33b5091be152a9f68f1e2541457 nostrip=yes -nocross=yes + +build_options="docs" +desc_option_docs="Build documentation. Disabled by default for time." if [ "$CROSS_BUILD" ]; then - configure_args+=" --enable-racket=/usr/bin/racket" + _chezscheme_path="${XBPS_BUILDDIR}/${wrksrc}/${build_wrksrc}" + + configure_args+=" --enable-racket=/usr/bin/racket + --enable-scheme=${_chezscheme_path}" hostmakedepends+=" racket sqlite-devel" -fi -case "$XBPS_TARGET_MACHINE" in -ppc*) - broken="hangs or segfaults";; -*-musl) - makedepends+=" libucontext-devel";; -esac - -pre_configure() { - case "$XBPS_TARGET_MACHINE" in - *-musl) - export CFLAGS+=" -D_GNU_SOURCE" - export LIBS+=" -lucontext" - ;; - esac -} + # Build ChezScheme for the host so we can use it to build Racket + # Using "--enable-racket=auto" above selects the wrong compiler toolchain + pre_build() { + # Make sure we don't get lost + _correct_position=$(pwd) + cd ${_chezscheme_path}/ChezScheme + + # If this builds the wrong arch, Racket's automatic + # arch detection for the ChezScheme build has failed. + # See <Racket sourcedir>/src/ChezScheme/IMPLEMENTATION.md "Build System" + # and <Racket sourcedir>/src/ChezScheme/s/cmacros.ss "define-machine-types" + # for the "machine-type" variable that needs to be passed to rktboot/main.rkt + racket rktboot/main.rkt + # Make sure Chez builds natively + env CC="gcc" \ + AR="ar" \ + ARFLAGS="rc" \ + RANLIB="ranlib" \ + CFLAGS="-m64 -O2 -D_REENTRANT -pthread" \ + -LDFLAGS="-Wl,-z,relro -Wl,-z,now -Wl,--as-needed -L/usr/lib -rdynamic" \ + ./configure --disable-curses --disable-x11 + make + + cd ${_correct_position} + } +fi post_install() { vlicense LICENSE-libscheme.txt @@ -47,9 +64,10 @@ racket-doc_package() { short_desc+=" - documentation" depends="racket>=${version}_${revision}" pkg_install() { - # Remove once --disable-doc can be removed - echo "Documentation currently not available." \ - > ${DESTDIR}/usr/share/doc/racket/no-doc.txt + if [ ! "$build_option_docs" ]; then + echo "Build using xbps-src with '-o docs' for documentation." \ + > ${DESTDIR}/usr/share/doc/racket/no-doc.txt + fi vmove usr/share/doc/racket } }
[-- Attachment #1: Type: text/plain, Size: 339 bytes --] New comment by Marie-Joseph on void-packages repository https://github.com/void-linux/void-packages/pull/34853#issuecomment-1006359952 Comment: Hmm, don't put comments after lines of commands broken up over multiple lines... Also do as the instructions say and build *exactly* what you commit, not just what you commit minus comments...
[-- Attachment #1: Type: text/plain, Size: 327 bytes --] New comment by Marie-Joseph on void-packages repository https://github.com/void-linux/void-packages/pull/34853#issuecomment-1006528461 Comment: I'm tempted to try CI with PPC 32-bit enabled, but I feel like that's probably wasteful of resources. It shouldn't fail, I just didn't want to build half of a userland to find out.
[-- Attachment #1: Type: text/plain, Size: 301 bytes --] New comment by ericonr on void-packages repository https://github.com/void-linux/void-packages/pull/34853#issuecomment-1006544637 Comment: You can try using void-ppc's repos, if you want. But regardless, it's also being deprecated there. I will try to review this soon, thanks for the nice work!
[-- Attachment #1: Type: text/plain, Size: 182 bytes --] New comment by leahneukirchen on void-packages repository https://github.com/void-linux/void-packages/pull/34853#issuecomment-1008332676 Comment: So ucontext isn't needed anymore?
[-- Attachment #1: Type: text/plain, Size: 267 bytes --] New comment by q66 on void-packages repository https://github.com/void-linux/void-packages/pull/34853#issuecomment-1008338438 Comment: the archs pattern is bad, it does not work this way in xbps-src (arch passes as long as there is at least one entry that matches)
[-- Attachment #1: Type: text/plain, Size: 313 bytes --] New comment by q66 on void-packages repository https://github.com/void-linux/void-packages/pull/34853#issuecomment-1008338438 Comment: the archs pattern is bad, it does not work this way in xbps-src (arch passes as long as there is at least one entry that matches - i.e. ppc would match as it matches not mips)
[-- Attachment #1: Type: text/plain, Size: 234 bytes --] New comment by q66 on void-packages repository https://github.com/void-linux/void-packages/pull/34853#issuecomment-1008338755 Comment: is chez scheme known to work on any ppc arches? if yes, then it should not be disabled this way
[-- Attachment #1: Type: text/plain, Size: 177 bytes --] New comment by leahneukirchen on void-packages repository https://github.com/void-linux/void-packages/pull/34853#issuecomment-1008340034 Comment: The manual mentions ppc32le.
[-- Attachment #1: Type: text/plain, Size: 407 bytes --] New comment by q66 on void-packages repository https://github.com/void-linux/void-packages/pull/34853#issuecomment-1008342568 Comment: i think "le" probably means "linux environment" or something along those lines here, rather than "little endian" :p nevertheless, it appears to be missing the boot files anyway so the archs should be set only for those that ship those files, rather than excluding
[-- Attachment #1: Type: text/plain, Size: 453 bytes --] New comment by q66 on void-packages repository https://github.com/void-linux/void-packages/pull/34853#issuecomment-1008342568 Comment: i think "le" probably means "linux environment" or something along those lines here, rather than "little endian" :p nevertheless, it appears to be missing the boot files anyway so the archs should be set only for those that ship those files, rather than excluding (i.e. sth like `x86_64* aarch64* i686* arm*`)
[-- Attachment #1: Type: text/plain, Size: 261 bytes --] New comment by leahneukirchen on void-packages repository https://github.com/void-linux/void-packages/pull/34853#issuecomment-1008346242 Comment: Aha, https://github.com/cisco/ChezScheme/blob/2077454566b0a845ee5804806c4ac94ad80984fd/s/ppc32le.def#L44 Yes.
[-- Attachment #1: Type: text/plain, Size: 621 bytes --] New comment by Marie-Joseph on void-packages repository https://github.com/void-linux/void-packages/pull/34853#issuecomment-1009420032 Comment: > So ucontext isn't needed anymore? Apparently not, see https://github.com/racket/racket/issues/4100#issuecomment-1003784010 > the archs pattern is bad It seems to work for CI, but I'll change it to be safe > [ppc] should not be disabled this way How should it be disabled? As I mentioned, the only reason I disabled it is build time. If that's not an issue, I can turn it back on (though only for 32-bit big-endian versions because that's what Chez supports)
[-- Attachment #1: Type: text/plain, Size: 327 bytes --] New comment by Marie-Joseph on void-packages repository https://github.com/void-linux/void-packages/pull/34853#issuecomment-1009423150 Comment: Also, wrt boot files, if you mean Chez Scheme boot files, those are generated by `racket rktboot/main.rkt`. It does other things, if I'm not mistaken, but among them is doing that.
[-- Attachment #1: Type: text/plain, Size: 473 bytes --] New comment by Marie-Joseph on void-packages repository https://github.com/void-linux/void-packages/pull/34853#issuecomment-1009423150 Comment: Also, wrt boot files, if you mean Chez Scheme boot files, those are generated by `racket rktboot/main.rkt`. It does other things, if I'm not mistaken, but among them is doing that. This is among the numerous differences between Cisco's Chez and Racket's Chez: https://github.com/racket/ChezScheme (at the bottom of the README)
[-- Attachment #1: Type: text/plain, Size: 574 bytes --] New comment by Marie-Joseph on void-packages repository https://github.com/void-linux/void-packages/pull/34853#issuecomment-1009434203 Comment: I just noticed that in line 49, that `-m64` flag only gets by CI because cross builds use 64-bit hosts. That'll be changed to `-m${XBPS_WORDSIZE}`. If anyone notices other things like that in the values passed to `env`, please let me know. I literally just copied the env passed to configure in the default build and changed the libraries and binaries to host versions (so instead of eg aarch64-musl-gcc it's just gcc, etc).
[-- Attachment #1: Type: text/plain, Size: 660 bytes --] New comment by Marie-Joseph on void-packages repository https://github.com/void-linux/void-packages/pull/34853#issuecomment-1009420032 Comment: > So ucontext isn't needed anymore? Apparently not, see https://github.com/racket/racket/issues/4100#issuecomment-1003784010 > the archs pattern is bad I'll change it. Why does it work for CI? (Trying to gain insights into xbps-src where I can!) > [ppc] should not be disabled this way How should it be disabled? As I mentioned, the only reason I disabled it is build time. If that's not an issue, I can turn it back on (though only for 32-bit big-endian versions because that's what Chez supports)
[-- Attachment #1: Type: text/plain, Size: 345 bytes --] New comment by Marie-Joseph on void-packages repository https://github.com/void-linux/void-packages/pull/34853#issuecomment-1012656068 Comment: @q66 just waiting on your feedback RE ppc to make changes. Specifically, whether or not I should enable the ppc arch (but not ppc-musl, I see now from void-ppc) and, if not, how I should disable it.
[-- Attachment #1: Type: text/plain, Size: 199 bytes --] New comment by q66 on void-packages repository https://github.com/void-linux/void-packages/pull/34853#issuecomment-1012698419 Comment: you should do what I said, i.e. `x86_64* aarch64* i686* arm*`
[-- Attachment #1: Type: text/plain, Size: 1525 bytes --] There is an updated pull request by Marie-Joseph against master on the void-packages repository https://github.com/Marie-Joseph/void-packages racket https://github.com/void-linux/void-packages/pull/34853 racket: re-enable cross-compilation * remove nocross * expound precise arch support (based on Racket's Chez Scheme support) * remove unneeded musl deps * put documentation behind a switch (builds fine, takes too long for CI) #### Testing the changes - I tested the changes in this PR: **YES** #### Local build testing - I built this PR locally for these architectures: - aarch64-musl - native and cross - x86_64-musl - native ### Notes Racket's architecture support is limited only by Chez Scheme. The Chez Scheme it uses supports all the architectures we do except MIPS and PowerPC64. However, when trying to cross-compile for PowerPC 32-bit musl, I found that an absolute boat load of dependencies had to be compiled first. This would make CI take way too long, so I've simply omitted all PowerPC platforms. It wasn't supported before anyway, so this is still progress. I don't actually know for sure that building documentation would cause this to time out. However, I didn't want to risk it (it does take a really long time, I just didn't time it), and this still makes local Racket documentation more accessible than it was before. (I use local documentation heavily, so this is important to me.) A patch file from https://github.com/void-linux/void-packages/pull/34853.patch is attached [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: github-pr-racket-34853.patch --] [-- Type: text/x-diff, Size: 3191 bytes --] From 00a92e144304204a3166ce5b8db4d0f7dc4b3cf0 Mon Sep 17 00:00:00 2001 From: jts <jtsims@pm.me> Date: Tue, 4 Jan 2022 21:18:42 +0000 Subject: [PATCH] racket: re-enable cross-compilation * remove nocross * expound precise arch support (based on Racket's Chez Scheme support) * remove unneeded musl deps * enable documentation --- srcpkgs/racket/template | 55 ++++++++++++++++++++++++----------------- 1 file changed, 33 insertions(+), 22 deletions(-) diff --git a/srcpkgs/racket/template b/srcpkgs/racket/template index fa837398b7c9..7123be16bc97 100644 --- a/srcpkgs/racket/template +++ b/srcpkgs/racket/template @@ -1,10 +1,12 @@ # Template file for 'racket' pkgname=racket version=8.3 -revision=1 +revision=2 +archs="aarch64* armv6* armv7* i686* x86_64*" +wrksrc=${pkgname}-${version} build_wrksrc=src build_style=gnu-configure -configure_args="--enable-useprefix --disable-docs" +configure_args="--enable-useprefix" hostmakedepends="gsfonts" makedepends="sqlite-devel gtk+3-devel" depends="gtk+3 libssl1.1" @@ -15,28 +17,40 @@ homepage="http://racket-lang.org/" distfiles="http://mirror.racket-lang.org/installers/${version}/${pkgname}-${version}-src.tgz" checksum=33dd0c20846c7c5fdf84af2dc250f765104ed33b5091be152a9f68f1e2541457 nostrip=yes -nocross=yes if [ "$CROSS_BUILD" ]; then - configure_args+=" --enable-racket=/usr/bin/racket" + _chezscheme_path="${XBPS_BUILDDIR}/${wrksrc}/${build_wrksrc}" + + configure_args+=" --enable-racket=/usr/bin/racket + --enable-scheme=${_chezscheme_path}" hostmakedepends+=" racket sqlite-devel" -fi -case "$XBPS_TARGET_MACHINE" in -ppc*) - broken="hangs or segfaults";; -*-musl) - makedepends+=" libucontext-devel";; -esac + # Build ChezScheme for the host so we can use it to build Racket + # Using "--enable-racket=auto" above selects the wrong compiler toolchain + pre_build() { + # Make sure we don't get lost + _correct_position=$(pwd) + cd ${_chezscheme_path}/ChezScheme -pre_configure() { - case "$XBPS_TARGET_MACHINE" in - *-musl) - export CFLAGS+=" -D_GNU_SOURCE" - export LIBS+=" -lucontext" - ;; - esac -} + # If this builds the wrong arch, Racket's automatic + # arch detection for the ChezScheme build has failed. + # See <Racket sourcedir>/src/ChezScheme/IMPLEMENTATION.md "Build System" + # and <Racket sourcedir>/src/ChezScheme/s/cmacros.ss "define-machine-types" + # for the "machine-type" variable that needs to be passed to rktboot/main.rkt + racket rktboot/main.rkt + # Make sure Chez builds natively + env CC="gcc" \ + AR="ar" \ + ARFLAGS="rc" \ + RANLIB="ranlib" \ + CFLAGS="-m${XBPS_WORDSIZE} -O2 -D_REENTRANT -pthread" \ + -LDFLAGS="-Wl,-z,relro -Wl,-z,now -Wl,--as-needed -L/usr/lib -rdynamic" \ + ./configure --disable-curses --disable-x11 + make + + cd ${_correct_position} + } +fi post_install() { vlicense LICENSE-libscheme.txt @@ -47,9 +61,6 @@ racket-doc_package() { short_desc+=" - documentation" depends="racket>=${version}_${revision}" pkg_install() { - # Remove once --disable-doc can be removed - echo "Documentation currently not available." \ - > ${DESTDIR}/usr/share/doc/racket/no-doc.txt vmove usr/share/doc/racket } }
[-- Attachment #1: Type: text/plain, Size: 1525 bytes --] There is an updated pull request by Marie-Joseph against master on the void-packages repository https://github.com/Marie-Joseph/void-packages racket https://github.com/void-linux/void-packages/pull/34853 racket: re-enable cross-compilation * remove nocross * expound precise arch support (based on Racket's Chez Scheme support) * remove unneeded musl deps * put documentation behind a switch (builds fine, takes too long for CI) #### Testing the changes - I tested the changes in this PR: **YES** #### Local build testing - I built this PR locally for these architectures: - aarch64-musl - native and cross - x86_64-musl - native ### Notes Racket's architecture support is limited only by Chez Scheme. The Chez Scheme it uses supports all the architectures we do except MIPS and PowerPC64. However, when trying to cross-compile for PowerPC 32-bit musl, I found that an absolute boat load of dependencies had to be compiled first. This would make CI take way too long, so I've simply omitted all PowerPC platforms. It wasn't supported before anyway, so this is still progress. I don't actually know for sure that building documentation would cause this to time out. However, I didn't want to risk it (it does take a really long time, I just didn't time it), and this still makes local Racket documentation more accessible than it was before. (I use local documentation heavily, so this is important to me.) A patch file from https://github.com/void-linux/void-packages/pull/34853.patch is attached [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: github-pr-racket-34853.patch --] [-- Type: text/x-diff, Size: 3191 bytes --] From 2aaf9a1971466a1b789b3975cce9a81f920249a7 Mon Sep 17 00:00:00 2001 From: jts <jtsims@pm.me> Date: Tue, 4 Jan 2022 21:18:42 +0000 Subject: [PATCH] racket: re-enable cross-compilation * remove nocross * expound precise arch support (based on Racket's Chez Scheme support) * remove unneeded musl deps * enable documentation --- srcpkgs/racket/template | 55 ++++++++++++++++++++++++----------------- 1 file changed, 33 insertions(+), 22 deletions(-) diff --git a/srcpkgs/racket/template b/srcpkgs/racket/template index fa837398b7c9..7123be16bc97 100644 --- a/srcpkgs/racket/template +++ b/srcpkgs/racket/template @@ -1,10 +1,12 @@ # Template file for 'racket' pkgname=racket version=8.3 -revision=1 +revision=2 +archs="aarch64* armv6* armv7* i686* x86_64*" +wrksrc=${pkgname}-${version} build_wrksrc=src build_style=gnu-configure -configure_args="--enable-useprefix --disable-docs" +configure_args="--enable-useprefix" hostmakedepends="gsfonts" makedepends="sqlite-devel gtk+3-devel" depends="gtk+3 libssl1.1" @@ -15,28 +17,40 @@ homepage="http://racket-lang.org/" distfiles="http://mirror.racket-lang.org/installers/${version}/${pkgname}-${version}-src.tgz" checksum=33dd0c20846c7c5fdf84af2dc250f765104ed33b5091be152a9f68f1e2541457 nostrip=yes -nocross=yes if [ "$CROSS_BUILD" ]; then - configure_args+=" --enable-racket=/usr/bin/racket" + _chezscheme_path="${XBPS_BUILDDIR}/${wrksrc}/${build_wrksrc}" + + configure_args+=" --enable-racket=/usr/bin/racket + --enable-scheme=${_chezscheme_path}" hostmakedepends+=" racket sqlite-devel" -fi -case "$XBPS_TARGET_MACHINE" in -ppc*) - broken="hangs or segfaults";; -*-musl) - makedepends+=" libucontext-devel";; -esac + # Build ChezScheme for the host so we can use it to build Racket + # Using "--enable-racket=auto" above selects the wrong compiler toolchain + pre_build() { + # Make sure we don't get lost + _correct_position=$(pwd) + cd ${_chezscheme_path}/ChezScheme -pre_configure() { - case "$XBPS_TARGET_MACHINE" in - *-musl) - export CFLAGS+=" -D_GNU_SOURCE" - export LIBS+=" -lucontext" - ;; - esac -} + # If this builds the wrong arch, Racket's automatic + # arch detection for the ChezScheme build has failed. + # See <Racket sourcedir>/src/ChezScheme/IMPLEMENTATION.md "Build System" + # and <Racket sourcedir>/src/ChezScheme/s/cmacros.ss "define-machine-types" + # for the "machine-type" variable that needs to be passed to rktboot/main.rkt + racket rktboot/main.rkt + # Make sure Chez builds natively + env CC="gcc" \ + AR="ar" \ + ARFLAGS="rc" \ + RANLIB="ranlib" \ + CFLAGS="-m${XBPS_WORDSIZE} -O2 -D_REENTRANT -pthread" \ + -LDFLAGS="-Wl,-z,relro -Wl,-z,now -Wl,--as-needed -L/usr/lib -rdynamic" \ + ./configure --disable-curses --disable-x11 + make + + cd ${_correct_position} + } +fi post_install() { vlicense LICENSE-libscheme.txt @@ -47,9 +61,6 @@ racket-doc_package() { short_desc+=" - documentation" depends="racket>=${version}_${revision}" pkg_install() { - # Remove once --disable-doc can be removed - echo "Documentation currently not available." \ - > ${DESTDIR}/usr/share/doc/racket/no-doc.txt vmove usr/share/doc/racket } }
[-- Attachment #1: Type: text/plain, Size: 328 bytes --] New comment by leahneukirchen on void-packages repository https://github.com/void-linux/void-packages/pull/34853#issuecomment-1013286270 Comment: Looks pretty good, but i'm worried about all the Pango warnings in the logs. Can you verify the generated images have text? Perhaps liberation-fonts-ttf or something is needed.
[-- Attachment #1: Type: text/plain, Size: 207 bytes --] New comment by Marie-Joseph on void-packages repository https://github.com/void-linux/void-packages/pull/34853#issuecomment-1013627024 Comment: I am using them and can confirm they have text and images :)
[-- Attachment #1: Type: text/plain, Size: 315 bytes --] New comment by Marie-Joseph on void-packages repository https://github.com/void-linux/void-packages/pull/34853#issuecomment-1013627024 Comment: I am using them and can confirm they have text and images. It may be using fallback fonts, though. I'll try adding some font dependencies and see if that helps, though.
[-- Attachment #1: Type: text/plain, Size: 1360 bytes --] There's a merged pull request on the void-packages repository racket: re-enable cross-compilation https://github.com/void-linux/void-packages/pull/34853 Description: * remove nocross * expound precise arch support (based on Racket's Chez Scheme support) * remove unneeded musl deps * put documentation behind a switch (builds fine, takes too long for CI) #### Testing the changes - I tested the changes in this PR: **YES** #### Local build testing - I built this PR locally for these architectures: - aarch64-musl - native and cross - x86_64-musl - native ### Notes Racket's architecture support is limited only by Chez Scheme. The Chez Scheme it uses supports all the architectures we do except MIPS and PowerPC64. However, when trying to cross-compile for PowerPC 32-bit musl, I found that an absolute boat load of dependencies had to be compiled first. This would make CI take way too long, so I've simply omitted all PowerPC platforms. It wasn't supported before anyway, so this is still progress. I don't actually know for sure that building documentation would cause this to time out. However, I didn't want to risk it (it does take a really long time, I just didn't time it), and this still makes local Racket documentation more accessible than it was before. (I use local documentation heavily, so this is important to me.)