packages feed

shake-language-c 0.8.4 → 0.8.6

raw patch · 4 files changed

+22/−10 lines, 4 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -1,5 +1,10 @@ # Changelog for shake-language-c +## v0.8.6++* Fix Windows host target+* Get host architecture from environment on Windows+ ## v0.8.3  * Allow to set linker command via `LD` environment variable
README.md view
@@ -1,7 +1,9 @@ # shake-language-c  [![Hackage version](https://img.shields.io/hackage/v/shake-language-c.svg?style=flat)](https://hackage.haskell.org/package/shake-language-c)-[![Build Status](https://img.shields.io/travis/samplecount/shake-language-c.svg?style=flat&branch=develop)](https://travis-ci.org/samplecount/shake-language-c)+[![Stackage LTS](http://stackage.org/package/shake-language-c/badge/lts)](http://stackage.org/lts/package/shake-language-c)+[![Stackage Nightly](http://stackage.org/package/shake-language-c/badge/nightly)](http://stackage.org/nightly/package/shake-language-c)+[![Build Status](https://travis-ci.org/samplecount/shake-language-c.svg?branch=develop)](https://travis-ci.org/samplecount/shake-language-c)  **shake-language-c** is a cross-platform build system based on the [Shake](https://github.com/ndmitchell/shake) Haskell library. The focus is on cross-compilation of *C*, *C++* and *Objective C* source code to various target platforms. Currently supported target platforms are *iOS*, *Android NDK*, *Google Portable Native Client*, *MacOS X*, *Linux* and *Windows* (*MinGW*). Supported host platforms are *MacOS X*, *Linux* and *Windows*. 
shake-language-c.cabal view
@@ -13,7 +13,7 @@ -- limitations under the License.  Name:         shake-language-c-Version:      0.8.4+Version:      0.8.6 Synopsis:     Utilities for cross-compiling with Shake Description:  This library provides <http://hackage.haskell.org/package/shake Shake> utilities for cross-compiling @C@, @C++@ and @ObjC@ code for various target platforms. Currently supported target platforms are Android, iOS, Linux, MacOS X, Windows\/MinGW and Google Portable Native Client (PNaCl). Supported host platforms are MacOS X, Linux and Windows. Category:     Development
src/Development/Shake/Language/C/Host/Windows.hs view
@@ -16,21 +16,26 @@   getHostToolChain ) where +import           Data.Char (isSpace) import           Development.Shake+import           Development.Shake.Command import           Development.Shake.Language.C.Target-import           Development.Shake.Language.C.Target.Linux+import           Development.Shake.Language.C.Target.Windows import           Development.Shake.Language.C.ToolChain import qualified System.Info as System +trim :: String -> String+trim = reverse . dropWhile isSpace . reverse+ getHostArch :: IO Arch getHostArch = do-    -- TODO: Get the info from the environment-    let arch = System.arch-    return $ case arch of-        "i386" -> X86 I386-        "i686" -> X86 I686-        "x86_64" -> X86 X86_64-        _ -> error $ "Unknown host architecture " ++ arch+    Stdout out <- cmd "wmic os get osarchitecture"+    let spec = map trim . lines $ out+    case spec of+        ("OSArchitecture":"32-Bit":_) -> return $ X86 I686+        ("OSArchitecture":"64-Bit":_) -> return $ X86 X86_64+        ("OSArchitecture":arch:_) -> error $ "Unknown host architecture " ++ arch+        _ -> error $ "Couldn't determine host architecture from " ++ show spec  getHostToolChain :: IO (Target, Action ToolChain) getHostToolChain = do