summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /dev-haskell/hdbc-sqlite
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'dev-haskell/hdbc-sqlite')
-rw-r--r--dev-haskell/hdbc-sqlite/Manifest1
-rw-r--r--dev-haskell/hdbc-sqlite/files/HDBC-sqlite3-2.3.3.0-ghc-7.6.patch52
-rw-r--r--dev-haskell/hdbc-sqlite/files/TestTime.hs100
-rw-r--r--dev-haskell/hdbc-sqlite/hdbc-sqlite-2.3.3.0.ebuild62
-rw-r--r--dev-haskell/hdbc-sqlite/metadata.xml9
5 files changed, 224 insertions, 0 deletions
diff --git a/dev-haskell/hdbc-sqlite/Manifest b/dev-haskell/hdbc-sqlite/Manifest
new file mode 100644
index 000000000000..772ab88e23ac
--- /dev/null
+++ b/dev-haskell/hdbc-sqlite/Manifest
@@ -0,0 +1 @@
+DIST HDBC-sqlite3-2.3.3.0.tar.gz 14827 SHA256 22f972fc44e830d0db62313fb870cd9d020f3d8efff2928d4cdb3f66b52de684 SHA512 66dfef4fd6dbaaaea4eadd3c5201a29f8f306170ef76dbf2e8a1f4239bcdcdd5b16d6d331c8a480a9e23209b2c86cfe981d7f83d4d3a0ba617dfdfb6663ad244 WHIRLPOOL b39aa543bfb12923dce1666e29d4f327691540d289b4faa0a83f5cf2aba2eaa3bd107947621fd46ca44b02ba9ba8888dece79cb8dbdadf597ae05efb52dc0ae6
diff --git a/dev-haskell/hdbc-sqlite/files/HDBC-sqlite3-2.3.3.0-ghc-7.6.patch b/dev-haskell/hdbc-sqlite/files/HDBC-sqlite3-2.3.3.0-ghc-7.6.patch
new file mode 100644
index 000000000000..c0c024218117
--- /dev/null
+++ b/dev-haskell/hdbc-sqlite/files/HDBC-sqlite3-2.3.3.0-ghc-7.6.patch
@@ -0,0 +1,52 @@
+--- HDBC-sqlite3-2.3.3.0-orig/testsrc/TestSbasics.hs 2011-08-10 07:08:57.000000000 +1000
++++ HDBC-sqlite3-2.3.3.0/testsrc/TestSbasics.hs 2012-10-13 11:28:21.094200366 +1100
+@@ -1,9 +1,13 @@
++{-# LANGUAGE CPP, ScopedTypeVariables #-}
+ module TestSbasics(tests) where
+ import Test.HUnit
+ import Database.HDBC
+ import TestUtils
+ import System.IO
+-import Control.Exception hiding (catch)
++#if !MIN_VERSION_base(4,6,0)
++import Prelude hiding (catch)
++#endif
++import Control.Exception
+
+ openClosedb = sqlTestCase $
+ do dbh <- connectDB
+@@ -140,7 +144,7 @@
+ -- Let's try a rollback.
+ catch (withTransaction dbh (\_ -> do sExecuteMany sth rows
+ fail "Foo"))
+- (\_ -> return ())
++ (\(_::IOException) -> return ())
+ sExecute qrysth []
+ sFetchAllRows qrysth >>= (assertEqual "rollback" [[Just "0"]])
+
+--- HDBC-sqlite3-2.3.3.0-orig/testsrc/Testbasics.hs 2011-08-10 07:08:57.000000000 +1000
++++ HDBC-sqlite3-2.3.3.0/testsrc/Testbasics.hs 2012-10-13 11:27:20.025541058 +1100
+@@ -1,9 +1,13 @@
++{-# LANGUAGE CPP, ScopedTypeVariables #-}
+ module Testbasics(tests) where
+ import Test.HUnit
+ import Database.HDBC
+ import TestUtils
+ import System.IO
+-import Control.Exception hiding (catch)
++#if !MIN_VERSION_base(4,6,0)
++import Prelude hiding (catch)
++#endif
++import Control.Exception
+
+ openClosedb = sqlTestCase $
+ do dbh <- connectDB
+@@ -140,7 +144,7 @@
+ -- Let's try a rollback.
+ catch (withTransaction dbh (\_ -> do executeMany sth rows
+ fail "Foo"))
+- (\_ -> return ())
++ (\(_::IOException) -> return ())
+ execute qrysth []
+ fetchAllRows qrysth >>= (assertEqual "rollback" [[SqlString "0"]])
+
diff --git a/dev-haskell/hdbc-sqlite/files/TestTime.hs b/dev-haskell/hdbc-sqlite/files/TestTime.hs
new file mode 100644
index 000000000000..5fd77da61058
--- /dev/null
+++ b/dev-haskell/hdbc-sqlite/files/TestTime.hs
@@ -0,0 +1,100 @@
+module TestTime(tests) where
+import Test.HUnit
+import Database.HDBC
+import TestUtils
+import Control.Exception
+import Data.Time
+import Data.Time.LocalTime
+import Data.Time.Clock.POSIX
+import Data.Maybe
+import Data.Convertible
+import SpecificDB
+import System.Locale(defaultTimeLocale)
+import Database.HDBC.Locale (iso8601DateFormat)
+import qualified System.Time as ST
+
+instance Eq ZonedTime where
+ a == b = zonedTimeToUTC a == zonedTimeToUTC b &&
+ zonedTimeZone a == zonedTimeZone b
+
+testZonedTime :: ZonedTime
+testZonedTime = fromJust $ parseTime defaultTimeLocale (iso8601DateFormat (Just "%T %z"))
+ "1989-08-01 15:33:01 -0500"
+
+testZonedTimeFrac :: ZonedTime
+testZonedTimeFrac = fromJust $ parseTime defaultTimeLocale (iso8601DateFormat (Just "%T%Q %z"))
+ "1989-08-01 15:33:01.536 -0500"
+
+
+rowdata t = [[SqlInt32 100, toSql t, SqlNull]]
+
+testDTType inputdata convToSqlValue = dbTestCase $ \dbh ->
+ do run dbh ("CREATE TABLE hdbctesttime (testid INTEGER PRIMARY KEY NOT NULL, \
+ \testvalue " ++ dateTimeTypeOfSqlValue value ++ ")") []
+ finally (testIt dbh) (do commit dbh
+ run dbh "DROP TABLE hdbctesttime" []
+ commit dbh
+ )
+ where testIt dbh =
+ do run dbh "INSERT INTO hdbctesttime (testid, testvalue) VALUES (?, ?)"
+ [iToSql 5, value]
+ commit dbh
+ r <- quickQuery' dbh "SELECT testid, testvalue FROM hdbctesttime" []
+ case r of
+ [[testidsv, testvaluesv]] ->
+ do assertEqual "testid" (5::Int) (fromSql testidsv)
+ assertEqual "testvalue" inputdata (fromSql testvaluesv)
+ value = convToSqlValue inputdata
+
+mkTest label inputdata convfunc =
+ TestLabel label (testDTType inputdata convfunc)
+
+tests = TestList $
+ ((TestLabel "Non-frac" $ testIt testZonedTime) :
+ if supportsFracTime then [TestLabel "Frac" $ testIt testZonedTimeFrac] else [])
+
+testIt baseZonedTime =
+ TestList [mkTest "Day" baseDay toSql,
+ mkTest "TimeOfDay" baseTimeOfDay toSql,
+ mkTest "ZonedTimeOfDay" baseZonedTimeOfDay toSql,
+ mkTest "LocalTime" baseLocalTime toSql,
+ mkTest "ZonedTime" baseZonedTime toSql,
+ mkTest "UTCTime" baseUTCTime toSql,
+ mkTest "DiffTime" baseDiffTime toSql,
+ mkTest "POSIXTime" basePOSIXTime posixToSql,
+ mkTest "ClockTime" baseClockTime toSql,
+ mkTest "CalendarTime" baseCalendarTime toSql,
+ mkTest "TimeDiff" baseTimeDiff toSql
+ ]
+ where
+ baseDay :: Day
+ baseDay = localDay baseLocalTime
+
+ baseTimeOfDay :: TimeOfDay
+ baseTimeOfDay = localTimeOfDay baseLocalTime
+
+ baseZonedTimeOfDay :: (TimeOfDay, TimeZone)
+ baseZonedTimeOfDay = fromSql (SqlZonedTime baseZonedTime)
+
+ baseLocalTime :: LocalTime
+ baseLocalTime = zonedTimeToLocalTime baseZonedTime
+
+ baseUTCTime :: UTCTime
+ baseUTCTime = convert baseZonedTime
+
+ baseDiffTime :: NominalDiffTime
+ baseDiffTime = basePOSIXTime
+
+ basePOSIXTime :: POSIXTime
+ basePOSIXTime = convert baseZonedTime
+
+ baseTimeDiff :: ST.TimeDiff
+ baseTimeDiff = convert baseDiffTime
+
+ -- No fractional parts for these two
+
+ baseClockTime :: ST.ClockTime
+ baseClockTime = convert testZonedTime
+
+ baseCalendarTime :: ST.CalendarTime
+ baseCalendarTime = convert testZonedTime
diff --git a/dev-haskell/hdbc-sqlite/hdbc-sqlite-2.3.3.0.ebuild b/dev-haskell/hdbc-sqlite/hdbc-sqlite-2.3.3.0.ebuild
new file mode 100644
index 000000000000..a5bd5259dc58
--- /dev/null
+++ b/dev-haskell/hdbc-sqlite/hdbc-sqlite-2.3.3.0.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+# ebuild generated by hackport 0.2.18.9999
+
+CABAL_FEATURES="bin lib profile haddock hoogle hscolour"
+inherit haskell-cabal
+
+MY_PN="HDBC-sqlite3"
+MY_P="${MY_PN}-${PV}"
+
+DESCRIPTION="Sqlite v3 driver for HDBC"
+HOMEPAGE="http://software.complete.org/hdbc-sqlite3"
+SRC_URI="mirror://hackage/packages/archive/${MY_PN}/${PV}/${MY_P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="2"
+KEYWORDS="~amd64 ~x86"
+IUSE="test"
+RESTRICT="test" # not all files are bundled
+
+RDEPEND=">=dev-haskell/hdbc-2.3.0.0[profile?]
+ dev-haskell/mtl[profile?]
+ dev-haskell/utf8-string[profile?]
+ >=dev-lang/ghc-6.10.1
+ >=dev-db/sqlite-3.2"
+DEPEND="${RDEPEND}
+ >=dev-haskell/cabal-1.2.3
+ test? ( dev-haskell/convertible
+ dev-haskell/hunit
+ dev-haskell/testpack
+ )
+ "
+
+S="${WORKDIR}/${MY_P}"
+
+src_prepare() {
+ epatch "${FILESDIR}/${MY_PN}-2.3.3.0-ghc-7.6.patch"
+ cp "${FILESDIR}/TestTime.hs" "${S}/testsrc"
+}
+
+src_configure() {
+ cabal_src_configure $(cabal_flag test buildtests)
+}
+
+src_test() {
+ # default tests
+ haskell-cabal_src_test || die "cabal test failed"
+
+ # built custom tests
+ "${S}/dist/build/runtests/runtests" || die "unit tests failed"
+}
+
+src_install() {
+ cabal_src_install
+
+ # if tests were enabled, make sure the unit test driver is deleted
+ rm -f "${ED}/usr/bin/runtests"
+}
diff --git a/dev-haskell/hdbc-sqlite/metadata.xml b/dev-haskell/hdbc-sqlite/metadata.xml
new file mode 100644
index 000000000000..179f158559e4
--- /dev/null
+++ b/dev-haskell/hdbc-sqlite/metadata.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>haskell</herd>
+ <longdescription>
+ This is the Sqlite v3 driver for HDBC, the generic
+ database access system for Haskell
+ </longdescription>
+</pkgmetadata>