nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at python-updates 77 lines 1.8 kB view raw
1{ 2 copyDesktopItems, 3 fetchurl, 4 lib, 5 makeDesktopItem, 6 stdenv, 7 tcl, 8 tk, 9}: 10 11stdenv.mkDerivation (finalAttrs: { 12 pname = "dirdiff"; 13 version = "2.1"; 14 15 src = fetchurl { 16 url = "mirror://samba/paulus/dirdiff-${finalAttrs.version}.tar.gz"; 17 hash = "sha256-yzc2VNV4gCeAQ1XjVd8GlYYsO/wfaj/GAUcisxVqklI="; 18 }; 19 20 nativeBuildInputs = [ copyDesktopItems ]; 21 buildInputs = [ 22 tcl 23 tk 24 ]; 25 26 # Some light path patching. 27 patches = [ ./dirdiff-2.1-vars.patch ]; 28 postPatch = '' 29 for file in dirdiff Makefile; do 30 substituteInPlace "$file" \ 31 --subst-var out \ 32 --subst-var-by tcl ${tcl} \ 33 --subst-var-by tk ${tk} 34 done 35 36 sed -i "1i #include <unistd.h>" filecmp.c 37 ''; 38 39 env = { 40 NIX_CFLAGS_COMPILE = "-DUSE_INTERP_RESULT"; 41 NIX_LDFLAGS = "-ltcl"; 42 }; 43 44 # If we don't create the directories ourselves, then 'make install' creates 45 # files named 'bin' and 'lib'. 46 preInstall = '' 47 mkdir -p $out/bin $out/lib 48 ''; 49 50 installFlags = [ 51 "BINDIR=${placeholder "out"}/bin" 52 "LIBDIR=${placeholder "out"}/lib" 53 ]; 54 55 desktopItems = [ 56 (makeDesktopItem { 57 name = "dirdiff"; 58 exec = "dirdiff"; 59 desktopName = "Dirdiff"; 60 genericName = "Directory Diff Viewer"; 61 comment = "Diff and merge directory trees"; 62 categories = [ "Development" ]; 63 }) 64 ]; 65 66 meta = { 67 description = "Graphical directory tree diff and merge tool"; 68 mainProgram = "dirdiff"; 69 longDescription = '' 70 Dirdiff is a graphical tool for displaying the differences between 71 directory trees and for merging changes from one tree into another. 72 ''; 73 homepage = "https://www.samba.org/ftp/paulus/"; 74 license = lib.licenses.gpl2Plus; 75 platforms = lib.platforms.unix; 76 }; 77})