diff --git a/.gitignore b/.gitignore index e69de29..182f28c 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/cmark-0.5.1.tar.gz diff --git a/cmark-nobundle.patch b/cmark-nobundle.patch new file mode 100644 index 0000000..483c641 --- /dev/null +++ b/cmark-nobundle.patch @@ -0,0 +1,69 @@ +diff --git a/cmark.cabal b/cmark.cabal +index 48e4c0c..9156baf 100644 +--- a/cmark.cabal ++++ b/cmark.cabal +@@ -48,6 +48,10 @@ Source-repository head + type: git + location: git://github.com/jgm/cmark-hs.git + ++flag pkgconfig ++ default: False ++ description: Use system libcmark via pkgconfig ++ + library + exposed-modules: CMark + build-depends: base >=4.5 && < 4.9, +@@ -57,28 +61,31 @@ library + build-depends: ghc-prim >= 0.2 + default-language: Haskell2010 + ghc-options: -Wall -fno-warn-unused-do-bind +- cc-options: -Wall -std=c99 +- Include-dirs: cbits +- Includes: cmark.h +- c-sources: cbits/houdini_html_u.c +- cbits/references.c +- cbits/utf8.c +- cbits/inlines.c +- cbits/blocks.c +- cbits/cmark.c +- cbits/iterator.c +- cbits/node.c +- cbits/buffer.c +- cbits/cmark_ctype.c +- cbits/houdini_html_e.c +- cbits/houdini_href_e.c +- cbits/scanners.c +- cbits/html.c +- cbits/man.c +- cbits/commonmark.c +- cbits/latex.c +- cbits/xml.c +- cbits/render.c ++ if flag(pkgconfig) ++ pkgconfig-depends: libcmark ++ else ++ cc-options: -Wall -std=c99 ++ Include-dirs: cbits ++ Includes: cmark.h ++ c-sources: cbits/houdini_html_u.c ++ cbits/references.c ++ cbits/utf8.c ++ cbits/inlines.c ++ cbits/blocks.c ++ cbits/cmark.c ++ cbits/iterator.c ++ cbits/node.c ++ cbits/buffer.c ++ cbits/cmark_ctype.c ++ cbits/houdini_html_e.c ++ cbits/houdini_href_e.c ++ cbits/scanners.c ++ cbits/html.c ++ cbits/man.c ++ cbits/commonmark.c ++ cbits/latex.c ++ cbits/xml.c ++ cbits/render.c + + benchmark bench-cmark + type: exitcode-stdio-1.0 diff --git a/ghc-cmark.spec b/ghc-cmark.spec new file mode 100644 index 0000000..8743ed3 --- /dev/null +++ b/ghc-cmark.spec @@ -0,0 +1,99 @@ +# https://fedoraproject.org/wiki/Packaging:Haskell + +%global pkg_name cmark + +%ifarch armv7hl +# https://github.com/jgm/cmark-hs/issues/6 +%bcond_with tests +%else +%bcond_without tests +%endif + +Name: ghc-%{pkg_name} +Version: 0.5.1 +Release: 1%{?dist} +Summary: Fast, accurate CommonMark (Markdown) parser and renderer + +License: BSD +Url: https://hackage.haskell.org/package/%{pkg_name} +Source0: https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{version}.tar.gz +Patch0: cmark-nobundle.patch + +BuildRequires: ghc-Cabal-devel +BuildRequires: ghc-rpm-macros +# Begin cabal-rpm deps: +BuildRequires: ghc-bytestring-devel +BuildRequires: ghc-text-devel +BuildRequires: pkgconfig(libcmark) +%if %{with tests} +BuildRequires: ghc-HUnit-devel +%endif +# End cabal-rpm deps + +%description +This package provides Haskell bindings for , the reference parser for , a fully +specified variant of Markdown. + + +%package devel +Summary: Haskell %{pkg_name} library development files +Provides: %{name}-static = %{version}-%{release} +Requires: ghc-compiler = %{ghc_version} +Requires(post): ghc-compiler = %{ghc_version} +Requires(postun): ghc-compiler = %{ghc_version} +Requires: %{name}%{?_isa} = %{version}-%{release} +# Begin cabal-rpm deps: +Requires: pkgconfig(libcmark) +# End cabal-rpm deps + +%description devel +This package provides the Haskell %{pkg_name} library development files. + + +%prep +%setup -q -n %{pkg_name}-%{version} +%patch0 -p1 -b .orig +rm -rf cbits +cabal-tweak-flag pkgconfig True + + +%build +%ghc_lib_build + + +%install +%ghc_lib_install + +rm %{buildroot}%{ghc_pkgdocdir}/LICENSE + + +%check +%if %{with tests} +%cabal test +%endif + + +%post devel +%ghc_pkg_recache + + +%postun devel +%ghc_pkg_recache + + +%files -f %{name}.files +%license LICENSE + + +%files devel -f %{name}-devel.files +%doc README.md + + +%changelog +* Fri Feb 5 2016 Jens Petersen - 0.5.1-1 +- patch to build with system cmark +- disable tests on armv7 + +* Wed Feb 3 2016 Fedora Haskell SIG +- spec file generated by cabal-rpm-0.9.9 diff --git a/sources b/sources index e69de29..3d65493 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +94daba85554ccff5b5a6066a94ff146e cmark-0.5.1.tar.gz