Link against sqlite using pkgconfig.

This commit is contained in:
Elliott Sales de Andrade 2017-09-29 20:10:07 -04:00
parent 59947b266c
commit d5daefa793
2 changed files with 46 additions and 2 deletions

View File

@ -0,0 +1,39 @@
From 761c3328275b03a6530532900973f7faf1363ae2 Mon Sep 17 00:00:00 2001
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Date: Fri, 29 Sep 2017 20:08:24 -0400
Subject: [PATCH] Link against sqlite using pkgconfig by default.
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---
persistent-sqlite/persistent-sqlite.cabal | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/persistent-sqlite/persistent-sqlite.cabal b/persistent-sqlite/persistent-sqlite.cabal
index aa57976f..7e0753e6 100644
--- a/persistent-sqlite/persistent-sqlite.cabal
+++ b/persistent-sqlite/persistent-sqlite.cabal
@@ -17,6 +17,9 @@ extra-source-files: ChangeLog.md cbits/*.c cbits/*.h
flag systemlib
description: Use the system-wide sqlite library
default: False
+flag no-pkgconfig
+ description: Don't use pkg-config to find system sqlite library
+ default: False
flag build-sanity-exe
description: Build a sanity check test executable
default: False
@@ -42,7 +45,10 @@ library
Database.Persist.Sqlite
ghc-options: -Wall
if flag(systemlib)
- extra-libraries: sqlite3
+ if flag(no-pkgconfig)
+ extra-libraries: sqlite3
+ else
+ pkgconfig-depends: sqlite3
else
c-sources: cbits/sqlite3.c
include-dirs: cbits
--
2.13.5

View File

@ -7,12 +7,14 @@
Name: ghc-%{pkg_name}
Version: 2.6.2
Release: 2%{?dist}
Release: 3%{?dist}
Summary: Backend for the persistent library using sqlite3
License: MIT
Url: https://hackage.haskell.org/package/%{pkg_name}
Source0: https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{version}.tar.gz
# https://github.com/yesodweb/persistent/pull/712
Patch0001: 0001-Link-against-sqlite-using-pkgconfig-by-default.patch
BuildRequires: ghc-Cabal-devel
BuildRequires: ghc-rpm-macros
@ -63,7 +65,7 @@ files.
%prep
%setup -q -n %{pkg_name}-%{version}
%autosetup -n %{pkg_name}-%{version} -p2
cabal-tweak-flag systemlib True
@ -96,6 +98,9 @@ cabal-tweak-flag systemlib True
%changelog
* Fri Sep 29 2017 Elliott Sales de Andrade <quantum.analyst@gmail.com> 2.6.2-3
- Use pkg-config to build against system sqlite library.
* Tue Sep 05 2017 Elliott Sales de Andrade <quantum.analyst@gmail.com> 2.6.2-2
- Build against system sqlite library.