Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/cabal2nix
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 611edf4ce673
Choose a base ref
...
head repository: NixOS/cabal2nix
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 285dbcad4e39
Choose a head ref

Commits on Apr 2, 2018

  1. Support all architectures and OSs that GHC and Cabal support

    This replicates GHC's normalization logic so that Cabal's built in parsers can
    be used. This should ensure maximum compatibility with how the Cabal file will
    actually be evaluated during the build.
    
    Additionally, this adds support for passing in the full LLVM style platform
    triple/quadruple (e.g. x86_64-unknown-linux-gnu) instead of just the short Nix
    style (x86_64-linux). This will make it possible for the ABI to treated as part
    of the OS where applicable (e.g. linux-android). We can then change
    `make-package-set.nix` to use `hostPlatform.config` instead of
    `hostPlatform.system` to get the full information.
    Ken Micklas committed Apr 2, 2018
    Copy the full SHA
    0bb88f0 View commit details

Commits on Apr 3, 2018

  1. Merge pull request #344 from obsidiansystems/parse-platform

    Support all architectures and OSs that GHC and Cabal support
    peti authored Apr 3, 2018
    Copy the full SHA
    17e0b6c View commit details

Commits on Apr 11, 2018

  1. persistent-sqlite: link the package against the system sqlite library

    The vendored library causes build errors, i.e.:
    
      yesodweb/persistent#803
    peti committed Apr 11, 2018
    Copy the full SHA
    7882850 View commit details

Commits on Apr 26, 2018

  1. Copy the full SHA
    143cae1 View commit details
  2. Copy the full SHA
    9ecb1e7 View commit details
  3. Copy the full SHA
    07ca643 View commit details

Commits on May 5, 2018

  1. Copy the full SHA
    2923434 View commit details

Commits on May 6, 2018

  1. Merge pull request #349 from mdorman/gdk-x11-3.0

    gdk-x11-3.0: point to the gtk3 package
    peti authored May 6, 2018
    Copy the full SHA
    a2d666d View commit details

Commits on May 9, 2018

  1. Copy the full SHA
    241b374 View commit details
  2. Copy the full SHA
    d8bc043 View commit details

Commits on May 28, 2018

  1. Copy the full SHA
    6806a6d View commit details
  2. Merge pull request #351 from nh2/show-which-source-failed

    fetchOrFromDB: Show which source failed when calling `fail`
    peti authored May 28, 2018
    Copy the full SHA
    5ecfc29 View commit details

Commits on May 29, 2018

  1. hackage2nix: clear homepage

    homepage will be set to Hackage by the generic builder.
    
    The hackage page is always there, and supports a TLS connection.
    ryantm committed May 29, 2018
    Copy the full SHA
    6fba7dd View commit details
  2. Merge pull request #352 from ryantm/homepage

    hackage2nix: clear homepage
    peti authored May 29, 2018
    Copy the full SHA
    580e4ea View commit details

Commits on May 31, 2018

  1. Fix dbusmenu-gtk3

    It also has a dependency on gtk3 which is not being picked up.
    puffnfresh committed May 31, 2018
    Copy the full SHA
    c033ef3 View commit details
  2. Merge pull request #353 from puffnfresh/package/dbusmenu-gtk3

    Fix dbusmenu-gtk3
    peti authored May 31, 2018
    Copy the full SHA
    179d8bb View commit details
  3. PostProcess: 'mesa' is now 'libGL'

    Fixes #354.
    peti committed May 31, 2018
    Copy the full SHA
    009c9e4 View commit details
  4. Copy the full SHA
    9312993 View commit details

Commits on Jun 14, 2018

  1. Copy the full SHA
    06cc00a View commit details

Commits on Jun 22, 2018

  1. Copy the full SHA
    7ccbd66 View commit details

Commits on Jun 28, 2018

  1. finalizeGenericPackageDescription: don't rely on defaultComponentRequ…

    …estedSpec
    
    A record update on defaultComponentRequestedSpec is no safer than just
    constructing an instance of the type directly, because there is a mysterious
    second constructor, OneComponentRequestedSpec, that our record update won't
    match if defaultComponentRequestedSpec turns out to be such a thing for some
    reason. Curiously enough, we have helper functions that can query the state of
    the ComponentRequestedSpec type, but we cannot easily manipulate it.
    peti committed Jun 28, 2018
    Copy the full SHA
    00e5cd2 View commit details
  2. Copy the full SHA
    e2d3438 View commit details
  3. Copy the full SHA
    c6f91ab View commit details
  4. Copy the full SHA
    e19c746 View commit details
  5. Copy the full SHA
    95c25b7 View commit details
  6. Copy the full SHA
    8810b21 View commit details
  7. lib: fix broken optHaddock logic

    When that value is set, it means that the --no-haddock options was not given on
    the command line. That is not the same thing as meaning that Haddock generation
    should be enabled.
    peti committed Jun 28, 2018
    Copy the full SHA
    7c77e7e View commit details

