mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-05-21 10:42:57 +00:00
Merge pull request #180 from silverhadch/dev
Fix the Nix Flake and make it a real Package.
This commit is contained in:
commit
0c33f0a186
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -6,6 +6,9 @@ builddir/
|
|||
build_meson/
|
||||
cmake-build-debug/
|
||||
|
||||
# Nix flake output
|
||||
result
|
||||
|
||||
# Final binaries and platform output
|
||||
/Linux/
|
||||
/x64/
|
||||
|
|
|
|||
65
flake.nix
65
flake.nix
|
|
@ -1,11 +1,11 @@
|
|||
{
|
||||
description = "4jcraft-nix dev shell";
|
||||
description = "4jcraft-nix package and dev shell";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
|
||||
};
|
||||
|
||||
outputs = { nixpkgs, ... }:
|
||||
outputs = { self, nixpkgs, ... }:
|
||||
let
|
||||
allSystems = [
|
||||
"x86_64-linux"
|
||||
|
|
@ -19,30 +19,45 @@
|
|||
});
|
||||
in
|
||||
{
|
||||
devShells = forAllSystems ({ pkgs }:
|
||||
let
|
||||
libs = with pkgs; [
|
||||
openssl.dev
|
||||
libGL
|
||||
libGLU
|
||||
sdl2
|
||||
zlib
|
||||
];
|
||||
packages = with pkgs; [
|
||||
clang
|
||||
lld
|
||||
cmake
|
||||
gnumake
|
||||
meson
|
||||
ninja
|
||||
pkg-config
|
||||
];
|
||||
in
|
||||
packages = forAllSystems ({ pkgs }:
|
||||
{
|
||||
default = pkgs.mkShell {
|
||||
LD_LIBRARY_PATH = "/run/opengl-driver/lib";
|
||||
buildInputs = libs;
|
||||
nativeBuildInputs = packages;
|
||||
default = pkgs.clangStdenv.mkDerivation {
|
||||
pname = "4jcraft";
|
||||
version = "0.1.0";
|
||||
|
||||
src = ./.;
|
||||
|
||||
buildInputs = with pkgs; [
|
||||
openssl.dev
|
||||
libGL
|
||||
libGLU
|
||||
SDL2
|
||||
zlib
|
||||
];
|
||||
|
||||
nativeBuildInputs = with pkgs; [
|
||||
lld
|
||||
meson
|
||||
ninja
|
||||
pkg-config
|
||||
python3
|
||||
makeWrapper
|
||||
];
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/share/4jcraft
|
||||
cp -r Minecraft.Client/. $out/share/4jcraft/
|
||||
|
||||
mkdir -p $out/bin
|
||||
makeWrapper $out/share/4jcraft/Minecraft.Client \
|
||||
$out/bin/4jcraft \
|
||||
--run "cd $out/share/4jcraft"
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "4JCraft";
|
||||
platforms = pkgs.lib.platforms.linux;
|
||||
};
|
||||
};
|
||||
}
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in a new issue