mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-11 20:25:32 +03:00
dedup-darwin: init at 0.0.6
This commit is contained in:
parent
f5d2974534
commit
a09de6a902
3 changed files with 73 additions and 0 deletions
13
pkgs/by-name/de/dedup-darwin/build-date-fix.patch
Normal file
13
pkgs/by-name/de/dedup-darwin/build-date-fix.patch
Normal 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 =
|
||||
|
18
pkgs/by-name/de/dedup-darwin/no-codesign.patch
Normal file
18
pkgs/by-name/de/dedup-darwin/no-codesign.patch
Normal 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
|
42
pkgs/by-name/de/dedup-darwin/package.nix
Normal file
42
pkgs/by-name/de/dedup-darwin/package.nix
Normal 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";
|
||||
};
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue