17 stdenv.mkDerivation rec {
19 version = "0-unstable-2023-09-05";
21 src = fetchFromBitbucket {
24 rev = "608f97eef5d81bb85963d66f955730dd93996f67";
25 hash = "sha256-lRIEtclx+NKxAO72nsvnxVeEGCEe6glC6w8MXh1HEwY=";
29 ./use-system-libraries.patch
34 substituteInPlace cc0/Makefile \
35 --replace '$(shell ./get_version.sh)' '${version}'
36 substituteInPlace cc0/compiler/bin/buildid \
37 --replace '`../get_version.sh`' '${version}' \
38 --replace '`date`' '1970-01-01T00:00:00Z' \
39 --replace '`hostname`' 'nixpkgs'
41 + lib.optionalString stdenv.hostPlatform.isDarwin ''
42 for f in cc0/compiler/bin/coin-o0-support cc0/compiler/bin/cc0-o0-support; do
43 substituteInPlace $f --replace '$(brew --prefix gnu-getopt)' '${getopt}'
55 ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ darwin.sigtool ];
67 installFlags = [ "PREFIX=$(out)" ];
70 mkdir -p $out/share/emacs/site-lisp
71 mv $out/c0-mode/ $out/share/emacs/site-lisp/
74 passthru.updateScript = unstableGitUpdater {
75 url = "https://bitbucket.org/c0-lang/c0.git";
79 description = "Small safe subset of the C programming language, augmented with contracts";
80 homepage = "https://c0.cs.cmu.edu/";
81 license = licenses.mit;
83 platforms = platforms.unix;
84 # line 1: ../../bin/wrappergen: cannot execute: required file not found
85 # make[2]: *** [../../lib.mk:83:
86 broken = stdenv.hostPlatform.isLinux;