odamex: 0.9.5 -> 11.1.1; add eljamm to maintainers (#459626)
This commit is contained in:
@@ -1,62 +1,218 @@
|
|||||||
{
|
{
|
||||||
lib,
|
lib,
|
||||||
stdenv,
|
stdenv,
|
||||||
fetchurl,
|
fetchFromGitHub,
|
||||||
|
fetchpatch,
|
||||||
|
|
||||||
cmake,
|
cmake,
|
||||||
pkg-config,
|
copyDesktopItems,
|
||||||
|
deutex,
|
||||||
|
makeDesktopItem,
|
||||||
makeWrapper,
|
makeWrapper,
|
||||||
SDL,
|
pkg-config,
|
||||||
SDL_mixer,
|
wrapGAppsHook3,
|
||||||
SDL_net,
|
|
||||||
|
SDL2,
|
||||||
|
SDL2_mixer,
|
||||||
|
SDL2_net,
|
||||||
|
alsa-lib,
|
||||||
|
cpptrace,
|
||||||
|
curl,
|
||||||
|
expat,
|
||||||
|
fltk,
|
||||||
|
libdwarf,
|
||||||
|
libselinux,
|
||||||
|
libsepol,
|
||||||
|
libsysprof-capture,
|
||||||
|
libuuid,
|
||||||
|
libxdmcp,
|
||||||
|
libxkbcommon,
|
||||||
|
pcre2,
|
||||||
|
portmidi,
|
||||||
|
wayland-scanner,
|
||||||
|
waylandpp,
|
||||||
wxGTK32,
|
wxGTK32,
|
||||||
|
xorg,
|
||||||
|
zstd,
|
||||||
|
|
||||||
|
nix-update-script,
|
||||||
|
|
||||||
|
withX11 ? stdenv.hostPlatform.isLinux,
|
||||||
|
withWayland ? stdenv.hostPlatform.isLinux,
|
||||||
}:
|
}:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
let
|
||||||
pname = "odamex";
|
# TODO: remove when this is resolved, likely at the next cpptrace bump
|
||||||
version = "0.9.5";
|
cpptrace' = cpptrace.overrideAttrs {
|
||||||
|
# tests are failing on darwin
|
||||||
src = fetchurl {
|
# https://hydra.nixos.org/build/310535948
|
||||||
url = "mirror://sourceforge/${pname}/${pname}-src-${version}.tar.bz2";
|
doCheck = !stdenv.hostPlatform.isDarwin;
|
||||||
sha256 = "sha256-WBqO5fWzemw1kYlY192v0nnZkbIEVuWmjWYMy+1ODPQ=";
|
|
||||||
};
|
};
|
||||||
|
in
|
||||||
|
|
||||||
|
stdenv.mkDerivation (finalAttrs: {
|
||||||
|
pname = "odamex";
|
||||||
|
version = "11.1.1";
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "odamex";
|
||||||
|
repo = "odamex";
|
||||||
|
tag = finalAttrs.version;
|
||||||
|
hash = "sha256-UUUavIaU65vU80Bp2cVjHg8IubpA6qMqZmDYvTDjfEw=";
|
||||||
|
fetchSubmodules = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
patches = [
|
||||||
|
# fix file-open panel on Darwin
|
||||||
|
# https://github.com/odamex/odamex/pull/1402
|
||||||
|
# TODO: remove on next release
|
||||||
|
(fetchpatch {
|
||||||
|
url = "https://patch-diff.githubusercontent.com/raw/odamex/odamex/pull/1402.patch";
|
||||||
|
hash = "sha256-JrcQ0rYkaFP5aKNWeXbrY2TN4r8nHpue19qajNXJXg4=";
|
||||||
|
})
|
||||||
|
];
|
||||||
|
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
cmake
|
cmake
|
||||||
pkg-config
|
copyDesktopItems
|
||||||
|
deutex
|
||||||
makeWrapper
|
makeWrapper
|
||||||
|
pkg-config
|
||||||
|
]
|
||||||
|
++ lib.optionals stdenv.hostPlatform.isLinux [
|
||||||
|
wrapGAppsHook3
|
||||||
];
|
];
|
||||||
|
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
SDL
|
SDL2
|
||||||
SDL_mixer
|
SDL2_mixer
|
||||||
SDL_net
|
SDL2_net
|
||||||
|
cpptrace'
|
||||||
|
curl
|
||||||
|
expat
|
||||||
|
fltk
|
||||||
|
libdwarf
|
||||||
|
libsysprof-capture
|
||||||
|
pcre2
|
||||||
|
portmidi
|
||||||
wxGTK32
|
wxGTK32
|
||||||
|
zstd
|
||||||
|
]
|
||||||
|
++ lib.optionals stdenv.hostPlatform.isLinux [
|
||||||
|
alsa-lib
|
||||||
|
libselinux
|
||||||
|
libuuid
|
||||||
|
libxdmcp
|
||||||
|
libsepol
|
||||||
|
]
|
||||||
|
++ lib.optionals withX11 [
|
||||||
|
xorg.libX11
|
||||||
|
xorg.xorgproto
|
||||||
|
]
|
||||||
|
++ lib.optionals withWayland [
|
||||||
|
libxkbcommon
|
||||||
|
wayland-scanner
|
||||||
|
waylandpp
|
||||||
|
];
|
||||||
|
|
||||||
|
cmakeFlags = [
|
||||||
|
(lib.cmakeBool "USE_INTERNAL_CPPTRACE" false)
|
||||||
|
(lib.cmakeFeature "ODAMEX_INSTALL_BINDIR" "$ODAMEX_BINDIR") # set by wrapper
|
||||||
];
|
];
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
runHook preInstall
|
runHook preInstall
|
||||||
''
|
|
||||||
+ (
|
${
|
||||||
if stdenv.hostPlatform.isDarwin then
|
if stdenv.hostPlatform.isDarwin then
|
||||||
''
|
# bash
|
||||||
mkdir -p $out/{Applications,bin}
|
''
|
||||||
mv odalaunch/odalaunch.app $out/Applications
|
mkdir -p $out/{Applications,bin}
|
||||||
makeWrapper $out/{Applications/odalaunch.app/Contents/MacOS,bin}/odalaunch
|
|
||||||
''
|
mv client odamex
|
||||||
else
|
for name in odamex odalaunch; do
|
||||||
''
|
contents="Applications/$name.app/Contents/MacOS"
|
||||||
make install
|
mv $name/*.app $out/Applications
|
||||||
''
|
makeWrapper $out/{"$contents",bin}/"$name" \
|
||||||
)
|
--set ODAMEX_BINDIR "${placeholder "out"}/Applications"
|
||||||
+ ''
|
done
|
||||||
|
|
||||||
|
cp server/odasrv $out/Applications
|
||||||
|
ln -s $out/Applications/odamex.app/Contents/MacOS/odamex.wad $out/Applications
|
||||||
|
makeWrapper $out/{Applications,bin}/odasrv
|
||||||
|
''
|
||||||
|
else
|
||||||
|
# bash
|
||||||
|
''
|
||||||
|
make install
|
||||||
|
|
||||||
|
# copy desktop file icons
|
||||||
|
for name in odamex odalaunch odasrv; do
|
||||||
|
for size in 96 128 256 512; do
|
||||||
|
install -Dm644 ../media/icon_"$name"_"$size".png \
|
||||||
|
$out/share/icons/hicolor/"$size"x"$size"/"$name".png
|
||||||
|
done
|
||||||
|
|
||||||
|
install -Dm644 ../media/icon_"$name"_128.png \
|
||||||
|
$out/share/pixmaps/"$name".png
|
||||||
|
done
|
||||||
|
''
|
||||||
|
}
|
||||||
|
|
||||||
runHook postInstall
|
runHook postInstall
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
preFixup = lib.optionalString (!stdenv.hostPlatform.isDarwin) ''
|
||||||
|
gappsWrapperArgs+=(
|
||||||
|
--set ODAMEX_BINDIR "${placeholder "out"}/bin"
|
||||||
|
)
|
||||||
|
'';
|
||||||
|
|
||||||
|
desktopItems = [
|
||||||
|
(makeDesktopItem {
|
||||||
|
name = "odamex";
|
||||||
|
icon = "odamex";
|
||||||
|
exec = "odamex";
|
||||||
|
desktopName = "Odamex Client";
|
||||||
|
comment = "A Doom multiplayer game engine";
|
||||||
|
categories = [
|
||||||
|
"ActionGame"
|
||||||
|
"Game"
|
||||||
|
"Shooter"
|
||||||
|
];
|
||||||
|
})
|
||||||
|
(makeDesktopItem {
|
||||||
|
name = "odalaunch";
|
||||||
|
icon = "odalaunch";
|
||||||
|
exec = "odalaunch";
|
||||||
|
desktopName = "Odamex Launcher";
|
||||||
|
comment = "Server Browser for Odamex";
|
||||||
|
categories = [
|
||||||
|
"ActionGame"
|
||||||
|
"Game"
|
||||||
|
"Shooter"
|
||||||
|
];
|
||||||
|
})
|
||||||
|
(makeDesktopItem {
|
||||||
|
name = "odasrv";
|
||||||
|
icon = "odasrv";
|
||||||
|
exec = "odasrv";
|
||||||
|
desktopName = "Odamex Server";
|
||||||
|
comment = "Run an Odamex game server";
|
||||||
|
categories = [
|
||||||
|
"Network"
|
||||||
|
];
|
||||||
|
})
|
||||||
|
];
|
||||||
|
|
||||||
|
passthru.updateScript = nix-update-script { };
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
homepage = "http://odamex.net/";
|
homepage = "http://odamex.net/";
|
||||||
description = "Client/server port for playing old-school Doom online";
|
description = "Client/server port for playing old-school Doom online";
|
||||||
license = lib.licenses.gpl2Only;
|
license = lib.licenses.gpl2Only;
|
||||||
platforms = lib.platforms.unix;
|
platforms = lib.platforms.unix;
|
||||||
maintainers = [ ];
|
maintainers = with lib.maintainers; [ eljamm ];
|
||||||
|
mainProgram = "odalaunch";
|
||||||
};
|
};
|
||||||
}
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user