-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpath-of-building.nix
40 lines (33 loc) · 1.02 KB
/
path-of-building.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
{ pkgs, luaEnv }:
pkgs.stdenv.mkDerivation rec {
pname = "path-of-building";
version = "2.49.0";
name = "path-of-building-${version}";
outputs = [ "out" "env" ];
src = fetchTarball {
url = "https://github.com/PathOfBuildingCommunity/PathOfBuilding/archive/refs/tags/v${version}.tar.gz";
sha256 = "1hhs9raijsi07qi22axn5hdik24kgb5y96niqr9fnx31wmxyxw2i";
};
patches = [ ./patches/pob-stop-updates.patch ];
nativeBuildInputs = [
luaEnv
];
installPhase = ''
mkdir -p $out/runtime
cp -r runtime/lua/ $out/runtime/lua
cp -r spec/ $out/spec
cp -r src/ $out/src
cp changelog.txt help.txt $out/src
touch $out/installed.cfg
cat >$out/manifest.xml <<EOL
<?xml version='1.0' encoding='UTF-8'?>
<PoBVersion>
<Version number="${version}" branch="release" platform="nix"/>
</PoBVersion>
EOL
cat >$env <<EOL
export LUA_PATH='$out/runtime/lua/?.lua;$out/runtime/lua/?/init.lua'
export LUA_CPATH='${luaEnv}/lib/lua/${luaEnv.lua.luaversion}/?.so'
EOL
'';
}