nix: use nixpkgs's quazip

This commit is contained in:
Mustafa Çalışkan 2022-05-27 22:23:33 +03:00
parent 3ff26d5cfe
commit 283e50e670
2 changed files with 9 additions and 11 deletions

View File

@ -5,10 +5,9 @@
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
flake-compat = { url = "github:edolstra/flake-compat"; flake = false; };
libnbtplusplus = { url = "github:multimc/libnbtplusplus"; flake = false; };
quazip = { url = "github:stachenov/quazip"; flake = false; };
};
outputs = { self, nixpkgs, libnbtplusplus, quazip, ... }:
outputs = { self, nixpkgs, libnbtplusplus, ... }:
let
# Generate a user-friendly version number.
version = builtins.substring 0 8 self.lastModifiedDate;
@ -23,7 +22,7 @@
pkgs = forAllSystems (system: nixpkgs.legacyPackages.${system});
in
{
packages = forAllSystems (system: { polymc = pkgs.${system}.libsForQt5.callPackage ./packages/nix/polymc { inherit version self quazip libnbtplusplus; }; });
packages = forAllSystems (system: { polymc = pkgs.${system}.libsForQt5.callPackage ./packages/nix/polymc { inherit version self libnbtplusplus; }; });
defaultPackage = forAllSystems (system: self.packages.${system}.polymc);
apps = forAllSystems (system: { polymc = { type = "app"; program = "${self.defaultPackage.${system}}/bin/polymc"; }; });

View File

@ -11,6 +11,7 @@
, xorg
, libpulseaudio
, qtbase
, quazip
, libGL
, msaClientID ? ""
@ -18,7 +19,6 @@
, self
, version
, libnbtplusplus
, quazip
}:
let
@ -43,8 +43,8 @@ mkDerivation rec {
src = lib.cleanSource self;
nativeBuildInputs = [ cmake ninja file makeWrapper ];
buildInputs = [ qtbase jdk zlib ];
nativeBuildInputs = [ cmake ninja jdk file makeWrapper ];
buildInputs = [ qtbase quazip zlib ];
dontWrapQtApps = true;
@ -55,12 +55,11 @@ mkDerivation rec {
'';
postUnpack = ''
# Copy submodules inputs
rm -rf source/libraries/{libnbtplusplus,quazip}
mkdir source/libraries/{libnbtplusplus,quazip}
# Copy libnbtplusplus
rm -rf source/libraries/libnbtplusplus
mkdir source/libraries/libnbtplusplus
cp -a ${libnbtplusplus}/* source/libraries/libnbtplusplus
cp -a ${quazip}/* source/libraries/quazip
chmod a+r+w source/libraries/{libnbtplusplus,quazip}/*
chmod a+r+w source/libraries/libnbtplusplus/*
'';
cmakeFlags = [