1 { lib, stdenv, fetchFromGitLab, buildEnv, makeWrapper, lua, luajit, readline
8 # Build a sort of "union package" with all the native dependencies we
9 # have: Lua (or LuaJIT), readline, etc. Then, we can depend on this
10 # and refer to ${urn-rt} instead of ${lua}, ${readline}, etc.
12 name = "urn-rt-${version}";
13 ignoreCollisions = true;
14 paths = if useLuaJit then
20 inherit (lib) optionalString concatMapStringsSep;
24 pname = "urn${optionalString (extraLibraries != []) "-with-libraries"}";
27 src = fetchFromGitLab {
31 sha256 = "0nclr3d8ap0y5cg36i7g4ggdqci6m5q27y9f26b57km8p266kcpy";
34 nativeBuildInputs = [ makeWrapper ];
35 # Any packages that depend on the compiler have a transitive
36 # dependency on the Urn runtime support.
37 propagatedBuildInputs = [ urn-rt ];
42 mkdir -p $out/bin $out/lib
43 install -m 0755 bin/urn.lua $out/bin/urn
44 cp -r lib $out/lib/urn
45 wrapProgram $out/bin/urn \
46 --add-flags "-i $out/lib/urn --prelude $out/lib/urn/prelude.lisp" \
47 --add-flags "${concatMapStringsSep " " (x: "-i ${x.libraryPath}") extraLibraries}" \
48 --prefix PATH : ${urn-rt}/bin/ \
49 --prefix LD_LIBRARY_PATH : ${urn-rt}/lib/
53 homepage = "https://urn-lang.com";
54 description = "Yet another Lisp variant which compiles to Lua";
55 license = licenses.bsd3;
56 maintainers = with maintainers; [ CrazedProgrammer ];
57 platforms = platforms.all;