Browse Source

Fixes for GHC 7.10.1

tags/v0.2.2.0
Peter J. Jones 4 years ago
parent
commit
1502b84c95

+ 3
- 1
CHANGES View File

@@ -2,9 +2,11 @@
#+title: Version History
#+startup: showall

* 1.1.0.0 (Unreleased)
* 1.1.0.0 (May 22, 2015)

- Added Ord instance for TV, Season, and Episode
- Removed unused dependencies from build-depends
- Changes to build with GHC 7.8.4. and 7.10.1

* 1.0.0.0 (April 5, 2015)


+ 0
- 15
GNUmakefile View File

@@ -1,15 +0,0 @@
################################################################################
.PHONEY: all install restart

################################################################################
# Set up the default target.
all::

################################################################################
CABAL_FLAGS = --enable-tests -fmaintainer
CABAL_DEP_PROFILING = -O2
CABAL_SANDBOX_DIR = ../../.cabal-sandbox
HLINT_DIRS = src example test

################################################################################
include util/haskell.mk

+ 53
- 0
default.nix View File

@@ -0,0 +1,53 @@
{ stdenv, haskellPackages }:

let
env = haskellPackages.ghcWithPackages (p: with p; [
# Tools:
cabal-install
hlint

# Libraries:
aeson
binary
bytestring
either
http-client
http-client-tls
http-types
mtl
network
network-uri
tasty
tasty-hunit
text
text-binary
time
time-locale-compat
transformers
unix
]);

in stdenv.mkDerivation rec {
name = "themoviedb";
src = ./src;

buildInputs = [ env ];

buildPhase = ''
( HOME="$(mktemp -d)" # For cabal-install.
cabal configure --enable-tests -fmaintainer
cabal build || exit 1
cabal test || exit 1
) && hlint src
'';

installPhase = ''
'';

shellHook = ''
export NIX_GHC="${env}/bin/ghc"
export NIX_GHCPKG="${env}/bin/ghc-pkg"
export NIX_GHC_DOCDIR="${env}/share/doc/ghc/html"
export NIX_GHC_LIBDIR=$( $NIX_GHC --print-libdir )
'';
}

+ 1
- 1
example/Main.hs View File

@@ -20,10 +20,10 @@ import Data.Maybe (listToMaybe)
import Data.Text (Text)
import qualified Data.Text as T
import Data.Time (formatTime)
import Data.Time.Locale.Compat (defaultTimeLocale)
import Network.API.TheMovieDB
import System.Environment (getArgs)
import System.Exit (exitFailure, exitSuccess)
import System.Locale (defaultTimeLocale)
import Text.Printf (printf)

--------------------------------------------------------------------------------

+ 13
- 0
shell.nix View File

@@ -0,0 +1,13 @@
{ pkgs ? (import <nixpkgs> {})
, ghc ? "7.8.4" # Allow overriding the GHC version.

# Logic to pick the correct version of haskellPackages:
, haskellPackages ? if ghc == "7.8.4"
then pkgs.haskell.packages.ghc784
else pkgs.haskell.packages.ghc7101
}:

(import ./default.nix) {
stdenv = pkgs.stdenv;
haskellPackages = haskellPackages;
}

+ 6
- 0
src/Network/API/TheMovieDB/Actions.hs View File

@@ -33,6 +33,12 @@ import Network.API.TheMovieDB.Types.Movie
import Network.API.TheMovieDB.Types.Season
import Network.API.TheMovieDB.Types.TV

--------------------------------------------------------------------------------
-- The following is a kludge to avoid the "redundant import" warning
-- when using GHC >= 7.10.x. This should be removed after we decide
-- to stop supporting GHC < 7.10.x.
import Prelude

--------------------------------------------------------------------------------
-- | Search TheMovieDB using the given query string.
--

+ 3
- 2
src/Network/API/TheMovieDB/Internal/Date.hs View File