Commits on Jul 4, 2018

  1. Fix some typos.

    peti committed Jul 4, 2018
    Copy the full SHA
    c96e5f3 View commit details
  2. Copy the full SHA
    daeaea6 View commit details

Commits on Jul 10, 2018

  1. Copy the full SHA
    89ac7f7 View commit details
  2. bump version number to 2.9.3

    peti committed Jul 10, 2018
    Copy the full SHA
    070a4e7 View commit details
  3. Copy the full SHA
    4702a50 View commit details
  4. Copy the full SHA
    96d4799 View commit details
  5. Copy the full SHA
    e82312f View commit details
  6. Copy the full SHA
    5fb2489 View commit details
  7. Copy the full SHA
    7c0ef5b View commit details
  8. Copy the full SHA
    890c282 View commit details
  9. Merge pull request #357 from NixOS/refactor-cabal2nix

    Refactor cabal2nix lib api
    peti authored Jul 10, 2018
    Copy the full SHA
    ae983e3 View commit details
  10. cabal2nix.cabal: tentatively bump version to 2.10.0.

    We've had an API change.
    peti committed Jul 10, 2018
    Copy the full SHA
    b330eb5 View commit details

Commits on Jul 12, 2018

  1. Copy the full SHA
    9cbf9e8 View commit details
  2. Fix build with hpack 0.29.

    Closes #359.
    peti committed Jul 12, 2018
    Copy the full SHA
    2d81cda View commit details
  3. Copy the full SHA
    66799f0 View commit details
  4. Be a bit more precises about pruning duplicates for sake of cross

    If we need a library and build tool from the same package, we should
    keep both deps.
    Ericson2314 committed Jul 12, 2018
    Copy the full SHA
    9e4691d View commit details
  5. Copy the full SHA
    2e6458f View commit details
  6. Add hack for common erroneous missing build-tool-depends

    See comment in code for more details.
    
    Fixes #356
    Ericson2314 committed Jul 12, 2018
    Copy the full SHA
    ec494dd View commit details
  7. Merge pull request #358 from obsidiansystems/missing-tools

    Add hack for common erroneous missing build-tool-depends, and keep duplicate deps for cross
    peti authored Jul 12, 2018
    Copy the full SHA
    0f70a5b View commit details
  8. README.md: add some badges

    peti committed Jul 12, 2018
    Copy the full SHA
    c7420eb View commit details

Commits on Jul 16, 2018

  1. Copy the full SHA
    ad6e885 View commit details
  2. Copy the full SHA
    f156d9a View commit details

Commits on Jul 17, 2018

  1. If both package.yaml and cabal exist, prefer package.yaml.

    This is because in a nomal workflow, you would generate the .cabal
    every now and then from the package.yaml file.
    
    If you forget to do this generation and you have an old .cabal file
    in your tree (common because for users of hpack, .cabal files are
    usually in .gitignore), then until now nix would pick up the outdated
    cabal file and you would accidentally be running against outdated cabal
    contents.
    
    So in this commit we change the logic from
    
      "if *.cabal doens't exist, check if package.yaml exist, if so use hpack"
    
    to
    
      "if package.ymal exists, use hpack, otherwise use *.cabal"
    nh2 committed Jul 17, 2018
    Copy the full SHA
    5721bed View commit details
Showing 374 changed files with 2,464 additions and 2,763 deletions.
113 changes: 63 additions & 50 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# This Travis job script has been generated by a script via
#
# runghc make_travis_yml_2.hs '--no-installed' '--doctest' '--doctest-options=-i ../dist-newstyle/build/*/*/cabal2nix-*/build/autogen' '--hlint' '-o' '.travis.yml' 'cabal2nix.cabal'
# haskell-ci '--installed=+all -Cabal' '--hlint' '--doctest' '-o' '.travis.yml' 'cabal2nix.cabal'
#
# For more information, see https://github.com/hvr/multi-ghc-travis
# For more information, see https://github.com/haskell-CI/haskell-ci
#
# version: 0.2
#
language: c
sudo: false
dist: xenial

