From 4b0a1afb75f29fae507988cf69527419e586f049 Mon Sep 17 00:00:00 2001 From: Andreas Abel Date: Tue, 25 Jun 2024 15:01:00 +0200 Subject: [PATCH] v0.7.2: drop support for old-time, allow latest dependencies --- CHANGELOG.md | 12 +++-- src/System/PosixCompat/Internal/Time.hs | 12 ----- unix-compat.cabal | 64 +++++++++---------------- 3 files changed, 31 insertions(+), 57 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a09be5..7484ff4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,17 @@ +## Version 0.7.2 (2024-06-25) + +- Remove flag `old-time` and drop support for `old-time`. +- Remove support for GHC 7. +- Tested with GHC 8.0 - 9.10. + ## Version 0.7.1 (2023-12-06) Santa Clause edition -- Add `System.PosixCompat.Process` module, exporting `getProcessID` +- Add `System.PosixCompat.Process` module, exporting `getProcessID`. ## Version 0.7 (2023-03-15) -- Remove `System.PosixCompat.User` module +- Remove `System.PosixCompat.User` module. ## Version 0.6 (2022-05-22) -- Better support for symbolic links +- Better support for symbolic links. diff --git a/src/System/PosixCompat/Internal/Time.hs b/src/System/PosixCompat/Internal/Time.hs index 023dd37..4a5c460 100644 --- a/src/System/PosixCompat/Internal/Time.hs +++ b/src/System/PosixCompat/Internal/Time.hs @@ -10,16 +10,6 @@ module System.PosixCompat.Internal.Time ( ) where import System.Posix.Types (EpochTime) - -#ifdef OLD_TIME - -import System.Time (ClockTime(TOD), getClockTime) - -clockTimeToEpochTime :: ClockTime -> EpochTime -clockTimeToEpochTime (TOD s _) = fromInteger s - -#else - import Data.Time.Clock.POSIX (POSIXTime, getPOSIXTime) type ClockTime = POSIXTime @@ -29,5 +19,3 @@ getClockTime = getPOSIXTime clockTimeToEpochTime :: ClockTime -> EpochTime clockTimeToEpochTime = fromInteger . floor - -#endif diff --git a/unix-compat.cabal b/unix-compat.cabal index e91e33a..45c8e18 100644 --- a/unix-compat.cabal +++ b/unix-compat.cabal @@ -1,5 +1,6 @@ +cabal-version: >= 1.10 name: unix-compat -version: 0.7.1 +version: 0.7.2 synopsis: Portable POSIX-compatibility layer. description: This package provides portable implementations of parts of the unix package. This package re-exports the unix @@ -13,7 +14,6 @@ author: Björn Bringert, Duncan Coutts, Jacob Stanley, Bryan O'Sullivan maintainer: https://github.com/haskell-pkg-janitors category: System build-type: Simple -cabal-version: >= 1.10 tested-with: GHC == 9.10.1 @@ -36,15 +36,8 @@ source-repository head type: git location: https://github.com/haskell-pkg-janitors/unix-compat.git -flag old-time - description: build against old-time package - default: False - Library - default-language: Haskell2010 hs-source-dirs: src - ghc-options: -Wall - build-depends: base == 4.* exposed-modules: System.PosixCompat @@ -56,27 +49,18 @@ Library System.PosixCompat.Types System.PosixCompat.Unistd + build-depends: base >= 4.9 && < 5 + if os(windows) c-sources: cbits/HsUname.c cbits/mktemp.c extra-libraries: msvcrt - build-depends: Win32 >= 2.5.0.0 - build-depends: filepath >= 1.0 && < 1.5 - - if flag(old-time) - build-depends: old-time >= 1.0.0.0 && < 1.2.0.0 - cpp-options: -DOLD_TIME - - if impl(ghc < 7) - build-depends: directory == 1.0.* - cpp-options: -DDIRECTORY_1_0 - else - build-depends: directory == 1.1.* - else - build-depends: time >= 1.0 && < 1.13 - build-depends: directory >= 1.3.1 && < 1.4 + build-depends: Win32 >= 2.5.0.0 + build-depends: directory >= 1.3.1 && < 1.4 + build-depends: filepath >= 1.0 && < 1.6 + build-depends: time >= 1.0 && < 1.13 other-modules: System.PosixCompat.Internal.Time @@ -90,11 +74,14 @@ Library if os(solaris) cc-options: -DSOLARIS -Test-Suite unix-compat-testsuite default-language: Haskell2010 + ghc-options: + -Wall + -Wcompat + +Test-Suite unix-compat-testsuite type: exitcode-stdio-1.0 hs-source-dirs: tests - ghc-options: -Wall main-is: main.hs other-modules: @@ -119,11 +106,12 @@ Test-Suite unix-compat-testsuite build-depends: unix-compat - , base == 4.* + , base , monad-parallel , hspec , HUnit - , directory + , directory >= 1.3.1.0 + -- directory-1.3.1.0 adds createFileLink , extra , temporary @@ -134,19 +122,8 @@ Test-Suite unix-compat-testsuite -- extra-libraries: msvcrt -- build-depends: Win32 >= 2.5.0.0 - - if flag(old-time) - build-depends: old-time >= 1.0.0.0 && < 1.2.0.0 - cpp-options: -DOLD_TIME - - if impl(ghc < 7) - build-depends: directory == 1.0.* - cpp-options: -DDIRECTORY_1_0 - else - build-depends: directory == 1.1.* - else - build-depends: time >= 1.0 && < 1.13 - build-depends: directory >= 1.3.1 && < 1.4 + build-depends: time + build-depends: directory -- other-modules: -- System.PosixCompat.Internal.Time @@ -160,4 +137,7 @@ Test-Suite unix-compat-testsuite if os(solaris) cc-options: -DSOLARIS - build-depends: directory >= 1.3.1 && < 1.4 + default-language: Haskell2010 + ghc-options: + -Wall + -Wcompat