16 stdenv.mkDerivation rec {
18 version = "unstable-2023-09-05";
20 src = fetchFromBitbucket {
23 rev = "608f97eef5d81bb85963d66f955730dd93996f67";
24 hash = "sha256-lRIEtclx+NKxAO72nsvnxVeEGCEe6glC6w8MXh1HEwY=";
28 ./use-system-libraries.patch
32 substituteInPlace cc0/Makefile \
33 --replace '$(shell ./get_version.sh)' '${version}'
34 substituteInPlace cc0/compiler/bin/buildid \
35 --replace '`../get_version.sh`' '${version}' \
36 --replace '`date`' '1970-01-01T00:00:00Z' \
37 --replace '`hostname`' 'nixpkgs'
38 '' + lib.optionalString stdenv.isDarwin ''
39 for f in cc0/compiler/bin/coin-o0-support cc0/compiler/bin/cc0-o0-support; do
40 substituteInPlace $f --replace '$(brew --prefix gnu-getopt)' '${getopt}'
52 ] ++ lib.optionals stdenv.isDarwin [ darwin.sigtool ];
64 installFlags = [ "PREFIX=$(out)" ];
67 mkdir -p $out/share/emacs/site-lisp
68 mv $out/c0-mode/ $out/share/emacs/site-lisp/
71 passthru.updateScript = unstableGitUpdater {
72 url = "https://bitbucket.org/c0-lang/c0.git";
76 description = "A small safe subset of the C programming language, augmented with contracts";
77 homepage = "https://c0.cs.cmu.edu/";
78 license = licenses.mit;
79 maintainers = [ maintainers.marsam ];
80 platforms = platforms.unix;
81 # line 1: ../../bin/wrappergen: cannot execute: required file not found
82 # make[2]: *** [../../lib.mk:83:
83 broken = stdenv.isLinux;