1 { lib, stdenv, fetchFromGitHub, fuse3, macfuse-stubs, pkg-config, sqlite, pcre2 }:
4 fuse = if stdenv.hostPlatform.isDarwin then macfuse-stubs else fuse3;
5 in stdenv.mkDerivation rec {
8 outputs = [ "bin" "man" "out" ];
10 src = fetchFromGitHub {
14 hash = "sha256-biVR932wHiUG56mvXoKWFzrzpkclbW9RWM4vY1+OMZ0=";
17 nativeBuildInputs = [ pkg-config ];
18 buildInputs = [ fuse pcre2 sqlite ];
20 patches = [ ./fusermount-setuid.patch ];
23 substituteInPlace src/tup/link.sh --replace '`git describe' '`echo ${version}'
25 cat << EOF > tup.config
26 CONFIG_CC=${stdenv.cc.targetPrefix}cc
27 CONFIG_AR=${stdenv.cc.targetPrefix}ar
28 CONFIG_TUP_USE_SYSTEM_SQLITE=y
32 # Regular tup builds require fusermount to have suid, which nix cannot
33 # currently provide in a build environment, so we bootstrap and use 'tup
39 ./build/tup generate script.sh
46 install -D tup -t $bin/bin/
47 install -D tup.1 -t $man/share/man/man1/
51 setupHook = ./setup-hook.sh;
54 description = "Fast, file-based build system";
57 Tup is a file-based build system for Linux, OSX, and Windows. It inputs a list
58 of file changes and a directed acyclic graph (DAG), then processes the DAG to
59 execute the appropriate commands required to update dependent files. Updates are
60 performed with very little overhead since tup implements powerful build
61 algorithms to avoid doing unnecessary work. This means you can stay focused on
62 your project rather than on your build system.
64 homepage = "https://gittup.org/tup/";
65 license = licenses.gpl2;
66 maintainers = with maintainers; [ ehmry ];
67 platforms = platforms.unix;
69 # TODO: Remove once nixpkgs uses newer SDKs that supports '*at' functions.
70 # Probably MacOS SDK 10.13 or later. Check the current version in
71 # ../../../../os-specific/darwin/apple-sdk/default.nix
73 # https://github.com/gittup/tup/commit/3697c74
74 broken = stdenv.hostPlatform.isDarwin;