diff options
Diffstat (limited to 'packages')
| -rw-r--r-- | packages/aurora4x/default.nix | 57 | ||||
| -rw-r--r-- | packages/freeciv/default.nix | 141 | ||||
| -rw-r--r-- | packages/freecol/default.nix | 64 | ||||
| -rw-r--r-- | packages/vintagestory/default.nix | 117 |
4 files changed, 379 insertions, 0 deletions
diff --git a/packages/aurora4x/default.nix b/packages/aurora4x/default.nix new file mode 100644 index 0000000..adc1a53 --- /dev/null +++ b/packages/aurora4x/default.nix @@ -0,0 +1,57 @@ +{ + lib, + stdenv, + fetchurl, + makeDesktopItem, + copyDesktopItems, + mono, + unrar +}: + +stdenv.mkDerivation rec { + name = "aurora4x-251"; + version = "251"; + + srcs = [ + (fetchurl { + url = "https://www.pentarch.org/steve/Aurora1130Full.rar"; + hash = "sha256-QaTka9fNXjK/PgiF0S5EX+1dtUGWitcqPQYr54qDYAQ="; + }) + (fetchurl { + url = "https://www.pentarch.org/steve/Aurora260.rar"; + hash = "sha256-AG10u3oVX1rN7FQERVg36l7JBocvpF19/7tvavxH5QQ="; + }) + ]; + + nativeBuildInputs = [ + copyDesktopItems + ]; + + buildInputs = [ + unrar + ]; + + runtimeLibs = lib.makeLibraryPath ( + [ + mono + ] + ); + + desktopItems = [ + (makeDesktopItem { + name = "aurora4x"; + desktopName = "Aurora 4X"; + exec = "aurora4x"; + }) + ]; + + unpackCmd = "unrar x -o+ $curSrc"; + + installPhase = '' + runHook preInstall + + mkdir -p $out/share/aurora4x $out/bin + + runHook postInstall + ''; +} diff --git a/packages/freeciv/default.nix b/packages/freeciv/default.nix new file mode 100644 index 0000000..5cd37c6 --- /dev/null +++ b/packages/freeciv/default.nix @@ -0,0 +1,141 @@ +{ + lib, + stdenv, + fetchFromGitHub, + autoreconfHook, + lua5_3, + pkg-config, + python3, + zlib, + bzip2, + curl, + xz, + gettext, + libiconv, + icu, + SDL2, + SDL2_mixer, + SDL2_image, + SDL2_ttf, + SDL2_gfx, + freetype, + fluidsynth, + sdl2Client ? false, + gtkClient ? true, + gtk4, + wrapGAppsHook3, + qtClient ? false, + qt5, + server ? true, + readline, + enableSqlite ? true, + sqlite, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "freeciv"; + version = "3.2.1"; + + src = fetchFromGitHub { + owner = "freeciv"; + repo = "freeciv"; + tag = "R${lib.replaceStrings [ "." ] [ "_" ] finalAttrs.version}"; + hash = "sha256-Rl/B71pp5PA6mtRaKs8TbOya18cYxlNmMzVJ4ySVmhY="; + }; + + postPatch = '' + for f in {common,utility}/*.py; do + substituteInPlace $f \ + --replace-fail '/usr/bin/env python3' ${python3.interpreter} + done + for f in bootstrap/*.sh; do + patchShebangs $f + done + ''; + + nativeBuildInputs = [ + autoreconfHook + pkg-config + ] + ++ lib.optionals qtClient [ qt5.wrapQtAppsHook ] + ++ lib.optionals gtkClient [ wrapGAppsHook3 ]; + + buildInputs = [ + lua5_3 + zlib + bzip2 + curl + xz + gettext + libiconv + icu + SDL2 + SDL2_mixer + fluidsynth + ] + ++ lib.optionals sdl2Client [ + SDL2_image + SDL2_ttf + SDL2_gfx + freetype + ] + ++ lib.optionals gtkClient [ gtk4 ] + ++ lib.optionals qtClient [ qt5.qtbase ] + ++ lib.optional server readline + ++ lib.optional enableSqlite sqlite; + + dontWrapQtApps = true; + dontWrapGApps = true; + + # configure is not smart enough to look for SDL2 headers under + # .../SDL2, but thankfully $SDL2_PATH is almost exactly what we want + preConfigure = '' + export CPPFLAGS="$(echo $SDL2_PATH | sed 's#/nix/store/#-I/nix/store/#g')" + ''; + configureFlags = [ + "--enable-shared" + ] + ++ lib.optionals sdl2Client [ + "--enable-client=sdl2" + "--enable-sdl-mixer=sdl2" + ] + ++ lib.optionals qtClient [ + "--enable-client=qt" + "--with-qtver=qt5" + "--with-qt5-includes=${qt5.qtbase.dev}/include" + ] + ++ lib.optionals gtkClient [ + "--enable-client=gtk4" + "--enable-sdl-mixer=sdl2" + ] + ++ lib.optional enableSqlite "--enable-fcdb=sqlite3" + ++ lib.optional (!gtkClient) "--enable-fcmp=cli" + ++ lib.optional (!server) "--disable-server"; + + postFixup = + lib.optionalString qtClient '' + wrapQtApp $out/bin/freeciv-qt + '' + + lib.optionalString gtkClient '' + wrapGApp $out/bin/freeciv-gtk4 + ''; + + enableParallelBuilding = true; + + meta = { + description = "Multiplayer (or single player), turn-based strategy game"; + longDescription = '' + Freeciv is a Free and Open Source empire-building strategy game + inspired by the history of human civilization. The game commences in + prehistory and your mission is to lead your tribe from the stone age + to the space age... + ''; + homepage = "https://freeciv.org/"; + license = lib.licenses.gpl2Plus; + maintainers = with lib.maintainers; [ pierron ]; + platforms = lib.platforms.unix; + hydraPlatforms = lib.platforms.linux; # sdl-config times out on darwin + broken = qtClient && stdenv.hostPlatform.isDarwin; # Missing Qt5 development files + }; +}) + diff --git a/packages/freecol/default.nix b/packages/freecol/default.nix new file mode 100644 index 0000000..e2562ad --- /dev/null +++ b/packages/freecol/default.nix @@ -0,0 +1,64 @@ +{ + lib, + stdenv, + fetchFromGitHub, + autoreconfHook, + lua5_3, + pkg-config, + python3, + zlib, + bzip2, + curl, + xz, + gettext, + libiconv, + icu, + SDL2, + SDL2_mixer, + SDL2_image, + SDL2_ttf, + SDL2_gfx, + freetype, + fluidsynth, + sdl2Client ? false, + gtkClient ? false, + gtk3, + wrapGAppsHook3, + qtClient ? true, + qt5, + server ? true, + readline, + enableSqlite ? true, + sqlite, +}: + +stdenv.mkDerivation rec { + pname = "freecol"; + version = "1.2.0"; + + src = fetchFromGitHub { + owner = "FreeCol"; + repo = "freecol"; + rev = "stable"; + hash = "sha256-+kAV9Jz0aQpzeVUFp3so+rYbWOn52NuxRwE8kP5hzM8="; + }; + + enableParallelBuilding = true; + + meta = { + description = "Multiplayer (or single player), turn-based strategy game"; + longDescription = '' + Freeciv is a Free and Open Source empire-building strategy game + inspired by the history of human civilization. The game commences in + prehistory and your mission is to lead your tribe from the stone age + to the space age... + ''; + homepage = "http://www.freeciv.org"; # http only + license = lib.licenses.gpl2Plus; + maintainers = with lib.maintainers; [ pierron ]; + platforms = lib.platforms.unix; + hydraPlatforms = lib.platforms.linux; # sdl-config times out on darwin + broken = qtClient && stdenv.hostPlatform.isDarwin; # Missing Qt5 development files + }; +} + diff --git a/packages/vintagestory/default.nix b/packages/vintagestory/default.nix new file mode 100644 index 0000000..8df3a75 --- /dev/null +++ b/packages/vintagestory/default.nix @@ -0,0 +1,117 @@ +{ + lib, + stdenv, + fetchurl, + makeWrapper, + makeDesktopItem, + copyDesktopItems, + xorg, + gtk2, + sqlite, + openal, + cairo, + libGLU, + SDL2, + freealut, + libglvnd, + pipewire, + libpulseaudio, + wayland, + libxkbcommon, + dotnet-runtime_8 +}: + +stdenv.mkDerivation rec { + name = "vintagestory-${version}"; + version = "1.21.4"; + + src = fetchurl { + url = "https://cdn.vintagestory.at/gamefiles/stable/vs_client_linux-x64_${version}.tar.gz"; + hash = "sha256-npffJgxgUMefX9OiveNk1r4kVqsMaVCC1jcWaibz9l8="; + }; + + nativeBuildInputs = [ + makeWrapper + copyDesktopItems + ]; + + buildInputs = [ dotnet-runtime_8 ]; + + runtimeLibs = lib.makeLibraryPath ( + [ + gtk2 + sqlite + openal + cairo + libGLU + SDL2 + freealut + libglvnd + pipewire + libpulseaudio + wayland + libxkbcommon + ] + ++ (with xorg; [ + libX11 + libXi + libXcursor + ]) + ); + + desktopItems = [ + (makeDesktopItem { + name = "vintagestory"; + desktopName = "Vintage Story"; + exec = "vintagestory"; + icon = "vintagestory"; + comment = "Innovate and explore in a sandbox world"; + categories = [ "Game" ]; + }) + (makeDesktopItem { + name = "Vintagestory_url_connect"; + desktopName = "Vintage Story URI Connect"; + type = "Application"; + noDisplay = true; + mimeTypes = [ "x-scheme-handler/vintagestoryjoin" ]; + exec = "vintagestory -c %U"; + categories = [ "Game" ]; + }) + (makeDesktopItem { + name = "Vintagestory_url_mod"; + desktopName = "Vintage Story URI mod install"; + type = "Application"; + noDisplay = true; + mimeTypes = [ "x-scheme-handler/vintagestorymodinstall" ]; + exec = "vintagestory -i %U"; + categories = [ "Game" ]; + }) + ]; + + installPhase = '' + runHook preInstall + + mkdir -p $out/share/vintagestory $out/bin $out/share/pixmaps $out/share/fonts/truetype + cp -r * $out/share/vintagestory + cp $out/share/vintagestory/assets/gameicon.xpm $out/share/pixmaps/vintagestory.xpm + cp $out/share/vintagestory/assets/game/fonts/*.ttf $out/share/fonts/truetype + + runHook postInstall + ''; + + preFixup = + '' + makeWrapper ${dotnet-runtime_8}/bin/dotnet $out/bin/vintagestory \ + --prefix LD_LIBRARY_PATH : "${runtimeLibs}" \ + --add-flags $out/share/vintagestory/Vintagestory.dll + makeWrapper ${dotnet-runtime_8}/bin/dotnet $out/bin/vintagestory-server \ + --prefix LD_LIBRARY_PATH : "${runtimeLibs}" \ + --add-flags $out/share/vintagestory/VintagestoryServer.dll + '' + + '' + find "$out/share/vintagestory/assets/" -not -path "*/fonts/*" -regex ".*/.*[A-Z].*" | while read -r file; do + local filename="$(basename -- "$file")" + ln -sf "$filename" "''${file%/*}"/"''${filename,,}" + done + ''; +} |
