Streams 0.1e released
Hello I released Streams library version 0.1e. Changes are: - Fixed bug: "openFD name WriteMode" don't truncated files on unixes * Full library now released under BSD3 license, thanks to John Goerzen + Now cabalized, thanks to Jeremy Shaw Download: http://freearc.narod.ru/Streams.tar.gz Docs: http://haskell.org/haskellwiki/Library/Streams btw, my cabal file contain line: Build-Depends: base, Win32, template-haskell if i correctly understand, this will not work on unix systems, while without Win32 package program can't be compiled on my windows box. what i can do here? only provide two separate cabal files - one for unix, one for windows and give to user text instructions about manual renaming of appropriate file? -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com
On 2006-06-08, Bulat Ziganshin <bulat.ziganshin@gmail.com> wrote:
Hello
I released Streams library version 0.1e. Changes are:
- Fixed bug: "openFD name WriteMode" don't truncated files on unixes
How's about adding an "AppendMode" that doesn't truncate, but leaving "WriteMode" as truncating? -- Aaron Denney -><-
Hello Aaron, Thursday, June 8, 2006, 7:58:46 PM, you wrote:
I released Streams library version 0.1e. Changes are:
- Fixed bug: "openFD name WriteMode" don't truncated files on unixes
How's about adding an "AppendMode" that doesn't truncate, but leaving "WriteMode" as truncating?
library supports all the variants of IOMode - ReadMode, WriteMode, AppendMode, ReadWriteMode. it was just a bug that "openFD WriteMode" was not truncating files as "openFile WriteMode" does ... seems that just my English is wrong? -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com
Bulat Ziganshin wrote:
I released Streams library version 0.1e. Changes are:
- Fixed bug: "openFD name WriteMode" don't truncated files on unixes * Full library now released under BSD3 license, thanks to John Goerzen + Now cabalized, thanks to Jeremy Shaw
Download: http://freearc.narod.ru/Streams.tar.gz Docs: http://haskell.org/haskellwiki/Library/Streams
btw, my cabal file contain line:
Build-Depends: base, Win32, template-haskell
if i correctly understand, this will not work on unix systems, while without Win32 package program can't be compiled on my windows box. what i can do here? only provide two separate cabal files - one for unix, one for windows and give to user text instructions about manual renaming of appropriate file?
One workaround: your Setup.lhs could distinguish the OS using System.Info, and then invoke the right .cabal file. Conditional dependencies are an important issue that we do plan to address in Cabal. Cheers, Simon
Hello Simon, Friday, June 9, 2006, 7:23:15 PM, you wrote:
btw, my cabal file contain line:
Build-Depends: base, Win32, template-haskell
if i correctly understand, this will not work on unix systems, while without Win32 package program can't be compiled on my windows box. what i can do here? only provide two separate cabal files - one for unix, one for windows and give to user text instructions about manual renaming of appropriate file?
One workaround: your Setup.lhs could distinguish the OS using System.Info, and then invoke the right .cabal file.
i done this, think that this script may be very useful for other programmers not familiar with Cabal: #!/usr/bin/runhaskell import qualified System.Info import Data.List import System.IO import Distribution.Simple import Distribution.PackageDescription main = do let isWindows = "mingw" `isPrefixOf` System.Info.os cabal = if isWindows then "Streams.cabal.win32" else "Streams.cabal" defaultMainNoRead =<< readPackageDescription cabal may be it can be done better? (more reliable windows detection, more compatible with various cabal versions) -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com
Hello Bulat, Friday, June 16, 2006, 11:19:08 AM, you wrote:
btw, my cabal file contain line:
Build-Depends: base, Win32, template-haskell
if i correctly understand, this will not work on unix systems, while without Win32 package program can't be compiled on my windows box.
sorry if i overfill mail list, but that is another solution, that don't contain hard-wired name of "Streams.cabal" file and don't require two separate cabal files - one for windows and one for unix. instead, it just use the default cabal file and adds "Win32" package to the list of used packages if we are running windows box: #!/usr/bin/runhaskell import qualified System.Info import Data.List import Distribution.Simple import Distribution.Simple.Utils import Distribution.PackageDescription main = do pkg_descr_file <- defaultPackageDesc pkg_descr <- readPackageDescription pkg_descr_file let isWindows = "mingw" `isPrefixOf` System.Info.os config = if isWindows then pkg_descr { buildDepends = Dependency "Win32" AnyVersion : buildDepends pkg_descr } else pkg_descr defaultMainNoRead config i hope that it will be useful for other developers p.s. for language lawyers: the code is in public domain -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com
On 16 June 2006 12:27, Bulat Ziganshin wrote:
sorry if i overfill mail list, but that is another solution, that don't contain hard-wired name of "Streams.cabal" file and don't require two separate cabal files - one for windows and one for unix. instead, it just use the default cabal file and adds "Win32" package to the list of used packages if we are running windows box:
#!/usr/bin/runhaskell
import qualified System.Info import Data.List import Distribution.Simple import Distribution.Simple.Utils import Distribution.PackageDescription
main = do pkg_descr_file <- defaultPackageDesc pkg_descr <- readPackageDescription pkg_descr_file let isWindows = "mingw" `isPrefixOf` System.Info.os config = if isWindows then pkg_descr { buildDepends = Dependency "Win32" AnyVersion : buildDepends pkg_descr } else pkg_descr defaultMainNoRead config
i hope that it will be useful for other developers
This is fine for now, but the drawback of both of these solutions is that external tools can't collect information about the package by reading the .cabal file. The Win32 dependency won't show up if you load the .cabal file into Visual Haskell, for example. Cheers, Simon
participants (4)
-
Aaron Denney -
Bulat Ziganshin -
Simon Marlow -
Simon Marlow