dedup-darwin: init at 0.0.6

This commit is contained in:
Matteo Pacini 2025-02-28 21:00:16 +00:00
parent f5d2974534
commit a09de6a902
3 changed files with 73 additions and 0 deletions

View file

@ -0,0 +1,13 @@
diff --git a/Makefile b/Makefile
index c9c56ec..75654f7 100644
--- a/Makefile
+++ b/Makefile
@@ -29,7 +29,7 @@ CFLAGS += \
-mtune=generic \
-O \
'-DVERSION="$(VERSION)"' \
- '-DBUILD_DATE="$(shell date '+%Y%m%d')"'
+ '-DBUILD_DATE="19700101"'
ENTITLEMENT_FLAGS =

View file

@ -0,0 +1,18 @@
Entitlements & code signature are only needed
for ASAN and other debugging tools.
See official README for more details.
diff --git a/Makefile b/Makefile
index c9c56ec..36b81e0 100644
--- a/Makefile
+++ b/Makefile
@@ -63,9 +63,6 @@ dedup.x86_64: CFLAGS += -target x86_64-apple-macos11
dedup dedup.arm dedup.x86_64: $(OBJECTS)
$(CC) $(CFLAGS) -o $@ $^
- mv $@ $@.unsigned
- codesign -s - -v -f $(ENTITLEMENT_FLAGS) $@.unsigned
- mv $@.unsigned $@
dedup.universal:
rm -f *.o

View file

@ -0,0 +1,42 @@
{
stdenv,
lib,
fetchFromGitHub,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "dedup-darwin";
version = "0.0.6";
src = fetchFromGitHub {
owner = "ttkb-oss";
repo = "dedup";
tag = "release-${finalAttrs.version}";
hash = "sha256-/qVrZVSVJPANMuKphbekB4p4ehjrOg6097yvjdIdl7I=";
};
patches = [
./build-date-fix.patch
./no-codesign.patch
];
postPatch = ''
# Fix the prefix
substituteInPlace Makefile --replace-fail \
"PREFIX ?= /usr/local" "PREFIX ?= ${placeholder "out"}"
'';
preInstall = ''
# Install complains of missing directories, hence this fix.
mkdir -p $out/{bin,share/man/man1}
'';
meta = {
description = "Darwin utility to replace duplicate file data with a copy-on-write clone";
homepage = "https://github.com/ttkb-oss/dedup";
license = lib.licenses.bsd2;
maintainers = [ lib.maintainers.matteopacini ];
platforms = lib.platforms.darwin;
mainProgram = "dedup";
};
})