git:
submodules: false # whether to recursively clone submodules
@@ -16,90 +18,101 @@ cache:
- $HOME/.cabal/store

before_cache:
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log
- rm -fv $CABALHOME/packages/hackage.haskell.org/build-reports.log
# remove files that are regenerated by 'cabal update'
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/00-index.*
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/*.json
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.cache
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.tar
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.tar.idx
- rm -fv $CABALHOME/packages/hackage.haskell.org/00-index.*
- rm -fv $CABALHOME/packages/hackage.haskell.org/*.json
- rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.cache
- rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.tar
- rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.tar.idx

- rm -rfv $HOME/.cabal/packages/head.hackage
- rm -rfv $CABALHOME/packages/head.hackage

matrix:
include:
- compiler: "ghc-8.2.2"
# env: TEST=--disable-tests BENCH=--disable-benchmarks
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.2.2], sources: [hvr-ghc]}}
- compiler: "ghc-8.4.1"
# env: TEST=--disable-tests BENCH=--disable-benchmarks
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.4.1], sources: [hvr-ghc]}}
- compiler: "ghc-8.6.3"
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.6.3], sources: [hvr-ghc]}}

before_install:
- HC=${CC}
- HC=/opt/ghc/bin/${CC}
- HCPKG=${HC/ghc/ghc-pkg}
- unset CC
- CABAL=/opt/ghc/bin/cabal
- CABALHOME=$HOME/.cabal
- export PATH="$CABALHOME/bin:$PATH"
- ROOTDIR=$(pwd)
- mkdir -p $HOME/.local/bin
- "PATH=/opt/ghc/bin:/opt/ghc-ppa-tools/bin:$HOME/local/bin:$PATH"
- HCNUMVER=$(( $(${HC} --numeric-version|sed -E 's/([0-9]+)\.([0-9]+)\.([0-9]+).*/\1 * 10000 + \2 * 100 + \3/') ))
- echo $HCNUMVER

install:
- cabal --version
- ${CABAL} --version
- echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"
- BENCH=${BENCH---enable-benchmarks}
- TEST=${TEST---enable-tests}
- HADDOCK=${HADDOCK-true}
- INSTALLED=${INSTALLED-true}
- TEST=--enable-tests
- BENCH=--enable-benchmarks
- GHCHEAD=${GHCHEAD-false}
- travis_retry cabal update -v
- "sed -i.bak 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config"
- travis_retry ${CABAL} update -v
- sed -i.bak 's/^jobs:/-- jobs:/' $CABALHOME/config
- rm -fv cabal.project cabal.project.local
- grep -Ev -- '^\s*--' ${HOME}/.cabal/config | grep -Ev '^\s*$'
- if [ $HCNUMVER -ge 80000 ]; then cabal new-install -w ${HC} --symlink-bindir=$HOME/.local/bin doctest --constraint='doctest ==0.14.*'; fi
- if [ $HCNUMVER -eq 80202 ]; then cabal new-install -w ${HC} --symlink-bindir=$HOME/.local/bin hlint --constraint='hlint ==2.1.*'; fi
- "printf 'packages: \".\"\\n' > cabal.project"
- cat cabal.project
- if [ -f "./configure.ac" ]; then
(cd "." && autoreconf -i);
fi
- grep -Ev -- '^\s*--' $CABALHOME/config | grep -Ev '^\s*$'
- ${CABAL} new-install -w ${HC} -j2 doctest --constraint='doctest ==0.16.*'
- ${CABAL} new-install -w ${HC} -j2 hlint --constraint='hlint ==2.1.*'
- rm -f cabal.project
- touch cabal.project
- "printf 'packages: \".\"\\n' >> cabal.project"
- "printf 'write-ghc-environment-files: always\\n' >> cabal.project"
- touch cabal.project.local
- "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | grep -vE -- '^(Cabal|cabal2nix)$' | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
- cat cabal.project || true
- cat cabal.project.local || true
- if [ -f "./configure.ac" ]; then (cd "." && autoreconf -i); fi
- rm -f cabal.project.freeze
- cabal new-build -w ${HC} ${TEST} ${BENCH} --project-file="cabal.project" --dep -j2 all
- cabal new-build -w ${HC} --disable-tests --disable-benchmarks --project-file="cabal.project" --dep -j2 all
- ${CABAL} new-freeze -w ${HC} ${TEST} ${BENCH} --project-file="cabal.project" --dry
- "cat \"cabal.project.freeze\" | sed -E 's/^(constraints: *| *)//' | sed 's/any.//'"
- rm "cabal.project.freeze"
- ${CABAL} new-build -w ${HC} ${TEST} ${BENCH} --project-file="cabal.project" --dep -j2 all
- ${CABAL} new-build -w ${HC} --disable-tests --disable-benchmarks --project-file="cabal.project" --dep -j2 all
- rm -rf .ghc.environment.* "."/dist
- DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)

