[packages/ghc-text-short] Initial

arekm arekm at pld-linux.org
Sun Nov 29 15:19:16 CET 2026


commit 7a9daa921cb7828e580de82293aa5f925f5a2120
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Sat Oct 17 19:42:40 2026 +0200

    Initial

 ghc-text-short.spec | 117 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 117 insertions(+)
---
diff --git a/ghc-text-short.spec b/ghc-text-short.spec
new file mode 100644
index 0000000..fba9089
--- /dev/null
+++ b/ghc-text-short.spec
@@ -0,0 +1,117 @@
+#
+# Conditional build:
+%bcond_without	prof	# profiling library
+#
+%define		pkgname	text-short
+Summary:	Memory-efficient representation of Unicode text strings
+Name:		ghc-%{pkgname}
+Version:	0.1.6
+Release:	1
+License:	BSD
+Group:		Development/Languages
+#Source0Download: https://hackage.haskell.org/package/text-short
+Source0:	https://hackage.haskell.org/package/%{pkgname}-%{version}/%{pkgname}-%{version}.tar.gz
+# Source0-md5:	97c166026623a6d9b017d2e7927fc709
+URL:		https://hackage.haskell.org/package/text-short
+# Hackage revision 3 of the .cabal file (relaxed dependency bounds)
+Source1:	https://hackage.haskell.org/package/%{pkgname}-%{version}/revision/3.cabal?/%{pkgname}-%{version}-r3.cabal
+# Source1-md5:	efd0d6933a5cd38696c55b470a3521be
+BuildRequires:	ghc
+BuildRequires:	ghc-hashable
+%if %{with prof}
+BuildRequires:	ghc-prof
+BuildRequires:	ghc-hashable-prof
+%endif
+BuildRequires:	rpmbuild(macros) >= 1.608
+%requires_eq	ghc
+Requires(post,postun):	/usr/bin/ghc-pkg
+Requires:	ghc-hashable
+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
+This package provides the 'ShortText' type which is suitable for
+keeping many short strings in memory. This is similiar to how
+'ShortByteString' relates to 'ByteString'.
+
+The main difference between 'Text' and 'ShortText' is that 'ShortText'
+doesn't support zero-copy slicing (thereby saving 2 words), and,
+compared to text-1.*, that it uses UTF-8 instead of UTF-16 internally.
+Consequently, the memory footprint of a (boxed) 'ShortText' value is 4
+words (2 words when unboxed) plus the length of the UTF-8 encoded
+payload.
+
+%package prof
+Summary:	Profiling %{pkgname} library for GHC
+Group:		Development/Libraries
+Requires:	%{name} = %{version}-%{release}
+Requires:	ghc-hashable-prof
+
+%description prof
+Profiling %{pkgname} library for GHC. Should be installed when GHC's
+profiling subsystem is needed.
+
+%prep
+%setup -q -n %{pkgname}-%{version}
+
+cp -p %{SOURCE1} %{pkgname}.cabal
+
+# tarball ships no Setup script
+echo 'import Distribution.Simple; main = defaultMain' > Setup.hs
+
+%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}/lib/package.conf.d
+
+runhaskell Setup.hs copy --destdir=$RPM_BUILD_ROOT
+
+# work around automatic haddock docs installation
+rm -rf %{name}-%{version}-doc
+%{__mv} $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version} %{name}-%{version}-doc
+
+runhaskell Setup.hs register \
+	--gen-pkg-config=$RPM_BUILD_ROOT%{_libdir}/%{ghcdir}/lib/package.conf.d/%{pkgname}.conf
+
+# the library directory name contains an ABI hash, so build the file lists
+pkgdir=$(echo $RPM_BUILD_ROOT%{_libdir}/*-linux-%{ghcdir}/%{pkgname}-%{version}-*)
+find $pkgdir -type d | sed -e "s|^$RPM_BUILD_ROOT|%dir |" > %{name}.files
+find $pkgdir -type f ! -name '*_p.a' ! -name '*.p_hi' | sed -e "s|^$RPM_BUILD_ROOT||" >> %{name}.files
+find $pkgdir -type f \( -name '*_p.a' -o -name '*.p_hi' \) | sed -e "s|^$RPM_BUILD_ROOT||" > %{name}-prof.files
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post
+%ghc_pkg_recache
+
+%postun
+%ghc_pkg_recache
+
+%files -f %{name}.files
+%defattr(644,root,root,755)
+%doc ChangeLog.md LICENSE %{name}-%{version}-doc/html
+%{_libdir}/%{ghcdir}/lib/package.conf.d/%{pkgname}.conf
+%dir %{_libdir}/*-linux-%{ghcdir}
+%{_libdir}/*-linux-%{ghcdir}/libHS%{pkgname}-%{version}-*.so
+
+%if %{with prof}
+%files prof -f %{name}-prof.files
+%defattr(644,root,root,755)
+%endif
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/ghc-text-short.git/commitdiff/7a9daa921cb7828e580de82293aa5f925f5a2120



More information about the pld-cvs-commit mailing list