commit
47ced4f28d
@ -0,0 +1,35 @@ |
||||
{ lib |
||||
, stdenv |
||||
, buildVimPluginFrom2Nix |
||||
, buildLuarocksPackage |
||||
, lua51Packages |
||||
, toVimPlugin |
||||
}: |
||||
let |
||||
# sanitizeDerivationName |
||||
normalizeName = lib.replaceStrings [ "." ] [ "-" ]; |
||||
in |
||||
|
||||
# function to create vim plugin from lua packages that are already packaged in |
||||
# luaPackages |
||||
{ |
||||
# the lua attribute name that matches this vim plugin. Both should be equal |
||||
# in the majority of cases but we make it possible to have different attribute names |
||||
luaAttr ? (normalizeName attrs.pname) |
||||
, ... |
||||
}@attrs: |
||||
let |
||||
originalLuaDrv = lua51Packages.${luaAttr}; |
||||
luaDrv = lua51Packages.lib.overrideLuarocks originalLuaDrv (drv: { |
||||
extraConfig = '' |
||||
-- to create a flat hierarchy |
||||
lua_modules_path = "lua" |
||||
''; |
||||
}); |
||||
finalDrv = toVimPlugin (luaDrv.overrideAttrs(oa: { |
||||
nativeBuildInputs = oa.nativeBuildInputs or [] ++ [ |
||||
lua51Packages.luarocksMoveDataFolder |
||||
]; |
||||
})); |
||||
in |
||||
finalDrv |
@ -0,0 +1,15 @@ |
||||
# luarocks installs data in a non-overridable location. Until a proper luarocks patch, |
||||
# we move the files around ourselves |
||||
echo "Sourcing luarocks-move-data-hook.sh" |
||||
|
||||
luarocksMoveDataHook () { |
||||
echo "Executing luarocksMoveDataHook" |
||||
if [ -d "$out/$rocksSubdir" ]; then |
||||
cp -rfv "$out/$rocksSubdir/$pname/$version/." "$out" |
||||
fi |
||||
|
||||
echo "Finished executing luarocksMoveDataHook" |
||||
} |
||||
|
||||
echo "Using luarocksMoveDataHook" |
||||
preDistPhases+=" luarocksMoveDataHook" |
@ -0,0 +1,25 @@ |
||||
{ lib |
||||
, buildGoModule |
||||
, fetchFromGitHub |
||||
}: |
||||
|
||||
buildGoModule rec { |
||||
pname = "oak"; |
||||
version = "0.2"; |
||||
|
||||
src = fetchFromGitHub { |
||||
owner = "thesephist"; |
||||
repo = pname; |
||||
rev = "v${version}"; |
||||
sha256 = "sha256-00UanINtrFyjQWiAw1ucB4eEODMr9+wT+99Zy2Oc1j4="; |
||||
}; |
||||
|
||||
vendorSha256 = "sha256-iQtb3zNa57nB6x4InVPw7FCmW7XPw5yuz0OcfASXPD8="; |
||||
|
||||
meta = with lib; { |
||||
description = "Expressive, simple, dynamic programming language"; |
||||
homepage = "https://oaklang.org/"; |
||||
license = licenses.mit; |
||||
maintainers = with maintainers; [ tejasag ]; |
||||
}; |
||||
} |
Loading…
Reference in new issue