stb-image 0.1.2 → 0.1.3
raw patch · 3 files changed
+26/−49 lines, 3 filesdep ~basesetup-changed
Dependency ranges changed: base
Files
- Codec/Image/STB.hs +9/−0
- Setup.lhs +1/−44
- stb-image.cabal +16/−5
Codec/Image/STB.hs view
@@ -26,6 +26,7 @@ , components , decodeImage , loadImage+ , loadImage' ) where import Control.Monad (liftM)@@ -159,4 +160,12 @@ b <- B.hGetContents h hClose h decodeImage b ++-- |Force the number of components in the image.+loadImage':: FilePath -> Int -> IO (Either String Image)+loadImage' path ncomps = handle ioHandler $ do+ h <- openBinaryFile path ReadMode + b <- B.hGetContents h+ hClose h+ decodeImage' ncomps b
Setup.lhs view
@@ -1,48 +1,5 @@ #! /usr/bin/env runhaskell > -> {-# LANGUAGE FlexibleInstances #-}->-> import Control.Monad-> import Data.Maybe-> import Data.List-> import Data.Version > import Distribution.Simple-> import Distribution.Simple.LocalBuildInfo-> import Distribution.Simple.Configure-> import Distribution.Simple.Setup-> import Distribution.Package-> import Distribution.PackageDescription-> import Distribution.Text-> import Text.PrettyPrint.HughesPJ-> -> -- for Cabal 1.4 compatibility-> instance Text [Char] where-> parse = undefined-> disp = text->-> addToBuildInfo opts binfo = binfo { cppOptions = cppOptions binfo ++ opts }-> addToLibrary opts lib = lib { libBuildInfo = addToBuildInfo opts (libBuildInfo lib) } -> addToExecutable opts exe = exe { buildInfo = addToBuildInfo opts (buildInfo exe) } -> addToPkgDesc opts pkgdesc = pkgdesc -> { library = liftM (addToLibrary opts) (library pkgdesc) -> , executables = map (addToExecutable opts) (executables pkgdesc) -> }-> addToLocalBuildInfo opts lbinfo = lbinfo -> { localPkgDescr = addToPkgDesc opts (localPkgDescr lbinfo) }->-> -- we detect the base version and add a respective #define -> myPostConf args flags pkgdesc locbuildinfo = do-> let distPref = fromFlag $ configDistPref flags-> deps = packageDeps locbuildinfo-> base = fromJust $ find (\pkg -> display (packageName pkg) == "base") deps-> ver = versionBranch (pkgVersion base)-> major = head ver-> opts = [ "-DBASE_MAJOR_VERSION=" ++ show major ]-> newlocbuildinfo = addToLocalBuildInfo opts locbuildinfo-> putStrLn $ "base version = " ++ concat (intersperse "." $ map show ver)-> writePersistBuildConfig distPref newlocbuildinfo-> -> main = do-> defaultMainWithHooks $ -> simpleUserHooks { postConf = myPostConf }+> main = defaultMain >
stb-image.cabal view
@@ -1,5 +1,5 @@ Name: stb-image-Version: 0.1.2+Version: 0.1.3 Synopsis: A wrapper around Sean Barrett's JPEG/PNG decoder Description: Partial implementation of JPEG, PNG, TGA, BMP, PSD decoders, with a really simple API.@@ -7,21 +7,32 @@ License-file: LICENSE Author: Balazs Komuves Maintainer: bkomuves (plus) hackage (at) gmail (dot) com+Homepage: http://code.haskell.org/~bkomuves/ Stability: Experimental Category: Codec Tested-With: GHC == 6.10.1, GHC == 6.8.3 -Cabal-Version: >= 1.4+Cabal-Version: >= 1.2 Build-Type: Simple Extra-Source-Files: example/viewer.hs Flag splitBase Description: Choose the new smaller, split-up base package. +Flag base4+ Description: Base-4 uses new exception framework+ Library if flag(splitBase)- Build-Depends: base >= 3, bytestring+ Build-Depends: bytestring+ if flag(base4)+ Build-Depends: base >= 4+ cpp-options: -DBASE_MAJOR_VERSION=4+ else+ Build-Depends: base >= 3 && < 4+ cpp-options: -DBASE_MAJOR_VERSION=3 else- Build-Depends: base < 3+ Build-Depends: base < 3+ cpp-options: -DBASE_MAJOR_VERSION=2 Exposed-Modules: Codec.Image.STB Hs-Source-Dirs: .@@ -29,4 +40,4 @@ ghc-options: -Wall C-Sources: cbits/stb_image.c Include-Dirs: cbits- cc-options: -O3 -DSTBI_NO_HDR -DSTBI_NO_STDIO -DSTBI_FAILURE_USERMSG+ cc-options: -DSTBI_NO_HDR -DSTBI_NO_STDIO -DSTBI_FAILURE_USERMSG