[packages/ghc-safe-exceptions] - new

baggins baggins at pld-linux.org
Wed May 27 00:16:30 CEST 2020


commit 0fdbba1bfa7cfbca2abd98ccbd853d7b9e233fa7
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Wed May 27 00:15:49 2020 +0200

    - new

 ghc-8.10.patch           |  17 +++++++
 ghc-safe-exceptions.spec | 115 +++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 132 insertions(+)
---
diff --git a/ghc-safe-exceptions.spec b/ghc-safe-exceptions.spec
new file mode 100644
index 0000000..c142684
--- /dev/null
+++ b/ghc-safe-exceptions.spec
@@ -0,0 +1,115 @@
+#
+# Conditional build:
+%bcond_without	prof	# profiling library
+#
+%define		pkgname	safe-exceptions
+Summary:	Safe, consistent, and easy exception handling
+Name:		ghc-%{pkgname}
+Version:	0.1.7.0
+Release:	1
+License:	MIT
+Group:		Development/Languages
+#Source0Download: http://hackage.haskell.org/package/safe-exceptions
+Source0:	http://hackage.haskell.org/package/%{pkgname}-%{version}/%{pkgname}-%{version}.tar.gz
+# Source0-md5:	a1ef100de8fcb54a3d7b5564fa295f1a
+Patch0:		ghc-8.10.patch
+URL:		http://hackage.haskell.org/package/safe-exceptions
+BuildRequires:	ghc >= 6.12.3
+%if %{with prof}
+BuildRequires:	ghc-prof
+%endif
+BuildRequires:	rpmbuild(macros) >= 1.608
+%requires_eq	ghc
+Requires(post,postun):	/usr/bin/ghc-pkg
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+# debuginfo is not useful for ghc
+%define		_enable_debug_packages	0
+
+# don't compress haddock files
+%define		_noautocompressdoc	*.haddock
+
+%description
+Runtime exceptions - as exposed in base by the Control.Exception
+module - have long been an intimidating part of the Haskell ecosystem.
+This package, and this README for the package, are intended to
+overcome this. It provides a safe and simple API on top of the
+existing exception handling machinery. The API is equivalent to
+the underlying implementation in terms of power but encourages best
+practices to minimize the chances of getting the exception handling
+wrong. By doing so and explaining the corner cases clearly, the hope
+is to turn what was previously something scary into an aspect of
+Haskell everyone feels safe using.
+
+%package prof
+Summary:	Profiling %{pkgname} library for GHC
+Summary(pl.UTF-8):	Biblioteka profilująca %{pkgname} dla GHC
+Group:		Development/Libraries
+Requires:	%{name} = %{version}-%{release}
+
+%description prof
+Profiling %{pkgname} library for GHC.  Should be installed when
+GHC's profiling subsystem is needed.
+
+%description prof -l pl.UTF-8
+Biblioteka profilująca %{pkgname} dla GHC. Powinna być zainstalowana
+kiedy potrzebujemy systemu profilującego z GHC.
+
+%prep
+%setup -q -n %{pkgname}-%{version}
+%patch0 -p1
+
+%build
+runhaskell Setup.hs configure -v2 \
+	%{?with_prof:--enable-library-profiling} \
+	--prefix=%{_prefix} \
+	--libdir=%{_libdir} \
+	--libexecdir=%{_libexecdir} \
+	--docdir=%{_docdir}/%{name}-%{version}
+
+runhaskell Setup.hs build
+runhaskell Setup.hs haddock --executables
+
+%install
+rm -rf $RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT%{_libdir}/%{ghcdir}/package.conf.d
+
+runhaskell Setup.hs copy --destdir=$RPM_BUILD_ROOT
+
+# work around automatic haddock docs installation
+%{__rm} -rf %{name}-%{version}-doc
+cp -a $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version} %{name}-%{version}-doc
+%{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}
+
+runhaskell Setup.hs register \
+	--gen-pkg-config=$RPM_BUILD_ROOT%{_libdir}/%{ghcdir}/package.conf.d/%{pkgname}.conf
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post
+%ghc_pkg_recache
+
+%postun
+%ghc_pkg_recache
+
+%files
+%defattr(644,root,root,755)
+%doc COOKBOOK.md ChangeLog.md LICENSE README.md %{name}-%{version}-doc/html
+%{_libdir}/%{ghcdir}/package.conf.d/%{pkgname}.conf
+%dir %{_libdir}/%{ghcdir}/%{pkgname}-%{version}
+%{_libdir}/%{ghcdir}/%{pkgname}-%{version}/*.so
+%{_libdir}/%{ghcdir}/%{pkgname}-%{version}/*.a
+%exclude %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/*_p.a
+
+%dir %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Control
+%dir %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Control/Exception
+%{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Control/Exception/*.hi
+%{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Control/Exception/*.dyn_hi
+
+%if %{with prof}
+%files prof
+%defattr(644,root,root,755)
+%{_libdir}/%{ghcdir}/%{pkgname}-%{version}/*_p.a
+%{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Control/Exception/*.p_hi
+%endif
diff --git a/ghc-8.10.patch b/ghc-8.10.patch
new file mode 100644
index 0000000..6ca138a
--- /dev/null
+++ b/ghc-8.10.patch
@@ -0,0 +1,17 @@
+--- safe-exceptions-0.1.7.0/safe-exceptions.cabal~	2018-01-18 16:32:22.000000000 +0100
++++ safe-exceptions-0.1.7.0/safe-exceptions.cabal	2020-05-27 00:09:09.907669342 +0200
+@@ -16,10 +16,10 @@
+ library
+   hs-source-dirs:      src
+   exposed-modules:     Control.Exception.Safe
+-  build-depends:       base >= 4.7 && < 4.11
+-                     , deepseq >= 1.2 && < 1.5
+-                     , exceptions >= 0.8 && < 0.9
+-                     , transformers >= 0.2 && < 0.6
++  build-depends:       base >= 4.7
++                     , deepseq >= 1.2
++                     , exceptions >= 0.8
++                     , transformers >= 0.2
+   default-language:    Haskell2010
+ 
+ test-suite safe-exceptions-test
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/ghc-safe-exceptions.git/commitdiff/0fdbba1bfa7cfbca2abd98ccbd853d7b9e233fa7



More information about the pld-cvs-commit mailing list