cabal-version: 2.2 name: lukko version: 0.1 synopsis: File locking category: System, Concurrency description: This package provides access to platform dependent file locking APIs: . * Open file descriptor locking on Linux ("Lukko.OFD") * @flock@ locking on unix platforms ("Lukko.FLock") * Windows locking @LockFileEx@ ("Lukko.Windows") * No-op locking, which throws exceptions ("Lukko.NoOp") * "Lukko" module exports the best option for the target platform with uniform API. . There are alternative file locking packages: . * "GHC.IO.Handle.Lock" in @base >= 4.10@ is good enough for most use cases. However, uses only 'Handle's so these locks cannot be used for intra-process locking. (You should use e.g. 'MVar' in addition). . * doesn't support OFD locking. . /Lukko/ means lock in Finnish. . Submodules "Lukko.OFD", "Lukko.Windows" etc are available based on following conditions. . @ if os(windows) \ cpp-options: -DHAS_WINDOWS_LOCK . elif (os(linux) && flag(ofd-locking)) \ cpp-options: -DHAS_OFD_LOCKING \ cpp-options: -DHAS_FLOCK . elif !(os(solaris) || os(aix)) \ cpp-options: -DHAS_FLOCK @ . "Lukko.FLock" is available on not (Windows or Solaris or AIX). "Lukko.NoOp" is always available. maintainer: Oleg Grenrus license: GPL-2.0-or-later AND BSD-3-Clause license-files: LICENSE LICENSE.GPLv2 LICENSE.GPLv3 build-type: Simple tested-with: GHC ==7.6.3 || ==7.8.4 || ==7.10.3 || ==8.0.2 || ==8.2.2 || ==8.4.4 || ==8.6.5 || ==8.8.1 source-repository head type: git location: https://github.com/phadej/lukko/ flag ofd-locking default: True manual: True description: Enable open file descriptor locking. Available on Linux (kernel 3.15, released Jun 8, 2014). library default-language: Haskell2010 hs-source-dirs: src build-depends: base >=4.5 && <4.14 build-tool-depends: hsc2hs:hsc2hs >=0.67 && <0.69 -- Main library module exposed-modules: Lukko Lukko.NoOp if os(windows) hs-source-dirs: src-windows cpp-options: -DUSE_WINDOWS_LOCK exposed-modules: Lukko.Windows c-sources: cbits/windows.c elif (os(linux) && flag(ofd-locking)) hs-source-dirs: src-ofd hs-source-dirs: src-flock hs-source-dirs: src-unix cpp-options: -DUSE_OFD_LOCKING exposed-modules: Lukko.OFD elif !(os(solaris) || os(aix)) hs-source-dirs: src-flock hs-source-dirs: src-unix cpp-options: -DUSE_FLOCK else hs-source-dirs: src-unix cpp-options: -DUSE_NOOP -- Cabal check is silly if (!os(windows) && !(os(solaris) || os(aix))) exposed-modules: Lukko.FLock other-modules: Lukko.Internal.FD Lukko.Internal.FillBytes Lukko.Internal.HandleToFD Lukko.Internal.Types test-suite test-thread default-language: Haskell2010 type: exitcode-stdio-1.0 hs-source-dirs: test main-is: Tests.hs ghc-options: -threaded build-depends: , async ^>=2.2.2 , base , filepath ^>=1.3.0.0 || ^>=1.4.0.0 , lukko , tasty ^>=1.2.3 , tasty-hunit ^>=0.10.0.2 , temporary ^>=1.3 if os(windows) cpp-options: -DHAS_WINDOWS_LOCK elif (os(linux) && flag(ofd-locking)) cpp-options: -DHAS_OFD_LOCKING cpp-options: -DHAS_FLOCK elif !(os(solaris) || os(aix)) cpp-options: -DHAS_FLOCK test-suite test-process default-language: Haskell2010 type: exitcode-stdio-1.0 hs-source-dirs: test main-is: TestProcess.hs ghc-options: -threaded build-depends: , base , bytestring >=0.9.2.1 && <0.11 , lukko if os(windows) cpp-options: -DHAS_WINDOWS_LOCK elif (os(linux) && flag(ofd-locking)) cpp-options: -DHAS_OFD_LOCKING cpp-options: -DHAS_FLOCK elif !(os(solaris) || os(aix)) cpp-options: -DHAS_FLOCK