# Here starts the actual work to be performed for the package under test;
# any command which exits with a non-zero exit code causes the build to fail.
script:
# test that source-distributions can be generated
- (cd "." && cabal sdist)
- mv "."/dist/cabal2nix-*.tar.gz ${DISTDIR}/
- ${CABAL} new-sdist all
- mv dist-newstyle/sdist/*.tar.gz ${DISTDIR}/
- cd ${DISTDIR} || false
- find . -maxdepth 1 -name '*.tar.gz' -exec tar -xvf '{}' \;
- "printf 'packages: cabal2nix-*/*.cabal\\n' > cabal.project"
- cat cabal.project
- rm -f cabal.project
- touch cabal.project
- "printf 'packages: \"cabal2nix-*/*.cabal\"\\n' >> cabal.project"
- "printf 'write-ghc-environment-files: always\\n' >> cabal.project"
- touch cabal.project.local
- "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | grep -vE -- '^(Cabal|cabal2nix)$' | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
- cat cabal.project || true
- cat cabal.project.local || true
# this builds all libraries and executables (without tests/benchmarks)
- cabal new-build -w ${HC} --disable-tests --disable-benchmarks all

- ${CABAL} new-build -w ${HC} --disable-tests --disable-benchmarks all

# build & run tests, build benchmarks
- cabal new-build -w ${HC} ${TEST} ${BENCH} all
- if [ "x$TEST" = "x--enable-tests" ]; then cabal new-test -w ${HC} ${TEST} ${BENCH} all; fi
- ${CABAL} new-build -w ${HC} ${TEST} ${BENCH} all
- if [ "x$TEST" = "x--enable-tests" ]; then ${CABAL} new-test -w ${HC} ${TEST} ${BENCH} all; fi

# doctest
- if [ $HCNUMVER -ge 80000 ]; then (cd cabal2nix-* && doctest -i ../dist-newstyle/build/*/*/cabal2nix-*/build/autogen src); fi
- (cd cabal2nix-* && doctest -XMonadFailDesugaring src)

# hlint
- if [ $HCNUMVER -eq 80202 ]; then (cd cabal2nix-* && hlint src); fi
- (cd cabal2nix-* && hlint -XMonadFailDesugaring src)
- (cd cabal2nix-* && hlint -XMonadFailDesugaring hackage2nix)
- (cd cabal2nix-* && hlint -XMonadFailDesugaring cabal2nix)

# cabal check
- (cd cabal2nix-* && cabal check)
- (cd cabal2nix-* && ${CABAL} check)

# haddock
- rm -rf ./dist-newstyle
- if $HADDOCK; then cabal new-haddock -w ${HC} ${TEST} ${BENCH} all; else echo "Skipping haddock generation";fi
- ${CABAL} new-haddock -w ${HC} ${TEST} ${BENCH} all

# Build without installed constraints for packages in global-db
- rm -f cabal.project.local; ${CABAL} new-build -w ${HC} --disable-tests --disable-benchmarks all;

# REGENDATA ["--no-installed","--doctest","--doctest-options=-i ../dist-newstyle/build/*/*/cabal2nix-*/build/autogen","--hlint","-o",".travis.yml","cabal2nix.cabal"]
# REGENDATA ["--installed=+all -Cabal","--hlint","--doctest","-o",".travis.yml","cabal2nix.cabal"]
# EOF
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Cabal2nix
=========

[![hackage release](https://img.shields.io/hackage/v/cabal2nix.svg?label=hackage)](http://hackage.haskell.org/package/cabal2nix)
[![stackage LTS package](http://stackage.org/package/cabal2nix/badge/lts)](http://stackage.org/lts/package/cabal2nix)
[![stackage Nightly package](http://stackage.org/package/cabal2nix/badge/nightly)](http://stackage.org/nightly/package/cabal2nix)
[![travis build status](https://img.shields.io/travis/NixOS/cabal2nix/master.svg?label=travis+build)](https://travis-ci.org/NixOS/cabal2nix)

`cabal2nix` converts a single Cabal file into a single Nix build expression.
For example:

Loading