Skip to content

Commit

Permalink
Add package.yaml and other changes
Browse files Browse the repository at this point in the history
  • Loading branch information
psibi committed Jun 28, 2020
1 parent 296b137 commit edbdee8
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 14 deletions.
1 change: 1 addition & 0 deletions app/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ computeLocale lang = case map toLower <$> lang of
Nothing -> Missing
Just ('e':'n':_) -> English
Just (a:b:'_':_) -> Other (a:b:[])
Just (a:b:c:'_':_) -> Other (a:b:c:[])
Just str -> Unknown str

main :: IO ()
Expand Down
18 changes: 12 additions & 6 deletions package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ extra-source-files:
- test/data/*.golden
- test/data/*.md

flags:
static:
description: Statically link executables.
manual: true
default: false

library:
source-dirs: src
exposed-modules:
Expand All @@ -33,11 +39,12 @@ executables:
main: Main.hs
source-dirs: app
when:
- condition: os(linux)
then:
ghc-options: -threaded -optl-pthread -rtsopts -with-rtsopts=-N
else:
ghc-options: -threaded -rtsopts -with-rtsopts=-N
- condition: flag(static)
then:
ld-options: -static
ghc-options: "-rtsopts -threaded -optc-Os -optl=-pthread -optl=-static -fPIC"
else:
ghc-options: "-rtsopts -threaded"
dependencies:
- base
- tldr
Expand All @@ -61,4 +68,3 @@ tests:
- tldr
- tasty
- tasty-golden

21 changes: 13 additions & 8 deletions tldr.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,18 @@ cabal-version: 1.12
--
-- see: https://github.com/sol/hpack
--
-- hash: 6d6a28bd0b56fd00a272f305ae388900bd3a5e235b44afb32bd4e758846bf2f7
-- hash: d47f8d65bfc505f5820b8234498ac3ada64de3d247fca3d0305310115c2696a2

name: tldr
version: 0.6.4
version: 0.6.0
synopsis: Haskell tldr client
description: Haskell tldr client with support for viewing tldr pages. Has offline
cache for accessing pages. Visit https://tldr.sh for more details.
description: Haskell tldr client with support for viewing tldr pages. Has offline cache for accessing pages. Visit https://tldr.sh for more details.
category: Web, CLI
homepage: https://github.com/psibi/tldr-hs#readme
bug-reports: https://github.com/psibi/tldr-hs/issues
author: Sibi Prabakaran
maintainer: sibi@psibi.in
copyright: 2017 Sibi Prabakaran
copyright: 2017 Sibi
license: BSD3
license-file: LICENSE
build-type: Simple
Expand All @@ -34,6 +33,11 @@ source-repository head
type: git
location: https://github.com/psibi/tldr-hs

flag static
description: Statically link executables.
manual: True
default: False

library
exposed-modules:
Tldr
Expand Down Expand Up @@ -64,10 +68,11 @@ executable tldr
, semigroups
, tldr
, typed-process
if os(linux)
ghc-options: -threaded -optl-pthread -rtsopts -with-rtsopts=-N
if flag(static)
ghc-options: -rtsopts -threaded -optc-Os -optl=-pthread -optl=-static -fPIC
ld-options: -static
else
ghc-options: -threaded -rtsopts -with-rtsopts=-N
ghc-options: -rtsopts -threaded
default-language: Haskell2010

test-suite tldr-test
Expand Down

0 comments on commit edbdee8

Please sign in to comment.