nixpkgs/pkgs/by-name/ca/cakelisp/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

56 lines
1.7 KiB
Nix

{ lib, stdenv, fetchgit, gcc, unstableGitUpdater }:
stdenv.mkDerivation {
pname = "cakelisp";
# using unstable as it's the only version that builds against gcc-13
version = "0.3.0-unstable-2024-04-25";
src = fetchgit {
url = "https://macoy.me/code/macoy/cakelisp";
rev = "eb4427f555c3def9d65612672ccfe59e11b14059";
hash = "sha256-wFyqAbHrBMFKqMYlBjS6flYHPn3Rxtaiqb1rRmlZrB4=";
};
buildInputs = [ gcc ];
postPatch = ''
substituteInPlace runtime/HotReloading.cake \
--replace '"/usr/bin/g++"' '"${gcc}/bin/g++"'
substituteInPlace src/ModuleManager.cpp \
--replace '"/usr/bin/g++"' '"${gcc}/bin/g++"'
'' + lib.optionalString stdenv.hostPlatform.isDarwin ''
substituteInPlace Build.sh --replace '--export-dynamic' '-export_dynamic'
substituteInPlace runtime/HotReloading.cake --replace '--export-dynamic' '-export_dynamic'
substituteInPlace Bootstrap.cake --replace '--export-dynamic' '-export_dynamic'
'';
buildPhase = ''
runHook preBuild
./Build.sh
runHook postBuild
'';
env.NIX_CFLAGS_COMPILE = "-Wno-error=format";
installPhase = ''
runHook preInstall
install -Dm755 bin/cakelisp -t $out/bin
runHook postInstall
'';
passthru.updateScript = unstableGitUpdater {
url = "https://macoy.me/code/macoy/cakelisp";
};
meta = with lib; {
description = "Performance-oriented Lisp-like language";
mainProgram = "cakelisp";
homepage = "https://macoy.me/code/macoy/cakelisp";
license = licenses.gpl3Plus;
platforms = platforms.darwin ++ platforms.linux;
maintainers = [ maintainers.sbond75 ];
# never built on aarch64-darwin since first introduction in nixpkgs
broken = stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64;
};
}