git.iko.soy/typeable/cabal2nix
on e60526d help sign in
.travis.yml+44−38
since splitsnapshots
unifiedsplit
@@ -4,11 +4,9 @@
4#
4#
5# For more information, see https://github.com/haskell-CI/haskell-ci
5# For more information, see https://github.com/haskell-CI/haskell-ci
6#
6#
7−# version: 0.9.20200306
7+# version: 0.5.20190916
8#
8#
9−version: ~> 1.0
10language: c
9language: c
11−os: linux
12dist: xenial
10dist: xenial
13git:
11git:
14 # whether to recursively clone submodules
12 # whether to recursively clone submodules
@@ -17,7 +15,6 @@ cache:
17 directories:
15 directories:
18 - $HOME/.cabal/packages
16 - $HOME/.cabal/packages
19 - $HOME/.cabal/store
17 - $HOME/.cabal/store
20− - $HOME/.hlint
21before_cache:
18before_cache:
22 - rm -fv $CABALHOME/packages/hackage.haskell.org/build-reports.log
19 - rm -fv $CABALHOME/packages/hackage.haskell.org/build-reports.log
23 # remove files that are regenerated by 'cabal update'
20 # remove files that are regenerated by 'cabal update'
@@ -27,20 +24,14 @@ before_cache:
27 - rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.tar
24 - rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.tar
28 - rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.tar.idx
25 - rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.tar.idx
29 - rm -rfv $CABALHOME/packages/head.hackage
26 - rm -rfv $CABALHOME/packages/head.hackage
30−jobs:
27+matrix:
31 include:
28 include:
32− - compiler: ghc-8.10.1
29+ - compiler: ghc-8.8.1
33− addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-8.10.1","cabal-install-3.2"]}}
30+ addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.8.1","cabal-install-3.0"]}}
34− os: linux
35− - compiler: ghc-8.8.3
36− addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-8.8.3","cabal-install-3.0"]}}
37− os: linux
38 - compiler: ghc-8.6.5
31 - compiler: ghc-8.6.5
39− addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-8.6.5","cabal-install-3.0"]}}
32+ addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.6.5","cabal-install-3.0"]}}
40− os: linux
41 allow_failures:
33 allow_failures:
42− - compiler: ghc-8.8.3
34+ - compiler: ghc-8.8.1
43− - compiler: ghc-8.10.1
44before_install:
35before_install:
45 - HC=$(echo "/opt/$CC/bin/ghc" | sed 's/-/\//')
36 - HC=$(echo "/opt/$CC/bin/ghc" | sed 's/-/\//')
46 - WITHCOMPILER="-w $HC"
37 - WITHCOMPILER="-w $HC"
@@ -53,8 +44,29 @@ before_install:
53 - TOP=$(pwd)
44 - TOP=$(pwd)
54 - "HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\\d+)\\.(\\d+)\\.(\\d+)(\\.(\\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')"
45 - "HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\\d+)\\.(\\d+)\\.(\\d+)(\\.(\\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')"
55 - echo $HCNUMVER
46 - echo $HCNUMVER
56− - CABAL="$CABAL -vnormal+nowrap"
47+ - CABAL="$CABAL -vnormal+nowrap+markoutput"
57 - set -o pipefail
48 - set -o pipefail
49+ - |
50+ echo 'function blue(s) { printf "\033[0;34m" s "\033[0m " }' >> .colorful.awk
51+ echo 'BEGIN { state = "output"; }' >> .colorful.awk
52+ echo '/^-----BEGIN CABAL OUTPUT-----$/ { state = "cabal" }' >> .colorful.awk
53+ echo '/^-----END CABAL OUTPUT-----$/ { state = "output" }' >> .colorful.awk
54+ echo '!/^(-----BEGIN CABAL OUTPUT-----|-----END CABAL OUTPUT-----)/ {' >> .colorful.awk
55+ echo ' if (state == "cabal") {' >> .colorful.awk
56+ echo ' print blue($0)' >> .colorful.awk
57+ echo ' } else {' >> .colorful.awk
58+ echo ' print $0' >> .colorful.awk
59+ echo ' }' >> .colorful.awk
60+ echo '}' >> .colorful.awk
61+ - cat .colorful.awk
62+ - |
63+ color_cabal_output () {
64+ awk -f $TOP/.colorful.awk
65+ }
66+ - echo text | color_cabal_output
67+install:
68+ - ${CABAL} --version
69+ - echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"
58 - TEST=--enable-tests
70 - TEST=--enable-tests
59 - BENCH=--enable-benchmarks
71 - BENCH=--enable-benchmarks
60 - HEADHACKAGE=false
72 - HEADHACKAGE=false
@@ -87,20 +99,14 @@ before_install:
87 echo " f76d08be13e9a61a377a85e2fb63f4c5435d40f8feb3e12eb05905edb8cdea89" >> $CABALHOME/config
99 echo " f76d08be13e9a61a377a85e2fb63f4c5435d40f8feb3e12eb05905edb8cdea89" >> $CABALHOME/config
88 echo " key-threshold: 3" >> $CABALHOME/config
100 echo " key-threshold: 3" >> $CABALHOME/config
89 fi
101 fi
90−install:
91− - ${CABAL} --version
92− - echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"
93 - |
102 - |
94 echo "program-default-options" >> $CABALHOME/config
103 echo "program-default-options" >> $CABALHOME/config
95 echo " ghc-options: $GHCJOBS +RTS -M6G -RTS" >> $CABALHOME/config
104 echo " ghc-options: $GHCJOBS +RTS -M6G -RTS" >> $CABALHOME/config
96 - cat $CABALHOME/config
105 - cat $CABALHOME/config
97 - rm -fv cabal.project cabal.project.local cabal.project.freeze
106 - rm -fv cabal.project cabal.project.local cabal.project.freeze
98 - travis_retry ${CABAL} v2-update -v
107 - travis_retry ${CABAL} v2-update -v
99− - (cd /tmp && ${CABAL} v2-install $WITHCOMPILER -j2 doctest --constraint='doctest ==0.16.2.*')
108+ - (cd /tmp && ${CABAL} v2-install $WITHCOMPILER -j2 doctest --constraint='doctest ==0.16.*' | color_cabal_output)
100− - if [ $HCNUMVER -lt 80800 ] ; then HLINTVER=$(cd /tmp && (${CABAL} v2-install -v $WITHCOMPILER --dry-run hlint --constraint='hlint ==2.2.*' | perl -ne 'if (/\bhlint-(\d+(\.\d+)*)\b/) { print "$1"; last; }')); echo "HLint version $HLINTVER" ; fi
109+ - if [ $HCNUMVER -lt 80800 ] ; then (cd /tmp && ${CABAL} v2-install $WITHCOMPILER -j2 hlint --constraint='hlint ==2.1.*' | color_cabal_output) ; fi
101− - "if [ $HCNUMVER -lt 80800 ] ; then if [ ! -e $HOME/.hlint/hlint-$HLINTVER/hlint ]; then echo \"Downloading HLint version $HLINTVER\"; mkdir -p $HOME/.hlint; curl --write-out 'Status Code: %{http_code} Redirects: %{num_redirects} Total time: %{time_total} Total Dsize: %{size_download}\\n' --silent --location --output $HOME/.hlint/hlint-$HLINTVER.tar.gz \"https://github.com/ndmitchell/hlint/releases/download/v$HLINTVER/hlint-$HLINTVER-x86_64-linux.tar.gz\"; tar -xzv -f $HOME/.hlint/hlint-$HLINTVER.tar.gz -C $HOME/.hlint; fi ; fi"
102− - if [ $HCNUMVER -lt 80800 ] ; then mkdir -p $CABALHOME/bin && ln -sf "$HOME/.hlint/hlint-$HLINTVER/hlint" $CABALHOME/bin/hlint ; fi
103− - if [ $HCNUMVER -lt 80800 ] ; then hlint --version ; fi
104 # Generate cabal.project
110 # Generate cabal.project
105 - rm -rf cabal.project cabal.project.local cabal.project.freeze
111 - rm -rf cabal.project cabal.project.local cabal.project.freeze
106 - touch cabal.project
112 - touch cabal.project
@@ -111,15 +117,15 @@ install:
111 - cat cabal.project || true
117 - cat cabal.project || true
112 - cat cabal.project.local || true
118 - cat cabal.project.local || true
113 - if [ -f "./configure.ac" ]; then (cd "." && autoreconf -i); fi
119 - if [ -f "./configure.ac" ]; then (cd "." && autoreconf -i); fi
114− - ${CABAL} v2-freeze $WITHCOMPILER ${TEST} ${BENCH}
120+ - ${CABAL} v2-freeze $WITHCOMPILER ${TEST} ${BENCH} | color_cabal_output
115 - "cat cabal.project.freeze | sed -E 's/^(constraints: *| *)//' | sed 's/any.//'"
121 - "cat cabal.project.freeze | sed -E 's/^(constraints: *| *)//' | sed 's/any.//'"
116 - rm cabal.project.freeze
122 - rm cabal.project.freeze
117− - travis_wait 40 ${CABAL} v2-build $WITHCOMPILER ${TEST} ${BENCH} --dep -j2 all
123+ - ${CABAL} v2-build $WITHCOMPILER ${TEST} ${BENCH} --dep -j2 all | color_cabal_output
118− - travis_wait 40 ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --dep -j2 all
124+ - ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --dep -j2 all | color_cabal_output
119script:
125script:
120 - DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)
126 - DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)
121 # Packaging...
127 # Packaging...
122− - ${CABAL} v2-sdist all
128+ - ${CABAL} v2-sdist all | color_cabal_output
123 # Unpacking...
129 # Unpacking...
124 - mv dist-newstyle/sdist/*.tar.gz ${DISTDIR}/
130 - mv dist-newstyle/sdist/*.tar.gz ${DISTDIR}/
125 - cd ${DISTDIR} || false
131 - cd ${DISTDIR} || false
@@ -137,25 +143,25 @@ script:
137 - cat cabal.project.local || true
143 - cat cabal.project.local || true
138 # Building...
144 # Building...
139 # this builds all libraries and executables (without tests/benchmarks)
145 # this builds all libraries and executables (without tests/benchmarks)
140− - ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks all
146+ - ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks all | color_cabal_output
141 # Building with tests and benchmarks...
147 # Building with tests and benchmarks...
142 # build & run tests, build benchmarks
148 # build & run tests, build benchmarks
143− - ${CABAL} v2-build $WITHCOMPILER ${TEST} ${BENCH} all
149+ - ${CABAL} v2-build $WITHCOMPILER ${TEST} ${BENCH} all | color_cabal_output
144 # Testing...
150 # Testing...
145− - ${CABAL} v2-test $WITHCOMPILER ${TEST} ${BENCH} all
151+ - ${CABAL} v2-test $WITHCOMPILER ${TEST} ${BENCH} all | color_cabal_output
146 # Doctest...
152 # Doctest...
147− - (cd ${PKGDIR_cabal2nix} && doctest -i ../dist-newstyle/build/*/*/cabal2nix-*/build/autogen src)
153+ - (cd ${PKGDIR_cabal2nix} && doctest -i ../dist-newstyle/build/*/*/cabal2nix-*/build/autogen -XMonadFailDesugaring src)
148 # HLint..
154 # HLint..
149− - if [ $HCNUMVER -lt 80800 ] ; then (cd ${PKGDIR_cabal2nix} && hlint src) ; fi
155+ - if [ $HCNUMVER -lt 80800 ] ; then (cd ${PKGDIR_cabal2nix} && hlint -XMonadFailDesugaring src) ; fi
150− - if [ $HCNUMVER -lt 80800 ] ; then (cd ${PKGDIR_cabal2nix} && hlint hackage2nix) ; fi
156+ - if [ $HCNUMVER -lt 80800 ] ; then (cd ${PKGDIR_cabal2nix} && hlint -XMonadFailDesugaring hackage2nix) ; fi
151− - if [ $HCNUMVER -lt 80800 ] ; then (cd ${PKGDIR_cabal2nix} && hlint cabal2nix) ; fi
157+ - if [ $HCNUMVER -lt 80800 ] ; then (cd ${PKGDIR_cabal2nix} && hlint -XMonadFailDesugaring cabal2nix) ; fi
152 # cabal check...
158 # cabal check...
153 - (cd ${PKGDIR_cabal2nix} && ${CABAL} -vnormal check)
159 - (cd ${PKGDIR_cabal2nix} && ${CABAL} -vnormal check)
154 # haddock...
160 # haddock...
155− - ${CABAL} v2-haddock $WITHCOMPILER --with-haddock $HADDOCK ${TEST} ${BENCH} all
161+ - ${CABAL} v2-haddock $WITHCOMPILER --with-haddock $HADDOCK ${TEST} ${BENCH} all | color_cabal_output
156 # Building without installed constraints for packages in global-db...
162 # Building without installed constraints for packages in global-db...
157 - rm -f cabal.project.local
163 - rm -f cabal.project.local
158− - ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks all
164+ - ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks all | color_cabal_output
159
165
160−# REGENDATA ("0.9.20200306",["--installed=+all -Cabal","--hlint","--doctest","--doctest-options=-i ../dist-newstyle/build/*/*/cabal2nix-*/build/autogen","-o",".travis.yml","cabal2nix.cabal","--head-hackage","--head-hackage-jobs","> 8.8"])
166+# REGENDATA ["--installed=+all -Cabal","--hlint","--doctest","--doctest-options=-i ../dist-newstyle/build/*/*/cabal2nix-*/build/autogen","-o",".travis.yml","cabal2nix.cabal","--head-hackage","--head-hackage-jobs","> 8.8"]
161# EOF
167# EOF
README.md+6−6
@@ -27,16 +27,16 @@ direct `http://host/path/pkg.cabal` URL can be provided, as well as a
27`file:///local/path/pkg.cabal` URI that doesn't depend on network access.
27`file:///local/path/pkg.cabal` URI that doesn't depend on network access.
28However, if the source hash is not already in `cabal2nix`'s cache or provided
28However, if the source hash is not already in `cabal2nix`'s cache or provided
29using the `--sha256` option, `cabal2nix` still needs to download the source
29using the `--sha256` option, `cabal2nix` still needs to download the source
30−code to compute the hash, which still causes network traffic. Run the utility
30+code to compute the hash, which obviously still causes network traffic. Run the
31−with `--help` to see the complete list of supported command-line flags.
31+utility with `--help` to see the complete list of supported command line flags.
32
32
33−Detailed instructions on how to use those generated files with Nix can be found at
33+Detailed instructions how to use those generated files with Nix can be found at
34https://nixos.org/nixpkgs/manual/#how-to-create-nix-builds-for-your-own-private-haskell-packages.
34https://nixos.org/nixpkgs/manual/#how-to-create-nix-builds-for-your-own-private-haskell-packages.
35
35
36`cabal2nix` can also build derivations for projects from other sources than
36`cabal2nix` can also build derivations for projects from other sources than
37−Hackage. You only need to provide a URI that points to a cabal project. The
37+hackage. You only need to provide an URI that points to a cabal project. The
38−most common use-case for this is probably to generate a derivation for a
38+most common usecase for this is probably to generate a derivation for a project
39−project on the local file system:
39+on the local file system:
40
40
41 $ cabal get mtl-2.2.1 && cd mtl-2.2.1
41 $ cabal get mtl-2.2.1 && cd mtl-2.2.1
42 $ cabal2nix .
42 $ cabal2nix .
cabal2nix.cabal+10−6
@@ -1,5 +1,5 @@
1name: cabal2nix
1name: cabal2nix
2−version: 2.15.1
2+version: 2.15.0
3synopsis: Convert Cabal files into Nix build instructions.
3synopsis: Convert Cabal files into Nix build instructions.
4description:
4description:
5 Convert Cabal files into Nix build instructions. Users of Nix can install the latest
5 Convert Cabal files into Nix build instructions. Users of Nix can install the latest
@@ -27,7 +27,7 @@ author: Peter Simons, Andres Loeh, Benno Fünfstück, Mateusz Kowalc
27 gebbert, laMudri, Александр Цамутали
27 gebbert, laMudri, Александр Цамутали
28maintainer: Peter Simons <simons@cryp.to>
28maintainer: Peter Simons <simons@cryp.to>
29stability: stable
29stability: stable
30−tested-with: GHC == 8.6.5, GHC == 8.8.3, GHC == 8.10.1
30+tested-with: GHC == 8.6.5, GHC == 8.8.1
31category: Distribution, Nix
31category: Distribution, Nix
32homepage: https://github.com/nixos/cabal2nix#readme
32homepage: https://github.com/nixos/cabal2nix#readme
33bug-reports: https://github.com/nixos/cabal2nix/issues
33bug-reports: https://github.com/nixos/cabal2nix/issues
@@ -61,7 +61,7 @@ library
61 other-modules: Paths_cabal2nix
61 other-modules: Paths_cabal2nix
62 hs-source-dirs: src
62 hs-source-dirs: src
63 build-depends: base > 4.11
63 build-depends: base > 4.11
64− , Cabal == 3.0.*
64+ , Cabal > 3
65 , aeson > 1
65 , aeson > 1
66 , ansi-wl-pprint
66 , ansi-wl-pprint
67 , bytestring
67 , bytestring
@@ -84,6 +84,7 @@ library
84 , transformers
84 , transformers
85 , yaml
85 , yaml
86 default-language: Haskell2010
86 default-language: Haskell2010
87+ default-extensions: MonadFailDesugaring
87 other-extensions: MultiParamTypeClasses
88 other-extensions: MultiParamTypeClasses
88 ScopedTypeVariables
89 ScopedTypeVariables
89 FlexibleInstances
90 FlexibleInstances
@@ -101,6 +102,7 @@ executable cabal2nix
101 hs-source-dirs: cabal2nix
102 hs-source-dirs: cabal2nix
102 build-depends: base, cabal2nix
103 build-depends: base, cabal2nix
103 default-language: Haskell2010
104 default-language: Haskell2010
105+ default-extensions: MonadFailDesugaring
104 ghc-options: -Wall -Wcompat -Wincomplete-uni-patterns -Wincomplete-record-updates
106 ghc-options: -Wall -Wcompat -Wincomplete-uni-patterns -Wincomplete-record-updates
105 -Wredundant-constraints
107 -Wredundant-constraints
106
108
@@ -110,7 +112,7 @@ executable hackage2nix
110 Paths_cabal2nix
112 Paths_cabal2nix
111 hs-source-dirs: hackage2nix
113 hs-source-dirs: hackage2nix
112 build-depends: base < 5
114 build-depends: base < 5
113− , Cabal
115+ , Cabal > 2.4
114 , aeson
116 , aeson
115 , bytestring
117 , bytestring
116 , cabal2nix
118 , cabal2nix
@@ -127,15 +129,16 @@ executable hackage2nix
127 , optparse-applicative
129 , optparse-applicative
128 , pretty >= 1.1.2
130 , pretty >= 1.1.2
129 default-language: Haskell2010
131 default-language: Haskell2010
132+ default-extensions: MonadFailDesugaring
130 ghc-options: -Wall -Wcompat -Wincomplete-uni-patterns -Wincomplete-record-updates
133 ghc-options: -Wall -Wcompat -Wincomplete-uni-patterns -Wincomplete-record-updates
131− -Wredundant-constraints -threaded -rtsopts -with-rtsopts=-maxN16
134+ -Wredundant-constraints -threaded -rtsopts -with-rtsopts=-N
132
135
133test-suite regression-test
136test-suite regression-test
134 type: exitcode-stdio-1.0
137 type: exitcode-stdio-1.0
135 main-is: Main.hs
138 main-is: Main.hs
136 hs-source-dirs: test
139 hs-source-dirs: test
137 build-depends: base
140 build-depends: base
138− , Cabal
141+ , Cabal > 2.4
139 , cabal2nix
142 , cabal2nix
140 , containers
143 , containers
141 , directory
144 , directory
@@ -147,6 +150,7 @@ test-suite regression-test
147 , tasty
150 , tasty
148 , tasty-golden
151 , tasty-golden
149 default-language: Haskell2010
152 default-language: Haskell2010
153+ default-extensions: MonadFailDesugaring
150 build-tools: cabal2nix
154 build-tools: cabal2nix
151 ghc-options: -Wall -Wcompat -Wincomplete-uni-patterns -Wincomplete-record-updates
155 ghc-options: -Wall -Wcompat -Wincomplete-uni-patterns -Wincomplete-record-updates
152 -Wredundant-constraints -threaded -with-rtsopts=-K64K
156 -Wredundant-constraints -threaded -with-rtsopts=-K64K
hackage2nix/Main.hs+1−1
@@ -10,7 +10,7 @@ import Control.Monad
10import Control.Monad.Par.Combinator
10import Control.Monad.Par.Combinator
11import Control.Monad.Par.IO
11import Control.Monad.Par.IO
12import Control.Monad.Trans ( liftIO )
12import Control.Monad.Trans ( liftIO )
13−import Data.List ( intercalate )
13+import Data.List
14import Data.Map.Strict ( Map )
14import Data.Map.Strict ( Map )
15import qualified Data.Map.Strict as Map
15import qualified Data.Map.Strict as Map
16import Data.Maybe
16import Data.Maybe
src/Cabal2nix.hs+2−2
@@ -11,9 +11,10 @@ module Cabal2nix
11import Control.Exception ( bracket )
11import Control.Exception ( bracket )
12import Control.Lens
12import Control.Lens
13import Control.Monad
13import Control.Monad
14−import Data.List ( intercalate, isPrefixOf )
14+import Data.List
15import Data.List.Split
15import Data.List.Split
16import Data.Maybe ( fromMaybe, isJust, listToMaybe )
16import Data.Maybe ( fromMaybe, isJust, listToMaybe )
17+import Data.Monoid ( (<>) )
17import qualified Data.Set as Set
18import qualified Data.Set as Set
18import Data.String
19import Data.String
19import Data.Time
20import Data.Time
@@ -135,7 +136,6 @@ ghcConvertOS os = case os of
135 "watchos" -> "ios"
136 "watchos" -> "ios"
136 "tvos" -> "ios"
137 "tvos" -> "ios"
137 "linux-android" -> "linux-android"
138 "linux-android" -> "linux-android"
138− "linux-androideabi" -> "linux-androideabi"
139 _ | "linux-" `isPrefixOf` os -> "linux"
139 _ | "linux-" `isPrefixOf` os -> "linux"
140 _ -> fromMaybe os $ listToMaybe
140 _ -> fromMaybe os $ listToMaybe
141 [prefix | prefix <- osPrefixes, prefix `isPrefixOf` os]
141 [prefix | prefix <- osPrefixes, prefix `isPrefixOf` os]
src/Distribution/Nixpkgs/Haskell/Derivation.hs+1−1
@@ -15,7 +15,7 @@ module Distribution.Nixpkgs.Haskell.Derivation
15
15
16import Control.DeepSeq
16import Control.DeepSeq
17import Control.Lens
17import Control.Lens
18−import Data.List ( isPrefixOf )
18+import Data.List
19import Data.Set ( Set )
19import Data.Set ( Set )
20import qualified Data.Set as Set
20import qualified Data.Set as Set
21import Data.Set.Lens
21import Data.Set.Lens
src/Distribution/Nixpkgs/Haskell/FromCabal/Flags.hs+3−8
@@ -4,7 +4,6 @@ module Distribution.Nixpkgs.Haskell.FromCabal.Flags ( configureCabalFlags ) wher
4
4
5import Distribution.Nixpkgs.Haskell.OrphanInstances ( )
5import Distribution.Nixpkgs.Haskell.OrphanInstances ( )
6
6
7−import Data.Char
8import Distribution.Package
7import Distribution.Package
9import Distribution.PackageDescription
8import Distribution.PackageDescription
10import Distribution.Version
9import Distribution.Version
@@ -16,7 +15,6 @@ configureCabalFlags' :: PackageIdentifier -> [(FlagName,Bool)]
16configureCabalFlags' (PackageIdentifier name version)
15configureCabalFlags' (PackageIdentifier name version)
17 | name == "accelerate-examples"= [disable "opencl"]
16 | name == "accelerate-examples"= [disable "opencl"]
18 | name == "arithmoi" = [disable "llvm"]
17 | name == "arithmoi" = [disable "llvm"]
19− | name == "bustle" = [disable "hgettext"] -- https://gitlab.freedesktop.org/bustle/bustle/issues/13
20 | name == "cabal-plan" = [enable "exe"]
18 | name == "cabal-plan" = [enable "exe"]
21 | name == "cassava" = [disable "bytestring--lt-0_10_4"]
19 | name == "cassava" = [disable "bytestring--lt-0_10_4"]
22 | name == "darcs" = [enable "library", enable "force-char8-encoding"]
20 | name == "darcs" = [enable "library", enable "force-char8-encoding"]
@@ -28,7 +26,7 @@ configureCabalFlags' (PackageIdentifier name version)
28 , enable "dbus"
26 , enable "dbus"
29 , disable "debuglocks"
27 , disable "debuglocks"
30 , enable "magicmime"
28 , enable "magicmime"
31− , enable "networkbsd"
29+ , disable "networkbsd"
32 , enable "pairing"
30 , enable "pairing"
33 , enable "production"
31 , enable "production"
34 , enable "s3"
32 , enable "s3"
@@ -59,10 +57,7 @@ configureCabalFlags' (PackageIdentifier name version)
59 | otherwise = []
57 | otherwise = []
60
58
61enable :: String -> (FlagName,Bool)
59enable :: String -> (FlagName,Bool)
62−enable name = (mkFlagName' name, True)
60+enable name = (mkFlagName name, True)
63
61
64disable :: String -> (FlagName,Bool)
62disable :: String -> (FlagName,Bool)
65−disable name = (mkFlagName' name, False)
63+disable name = (mkFlagName name, False)
66−
67−mkFlagName' :: String -> FlagName
68−mkFlagName' = mkFlagName . map toLower
src/Distribution/Nixpkgs/Haskell/FromCabal/Name.hs+1−1
@@ -96,7 +96,6 @@ libNixName "libavutil" = return "ffmpeg"
96libNixName "libgsasl" = return "gsasl"
96libNixName "libgsasl" = return "gsasl"
97libNixName "libpcre" = return "pcre"
97libNixName "libpcre" = return "pcre"
98libNixName "libpcre2" = return "pcre2"
98libNixName "libpcre2" = return "pcre2"
99−libNixName "libpcre2-8" = libNixName "libpcre2"
100libNixName "libqrencode" = return "qrencode"
99libNixName "libqrencode" = return "qrencode"
101libNixName "libR" = return "R"
100libNixName "libR" = return "R"
102libNixName "libsoup-gnome-2.4" = return "libsoup"
101libNixName "libsoup-gnome-2.4" = return "libsoup"
@@ -203,6 +202,7 @@ buildToolNixName "nix-env" = return "nix"
203buildToolNixName "nix-hash" = return "nix"
202buildToolNixName "nix-hash" = return "nix"
204buildToolNixName "nix-instantiate" = return "nix"
203buildToolNixName "nix-instantiate" = return "nix"
205buildToolNixName "nix-store" = return "nix"
204buildToolNixName "nix-store" = return "nix"
205+buildToolNixName "pkg-config" = return "pkgconfig"
206buildToolNixName x = return (fromString x)
206buildToolNixName x = return (fromString x)
207
207
208-- | Helper function to extract the package name from a String that may or may
208-- | Helper function to extract the package name from a String that may or may
src/Distribution/Nixpkgs/Haskell/FromCabal/PostProcess.hs+3−10
@@ -13,7 +13,6 @@ import Data.Set ( Set )
13import qualified Data.Set as Set
13import qualified Data.Set as Set
14import Distribution.Nixpkgs.Haskell
14import Distribution.Nixpkgs.Haskell
15import Distribution.Nixpkgs.Meta
15import Distribution.Nixpkgs.Meta
16−import Distribution.Nixpkgs.License
17import Distribution.Package
16import Distribution.Package
18import Distribution.System
17import Distribution.System
19import Distribution.Text
18import Distribution.Text
@@ -79,7 +78,7 @@ hooks =
79 , ("alsa-core", over (metaSection . platforms) (Set.filter (\(Platform _ os) -> os == Linux)))
78 , ("alsa-core", over (metaSection . platforms) (Set.filter (\(Platform _ os) -> os == Linux)))
80 , ("bindings-GLFW", over (libraryDepends . system) (Set.union (Set.fromList [bind "pkgs.xorg.libXext", bind "pkgs.xorg.libXfixes"])))
79 , ("bindings-GLFW", over (libraryDepends . system) (Set.union (Set.fromList [bind "pkgs.xorg.libXext", bind "pkgs.xorg.libXfixes"])))
81 , ("bindings-lxc", over (metaSection . platforms) (Set.filter (\(Platform _ os) -> os == Linux)))
80 , ("bindings-lxc", over (metaSection . platforms) (Set.filter (\(Platform _ os) -> os == Linux)))
82− , ("bustle", bustleOverrides)
81+ , ("bustle", set (libraryDepends . pkgconfig . contains "system-glib = pkgs.glib") True)
83 , ("Cabal", set doCheck False) -- test suite doesn't work in Nix
82 , ("Cabal", set doCheck False) -- test suite doesn't work in Nix
84 , ("Cabal >2.2", over (setupDepends . haskell) (Set.union (Set.fromList [self "mtl", self "parsec"]))) -- https://github.com/haskell/cabal/issues/5391
83 , ("Cabal >2.2", over (setupDepends . haskell) (Set.union (Set.fromList [self "mtl", self "parsec"]))) -- https://github.com/haskell/cabal/issues/5391
85 , ("cabal-helper", set doCheck False) -- https://github.com/DanielG/cabal-helper/issues/17
84 , ("cabal-helper", set doCheck False) -- https://github.com/DanielG/cabal-helper/issues/17
@@ -90,7 +89,7 @@ hooks =
90 , ("dns", set testTarget "spec") -- don't execute tests that try to access the network
89 , ("dns", set testTarget "spec") -- don't execute tests that try to access the network
91 , ("eventstore", over (metaSection . platforms) (Set.filter (\(Platform arch _) -> arch == X86_64)))
90 , ("eventstore", over (metaSection . platforms) (Set.filter (\(Platform arch _) -> arch == X86_64)))
92 , ("freenect < 1.2.1", over configureFlags (Set.union (Set.fromList ["--extra-include-dirs=${pkgs.freenect}/include/libfreenect", "--extra-lib-dirs=${pkgs.freenect}/lib"])))
91 , ("freenect < 1.2.1", over configureFlags (Set.union (Set.fromList ["--extra-include-dirs=${pkgs.freenect}/include/libfreenect", "--extra-lib-dirs=${pkgs.freenect}/lib"])))
93− , ("fltkhs", set (libraryDepends . system . contains (pkg "fltk14")) True . over (libraryDepends . pkgconfig) (Set.union (pkgs ["libGLU", "libGL"]))) -- TODO: fltk14 belongs into the *setup* dependencies.
92+ , ("fltkhs", set (libraryDepends . system . contains (pkg "fltk14")) True . set (libraryDepends . pkgconfig . contains (pkg "libGLU_combined")) True) -- TODO: fltk14 belongs into the *setup* dependencies.
94 , ("gf", set phaseOverrides gfPhaseOverrides . set doCheck False)
93 , ("gf", set phaseOverrides gfPhaseOverrides . set doCheck False)
95 , ("gi-cairo", giCairoPhaseOverrides) -- https://github.com/haskell-gi/haskell-gi/issues/36
94 , ("gi-cairo", giCairoPhaseOverrides) -- https://github.com/haskell-gi/haskell-gi/issues/36
96 , ("gi-gdk", set runHaddock True )
95 , ("gi-gdk", set runHaddock True )
@@ -256,7 +255,7 @@ gfPhaseOverrides = unlines
256 , " sed -i \"s|numJobs (bf bi)++||\" ./Setup.hs"
255 , " sed -i \"s|numJobs (bf bi)++||\" ./Setup.hs"
257 -- Parallel compilation fails. Disable it.
256 -- Parallel compilation fails. Disable it.
258 , "'';"
257 , "'';"
259− , "preBuild = ''export LD_LIBRARY_PATH=`pwd`/dist/build''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH'';"
258+ , "preBuild = ''export LD_LIBRARY_PATH=`pwd`/dist/build:$LD_LIBRARY_PATH'';"
260 -- The build step itself, after having built the library, needs to be able
259 -- The build step itself, after having built the library, needs to be able
261 -- to find the library it just built in order to compile grammar files.
260 -- to find the library it just built in order to compile grammar files.
262 ]
261 ]
@@ -401,9 +400,3 @@ pandocOverrides = set phaseOverrides postInstall
401 , " mv \"man/\"*.1 $out/share/man/man1/"
400 , " mv \"man/\"*.1 $out/share/man/man1/"
402 , "'';"
401 , "'';"
403 ]
402 ]
404−
405−bustleOverrides :: Derivation -> Derivation
406−bustleOverrides = set (libraryDepends . pkgconfig . contains "system-glib = pkgs.glib") True
407− . set (executableDepends . pkgconfig . contains "gio-unix = null") False
408− . set (metaSection . license) (Known "stdenv.lib.licenses.lgpl21Plus")
409− . set (metaSection . hydraPlatforms) allKnownPlatforms
update-stackage.sh+3−2
@@ -25,7 +25,6 @@ sed -r \
25sed -r \
25sed -r \
26 -e '/ cabal-install /d' \
26 -e '/ cabal-install /d' \
27 -e '/ cabal2nix /d' \
27 -e '/ cabal2nix /d' \
28− -e '/ cabal2spec /d' \
29 -e '/ distribution-nixpkgs /d' \
28 -e '/ distribution-nixpkgs /d' \
30 -e '/ git-annex /d' \
29 -e '/ git-annex /d' \
31 -e '/ hindent /d' \
30 -e '/ hindent /d' \
@@ -35,6 +34,8 @@ sed -r \
35 -e '/ hopenssl /d' \
34 -e '/ hopenssl /d' \
36 -e '/ jailbreak-cabal /d' \
35 -e '/ jailbreak-cabal /d' \
37 -e '/ json-autotype/d' \
36 -e '/ json-autotype/d' \
37+ -e '/ lambdabot-core /d' \
38+ -e '/ lambdabot-irc-plugins /d' \
38 -e '/ language-nix /d' \
39 -e '/ language-nix /d' \
39 -e '/ shake /d' \
40 -e '/ shake /d' \
40 -e '/ ShellCheck /d' \
41 -e '/ ShellCheck /d' \
@@ -44,7 +45,7 @@ sed -r \
44
45
45# Drop the previous configuration ...
46# Drop the previous configuration ...
46# shellcheck disable=SC1004
47# shellcheck disable=SC1004
47−sed -e '/ # LTS Haskell/,/^$/c \TODO\
48+sed -e '/# LTS Haskell/,/^$/c \TODO\
48' -i nixpkgs/pkgs/development/haskell-modules/configuration-hackage2nix.yaml
49' -i nixpkgs/pkgs/development/haskell-modules/configuration-hackage2nix.yaml
49
50
50# ... and replace it with the new one.
51# ... and replace it with the new one.