@@ -1,3 +1,4 @@
{-# OPTIONS_GHC -Wwarn #-} -- Kludge to not error out on parseTime deprecation.
{-# LANGUAGE OverloadedStrings #-}

{-
@@ -25,8 +26,8 @@ import Data.Aeson
import Data.Aeson.Types (Parser, typeMismatch)
import Data.Text (Text)
import qualified Data.Text as T
import Data.Time (parseTime, Day(..))
import System.Locale (defaultTimeLocale)
import Data.Time (Day(..), parseTime)
import Data.Time.Locale.Compat (defaultTimeLocale)

--------------------------------------------------------------------------------
-- | A simple type wrapper around 'Day' in order to parse a movie's

+ 6
- 0
src/Network/API/TheMovieDB/Internal/HTTP.hs View File

@@ -24,6 +24,12 @@ import Network.API.TheMovieDB.Internal.Types
import qualified Network.HTTP.Client as HC
import Network.HTTP.Types

--------------------------------------------------------------------------------
-- The following is a kludge to avoid the "redundant import" warning
-- when using GHC >= 7.10.x. This should be removed after we decide
-- to stop supporting GHC < 7.10.x.
import Prelude

--------------------------------------------------------------------------------
-- | The base URL for the version of the API we're using.
apiBaseURL :: String

+ 6
- 0
src/Network/API/TheMovieDB/Internal/TheMovieDB.hs View File

@@ -33,6 +33,12 @@ import Network.HTTP.Client (Manager, withManager)
import Network.HTTP.Client.TLS (tlsManagerSettings)
import Network.HTTP.Types

--------------------------------------------------------------------------------
-- The following is a kludge to avoid the "redundant import" warning
-- when using GHC >= 7.10.x. This should be removed after we decide
-- to stop supporting GHC < 7.10.x.
import Prelude

--------------------------------------------------------------------------------
-- | The type for functions that make requests to the API (or pretend
-- to make a request for testing purposes).

+ 6
- 0
src/Network/API/TheMovieDB/Types/Episode.hs View File

@@ -27,6 +27,12 @@ import Network.API.TheMovieDB.Internal.Configuration
import Network.API.TheMovieDB.Internal.Date
import Network.API.TheMovieDB.Internal.Types

--------------------------------------------------------------------------------
-- The following is a kludge to avoid the "redundant import" warning
-- when using GHC >= 7.10.x. This should be removed after we decide
-- to stop supporting GHC < 7.10.x.
import Prelude

--------------------------------------------------------------------------------
-- | Metadata for a TV Episode.
--

+ 6
- 0
src/Network/API/TheMovieDB/Types/Genre.hs View File

@@ -23,6 +23,12 @@ import Data.Aeson.Types (typeMismatch)
import Data.Text (Text)
import Network.API.TheMovieDB.Internal.Types

--------------------------------------------------------------------------------
-- The following is a kludge to avoid the "redundant import" warning
-- when using GHC >= 7.10.x. This should be removed after we decide
-- to stop supporting GHC < 7.10.x.
import Prelude

--------------------------------------------------------------------------------
-- | Metadata for a genre.
data Genre = Genre

+ 6
- 0
src/Network/API/TheMovieDB/Types/Movie.hs View File

@@ -28,6 +28,12 @@ import Network.API.TheMovieDB.Internal.Date
import Network.API.TheMovieDB.Internal.Types
import Network.API.TheMovieDB.Types.Genre

--------------------------------------------------------------------------------
-- The following is a kludge to avoid the "redundant import" warning
-- when using GHC >= 7.10.x. This should be removed after we decide
-- to stop supporting GHC < 7.10.x.
import Prelude

--------------------------------------------------------------------------------
-- | Metadata for a movie.
--

+ 6
- 0
src/Network/API/TheMovieDB/Types/Season.hs View File

@@ -28,6 +28,12 @@ import Network.API.TheMovieDB.Internal.Date
import Network.API.TheMovieDB.Internal.Types
import Network.API.TheMovieDB.Types.Episode

--------------------------------------------------------------------------------
-- The following is a kludge to avoid the "redundant import" warning
-- when using GHC >= 7.10.x. This should be removed after we decide
-- to stop supporting GHC < 7.10.x.
import Prelude

--------------------------------------------------------------------------------
-- | Metadata for a TV Season.
--

+ 6
- 0
src/Network/API/TheMovieDB/Types/TV.hs View File

@@ -29,6 +29,12 @@ import Network.API.TheMovieDB.Internal.Types
import Network.API.TheMovieDB.Types.Genre
import Network.API.TheMovieDB.Types.Season

--------------------------------------------------------------------------------
-- The following is a kludge to avoid the "redundant import" warning
-- when using GHC >= 7.10.x. This should be removed after we decide
-- to stop supporting GHC < 7.10.x.
import Prelude

--------------------------------------------------------------------------------
-- | Metadata for a TV series.
--

+ 6
- 0
test/TestHelper.hs View File

@@ -14,6 +14,12 @@ import Network.API.TheMovieDB.Internal.TheMovieDB
import Network.API.TheMovieDB.Internal.Types
import Test.Tasty.HUnit

--------------------------------------------------------------------------------
-- The following is a kludge to avoid the "redundant import" warning
-- when using GHC >= 7.10.x. This should be removed after we decide
-- to stop supporting GHC < 7.10.x.
import Prelude

--------------------------------------------------------------------------------
fakeTMDB :: FilePath -> TheMovieDB a -> IO a
fakeTMDB path m = do

+ 28
- 25
themoviedb.cabal View File

@@ -1,6 +1,6 @@
--------------------------------------------------------------------------------
name: themoviedb
version: 1.0.0.0
version: 1.1.0.0
synopsis: Haskell API bindings for http://themoviedb.org
homepage: http://github.com/pjones/themoviedb
bug-reports: http://github.com/pjones/themoviedb/issues
@@ -11,7 +11,7 @@ maintainer: Peter Jones <pjones@devalot.com>
copyright: Copyright: (c) 2012-2015 Peter Jones
category: Network, API
stability: experimental
tested-with: GHC == 7.8.4
tested-with: GHC == 7.8.4, GHC == 7.10.1
build-type: Simple
cabal-version: >=1.10
description: This library provides functions for retrieving metadata
@@ -61,23 +61,20 @@ library
if flag(maintainer)
ghc-options: -Werror

build-depends: aeson >= 0.6 && < 0.9
, base >= 4.6 && < 5.0
, binary >= 0.7 && < 0.8
, bytestring >= 0.9 && < 0.11
, either >= 4.3 && < 4.4
, http-client >= 0.4 && < 0.5
, http-client-tls >= 0.2.2 && < 0.3
, http-types >= 0.8 && < 0.9
, mtl >= 2.1 && < 2.2
, network >= 2.3 && < 2.7
, network-uri >= 2.6 && < 2.7
, old-locale >= 1.0 && < 1.1
, text >= 0.11 && < 1.3
, text-binary >= 0.1 && < 0.2
, time >= 1.2 && < 1.6
, transformers >= 0.3 && < 0.5
, unix >= 2.5 && < 2.8
build-depends: aeson >= 0.6 && < 0.9
, base >= 4.6 && < 5.0
, binary >= 0.7 && < 0.8
, bytestring >= 0.9 && < 0.11
, either >= 4.3 && < 4.4
, http-client >= 0.4 && < 0.5
, http-client-tls >= 0.2.2 && < 0.3
, http-types >= 0.8 && < 0.9
, mtl >= 2.1 && < 2.3
, text >= 0.11 && < 1.3
, text-binary >= 0.1 && < 0.2
, time >= 1.2 && < 1.6
, time-locale-compat >= 0.1 && < 0.2
, transformers >= 0.3 && < 0.5

--------------------------------------------------------------------------------
executable tmdb
@@ -90,9 +87,12 @@ executable tmdb
if flag(maintainer)
ghc-options: -Werror

build-depends: themoviedb, base, unix, old-locale, time,
text, aeson, network, bytestring, transformers

build-depends: base
, text
, themoviedb
, time
, time-locale-compat
, transformers

--------------------------------------------------------------------------------
test-suite test
@@ -107,7 +107,10 @@ test-suite test
if flag(maintainer)
ghc-options: -Werror

build-depends: tasty >= 0.10 && < 0.11
build-depends: base
, bytestring
, tasty >= 0.10 && < 0.11
, tasty-hunit >= 0.9 && < 0.10
, themoviedb, base, unix, old-locale, time
, text, aeson, network, bytestring, transformers
, text
, themoviedb
, time

+ 0
- 1
util View File

@@ -1 +0,0 @@
../../util/

Loading…
Cancel
Save