mirror of
https://github.com/Qsgs-Fans/FreeKill.git
synced 2024-11-16 11:42:45 +08:00
Initial support for building with nix. (#106)
Add flake.nix to project, so this project can be built with nix. Also: - Fix a died link in README. - Add missing dependencies in docs for Ubuntu and Arch (not tested).
This commit is contained in:
parent
ed70e54cff
commit
8aa8775fd6
|
@ -44,7 +44,7 @@ ___
|
||||||
|
|
||||||
## 如何构建
|
## 如何构建
|
||||||
|
|
||||||
关于如何从头构建FreeKill,详见[编译教程](./doc/dev/compile.md)。
|
关于如何从头构建FreeKill,详见[编译教程](https://notify-ctrl.github.io/FreeKill/dev/compile.html)。
|
||||||
|
|
||||||
___
|
___
|
||||||
|
|
||||||
|
|
|
@ -46,13 +46,13 @@ Debian一家子:
|
||||||
|
|
||||||
.. code:: sh
|
.. code:: sh
|
||||||
|
|
||||||
$ sudo apt install liblua5.4-dev libsqlite3-dev libssl-dev swig flex bison
|
$ sudo apt install liblua5.4-dev libsqlite3-dev libreadline-dev libssl-dev swig flex bison
|
||||||
|
|
||||||
Arch Linux:
|
Arch Linux:
|
||||||
|
|
||||||
.. code:: sh
|
.. code:: sh
|
||||||
|
|
||||||
$ sudo pacman -Sy lua sqlite swig openssl flex bison
|
$ sudo pacman -Sy lua sqlite swig openssl flex bison libgit2
|
||||||
|
|
||||||
然后使用配置好的QtCreator环境即可编译。
|
然后使用配置好的QtCreator环境即可编译。
|
||||||
|
|
||||||
|
@ -71,6 +71,13 @@ Arch Linux:
|
||||||
$ cmake ..
|
$ cmake ..
|
||||||
$ make -j8
|
$ make -j8
|
||||||
|
|
||||||
|
如果你使用 Nix/NixOs 的话,可以在clone repo后直接使用 nix flake 构建:
|
||||||
|
|
||||||
|
.. code:: sh
|
||||||
|
|
||||||
|
$ git clone https://github.com/Notify-ctrl/FreeKill
|
||||||
|
$ nix build '.?submodules=1'
|
||||||
|
|
||||||
--------------
|
--------------
|
||||||
|
|
||||||
Linux服务器
|
Linux服务器
|
||||||
|
|
27
flake.lock
Normal file
27
flake.lock
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
{
|
||||||
|
"nodes": {
|
||||||
|
"nixpkgs": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1680724564,
|
||||||
|
"narHash": "sha256-eeUUGOTKTelYKDbUxKs0V7GUa186L2fym7jM2QQ4Oss=",
|
||||||
|
"owner": "nixos",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "36adaa6aaa6b03e59102df0c1b12cdc3f23fd112",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nixos",
|
||||||
|
"ref": "nixos-22.11",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": "nixpkgs"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": "root",
|
||||||
|
"version": 7
|
||||||
|
}
|
38
flake.nix
Normal file
38
flake.nix
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
{
|
||||||
|
description = "Sanguosha (a.k.a. Legend of Three Kingdoms, LTK) written in Qt and Lua.";
|
||||||
|
|
||||||
|
inputs = {
|
||||||
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-22.11";
|
||||||
|
};
|
||||||
|
|
||||||
|
outputs = { self, nixpkgs }: {
|
||||||
|
defaultPackage.x86_64-linux =
|
||||||
|
with import nixpkgs { system = "x86_64-linux"; };
|
||||||
|
stdenv.mkDerivation {
|
||||||
|
name = "freekill";
|
||||||
|
version = "0.0.7";
|
||||||
|
src = self;
|
||||||
|
|
||||||
|
buildInputs = with qt6; [
|
||||||
|
qtbase
|
||||||
|
qtdeclarative
|
||||||
|
qt5compat
|
||||||
|
qtmultimedia
|
||||||
|
qttools
|
||||||
|
sqlite
|
||||||
|
swig
|
||||||
|
openssl
|
||||||
|
flex
|
||||||
|
bison
|
||||||
|
readline
|
||||||
|
libgit2
|
||||||
|
lua5_4
|
||||||
|
];
|
||||||
|
nativeBuildInputs = [ cmake qt6.wrapQtAppsHook ];
|
||||||
|
|
||||||
|
postPatch = ''
|
||||||
|
substituteInPlace src/CMakeLists.txt --replace "LUA_LIB lua5.4" "LUA_LIB lua";
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user