From 09527a512dae66a45f9b49fac6839c012972b83c Mon Sep 17 00:00:00 2001 From: Jens Petersen Date: Thu, 23 Feb 2017 20:58:38 +0900 Subject: [PATCH] subpackages can contain numbers and need --user --- ghc-rpm-macros.spec | 6 +++++- macros.ghc | 4 ++-- macros.ghc-extra | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ghc-rpm-macros.spec b/ghc-rpm-macros.spec index 0da784c..d063ce2 100644 --- a/ghc-rpm-macros.spec +++ b/ghc-rpm-macros.spec @@ -10,7 +10,7 @@ #%%global without_hscolour 1 Name: ghc-rpm-macros -Version: 1.6.16 +Version: 1.6.17 Release: 1%{?dist} Summary: RPM macros for building Haskell packages for GHC @@ -147,6 +147,10 @@ EOF %changelog +* Wed Feb 22 2017 Jens Petersen - 1.6.17-1 +- setup --global/--user in cabal_configure +- allow subpackage names to contain digits + * Wed Feb 22 2017 Jens Petersen - 1.6.16-1 - fix generation of haddock's - fix fixing of rpaths for subpackages diff --git a/macros.ghc b/macros.ghc index 2816c60..c08af31 100644 --- a/macros.ghc +++ b/macros.ghc @@ -31,7 +31,7 @@ fi CFLAGS="${CFLAGS:-%optflags}"; export CFLAGS\ %endif\ LDFLAGS="${LDFLAGS:-%{?__global_ldflags}}"; export LDFLAGS\ -%cabal configure --prefix=%{_prefix} --libdir=%{_libdir} --docdir=%{_ghcdocdir} --libsubdir='$compiler/$pkgkey' --datasubdir='$pkgid' --ghc %{!?ghc_without_dynamic:--enable-executable-dynamic} %{?with_tests:--enable-tests} --ghc-options="${CFLAGS:+$(echo ' '$CFLAGS | sed -e 's/ / -optc/g')} ${LDFLAGS:+$(echo ' '$LDFLAGS | sed -e 's/ / -optl/g')}" %{?cabal_configure_options} $cabal_configure_extra_options +%cabal configure --prefix=%{_prefix} --libdir=%{_libdir} --docdir=%{_ghcdocdir} --libsubdir='$compiler/$pkgkey' --datasubdir='$pkgid' --ghc %{!?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')}" %{?cabal_configure_options} $cabal_configure_extra_options # install %cabal_install %cabal copy --destdir=%{buildroot} %{?cabal_install_options} @@ -117,7 +117,7 @@ install -D --mode=0644 %{pkgnamever}.conf %{buildroot}%{ghclibdir}/package.conf. # ghc_lib_build_without_haddock [name] [version] %ghc_lib_build_without_haddock()\ %global debug_package %{nil}\ -%cabal_configure %{!?without_prof:-p} %{!?ghc_without_shared:--enable-shared} %{?ghc_without_shared:--disable-shared} %{?pkg_name:--htmldir=%{ghclibdocdir}/%{pkg_name}-%{version}} %{?1:--docdir=%{?_defaultlicensedir}%{!?_defaultlicensedir:%_docdir}/ghc-%1%{!?fedora:-%2} --htmldir=%{ghclibdocdir}/%1-%2} %{?ghc_subpackaging:--user}%{!?ghc_subpackaging:--global} %{?ghc_with_lib_for_ghci:--enable-library-for-ghci}\ +%cabal_configure %{!?without_prof:-p} %{!?ghc_without_shared:--enable-shared} %{?ghc_without_shared:--disable-shared} %{?pkg_name:--htmldir=%{ghclibdocdir}/%{pkg_name}-%{version}} %{?1:--docdir=%{?_defaultlicensedir}%{!?_defaultlicensedir:%_docdir}/ghc-%1%{!?fedora:-%2} --htmldir=%{ghclibdocdir}/%1-%2} %{?ghc_with_lib_for_ghci:--enable-library-for-ghci}\ %cabal build %{?cabal_build_options}\ %{nil} diff --git a/macros.ghc-extra b/macros.ghc-extra index 4b1686b..189953a 100644 --- a/macros.ghc-extra +++ b/macros.ghc-extra @@ -5,7 +5,7 @@ %ghc_lib_subpackage(c:dl:x)\ %define pkgname %{?2:%{1}}%{!?2:%{lua:\ local pv = rpm.expand("%1")\ -local _, _, name = string.find(pv, "^([%a-]+)-")\ +local _, _, name = string.find(pv, "^([%a%d-]+)-")\ print(name)\ }}\ %define pkgver %{?2}%{!?2:%{lua:\