From 0e3e6f80636925ca1ff8ff536a9a3c8869abe75c Mon Sep 17 00:00:00 2001 From: Oleg Grenrus Date: Thu, 19 Sep 2019 22:51:28 +0300 Subject: [PATCH] Updates 2019-09-19 --- .travis.yml | 2 +- CONTRIBUTING.md | 12 ++ postgresql-libpq.cabal | 132 ++++++++++++---------- src/Database/PostgreSQL/LibPQ/Internal.hs | 5 +- 4 files changed, 87 insertions(+), 64 deletions(-) create mode 100644 CONTRIBUTING.md diff --git a/.travis.yml b/.travis.yml index d6ea245..1196be6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ # # For more information, see https://github.com/haskell-CI/haskell-ci # -# version: 0.5.20190908 +# version: 0.5.20190916 # language: c dist: xenial diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..3df30fc --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,12 @@ +Patches welcome! + +- If you are only going to bump bounds: + - If it's really **only bounds**, please simply open an issue (so you'll have a URL to refer to). I have a semi-automated process to make revisions, pull requests only disturb it. + - If patch includes **source code change** (i.e. I'll need to make a release), and it's a patch to support **newer base/GHC version**: + - Amend `tested-with` to include that GHC + - Regenerate `.travis.yml` with `haskell-ci regenerate` (get the latest from [GitHub haskell-ci/haskell-ci](https://github.com/haskell-ci/haskell-ci)) + +- Don't edit `CHANGELOG.md`, rather include a copyable entry in your pull request description. I often process pull requests in bulk, and everyone editing the `CHANGELOG.md` causes unnecessary conflicts. + +- I use [`stylish-haskell`](https://github.com/jaspervdj/stylish-haskell) to format imports. I encourage you to use it too, when contributing. +- General code style is 4 spaces, just look around how it looks, it's not so strict. diff --git a/postgresql-libpq.cabal b/postgresql-libpq.cabal index 22cc25d..66ffe8f 100644 --- a/postgresql-libpq.cabal +++ b/postgresql-libpq.cabal @@ -1,71 +1,77 @@ -Name: postgresql-libpq -Version: 0.9.4.2 -x-revision: 1 -Synopsis: low-level binding to libpq - -Description: This is a binding to libpq: the C application - programmer's interface to PostgreSQL. libpq is a - set of library functions that allow client - programs to pass queries to the PostgreSQL - backend server and to receive the results of - these queries. - -Homepage: https://github.com/phadej/postgresql-libpq -License: BSD3 -License-file: LICENSE -Author: Grant Monroe, Leon P Smith, Joey Adams -Maintainer: Oleg Grenrus -Copyright: (c) 2010 Grant Monroe - (c) 2011 Leon P Smith -Category: Database -Build-type: Custom -Extra-source-files: cbits/noticehandlers.h -Cabal-version: >=1.8 -Tested-with: - GHC==7.0.4, - GHC==7.2.2, - GHC==7.4.2, - GHC==7.6.3, - GHC==7.8.4, - GHC==7.10.3, - GHC==8.0.2, - GHC==8.2.2, - GHC==8.4.4, - GHC==8.6.5, - GHC==8.8.1 - -extra-source-files: - CHANGELOG.md - -Custom-setup +name: postgresql-libpq +version: 0.9.4.2 +x-revision: 1 +synopsis: low-level binding to libpq +description: + This is a binding to libpq: the C application + programmer's interface to PostgreSQL. libpq is a + set of library functions that allow client + programs to pass queries to the PostgreSQL + backend server and to receive the results of + these queries. + +homepage: https://github.com/phadej/postgresql-libpq +license: BSD3 +license-file: LICENSE +author: Grant Monroe, Leon P Smith, Joey Adams +maintainer: Oleg Grenrus +copyright: + (c) 2010 Grant Monroe + (c) 2011 Leon P Smith + +category: Database +build-type: Custom +extra-source-files: cbits/noticehandlers.h +cabal-version: >=1.8 +tested-with: + GHC ==7.0.4 + || ==7.2.2 + || ==7.4.2 + || ==7.6.3 + || ==7.8.4 + || ==7.10.3 + || ==8.0.2 + || ==8.2.2 + || ==8.4.4 + || ==8.6.5 + || ==8.8.1 + +extra-source-files: CHANGELOG.md + +custom-setup setup-depends: - base >= 4.3 && <5, Cabal >= 1.10 && <3.1 + base >=4.3 && <5 + , Cabal >=1.10 && <3.1 -- If true, use pkg-config, otherwise use the pg_config based build -- configuration -Flag use-pkg-config +flag use-pkg-config default: False manual: True -Library - hs-source-dirs: src - c-sources: cbits/noticehandlers.c - include-dirs: cbits - Exposed-modules: Database.PostgreSQL.LibPQ - Database.PostgreSQL.LibPQ.Internal - Build-depends: base >=4.3 && <4.14 - , bytestring >=0.9.1.0 && <0.11 +library + hs-source-dirs: src + c-sources: cbits/noticehandlers.c + include-dirs: cbits + exposed-modules: + Database.PostgreSQL.LibPQ + Database.PostgreSQL.LibPQ.Internal + + build-depends: + base >=4.3 && <4.14 + , bytestring >=0.9.1.0 && <0.11 if !os(windows) - Build-depends: unix >=2.4.2.0 && <2.8 + build-depends: unix >=2.4.2.0 && <2.8 if os(windows) - Build-depends: Win32 >=2.2.0.2 && <2.7 + build-depends: Win32 >=2.2.0.2 && <2.7 - GHC-Options: -Wall + ghc-options: -Wall if flag(use-pkg-config) - Pkgconfig-depends: libpq >=9.3 + pkgconfig-depends: libpq ==9.3 || >9.3 + else if os(windows) -- Due to https://sourceware.org/bugzilla/show_bug.cgi?id=22948, @@ -73,23 +79,27 @@ Library -- libpq.dll directly, which can lead to segfaults. As a temporary hack, -- we force ld to link against the libpq.lib import library directly -- by specifying libpq here. - Extra-Libraries: libpq + extra-libraries: libpq + else - Extra-Libraries: pq + extra-libraries: pq + if os(openbsd) - Extra-Libraries: crypto ssl + extra-libraries: + crypto + ssl -- Other-modules: - Build-tools: hsc2hs + build-tools: hsc2hs -any test-suite smoke type: exitcode-stdio-1.0 main-is: Smoke.hs hs-source-dirs: test build-depends: - base, - bytestring, - postgresql-libpq + base + , bytestring + , postgresql-libpq source-repository head type: git diff --git a/src/Database/PostgreSQL/LibPQ/Internal.hs b/src/Database/PostgreSQL/LibPQ/Internal.hs index 5871a6c..bbd2e69 100644 --- a/src/Database/PostgreSQL/LibPQ/Internal.hs +++ b/src/Database/PostgreSQL/LibPQ/Internal.hs @@ -11,12 +11,13 @@ -- ----------------------------------------------------------------------------- -{-# LANGUAGE BangPatterns, EmptyDataDecls #-} +{-# LANGUAGE BangPatterns #-} +{-# LANGUAGE EmptyDataDecls #-} module Database.PostgreSQL.LibPQ.Internal where +import Control.Concurrent.MVar (MVar) import Foreign -import Control.Concurrent.MVar ( MVar ) -- | 'Connection' encapsulates a connection to the backend.