Compare commits

...

10 Commits

Author SHA1 Message Date
David Abdurachmanov 0f09180d62
Update spec for riscv64
Signed-off-by: David Abdurachmanov <davidlt@rivosinc.com>
2023-11-20 19:35:55 +02:00
David Abdurachmanov c2660c6ba0
Changes for riscv64
These remove a ton of verbose warnings on riscv64 unregistered build.

RISCV might be unstable with -j higher than 1. This needs retesting.
Last time tested with GHC 9.2 + LLVM 12 and 13, not with the current GHC
9.4 + LLVM 14.

Signed-off-by: David Abdurachmanov <davidlt@rivosinc.com>
2023-11-20 19:33:49 +02:00
Jens Petersen a8ecfed0e9 prepare 2.6.5 2023-11-12 20:27:40 +08:00
Jens Petersen beafd4c14d improve ghc-info.sh with a show mode 2023-11-12 15:49:12 +08:00
Jens Petersen 52c1a4cf86 ghc-deps.sh: make ghc-version arg cleaner 2023-11-12 15:44:28 +08:00
Jens Petersen e0969bcd81 ghc-deps.sh: ghc-9.8 prof fixes from opensuse (mimi1vx) 2023-11-12 15:44:21 +08:00
Jens Petersen 6de96812b5 append \ to flatpak comments 2023-11-09 13:01:48 +08:00
Jens Petersen 6fc265fb5e add comments about flatpak hardcoding of paths 2023-11-09 11:51:13 +08:00
Yaakov Selkowitz cb06e9e98f Fix flatpak builds
Packages to be installed into flatpaks are built with the /app prefix
but build-only dependencies use the system packages in /usr.  Since ghc
falls into the latter category, installation path macros must not be
used to reference their installed location.
2023-10-30 19:02:40 -04:00
Jens Petersen 0a2fb947eb Revert "ghc_gen_filelists: tweak haddock_dir for ghc-9.8 short hash suffices"
This reverts commit 1466da90e6.

instead removing the ghc9.8 haddock dirs hashes
2023-10-26 09:58:40 +08:00
5 changed files with 44 additions and 22 deletions

View File

@ -1,7 +1,7 @@
#!/bin/sh
# find rpm provides and requires for Haskell GHC libraries
[ $# -lt 3 ] && echo "Usage: $(basename "$0") [--provides|--requires] %{buildroot} %{ghclibdir} [ghc-version]" && exit 1
[ $# -lt 3 ] && echo "Usage: $(basename "$0") [--provides|--requires] %{buildroot} %{ghclibdir} [ghc-<version>]" && exit 1
set +x -e
@ -45,9 +45,16 @@ for i in $files; do
esac
done
;;
*/libHS*_p.a)
pkgver=$(basename "$(dirname "$i")")
if [ -e "$BUILDROOT$PKGCONFDIR/$pkgver.conf" ]; then
$BUILDROOT$PKGBASELIB/*/libHS*_p.a)
pkgverhash=$(basename "$(dirname "$i")")
case $i in
$BUILDROOT$PKGBASELIB/*-linux-ghc-9.8.*)
pkgver=$(echo $pkgverhash | sed -e "s/\(.*\)-.*/\\1/")
;;
*) pkgver=$pkgverhash
;;
esac
if [ -e "$BUILDROOT$PKGCONFDIR/$pkgverhash.conf" ]; then
ids=$($GHC_PKG field "$pkgver" "$field" | sed -e "s/\(^\| \)rts\( \|$\)/ /" -e "s/bin-package-db-[^ ]\+//")
else
conf=$(basename "$i" | sed -e "s%libHS%$BUILDROOT$PKGCONFDIR/%" -e 's%_p.a%.conf%')
@ -64,7 +71,7 @@ for i in $files; do
;;
*)
for f in "$PKGBASELIB"/*/libHS"${d}"_p.a "$BUILDROOT$PKGBASELIB"/*/libHS"${d}"_p.a "$PKGBASELIB"/*/*/libHS"${d}"_p.a "$BUILDROOT$PKGBASELIB"/*/*/libHS"${d}"_p.a; do
if [ -f $f ]; then
if [ -f "$f" ]; then
echo "$GHCPREFIX-prof($d)"
break
fi

View File

@ -1,8 +1,12 @@
#!/bin/sh
[ $# -lt 2 ] && echo "Usage: $(basename "$0") GHCVERSION INFOFIELD"
[ $# -lt 1 ] && echo "Usage: $(basename "$0") GHCVERSION INFOFIELD" && exit 1
GHCVER=$1
FIELD=$2
GHCVER="$1"
FIELD="$2"
/usr/bin/ghc-${GHCVER} --info | grep \"$FIELD\" | sed -e 's/.*","\(.*\)")/\1/'
if [ -z "$FIELD" ]; then
/usr/bin/ghc-${GHCVER} --info | sed -e 's/.*(\(".*"\),\(".*"\).*/\1: \2/' -e '/]/d'
else
/usr/bin/ghc-${GHCVER} --info | grep \""$FIELD"\" | sed -e 's/.*","\(.*\)")/\1/'
fi

View File

