nix: revert overlay changes and add conditionals to derivation for flake build
This commit is contained in:
parent
9611b92b07
commit
6065b4dcf9
@ -21,14 +21,13 @@
|
||||
packages = {
|
||||
polymc = pkgs.libsForQt5.callPackage ./packages/nix/polymc {
|
||||
inherit self;
|
||||
isFlakeBuild = true;
|
||||
submoduleQuazip = quazip;
|
||||
submoduleNbt = libnbtplusplus;
|
||||
};
|
||||
};
|
||||
|
||||
overlay = import ./packages/nix/overlay.nix {
|
||||
inherit self quazip libnbtplusplus;
|
||||
};
|
||||
overlay = import ./packages/nix/overlay.nix {};
|
||||
|
||||
apps = {
|
||||
polymc = flake-utils.lib.mkApp {
|
||||
|
@ -1,9 +1,3 @@
|
||||
{ self, quazip, libnbtplusplus }:
|
||||
|
||||
final: prev: rec {
|
||||
polymc = prev.libsForQt5.callPackage ./polymc {
|
||||
inherit self;
|
||||
submoduleQuazip = quazip;
|
||||
submoduleNbt = libnbtplusplus;
|
||||
};
|
||||
polymc = prev.libsForQt5.callPackage ./polymc {};
|
||||
}
|
||||
|
@ -15,9 +15,10 @@
|
||||
, qtbase
|
||||
, libGL
|
||||
# submodules
|
||||
, self
|
||||
, submoduleNbt
|
||||
, submoduleQuazip
|
||||
, isFlakeBuild ? false
|
||||
, self ? ""
|
||||
, submoduleNbt ? ""
|
||||
, submoduleQuazip ? ""
|
||||
}:
|
||||
|
||||
let
|
||||
@ -34,19 +35,26 @@ in
|
||||
|
||||
mkDerivation rec {
|
||||
pname = "polymc";
|
||||
version = "nightly";
|
||||
version = if isFlakeBuild then "nightly" else "1.0.4";
|
||||
|
||||
src = lib.cleanSource self;
|
||||
src = if isFlakeBuild then lib.cleanSource self
|
||||
else fetchFromGitHub {
|
||||
owner = "PolyMC";
|
||||
repo = "PolyMC";
|
||||
rev = "${version}";
|
||||
sha256 = "sha256-8aya0KfV9F+i2qBpweWcR9hwyTSQkqn2wHdtkCEeNvk=";
|
||||
fetchSubmodules = true;
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ cmake file makeWrapper ];
|
||||
buildInputs = [ qtbase jdk8 zlib ];
|
||||
|
||||
postUnpack = ''
|
||||
postUnpack = if isFlakeBuild then ''
|
||||
mkdir source/libraries/{libnbtplusplus,quazip}
|
||||
cp -a ${submoduleNbt}/* source/libraries/libnbtplusplus
|
||||
cp -a ${submoduleQuazip}/* source/libraries/quazip
|
||||
chmod a+r+w source/libraries/{libnbtplusplus,quazip}/*
|
||||
'';
|
||||
'' else "";
|
||||
|
||||
cmakeFlags = [
|
||||
"-DLauncher_LAYOUT=lin-system"
|
||||
|
Loading…
Reference in New Issue
Block a user