lad: init
Build and populate cache / tests (sydpkgs, nixpkgs=https://github.com/NixOS/nixpkgs/archive/refs/heads/nixpkgs-unstable.tar.gz, sydpkgs) (push) Has been cancelled
Build and populate cache / tests (sydpkgs, nixpkgs=https://github.com/NixOS/nixpkgs/archive/refs/heads/nixpkgs-unstable.tar.gz, sydpkgs) (pull_request) Has been cancelled

This commit was merged in pull request #2.
This commit is contained in:
2026-06-21 19:06:11 -06:00
parent 59d3a471cd
commit a787aeb2a9
+49
View File
@@ -0,0 +1,49 @@
{ lua5_2
, lua5_1
, stdenv
, makeWrapper
, fetchFromGitHub
, lib
, wantLad5_1 ? true
, wantLad5_2 ? true
}:
let
our-lua52 = lua5_2.withPackages (ps: with ps; [
lpeg
]);
our-lua51 = lua5_1.withPackages (ps: with ps; [
lpeg
]);
in stdenv.mkDerivation {
pname = "lad";
version = "5d2eafb";
nativeBuildInputs = [
makeWrapper
];
src = fetchFromGitHub {
owner = "andremm";
repo = "lad";
rev = "5d2eafb8790d7a1030aca0dbb75201073aacd1d9";
hash = "sha256-oIKayAUuRDqiHmAD37A5RYcMTh1RtpNl0jLcc5h3718=";
};
LUA51 = lib.getExe our-lua51;
LUA52 = lib.getExe our-lua52;
installPhase = ''
mkdir -p $out/bin $out/opt/{5.1,5.2}
cp 5.1/*.lua $out/opt/5.1/
cp 5.2/*.lua $out/opt/5.2/
${lib.optionalString wantLad5_1 ''
makeWrapper $LUA51 $out/bin/luaa-5.1 \
--add-flags $out/opt/5.1/assembler.lua
makeWrapper $LUA51 $out/bin/luad-5.1 \
--add-flags $out/opt/5.1/disassembler.lua
''}
${lib.optionalString wantLad5_2 ''
makeWrapper $LUA52 $out/bin/luaa-5.2 \
--add-flags $out/opt/5.2/luaa.lua
makeWrapper $LUA52 $out/bin/luad-5.2 \
--add-flags $out/opt/5.2/luad.lua
''}
'';
}