@ -7,8 +7,8 @@
%endif
Name: ghc-rpm-macros
Version: 2.6.2
Release: 1%{?dist}
Version: 2.6.5
Release: 1.0.riscv64%{?dist}
Summary: RPM macros for building Haskell packages for GHC
License: GPL-3.0-or-later
@ -185,8 +185,19 @@ mkdir -p %{buildroot}%{_docdir}/ghc/html/libraries
%changelog
* Thu Oct 26 2023 Jens Petersen <petersen@redhat.com> - 2.6.2-1
- ghc_gen_filelists: tweak haddock_dir for ghc-9.8 short hash suffices
* Mon Nov 20 2023 David Abdurachmanov <davidlt@rivosinc.com> - 2.6.5-1.0.riscv64
- Set -j to 1 on riscv64
- Reduce warning verbosity on riscv64
* Sun Nov 12 2023 Jens Petersen <petersen@redhat.com> - 2.6.5-1
- ghc-deps.sh: ghc-9.8 prof fixes adapted from mimi1vx (opensuse)
- improve ghc-info.sh with a show mode
* Thu Nov 9 2023 Jens Petersen <petersen@redhat.com> - 2.6.4-1
- fix my flatpak comments
* Mon Oct 30 2023 Yaakov Selkowitz <yselkowi@redhat.com> - 2.6.3-1
- Fix flatpak builds
* Tue Oct 24 2023 Jens Petersen <petersen@redhat.com> - 2.6.1-1
- ghc_gen_filelists: tweak pkgdir for ghc-9.8 short hash suffices

View File

@ -79,7 +79,7 @@ fi\
%global _lto_cflags %{nil}\
%global __brp_strip_lto %{nil}\
CFLAGS="${CFLAGS:-%optflags}"\
%ifarch s390x\
%ifarch s390x riscv64\
%if %[v"%{ghc_version}" < v"9.2"]\
# -Wunused-label is extremely noisy\
CFLAGS="$(echo ${CFLAGS:-%optflags} | sed -e 's/-Wall //' -e 's/-Werror=format-security //')"\
@ -95,13 +95,15 @@ export LDFLAGS="${LDFLAGS:-%{?__global_ldflags}}"\
%cabal_configure\
%ghc_set_gcc_flags\
if ! [ -f Setup.hs -o -f Setup.lhs ]; then\
cp %{_datadir}/ghc-rpm-macros/Setup.hs .\
# datadir hardcoded for flatpaks\
cp /usr/share/ghc-rpm-macros/Setup.hs .\
fi\
if [ -d "%{ghclibdir}/lib" ]; then\
subsubdir=/lib\
fi\
%cabal --version\
%cabal configure %{!-W:%{?ghc_name:--with-compiler=%{_bindir}/ghc-%{ghc_version}}} --prefix=%{_prefix} --libdir=%{_libdir} --docdir=%{_ghcdocdir} --libsubdir='$compiler'${subsubdir}/'$pkgid' --datasubdir='$pkgid' --libexecsubdir='$pkgid' --ghc --dynlibdir=%{?_ghcdynlibdir}%{?!_ghcdynlibdir:%{_libdir}/ghc-%{ghc_version}${subsubdir}} %{!?ghc_without_dynamic:--enable-executable-dynamic} %{?with_tests:--enable-tests} %{?ghc_subpackaging:--user}%{!?ghc_subpackaging:--global} --ghc-options="${CFLAGS:+$(echo ' '$CFLAGS | sed -e 's/ / -optc/g')} ${LDFLAGS:+$(echo ' '$LDFLAGS | sed -e 's/ / -optl/g')} -fhide-source-paths" %{?cabal_configure_options} $cabal_configure_extra_options
# bindir hardcoded for flatpaks\
%cabal configure %{!-W:%{?ghc_name:--with-compiler=/usr/bin/ghc-%{ghc_version}}} --prefix=%{_prefix} --libdir=%{_libdir} --docdir=%{_ghcdocdir} --libsubdir='$compiler'${subsubdir}/'$pkgid' --datasubdir='$pkgid' --libexecsubdir='$pkgid' --ghc --dynlibdir=%{?_ghcdynlibdir}%{?!_ghcdynlibdir:%{_libdir}/ghc-%{ghc_version}${subsubdir}} %{!?ghc_without_dynamic:--enable-executable-dynamic} %{?with_tests:--enable-tests} %{?ghc_subpackaging:--user}%{!?ghc_subpackaging:--global} --ghc-options="${CFLAGS:+$(echo ' '$CFLAGS | sed -e 's/ / -optc/g')} ${LDFLAGS:+$(echo ' '$LDFLAGS | sed -e 's/ / -optl/g')} -fhide-source-paths" %{?flatpak:--extra-lib-dirs=%{_libdir}} %{?cabal_configure_options} $cabal_configure_extra_options
# install
%cabal_install %cabal copy --destdir=%{buildroot} %{?cabal_install_options}
@ -197,11 +199,8 @@ fi\
ls %{buildroot}%{ghcliblib}${subsubdir}/package.conf.d/%{pkgnamever}*.conf >> %{basepkg}-devel.files\
%if %{with haddock}\
haddock_dir=%{ghc_html_libraries_dir}/%{pkgnamever}\
%if %[v"%{ghc_version}" > v"9.8"]\
haddock_dir="${haddock_dir}-*"\
%endif\
if [ -d %{buildroot}$haddock_dir ]; then\
echo %{buildroot}$haddock_dir >> %{basepkg}-doc.files\
echo $haddock_dir >> %{basepkg}-doc.files\
%if %{with hadrian}\
# for < 9.4.1-rc1\
else\
@ -305,7 +304,8 @@ done\
done\
%endif
%ghc_pkg_recache %{_bindir}/ghc-pkg-%{ghc_version} recache --no-user-package-db || :
# bindir hardcoded for flatpaks
%ghc_pkg_recache /usr/bin/ghc-pkg-%{ghc_version} recache --no-user-package-db || :
# skip prof libs and documentation
%ghc_quick_build\

View File

@ -8,4 +8,4 @@
%with_haddock 1
# %%{?_smp_ncpus_max:--jobs=%%{?_smp_ncpus_max}}
%ghc_smp_mflags %{?_smp_mflags}
%ghc_smp_mflags -j1