Prepare v0.6.0.4

This commit is contained in:
maralorn 2022-11-28 16:13:21 +01:00
parent dfd5eea314
commit 3d00e5e33c
6 changed files with 35 additions and 13 deletions

View File

@ -1,5 +1,9 @@
# Revision history for taskwarrior
## 0.6.0.4
* GHC 9.4 compatibility
## 0.6.0.3
* Bump bounds for aeson 2.1

View File

@ -1,6 +1,6 @@
{ sources ? import ./nix/sources.nix, pkgs ? import sources.nixpkgs { } }:
let
inherit (pkgs) haskellPackages;
haskellPackages = pkgs.haskell.packages.ghc94;
in
pkgs.haskell.lib.overrideCabal (haskellPackages.callCabal2nix "taskwarrior" ./. {}) {
postPatch = ''

View File

@ -5,10 +5,10 @@
"homepage": "",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "0dbbfdd03f48b3f042857bfcf419e62da2957256",
"sha256": "05pvs7y2a6ndv49n5lglg8bymg5hi9nvawmipfc93arwaa50r9jf",
"rev": "3f1aa79da7448d4f041dc3c0e099b49c04d8fead",
"sha256": "1r9r7kvrcaygba7lajks3w6gy8i9rnga76nxq537p6njl4vv40wi",
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/0dbbfdd03f48b3f042857bfcf419e62da2957256.tar.gz",
"url": "https://github.com/NixOS/nixpkgs/archive/3f1aa79da7448d4f041dc3c0e099b49c04d8fead.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
}
}

View File

@ -31,8 +31,28 @@ let
if spec ? branch then "refs/heads/${spec.branch}" else
if spec ? tag then "refs/tags/${spec.tag}" else
abort "In git source '${name}': Please specify `ref`, `tag` or `branch`!";
submodules = if spec ? submodules then spec.submodules else false;
submoduleArg =
let
nixSupportsSubmodules = builtins.compareVersions builtins.nixVersion "2.4" >= 0;
emptyArgWithWarning =
if submodules == true
then
builtins.trace
(
"The niv input \"${name}\" uses submodules "
+ "but your nix's (${builtins.nixVersion}) builtins.fetchGit "
+ "does not support them"
)
{}
else {};
in
if nixSupportsSubmodules
then { inherit submodules; }
else emptyArgWithWarning;
in
builtins.fetchGit { url = spec.repo; inherit (spec) rev; inherit ref; };
builtins.fetchGit
({ url = spec.repo; inherit (spec) rev; inherit ref; } // submoduleArg);
fetch_local = spec: spec.path;

View File

@ -16,10 +16,8 @@ module Taskwarrior.IO (
import Control.Monad (when)
import qualified Data.Aeson as Aeson
import qualified Data.ByteString as BS
import qualified Data.ByteString.Lazy as LBS hiding (
putStrLn,
)
import qualified Data.ByteString.Lazy.Char8 as LBS
import qualified Data.ByteString.Lazy as LBS
import qualified Data.ByteString.Lazy.Char8 as LBSC
import Data.Text (Text)
import qualified Data.Text as Text
import Data.Time (getCurrentTime)
@ -77,7 +75,7 @@ getUUIDs args =
input <- LBS.hGetContents stdout
maybe (fail "Couldn't parse UUIDs") return
. traverse UUID.fromLazyASCIIBytes
. LBS.lines
. LBSC.lines
$ input
-- | Uses @task import@ to save the given tasks.
@ -123,7 +121,7 @@ onModify :: (Task -> Task -> IO Task) -> IO ()
onModify f = do
original <- readTaskLine onModifyError
modified <- readTaskLine onModifyError
LBS.putStrLn . Aeson.encode =<< f original modified
LBSC.putStrLn . Aeson.encode =<< f original modified
readTaskLine :: String -> IO Task
readTaskLine errorMsg =
@ -136,6 +134,6 @@ onAddPure f = onAdd (pure . f)
-- | Like onAddPure with side effects.
onAdd :: (Task -> IO Task) -> IO ()
onAdd f =
LBS.putStrLn . Aeson.encode =<< f
LBSC.putStrLn . Aeson.encode =<< f
=<< readTaskLine
"OnAdd hook couldnt parse task."

View File

@ -46,7 +46,7 @@ library
build-depends:
, aeson >=2.0.0.0 && < 2.2
, base >=4.11 && < 4.17
, base >=4.11 && < 4.18
, bytestring >=0.10.8.2 && < 0.12
, containers >=0.5.0.0 && < 0.7
, process ^>=1.6.5.0