From b143dd14c6474d2dba6707057ff465604cbebc6b Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Thu, 27 Aug 2020 10:52:58 +0200 Subject: [PATCH] Fix build for cabal users that don't have systemd This is mainly due to a cabal bug and should be removed in the future: https://github.com/haskell/cabal/issues/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 --- scripts/gen-cabal-nosystemd.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 scripts/gen-cabal-nosystemd.sh diff --git a/scripts/gen-cabal-nosystemd.sh b/scripts/gen-cabal-nosystemd.sh new file mode 100755 index 00000000000..bb8df721289 --- /dev/null +++ b/scripts/gen-cabal-nosystemd.sh @@ -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