git-annex: adjust for 10.20250320

- git-annex now supports either filepath-bytestring or filepath (>=
1.5.2) with the new OsPath API. For GHC 9.8, we have too stick to
filepath-bytestring and manually disable the OsPath flag. However,
we can already support building git-annex with GHC 9.10 and implement
our overrides in a future proof way.

Due to code changes relating to OsPath, our patch has to be rebased.

- The Utility.* modules gain a few dependencies, but for modules that
aren't used in Setup.hs. Consequently, our approach of reusing the
setup package db in GHC for the installer tool managed by the
git-annex Makefile is no longer enough.

Changed files
+48 -31
pkgs
+34 -26
pkgs/development/haskell-modules/configuration-common.nix
···
# 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
+9
pkgs/development/haskell-modules/configuration-nix.nix
···
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 ""
+ ''
+5 -5
pkgs/development/haskell-modules/patches/git-annex-no-usr-prefix.patch
···
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