Move packages into overlays as God intended
This commit is contained in:
parent
fa3890b814
commit
a62148572b
11 changed files with 10 additions and 9 deletions
17
overlays/packages/xash3d/change-zip-date.patch
Normal file
17
overlays/packages/xash3d/change-zip-date.patch
Normal file
|
@ -0,0 +1,17 @@
|
|||
diff --git a/scripts/waifulib/zip.py b/scripts/waifulib/zip.py
|
||||
index 6e903ba7..d47f1754 100644
|
||||
--- a/scripts/waifulib/zip.py
|
||||
+++ b/scripts/waifulib/zip.py
|
||||
@@ -25,7 +25,11 @@ class ziparchive(Task.Task):
|
||||
arcfile = src.path_from(self.relative_to)
|
||||
|
||||
Logs.debug('%s: %s <- %s as %s', self.__class__.__name__, outfile, infile, arcfile)
|
||||
- zf.write(infile, arcfile)
|
||||
+
|
||||
+ arcfile = zipfile.ZipInfo(filename=arcfile, date_time=(1980, 1, 1, 0, 0, 0))
|
||||
+
|
||||
+ with open(infile, 'rb') as f:
|
||||
+ zf.writestr(arcfile, f.read())
|
||||
|
||||
@TaskGen.feature('zip')
|
||||
def create_zip_archive(self):
|
68
overlays/packages/xash3d/default.nix
Normal file
68
overlays/packages/xash3d/default.nix
Normal file
|
@ -0,0 +1,68 @@
|
|||
{ lib
|
||||
, pkgs
|
||||
, stdenv
|
||||
, fetchFromGitHub
|
||||
, dedicated ? false # dedicated server
|
||||
, gamedir ? "valve"
|
||||
, enableBsp2 ? false # bsp2 support (for quake)
|
||||
, enableGles1 ? false # gles1 renderer (nanogl)
|
||||
, enableGles2 ? false # gles2 renderer (glwes)
|
||||
, enableGl4es ? false # gles2 renderer (gl4es)
|
||||
, enableGl ? true # opengl renderer
|
||||
, enableSoft ? true # soft renderer
|
||||
, enableUtils ? false # mdldec
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
pname = "xash3d-fwgs";
|
||||
version = "2023-03-01";
|
||||
|
||||
nativeBuildInputs = with pkgs; [python3 pkg-config makeWrapper];
|
||||
buildInputs = with pkgs; [SDL2 libopus freetype fontconfig];
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "FWGS";
|
||||
repo = "xash3d-fwgs";
|
||||
rev = "7e9d46689ca76d6bf1669ada6344fc724dd683cf";
|
||||
sha256 = "sha256-rvONYm1Gz9PpK8KY6RIIJ82FtxGcWe/4YoT2eV4sCOc=";
|
||||
fetchSubmodules = true;
|
||||
};
|
||||
patches = [ ./change-zip-date.patch ];
|
||||
|
||||
configurePhase = let
|
||||
optionals = lib.optionals;
|
||||
optional = (cond: val: optionals cond [val]);
|
||||
flags = ["-8" "-P" "--prefix=/"]
|
||||
++ (optional dedicated "-d")
|
||||
++ (optionals (gamedir != "valve") ["--gamedir" gamedir])
|
||||
++ (optional enableBsp2 "--enable-bsp2")
|
||||
++ (optional enableGles1 "--enable-gles1")
|
||||
++ (optional enableGles2 "--enable-gles2")
|
||||
++ (optional enableGl4es "--enable-gl4es")
|
||||
++ (optional (!enableGl) "--disable-gl")
|
||||
++ (optional (!enableSoft) "--disable-soft")
|
||||
++ (optional enableUtils "--enable-utils")
|
||||
;
|
||||
in ''
|
||||
python3 ./waf configure -T release ${lib.strings.escapeShellArgs flags}
|
||||
'';
|
||||
|
||||
buildPhase = ''
|
||||
python3 ./waf build
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
python3 ./waf install "--destdir=$out"
|
||||
mkdir $out/bin
|
||||
makeWrapper $out/lib/xash3d/xash3d $out/bin/xash3d --set XASH3D_EXTRAS_PAK1 $out/share/xash3d/valve/extras.pk3
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Xash3D FWGS engine";
|
||||
homepage = "https://github.com/FWGS/xash3d-fwgs";
|
||||
# this is a mess because of vendoring...
|
||||
# maybe the correct thing to do use to simply use `[ unfree gpl3Plus ]` instead
|
||||
license = with licenses; [ unfree gpl2Plus gpl3Plus lgpl3Plus mit bsd3 ];
|
||||
# maintainers = with maintainers; [ chayleaf ];
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue