git.iko.soy/typeable/cabal2nix
on 843e591 help sign in
8 files changed+58−58
since splitsnapshots
unifiedsplit
.travis.yml+44−38 cabal2nix.cabal+5−5 hackage2nix/Main.hs+1−1 src/Cabal2nix.hs+2−1 src/Distribution/Nixpkgs/Haskell/Derivation.hs+1−1 src/Distribution/Nixpkgs/Haskell/FromCabal/Flags.hs+1−2 src/Distribution/Nixpkgs/Haskell/FromCabal/PostProcess.hs+1−8 update-stackage.sh+3−2
.travis.yml+44−38
@@ -4,11 +4,9 @@
44#
55# For more information, see https://github.com/haskell-CI/haskell-ci
66#
7−# version: 0.9.20200306
7+# version: 0.5.20190916
88#
9−version: ~> 1.0
109language: c
11−os: linux
1210dist: xenial
1311git:
1412 # whether to recursively clone submodules
@@ -17,7 +15,6 @@ cache:
1715 directories:
1816 - $HOME/.cabal/packages
1917 - $HOME/.cabal/store
20− - $HOME/.hlint
2118before_cache:
2219 - rm -fv $CABALHOME/packages/hackage.haskell.org/build-reports.log
2320 # remove files that are regenerated by 'cabal update'
@@ -27,20 +24,14 @@ before_cache:
2724 - rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.tar
2825 - rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.tar.idx
2926 - rm -rfv $CABALHOME/packages/head.hackage
30−jobs:
27+matrix:
3128 include:
32− - compiler: ghc-8.10.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"]}}
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
29+ - compiler: ghc-8.8.1
30+ addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.8.1","cabal-install-3.0"]}}
3831 - 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"]}}
40− os: linux
32+ addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.6.5","cabal-install-3.0"]}}
4133 allow_failures:
42− - compiler: ghc-8.8.3
43− - compiler: ghc-8.10.1
34+ - compiler: ghc-8.8.1
4435before_install:
4536 - HC=$(echo "/opt/$CC/bin/ghc" | sed 's/-/\//')
4637 - WITHCOMPILER="-w $HC"
@@ -53,8 +44,29 @@ before_install:
5344 - TOP=$(pwd)
5445 - "HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\\d+)\\.(\\d+)\\.(\\d+)(\\.(\\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')"
5546 - echo $HCNUMVER
56− - CABAL="$CABAL -vnormal+nowrap"
47+ - CABAL="$CABAL -vnormal+nowrap+markoutput"
5748 - 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 '?')]"
5870 - TEST=--enable-tests
5971 - BENCH=--enable-benchmarks
6072 - HEADHACKAGE=false
@@ -87,20 +99,14 @@ before_install:
8799 echo " f76d08be13e9a61a377a85e2fb63f4c5435d40f8feb3e12eb05905edb8cdea89" >> $CABALHOME/config
88100 echo " key-threshold: 3" >> $CABALHOME/config
89101 fi
90−install:
91− - ${CABAL} --version
92− - echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"
93102 - |
94103 echo "program-default-options" >> $CABALHOME/config
95104 echo " ghc-options: $GHCJOBS +RTS -M6G -RTS" >> $CABALHOME/config
96105 - cat $CABALHOME/config
97106 - rm -fv cabal.project cabal.project.local cabal.project.freeze
98107 - travis_retry ${CABAL} v2-update -v
99− - (cd /tmp && ${CABAL} v2-install $WITHCOMPILER -j2 doctest --constraint='doctest ==0.16.2.*')
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
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
108+ - (cd /tmp && ${CABAL} v2-install $WITHCOMPILER -j2 doctest --constraint='doctest ==0.16.*' | color_cabal_output)
109+ - if [ $HCNUMVER -lt 80800 ] ; then (cd /tmp && ${CABAL} v2-install $WITHCOMPILER -j2 hlint --constraint='hlint ==2.1.*' | color_cabal_output) ; fi
104110 # Generate cabal.project
105111 - rm -rf cabal.project cabal.project.local cabal.project.freeze
106112 - touch cabal.project
@@ -111,15 +117,15 @@ install:
111117 - cat cabal.project || true
112118 - cat cabal.project.local || true
113119 - 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
115121 - "cat cabal.project.freeze | sed -E 's/^(constraints: *| *)//' | sed 's/any.//'"
116122 - rm cabal.project.freeze
117− - travis_wait 40 ${CABAL} v2-build $WITHCOMPILER ${TEST} ${BENCH} --dep -j2 all
118− - travis_wait 40 ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --dep -j2 all
123+ - ${CABAL} v2-build $WITHCOMPILER ${TEST} ${BENCH} --dep -j2 all | color_cabal_output
124+ - ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --dep -j2 all | color_cabal_output
119125script:
120126 - DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)
121127 # Packaging...
122− - ${CABAL} v2-sdist all
128+ - ${CABAL} v2-sdist all | color_cabal_output
123129 # Unpacking...
124130 - mv dist-newstyle/sdist/*.tar.gz ${DISTDIR}/
125131 - cd ${DISTDIR} || false
@@ -137,25 +143,25 @@ script:
137143 - cat cabal.project.local || true
138144 # Building...
139145 # 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
141147 # Building with tests and benchmarks...
142148 # build & run tests, build benchmarks
143− - ${CABAL} v2-build $WITHCOMPILER ${TEST} ${BENCH} all
149+ - ${CABAL} v2-build $WITHCOMPILER ${TEST} ${BENCH} all | color_cabal_output
144150 # Testing...
145− - ${CABAL} v2-test $WITHCOMPILER ${TEST} ${BENCH} all
151+ - ${CABAL} v2-test $WITHCOMPILER ${TEST} ${BENCH} all | color_cabal_output
146152 # 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)
148154 # HLint..
149− - if [ $HCNUMVER -lt 80800 ] ; then (cd ${PKGDIR_cabal2nix} && hlint src) ; fi
150− - if [ $HCNUMVER -lt 80800 ] ; then (cd ${PKGDIR_cabal2nix} && hlint hackage2nix) ; fi
151− - if [ $HCNUMVER -lt 80800 ] ; then (cd ${PKGDIR_cabal2nix} && hlint cabal2nix) ; fi
155+ - if [ $HCNUMVER -lt 80800 ] ; then (cd ${PKGDIR_cabal2nix} && hlint -XMonadFailDesugaring src) ; fi
156+ - if [ $HCNUMVER -lt 80800 ] ; then (cd ${PKGDIR_cabal2nix} && hlint -XMonadFailDesugaring hackage2nix) ; fi
157+ - if [ $HCNUMVER -lt 80800 ] ; then (cd ${PKGDIR_cabal2nix} && hlint -XMonadFailDesugaring cabal2nix) ; fi
152158 # cabal check...
153159 - (cd ${PKGDIR_cabal2nix} && ${CABAL} -vnormal check)
154160 # 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
156162 # Building without installed constraints for packages in global-db...
157163 - 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
159165
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"]
161167# EOF
cabal2nix.cabal+5−5
@@ -1,5 +1,5 @@
11name: cabal2nix
2−version: 2.15.1
2+version: 2.15.0
33synopsis: Convert Cabal files into Nix build instructions.
44description:
55 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
2727 gebbert, laMudri, Александр Цамутали
2828maintainer: Peter Simons <simons@cryp.to>
2929stability: 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
3131category: Distribution, Nix
3232homepage: https://github.com/nixos/cabal2nix#readme
3333bug-reports: https://github.com/nixos/cabal2nix/issues
@@ -61,7 +61,7 @@ library
6161 other-modules: Paths_cabal2nix
6262 hs-source-dirs: src
6363 build-depends: base > 4.11
64− , Cabal == 3.0.*
64+ , Cabal > 3
6565 , aeson > 1
6666 , ansi-wl-pprint
6767 , bytestring
@@ -110,7 +110,7 @@ executable hackage2nix
110110 Paths_cabal2nix
111111 hs-source-dirs: hackage2nix
112112 build-depends: base < 5
113− , Cabal
113+ , Cabal > 2.4
114114 , aeson
115115 , bytestring
116116 , cabal2nix
@@ -135,7 +135,7 @@ test-suite regression-test
135135 main-is: Main.hs
136136 hs-source-dirs: test
137137 build-depends: base
138− , Cabal
138+ , Cabal > 2.4
139139 , cabal2nix
140140 , containers
141141 , directory
hackage2nix/Main.hs+1−1
@@ -10,7 +10,7 @@ import Control.Monad
1010import Control.Monad.Par.Combinator
1111import Control.Monad.Par.IO
1212import Control.Monad.Trans ( liftIO )
13−import Data.List ( intercalate )
13+import Data.List
1414import Data.Map.Strict ( Map )
1515import qualified Data.Map.Strict as Map
1616import Data.Maybe
src/Cabal2nix.hs+2−1
@@ -11,9 +11,10 @@ module Cabal2nix
1111import Control.Exception ( bracket )
1212import Control.Lens
1313import Control.Monad
14−import Data.List ( intercalate, isPrefixOf )
14+import Data.List
1515import Data.List.Split
1616import Data.Maybe ( fromMaybe, isJust, listToMaybe )
17+import Data.Monoid ( (<>) )
1718import qualified Data.Set as Set
1819import Data.String
1920import Data.Time
src/Distribution/Nixpkgs/Haskell/Derivation.hs+1−1
@@ -15,7 +15,7 @@ module Distribution.Nixpkgs.Haskell.Derivation
1515
1616import Control.DeepSeq
1717import Control.Lens
18−import Data.List ( isPrefixOf )
18+import Data.List
1919import Data.Set ( Set )
2020import qualified Data.Set as Set
2121import Data.Set.Lens
src/Distribution/Nixpkgs/Haskell/FromCabal/Flags.hs+1−2
@@ -16,7 +16,6 @@ configureCabalFlags' :: PackageIdentifier -> [(FlagName,Bool)]
1616configureCabalFlags' (PackageIdentifier name version)
1717 | name == "accelerate-examples"= [disable "opencl"]
1818 | name == "arithmoi" = [disable "llvm"]
19− | name == "bustle" = [disable "hgettext"] -- https://gitlab.freedesktop.org/bustle/bustle/issues/13
2019 | name == "cabal-plan" = [enable "exe"]
2120 | name == "cassava" = [disable "bytestring--lt-0_10_4"]
2221 | name == "darcs" = [enable "library", enable "force-char8-encoding"]
@@ -28,7 +27,7 @@ configureCabalFlags' (PackageIdentifier name version)
2827 , enable "dbus"
2928 , disable "debuglocks"
3029 , enable "magicmime"
31− , enable "networkbsd"
30+ , disable "networkbsd"
3231 , enable "pairing"
3332 , enable "production"
3433 , enable "s3"
src/Distribution/Nixpkgs/Haskell/FromCabal/PostProcess.hs+1−8
@@ -13,7 +13,6 @@ import Data.Set ( Set )
1313import qualified Data.Set as Set
1414import Distribution.Nixpkgs.Haskell
1515import Distribution.Nixpkgs.Meta
16−import Distribution.Nixpkgs.License
1716import Distribution.Package
1817import Distribution.System
1918import Distribution.Text
@@ -79,7 +78,7 @@ hooks =
7978 , ("alsa-core", over (metaSection . platforms) (Set.filter (\(Platform _ os) -> os == Linux)))
8079 , ("bindings-GLFW", over (libraryDepends . system) (Set.union (Set.fromList [bind "pkgs.xorg.libXext", bind "pkgs.xorg.libXfixes"])))
8180 , ("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)
8382 , ("Cabal", set doCheck False) -- test suite doesn't work in Nix
8483 , ("Cabal >2.2", over (setupDepends . haskell) (Set.union (Set.fromList [self "mtl", self "parsec"]))) -- https://github.com/haskell/cabal/issues/5391
8584 , ("cabal-helper", set doCheck False) -- https://github.com/DanielG/cabal-helper/issues/17
@@ -401,9 +400,3 @@ pandocOverrides = set phaseOverrides postInstall
401400 , " mv \"man/\"*.1 $out/share/man/man1/"
402401 , "'';"
403402 ]
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 \
2525sed -r \
2626 -e '/ cabal-install /d' \
2727 -e '/ cabal2nix /d' \
28− -e '/ cabal2spec /d' \
2928 -e '/ distribution-nixpkgs /d' \
3029 -e '/ git-annex /d' \
3130 -e '/ hindent /d' \
@@ -35,6 +34,8 @@ sed -r \
3534 -e '/ hopenssl /d' \
3635 -e '/ jailbreak-cabal /d' \
3736 -e '/ json-autotype/d' \
37+ -e '/ lambdabot-core /d' \
38+ -e '/ lambdabot-irc-plugins /d' \
3839 -e '/ language-nix /d' \
3940 -e '/ shake /d' \
4041 -e '/ ShellCheck /d' \
@@ -44,7 +45,7 @@ sed -r \
4445
4546# Drop the previous configuration ...
4647# shellcheck disable=SC1004
47−sed -e '/ # LTS Haskell/,/^$/c \TODO\
48+sed -e '/# LTS Haskell/,/^$/c \TODO\
4849' -i nixpkgs/pkgs/development/haskell-modules/configuration-hackage2nix.yaml
4950
5051# ... and replace it with the new one.