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 Sep 25, 2020
1 parent 0b2888b commit 5918d83
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions scripts/gen-cabal-nosystemd.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/sh

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

set -eux

root="$(dirname "$(dirname "$(realpath "$0")")")"

cd "${root}"

perl -00 -ne 'print if not /.*scribe-systemd.*/' 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 5918d83

Please sign in to comment.