17 src = fetchFromGitHub {
21 hash = "sha256-s2GqiFcekXRts8BU5CSmTrkFZ9xLqq4A5MybhB1o1Gg=";
26 codon-llvm = stdenv.mkDerivation {
28 version = "unstable-2022-09-23";
30 src = fetchFromGitHub {
32 repo = "llvm-project";
33 rev = "55b0b8fa1c9f9082b535628fc9fa6313280c0b9a";
34 hash = "sha256-03SPQgNdrpR6/JZ5aR/ntoh/FnZvCjT/6bTAcZaFafw=";
46 "-DLLVM_ENABLE_RTTI=ON"
47 "-DLLVM_ENABLE_TERMINFO=OFF"
48 "-DLLVM_ENABLE_ZLIB=OFF"
49 "-DLLVM_INCLUDE_TESTS=OFF"
50 "-DLLVM_TARGETS_TO_BUILD=all"
51 "-DLLVM_USE_LINKER=lld"
56 codon-deps = stdenv.mkDerivation {
57 name = "codon-deps-${version}.tar.gz";
72 "-DCPM_DOWNLOAD_ALL=ON"
73 "-DCPM_SOURCE_CACHE=${depsDir}"
74 "-DLLVM_DIR=${codon-llvm}/lib/cmake/llvm"
78 # Prune the `.git` directories
79 find ${depsDir} -name .git -type d -prune -exec rm -rf {} \;;
80 # Build a reproducible tar, per instructions at https://reproducible-builds.org/docs/archives/
81 tar --owner=0 --group=0 --numeric-owner --format=gnu \
82 --sort=name --mtime="@$SOURCE_DATE_EPOCH" \
86 _deps/googletest-subbuild/googletest-populate-prefix/src/*.zip
90 if stdenv.hostPlatform.isDarwin then
91 "sha256-KfemYV42xBAhsPbwTkzdc3GxCVHiWRbyUZORPWxx4vg="
93 "sha256-a1zGSpbMjfQBrcgW/aiIdKX8+uI3p/S9pgZjHe2HtWs=";
95 outputHashAlgo = "sha256";
104 # Without the hash, CMake will try to replace the `.zip` file
105 ./Add-a-hash-to-the-googletest-binary.patch
108 nativeBuildInputs = [
118 mkdir -p $sourceRoot/build
119 tar -xf ${codon-deps} -C $sourceRoot/build
123 "-DCPM_SOURCE_CACHE=${depsDir}"
124 "-DLLVM_DIR=${codon-llvm}/lib/cmake/llvm"
125 "-DLLVM_USE_LINKER=lld"
128 postInstall = lib.optionalString stdenv.isDarwin ''
129 ln -s $out/lib/codon/*.dylib $out/lib/
132 passthru.updateScript = nix-update-script { };
135 description = "A high-performance, zero-overhead, extensible Python compiler using LLVM";
136 homepage = "https://docs.exaloop.io/codon";
137 maintainers = [ lib.maintainers.paveloom ];
138 license = lib.licenses.bsl11;
139 platforms = lib.platforms.all;