[packages] Add UltimateDoomBuilder

This commit is contained in:
Ryze 2024-08-14 17:06:14 +03:00
parent f7aa9acafd
commit f263997edd
Signed by: ryze
GPG key ID: 9B296C5CEAEAAAC1
3 changed files with 104 additions and 5 deletions

View file

@ -1,9 +1,10 @@
# Packages
| Name | Package | Description |
|-------------------|-------------------|-----------------------------------------------------------------------------------------|
|-----------------------|---------------------|-----------------------------------------------------------------------------------------|
| AudioRelay | audiorelay | Application to stream every sound from your PC to one or multiple Android devices |
| Compile optimized | compileOptimized | Utility function for compiling packages with custom compile flags aimed at optimization |
| VSCode extensions | vscode-extensions | Collection of VSCode extensions not found in nixpkgs |
| Ultimate Doom Builder | UltimateDoomBuilder | Comprehensive map editor for Doom, Heretic, Hexen and Strife based games |
# Compile optimized
Compile packages written in various languages using custom compile flags, typically this would override some attribute in the provided package derivation. A set of defaults is provided, which can be overriden. Additional flags may be set using `additionalFlags` parameter.

View file

@ -0,0 +1,97 @@
{
stdenv,
lib,
fetchFromGitHub,
makeDesktopItem,
makeWrapper,
mono,
iconv,
imagemagick,
msbuild,
alsa-lib,
libGL,
gtk2,
xorg,
}:
let
desktopItem = makeDesktopItem {
name = "ultimate-doom-builder";
desktopName = "Ultimate Doom Builder";
genericName = "Map editor";
categories = [ "Development" "Game" ];
icon = "ultimate-doom-builder";
exec = "ultimate-doom-builder";
startupNotify = true;
startupWMClass = "ultimate-doom-builder";
};
in
stdenv.mkDerivation {
pname = "UltimateDoomBuilder";
version = "4190-unstable-2024-08-04";
src = fetchFromGitHub {
owner = "UltimateDoomBuilder";
repo = "UltimateDoomBuilder";
# Have to use later commit because of missing DLLs
# See https://github.com/UltimateDoomBuilder/UltimateDoomBuilder/commit/6a66d1ada4b47c1331413ea8c5755e275c594df2
rev = "66f7204f6c9265744f96ee9410f22bfa97e0b7fb";
hash = "sha256-PzgkG+RD9zMX3aWTwNzrxiIC6fmU9psa/MeBQbQQ+Gg==";
};
nativeBuildInputs = [
makeWrapper
iconv
imagemagick
msbuild
libGL
] ++ (with xorg; [ libX11 libXfixes ]);
# Some files contain wronly encoded files
# Try to convert to UTF-8 to fix them
# See https://github.com/UltimateDoomBuilder/UltimateDoomBuilder/issues/1092
patchPhase = ''
runHook prePatch
fixEncoding() {
cp "$1" temp
iconv -f WINDOWS-1252 -t UTF8 temp -o "$1"
rm temp
}
fixEncoding Source/Core/Controls/MultiSelectTreeview.cs
fixEncoding Source/Core/Geometry/Vector2D.cs
fixEncoding Source/Plugins/BuilderModes/ClassicModes/CurveLinedefsMode.cs
runHook postPatch
'';
installPhase = ''
runHook preInstall
mkdir -p $out/opt/ultimate-doom-builder
cp -r Build/* $out/opt/ultimate-doom-builder
rm -f $out/opt/ultimate-doom-builder/Builder.sh
convert "Source/Core/Resources/UDB2.ico[3]" icon.png
install -Dm644 icon.png $out/share/pixmaps/ultimate-doom-builder.png
install -Dm644 ${desktopItem}/share/applications/ultimate-doom-builder.desktop $out/share/applications/ultimate-doom-builder.desktop
makeWrapper ${lib.getExe' mono "mono"} $out/bin/ultimate-doom-builder \
--add-flags $out/opt/ultimate-doom-builder/Builder.exe \
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ alsa-lib libGL gtk2 ]}
runHook postInstall
'';
meta = {
description = "Comprehensive map editor for Doom, Heretic, Hexen and Strife based games";
homepage = "https://github.com/UltimateDoomBuilder/UltimateDoomBuilder";
downloadPage = "https://ultimatedoombuilder.github.io";
license = lib.licenses.gpl3;
};
}

View file

@ -3,5 +3,6 @@
{
audiorelay = callPackage ./packages/audiorelay.nix {};
compileOptimized = callPackage ./packages/compileOptimized.nix {};
ultimatedoombuilder = callPackage ./packages/ultimatedoombuilder.nix {};
vscode-extensions = callPackage ./packages/vscode-extensions.nix {};
}