Skip to content

Commit

Permalink
Fix build for cabal users that don't have systemd
Browse files Browse the repository at this point in the history
This is mainly due to a cabal bug and should be removed in
the future: haskell/cabal#5444

There are various distros, where installing development files
of libsystemd won't be an option:

- Alpine (doesn't have systemd at all)
- Gentoo (not installable when eudev is installed)
- Exherbo (not installable when eudev is installed)

Users are expected to run the script and then execute cabal like so:

  cabal build --project-file=cabal.nosystemd.project all
  • Loading branch information
Julian Ospald committed Aug 27, 2020
1 parent cccef26 commit bd4bf4e
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions gen-cabal-nosystemd.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh

# force systemd off until there's a solution to
# https://github.com/haskell/cabal/issues/5444

set -eux

sed -e '/^source-repository-package/N;/type:/N;/location:/N;/tag:/N;/scribe-systemd/d' cabal.project \
> cabal.nosystemd.project
echo "" >> cabal.nosystemd.project
echo "flags: -systemd" >> cabal.nosystemd.project

if [ -e cabal.project.freeze ] ; then
cp cabal.project.freeze cabal.nosystemd.project.freeze
fi

0 comments on commit bd4bf4e

Please sign in to comment.