- Switch over to pb (Platform without native-code Backend) for

architectures which do not build
- Add patch racket-fortify.patch to make it build with latest gcc

OBS-URL: https://build.opensuse.org/package/show/devel:languages:misc/racket?expand=0&rev=87
This commit is contained in:
Fred Fu 2024-07-25 14:41:56 +00:00 committed by Git OBS Bridge
parent 3170f77f5e
commit cf94c9b449
4 changed files with 113 additions and 19 deletions

View File

@ -28,4 +28,22 @@
</cpu>
</hardware>
</overwrite>
<overwrite>
<conditions>
<arch>ppc64le</arch>
<arch>s390x</arch>
</conditions>
<hardware>
<physicalmemory>
<size unit="G">8</size>
</physicalmemory>
<memory>
<size unit="G">12</size>
</memory>
<processors>8</processors>
<disk>
<size unit="G">4</size>
</disk>
</hardware>
</overwrite>
</constraints>

53
racket-fortify.patch Normal file
View File

@ -0,0 +1,53 @@
---
src/rktio/rktio_fs.c | 4 +++-
src/start/ustart.c | 5 +++--
2 files changed, 6 insertions(+), 3 deletions(-)
--- src/rktio/rktio_fs.c
+++ src/rktio/rktio_fs.c 2024-06-18 12:25:03.035413375 +0000
@@ -1,6 +1,7 @@
#include "rktio.h"
#include "rktio_private.h"
#include <errno.h>
+#include <limits.h>
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
@@ -1092,7 +1093,8 @@ char *rktio_readlink(rktio_t *rktio, con
return NULL;
}
#else
- int len, buf_len = 256;
+ ssize_t len;
+ size_t buf_len = PATH_MAX;
char *buffer = malloc(buf_len);
while (1) {
--- src/start/ustart.c
+++ src/start/ustart.c 2024-06-18 12:25:13.635224103 +0000
@@ -10,6 +10,7 @@
#include <string.h>
#include <fcntl.h>
#include <errno.h>
+#include <limits.h>
#include <stdio.h>
#if defined(__GNUC__)
@@ -266,7 +267,7 @@ int main(int argc, char **argv)
char *exe_path, *lib_path, *dll_path;
int start, decl_end, prog_end, end, count, fd, v, en, x11;
int argpos, inpos, collcount = 1, fix_argv;
- int bufsize = 127;
+ size_t bufsize = PATH_MAX;
if (config[7] == '[') {
write_str(2, argv[0]);
@@ -280,7 +281,7 @@ int main(int argc, char **argv)
/* resolve soft links */
while (1) {
- int len;
+ ssize_t len;
char *buf;
buf = (char *)malloc(bufsize + 1);
len = readlink(me, buf, bufsize);

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Fri Jun 21 07:17:41 UTC 2024 - Dr. Werner Fink <werner@suse.de>
- Switch over to pb (Platform without native-code Backend) for
architectures which do not build
- Add patch racket-fortify.patch to make it build with latest gcc
-------------------------------------------------------------------
Fri May 24 13:46:41 UTC 2024 - Martin Schreiner <martin.schreiner@suse.com>

View File

@ -17,6 +17,7 @@
#
%global _configure ../configure
Name: racket
Version: 8.13
Release: 0
@ -28,6 +29,7 @@ Source0: http://download.racket-lang.org/installers/%{version}/%{name}-%{
Source2: racket-completion.bash
Source3: racket-rpmlintrc
Patch0: racket-doc.patch
Patch1: racket-fortify.patch
BuildRequires: ImageMagick
BuildRequires: ca-certificates
BuildRequires: chrpath
@ -126,16 +128,32 @@ cp -p %{SOURCE2} src/
%build
cd src/
mkdir build
pushd build
%add_optflags -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=500 -fno-gcse -Wno-stringop-overread
#
# Overwrite stack size limit (hopefully a soft limit only)
#
for flag in s l m
do
ulimit -H$flag unlimited || true
ulimit -S$flag unlimited || true
done
echo "int main () { return !(sizeof(void*) >= 8); }" | gcc -x c -o test64 -
echo "int main () { return !(((union {unsigned int x; unsigned char c; }){1}).c); }" | gcc -x c -o testendianess -
./test64 && wide=64 || wide=32
./testendianess && endianess=l || endianess=b
rm -f test64 testendianess
mach=tpb${wide}${endianess}
unset wide endianess
%configure \
--prefix="%{_prefix}" \
--exec-prefix="%{_prefix}" \
--libdir=%{_libdir} \
--docdir="%{_defaultdocdir}/%{name}" \
--enable-shared \
%ifarch ppc64 ppc64le s390x
--enable-bcdefault \
%ifarch ppc64le s390x
--enable-pb --enable-mach=$mach \
%endif
--disable-static \
--disable-strip \
@ -145,9 +163,12 @@ cd src/
--enable-liblz4 \
--enable-pthread
%make_build
popd
%install
topdir=$(pwd)
cd src/
pushd build
# use the following if setting extra plt_setup options
# export LD_LIBRARY_PATH=%%{buildroot}%%{_libdir}
@ -157,6 +178,8 @@ install -d %{buildroot}/%{_datadir}/doc/%{name}/
%make_install
popd
# we do not need *.la and *.a files
find %{buildroot}%{_libdir} -name "*.la" -delete
find %{buildroot}%{_libdir} -name "*.a" -delete
@ -224,6 +247,14 @@ install -m 0644 ../README %{buildroot}%{_docdir}/%{name}/README
%fdupes %{buildroot}%{_prefix}
#
# Dynamically determine which files gets installed
# bc, cs, and pb builds
#
pushd %{buildroot}%{_libdir}
find \( -name '*.boot' -o -name '*.so*' -o -name '*.lo' -o -name '*.o' -o -name bootinfo \) -printf '%{_libdir}/%%P\n' > ${topdir}/file.list
popd
%post
/sbin/ldconfig
%desktop_database_post
@ -232,7 +263,7 @@ install -m 0644 ../README %{buildroot}%{_docdir}/%{name}/README
/sbin/ldconfig
%desktop_database_postun
%files
%files -f file.list
%doc %dir %{_docdir}/%{name}
%doc %{_docdir}/%{name}/README
%{_bindir}/drracket
@ -263,21 +294,6 @@ install -m 0644 ../README %{buildroot}%{_docdir}/%{name}/README
%verify(not md5 size mtime) %{_libdir}/%{name}/*.rktd
%dir %{_libdir}/%{name}/compiled/
%{_libdir}/%{name}/compiled/*
%ifnarch ppc64 ppc64le s390x
%{_libdir}/%{name}/petite.boot
%{_libdir}/%{name}/racket.boot
%{_libdir}/%{name}/scheme.boot
%endif
%ifarch ppc64 ppc64le s390x
%{_libdir}/libracket3m*
%{_libdir}/%{name}/buildinfo
%endif
%ifarch s390x
%{_libdir}/%{name}/mzdyn3m.o
%endif
%ifarch ppc64 ppc64le
%{_libdir}/%{name}/mzdyn3m.lo
%endif
%{_mandir}/man1/mz*
%{_mandir}/man1/racket*
%{_mandir}/man1/raco*