diff --git a/pkgs/development/haskell-modules/configuration-common.nix b/pkgs/development/haskell-modules/configuration-common.nix index de31a5a203d4..5eddebb7a6d5 100644 --- a/pkgs/development/haskell-modules/configuration-common.nix +++ b/pkgs/development/haskell-modules/configuration-common.nix @@ -463,34 +463,42 @@ self: super: # The Hackage tarball is purposefully broken, because it's not intended to be, like, useful. # https://git-annex.branchable.com/bugs/bash_completion_file_is_missing_in_the_6.20160527_tarball_on_hackage/ - git-annex = overrideCabal (drv: { - src = pkgs.fetchgit { - name = "git-annex-${super.git-annex.version}-src"; - url = "git://git-annex.branchable.com/"; - rev = "refs/tags/" + super.git-annex.version; - sha256 = "08k0qlx97j0c7vx07nwhzwxb2rxcnzwzlg2x3j01cx033vwch8hq"; - # delete android and Android directories which cause issues on - # darwin (case insensitive directory). Since we don't need them - # during the build process, we can delete it to prevent a hash - # mismatch on darwin. - postFetch = '' - rm -r $out/doc/?ndroid* - ''; - }; + git-annex = lib.pipe super.git-annex ( + [ + (overrideCabal (drv: { + src = pkgs.fetchgit { + name = "git-annex-${super.git-annex.version}-src"; + url = "git://git-annex.branchable.com/"; + rev = "refs/tags/" + super.git-annex.version; + sha256 = "18n6ah4d5i8qhx1s95zsb8bg786v0nv9hcjyxggrk88ya77maxha"; + # delete android and Android directories which cause issues on + # darwin (case insensitive directory). Since we don't need them + # during the build process, we can delete it to prevent a hash + # mismatch on darwin. + postFetch = '' + rm -r $out/doc/?ndroid* + ''; + }; - patches = drv.patches or [ ] ++ [ - # Prevent .desktop files from being installed to $out/usr/share. - # TODO(@sternenseemann): submit upstreamable patch resolving this - # (this should be possible by also taking PREFIX into account). - ./patches/git-annex-no-usr-prefix.patch - ]; + patches = drv.patches or [ ] ++ [ + # Prevent .desktop files from being installed to $out/usr/share. + # TODO(@sternenseemann): submit upstreamable patch resolving this + # (this should be possible by also taking PREFIX into account). + ./patches/git-annex-no-usr-prefix.patch + ]; - postPatch = '' - substituteInPlace Makefile \ - --replace-fail 'InstallDesktopFile $(PREFIX)/bin/git-annex' \ - 'InstallDesktopFile git-annex' - ''; - }) super.git-annex; + postPatch = '' + substituteInPlace Makefile \ + --replace-fail 'InstallDesktopFile $(PREFIX)/bin/git-annex' \ + 'InstallDesktopFile git-annex' + ''; + })) + ] + ++ lib.optionals (lib.versionOlder self.ghc.version "9.10") [ + (disableCabalFlag "OsPath") + (addBuildDepends [ self.filepath-bytestring ]) + ] + ); # Too strict bounds on servant # Pending a hackage revision: https://github.com/berberman/arch-web/commit/5d08afee5b25e644f9e2e2b95380a5d4f4aa81ea#commitcomment-89230555 diff --git a/pkgs/development/haskell-modules/configuration-nix.nix b/pkgs/development/haskell-modules/configuration-nix.nix index 8dd8bd3e6e41..79a2c404bd2a 100644 --- a/pkgs/development/haskell-modules/configuration-nix.nix +++ b/pkgs/development/haskell-modules/configuration-nix.nix @@ -851,6 +851,15 @@ builtins.intersectAttrs super { executableSystemDepends = runtimeExecDeps; enableSharedExecutables = false; + # Unnecessary for Setup.hs, but we reuse the setup package db + # for the installation utilities. + setupHaskellDepends = drv.setupHaskellDepends or [ ] ++ [ + self.buildHaskellPackages.unix-compat + self.buildHaskellPackages.IfElse + self.buildHaskellPackages.QuickCheck + self.buildHaskellPackages.data-default + ]; + preConfigure = drv.preConfigure or "" + '' diff --git a/pkgs/development/haskell-modules/patches/git-annex-no-usr-prefix.patch b/pkgs/development/haskell-modules/patches/git-annex-no-usr-prefix.patch index 03c9368d52fb..e5529208b59f 100644 --- a/pkgs/development/haskell-modules/patches/git-annex-no-usr-prefix.patch +++ b/pkgs/development/haskell-modules/patches/git-annex-no-usr-prefix.patch @@ -2,12 +2,12 @@ diff --git a/Utility/FreeDesktop.hs b/Utility/FreeDesktop.hs index 896b89b991..6cbb4f90ae 100644 --- a/Utility/FreeDesktop.hs +++ b/Utility/FreeDesktop.hs -@@ -112,7 +112,7 @@ desktopfile f = f ++ ".desktop" +@@ -106,7 +106,7 @@ desktopfile f = toOsPath $ f ++ ".desktop" {- Directory used for installation of system wide data files.. -} - systemDataDir :: FilePath --systemDataDir = "/usr/share" -+systemDataDir = "/share" + systemDataDir :: OsPath +-systemDataDir = literalOsPath "/usr/share" ++systemDataDir = literalOsPath "/share" {- Directory used for installation of system wide config files. -} - systemConfigDir :: FilePath + systemConfigDir :: OsPath