From 0c0ad44ac6376d9bfb2b84d5f2293d945130ab45 Mon Sep 17 00:00:00 2001 From: Eugene Crosser Date: Mon, 21 Apr 2014 01:22:06 +0400 Subject: [PATCH] i2p elements are optional --- NmcDom.hs | 12 ++++++------ build | 3 ++- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/NmcDom.hs b/NmcDom.hs index 477def1..3ab8c7f 100644 --- a/NmcDom.hs +++ b/NmcDom.hs @@ -81,16 +81,16 @@ instance Mergeable NmcRRService where merge _ b = b data NmcRRI2p = NmcRRI2p - { i2pDestination :: String - , i2pName :: String - , i2pB32 :: String + { i2pDestination :: Maybe String + , i2pName :: Maybe String + , i2pB32 :: Maybe String } deriving (Show, Eq) instance FromJSON NmcRRI2p where parseJSON (Object o) = NmcRRI2p - <$> o .: "destination" - <*> o .: "name" - <*> o .: "b32" + <$> o .:? "destination" + <*> o .:? "name" + <*> o .:? "b32" parseJSON _ = empty instance Mergeable NmcRRI2p where diff --git a/build b/build index 319e038..c77b024 100755 --- a/build +++ b/build @@ -5,7 +5,8 @@ sfx="linux-glibc6.`uname -m`.`date +%Y-%m-%d`.git-`git rev-parse --verify HEAD | echo "Making $file.$sfx" # tried this: -#ghc --make -static -optc-static -optl-shared-libgcc -optl-static -optl-pthread +#ghc --make -static -optc-static -optl-shared-libgcc -optl-static \ +# -optl-pthread -pgml g++ "$file" # but cannot make it "only glibc is shared". And with static glibc, # getaddrinfo does not work on systems with different glibc. ghc --make "$file" -- 2.39.2