mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-08-20 09:57:10 +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/
|
build_meson/
|
||||||
cmake-build-debug/
|
cmake-build-debug/
|
||||||
|
|
||||||
|
# Nix flake output
|
||||||
|
result
|
||||||
|
|
||||||
# Final binaries and platform output
|
# Final binaries and platform output
|
||||||
/Linux/
|
/Linux/
|
||||||
/x64/
|
/x64/
|
||||||
|
|
|
||||||
65
flake.nix
65
flake.nix
|
|
@ -1,11 +1,11 @@
|
||||||
{
|
{
|
||||||
description = "4jcraft-nix dev shell";
|
description = "4jcraft-nix package and dev shell";
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
|
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { nixpkgs, ... }:
|
outputs = { self, nixpkgs, ... }:
|
||||||
let
|
let
|
||||||
allSystems = [
|
allSystems = [
|
||||||
"x86_64-linux"
|
"x86_64-linux"
|
||||||
|
|
@ -19,30 +19,45 @@
|
||||||
});
|
});
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
devShells = forAllSystems ({ pkgs }:
|
packages = forAllSystems ({ pkgs }:
|
||||||
let
|
|
||||||
libs = with pkgs; [
|
|
||||||
openssl.dev
|
|
||||||
libGL
|
|
||||||
libGLU
|
|
||||||
sdl2
|
|
||||||
zlib
|
|
||||||
];
|
|
||||||
packages = with pkgs; [
|
|
||||||
clang
|
|
||||||
lld
|
|
||||||
cmake
|
|
||||||
gnumake
|
|
||||||
meson
|
|
||||||
ninja
|
|
||||||
pkg-config
|
|
||||||
];
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
default = pkgs.mkShell {
|
default = pkgs.clangStdenv.mkDerivation {
|
||||||
LD_LIBRARY_PATH = "/run/opengl-driver/lib";
|
pname = "4jcraft";
|
||||||
buildInputs = libs;
|
version = "0.1.0";
|
||||||
nativeBuildInputs = packages;
|
|
||||||
|
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