Compare commits
10 Commits
1466da90e6
...
0f09180d62
Author | SHA1 | Date | |
---|---|---|---|
0f09180d62 | |||
c2660c6ba0 | |||
|
a8ecfed0e9 | ||
|
beafd4c14d | ||
|
52c1a4cf86 | ||
|
e0969bcd81 | ||
|
6de96812b5 | ||
|
6fc265fb5e | ||
|
cb06e9e98f | ||
|
0a2fb947eb |
17
ghc-deps.sh
17
ghc-deps.sh
@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# find rpm provides and requires for Haskell GHC libraries
|
# 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
|
set +x -e
|
||||||
|
|
||||||
@ -45,9 +45,16 @@ for i in $files; do
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
;;
|
;;
|
||||||
*/libHS*_p.a)
|
$BUILDROOT$PKGBASELIB/*/libHS*_p.a)
|
||||||
pkgver=$(basename "$(dirname "$i")")
|
pkgverhash=$(basename "$(dirname "$i")")
|
||||||
if [ -e "$BUILDROOT$PKGCONFDIR/$pkgver.conf" ]; then
|
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-[^ ]\+//")
|
ids=$($GHC_PKG field "$pkgver" "$field" | sed -e "s/\(^\| \)rts\( \|$\)/ /" -e "s/bin-package-db-[^ ]\+//")
|
||||||
else
|
else
|
||||||
conf=$(basename "$i" | sed -e "s%libHS%$BUILDROOT$PKGCONFDIR/%" -e 's%_p.a%.conf%')
|
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
|
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)"
|
echo "$GHCPREFIX-prof($d)"
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
|
12
ghc-info.sh
12
ghc-info.sh
@ -1,8 +1,12 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
[ $# -lt 2 ] && echo "Usage: $(basename "$0") GHCVERSION INFOFIELD"
|
[ $# -lt 1 ] && echo "Usage: $(basename "$0") GHCVERSION INFOFIELD" && exit 1
|
||||||
|
|
||||||
GHCVER=$1
|
GHCVER="$1"
|
||||||
FIELD=$2
|
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
|
||||||
|
@ -7,8 +7,8 @@
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
Name: ghc-rpm-macros
|
Name: ghc-rpm-macros
|
||||||
Version: 2.6.2
|
Version: 2.6.5
|
||||||
Release: 1%{?dist}
|
Release: 1.0.riscv64%{?dist}
|
||||||
Summary: RPM macros for building Haskell packages for GHC
|
Summary: RPM macros for building Haskell packages for GHC
|
||||||
|
|
||||||
License: GPL-3.0-or-later
|
License: GPL-3.0-or-later
|
||||||
@ -185,8 +185,19 @@ mkdir -p %{buildroot}%{_docdir}/ghc/html/libraries
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Thu Oct 26 2023 Jens Petersen <petersen@redhat.com> - 2.6.2-1
|
* Mon Nov 20 2023 David Abdurachmanov <davidlt@rivosinc.com> - 2.6.5-1.0.riscv64
|
||||||
- ghc_gen_filelists: tweak haddock_dir for ghc-9.8 short hash suffices
|
- 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
|
* 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
|
- ghc_gen_filelists: tweak pkgdir for ghc-9.8 short hash suffices
|
||||||
|
16
macros.ghc
16
macros.ghc
@ -79,7 +79,7 @@ fi\
|
|||||||
%global _lto_cflags %{nil}\
|
%global _lto_cflags %{nil}\
|
||||||
%global __brp_strip_lto %{nil}\
|
%global __brp_strip_lto %{nil}\
|
||||||
CFLAGS="${CFLAGS:-%optflags}"\
|
CFLAGS="${CFLAGS:-%optflags}"\
|
||||||
%ifarch s390x\
|
%ifarch s390x riscv64\
|
||||||
%if %[v"%{ghc_version}" < v"9.2"]\
|
%if %[v"%{ghc_version}" < v"9.2"]\
|
||||||
# -Wunused-label is extremely noisy\
|
# -Wunused-label is extremely noisy\
|
||||||
CFLAGS="$(echo ${CFLAGS:-%optflags} | sed -e 's/-Wall //' -e 's/-Werror=format-security //')"\
|
CFLAGS="$(echo ${CFLAGS:-%optflags} | sed -e 's/-Wall //' -e 's/-Werror=format-security //')"\
|
||||||
@ -95,13 +95,15 @@ export LDFLAGS="${LDFLAGS:-%{?__global_ldflags}}"\
|
|||||||
%cabal_configure\
|
%cabal_configure\
|
||||||
%ghc_set_gcc_flags\
|
%ghc_set_gcc_flags\
|
||||||
if ! [ -f Setup.hs -o -f Setup.lhs ]; then\
|
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\
|
fi\
|
||||||
if [ -d "%{ghclibdir}/lib" ]; then\
|
if [ -d "%{ghclibdir}/lib" ]; then\
|
||||||
subsubdir=/lib\
|
subsubdir=/lib\
|
||||||
fi\
|
fi\
|
||||||
%cabal --version\
|
%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
|
# install
|
||||||
%cabal_install %cabal copy --destdir=%{buildroot} %{?cabal_install_options}
|
%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\
|
ls %{buildroot}%{ghcliblib}${subsubdir}/package.conf.d/%{pkgnamever}*.conf >> %{basepkg}-devel.files\
|
||||||
%if %{with haddock}\
|
%if %{with haddock}\
|
||||||
haddock_dir=%{ghc_html_libraries_dir}/%{pkgnamever}\
|
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\
|
if [ -d %{buildroot}$haddock_dir ]; then\
|
||||||
echo %{buildroot}$haddock_dir >> %{basepkg}-doc.files\
|
echo $haddock_dir >> %{basepkg}-doc.files\
|
||||||
%if %{with hadrian}\
|
%if %{with hadrian}\
|
||||||
# for < 9.4.1-rc1\
|
# for < 9.4.1-rc1\
|
||||||
else\
|
else\
|
||||||
@ -305,7 +304,8 @@ done\
|
|||||||
done\
|
done\
|
||||||
%endif
|
%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
|
# skip prof libs and documentation
|
||||||
%ghc_quick_build\
|
%ghc_quick_build\
|
||||||
|
@ -8,4 +8,4 @@
|
|||||||
%with_haddock 1
|
%with_haddock 1
|
||||||
|
|
||||||
# %%{?_smp_ncpus_max:--jobs=%%{?_smp_ncpus_max}}
|
# %%{?_smp_ncpus_max:--jobs=%%{?_smp_ncpus_max}}
|
||||||
%ghc_smp_mflags %{?_smp_mflags}
|
%ghc_smp_mflags -j1
|
||||||
|
Loading…
Reference in New Issue
Block a user