15 , scalingFactor ? 2 # this is to resize the fixed-size zod_launcher window
20 version = "2011-09-06";
22 url = "mirror://sourceforge/zod/linux_releases/zod_linux-${version}.tar.gz";
23 sha256 = "017v96aflrv07g8j8zk9mq8f8rqxl5228rjff5blq8dxpsv1sx7h";
26 sed '1i#include <ctime>' -i zod_src/common.cpp # gcc12
40 hardeningDisable = [ "format" ];
41 NIX_LDFLAGS = "-L${libmysqlclient}/lib/mysql";
42 zod_engine = stdenv.mkDerivation {
43 inherit version src postPatch nativeBuildInputs buildInputs hardeningDisable NIX_LDFLAGS;
44 pname = "${name}-engine";
45 enableParallelBuilding = true;
46 preBuild = "cd zod_src";
49 install -m755 zod $out/bin/
50 wrapProgram $out/bin/zod --chdir "${zod_assets}/usr/lib/commander-zod"
53 zod_map_editor = stdenv.mkDerivation {
54 inherit version src postPatch nativeBuildInputs buildInputs hardeningDisable NIX_LDFLAGS;
55 pname = "${name}-map_editor";
56 enableParallelBuilding = true;
57 preBuild = "cd zod_src";
58 makeFlags = [ "map_editor" ];
61 install -m755 zod_map_editor $out/bin
62 wrapProgram $out/bin/zod_map_editor --chdir "${zod_assets}/usr/lib/commander-zod"
65 zod_launcher = stdenv.mkDerivation {
66 inherit version src nativeBuildInputs buildInputs zod_engine zod_map_editor;
67 pname = "${name}-launcher";
68 # This is necessary because the zod_launcher has terrible fixed-width window
69 # the Idea is to apply the scalingFactor to all positions and sizes and I tested 1,2,3 and 4
70 # 2,3,4 look acceptable on my 4k monitor and 1 is unreadable.
71 # also the ./ in the run command is removed to have easier time starting the game
74 inherit scalingFactor;
75 src=./0002-add-scaling-factor-to-source.patch;
79 substituteInPlace zod_launcher_src/zod_launcherFrm.cpp \
80 --replace 'message = wxT("./zod");' 'message = wxT("zod");' \
81 --replace "check.replace(i,1,1,'_');" "check.replace(i,1,1,(wxUniChar)'_');"
83 preBuild = "cd zod_launcher_src";
86 install -m755 zod_launcher $out/bin
89 zod_assets = runCommandLocal "${name}-assets" {} ''
90 mkdir -p $out/usr/lib/commander-zod{,blank_maps}
91 cp -r ${src}/assets $out/usr/lib/commander-zod/assets
92 for i in ${src}/*.map ${src}/*.txt; do
93 install -m644 $i $out/usr/lib/commander-zod
95 for map in ${src}/blank_maps/*; do
96 install -m644 $map $out/usr/lib/commander-zod/blank_maps
109 description = "Multiplayer remake of ZED";
110 homepage = "http://zod.sourceforge.net/";
111 maintainers = with maintainers; [ zeri ];
112 license = licenses.gpl3Plus; /* Says the website */
113 platforms = platforms.linux;