1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-18 03:30:45 +00:00

ut1999: add support for i686-linux

This commit is contained in:
Elian Doran 2024-03-26 22:56:32 +02:00
parent 7848d6f048
commit 1f047397ab
No known key found for this signature in database

View file

@ -2,6 +2,17 @@
, runCommand, libgcc, wxGTK32, innoextract, libGL, SDL2, openal, libmpg123, libxmp }:
let
version = "469d";
srcs = {
x86_64-linux = fetchurl {
url = "https://github.com/OldUnreal/UnrealTournamentPatches/releases/download/v${version}/OldUnreal-UTPatch${version}-Linux-amd64.tar.bz2";
hash = "sha256-aoGzWuakwN/OL4+xUq8WEpd2c1rrNN/DkffI2vDVGjs=";
};
i686-linux = fetchurl {
url = "https://github.com/OldUnreal/UnrealTournamentPatches/releases/download/v${version}/OldUnreal-UTPatch${version}-Linux-x86.tar.bz2";
hash = "sha256-1JsFKuAAj/LtYvOUPFu0Hn+zvY3riW0YlJbLd4UnaKU=";
};
};
unpackGog = runCommand "ut1999-gog" {
src = requireFile rec {
name = "setup_ut_goty_2.0.0.5.exe";
@ -21,14 +32,15 @@ let
mkdir $out
cp -r app/* $out
'';
in stdenv.mkDerivation rec {
systemDir = {
x86_64-linux = "System64";
i686-linux = "System";
}.${stdenv.hostPlatform.system} or (throw "unsupported system: ${stdenv.hostPlatform.system}");
in stdenv.mkDerivation {
name = "ut1999";
version = "469d";
inherit version;
sourceRoot = ".";
src = fetchurl {
url = "https://github.com/OldUnreal/UnrealTournamentPatches/releases/download/v${version}/OldUnreal-UTPatch${version}-Linux-amd64.tar.bz2";
hash = "sha256-aoGzWuakwN/OL4+xUq8WEpd2c1rrNN/DkffI2vDVGjs=";
};
src = srcs.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
buildInputs = [
libgcc
@ -54,10 +66,10 @@ in stdenv.mkDerivation rec {
cp -r ./* $out
# Remove bundled libraries to use native versions instead
rm $out/System64/libmpg123.so* \
$out/System64/libopenal.so* \
$out/System64/libSDL2* \
$out/System64/libxmp.so*
rm $out/${systemDir}/libmpg123.so* \
$out/${systemDir}/libopenal.so* \
$out/${systemDir}/libSDL2* \
$out/${systemDir}/libxmp.so*
chmod -R 755 $out
@ -67,8 +79,8 @@ in stdenv.mkDerivation rec {
ln -s ${unpackGog}/Maps $out
cp -n ${unpackGog}/System/*.{u,int} $out/System || true
ln -s "$out/System64/ut-bin" "$out/bin/ut1999"
ln -s "$out/System64/ucc-bin" "$out/bin/ut1999-ucc"
ln -s "$out/${systemDir}/ut-bin" "$out/bin/ut1999"
ln -s "$out/${systemDir}/ucc-bin" "$out/bin/ut1999-ucc"
convert "${unpackGog}/gfw_high.ico" "ut1999.png"
install -D ut1999-5.png "$out/share/icons/hicolor/256x256/apps/ut1999.png"
@ -90,9 +102,9 @@ in stdenv.mkDerivation rec {
meta = with lib; {
description = "Unreal Tournament GOTY (1999) with the OldUnreal patch.";
license = licenses.unfree;
platforms = [ "x86_64-linux" ];
platforms = attrNames srcs;
maintainers = with maintainers; [ eliandoran ];
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
mainProgram = "ut1999";
};
}