dformat: init at 0.15.2 (#401429)

This commit is contained in:
Sandro
2025-10-13 13:10:17 +00:00
committed by GitHub
3 changed files with 74 additions and 0 deletions
+8
View File
@@ -0,0 +1,8 @@
{
"dependencies": {
"libdparse": {
"version": "0.25.0",
"sha256": "012ihzwhikvpd7crr3ql38hs32lfy9gnkg9qvjgpd7ar3xbsa5sz"
}
}
}
+13
View File
@@ -0,0 +1,13 @@
diff --git a/dub.json b/dub.json
index a0d6357..abae578 100644
--- a/dub.json
+++ b/dub.json
@@ -13,8 +13,5 @@
],
"versions" : [
"built_with_dub"
- ],
- "preBuildCommands" : [
- "$DC -run \"$PACKAGE_DIR/dubhash.d\""
]
}
+53
View File
@@ -0,0 +1,53 @@
{
lib,
buildDubPackage,
fetchFromGitHub,
versionCheckHook,
}:
buildDubPackage rec {
pname = "dfmt";
version = "0.15.2";
src = fetchFromGitHub {
owner = "dlang-community";
repo = "dfmt";
tag = "v${version}";
hash = "sha256-QjmYPIQFs+91jB1sdaFoenfWt5TLXyEJauSSHP2fd+M=";
};
preBuild = ''
mkdir -p bin/
echo "v${version}" > bin/dubhash.txt
'';
patches = [
# do not run the dubhash tool, we supply the version in preBuild
./fix_version.patch
];
dubLock = ./dub-lock.json;
doCheck = true;
installPhase = ''
runHook preInstall
install -Dm755 bin/dfmt -t $out/bin
runHook postInstall
'';
nativeInstallCheckInputs = [
versionCheckHook
];
doInstallCheck = true;
meta = {
description = "Formatter for D source code";
changelog = "https://github.com/dlang-community/dfmt/releases/tag/v${version}";
homepage = "https://github.com/dlang-community/dfmt";
maintainers = with lib.maintainers; [ ipsavitsky ];
mainProgram = "dfmt";
license = lib.licenses.boost;
};
}