diff options
Diffstat (limited to 'packages')
| -rw-r--r-- | packages/aurora4x/default.nix | 57 | ||||
| -rw-r--r-- | packages/betacraft.nix | 65 | ||||
| -rw-r--r-- | packages/betacraft/default.nix | 15 | ||||
| -rw-r--r-- | packages/freeciv/default.nix | 141 | ||||
| -rw-r--r-- | packages/freecol/default.nix | 64 |
5 files changed, 342 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/betacraft.nix b/packages/betacraft.nix new file mode 100644 index 0000000..1e2b080 --- /dev/null +++ b/packages/betacraft.nix @@ -0,0 +1,65 @@ +{ + lib, + stdenv, + fetchurl, + makeWrapper, + makeDesktopItem, + copyDesktopItems, + jre8, + libxxf86vm, + libGL, + openal, + pulseaudio, + xrandr +}: +stdenv.mkDerivation rec { + pname = "betacraft"; + version = "1.09_17"; + + launcherjar = fetchurl { + url = "https://github.com/betacraftuk/betacraft-launcher/releases/download/${version}/launcher-${version}.jar"; + hash = "sha256-CMemX7mrCa5d9kQJN1/ryeBnJ/s6yz3aHq9ym4WWWOM"; + }; + + nativeBuildInputs = [ + makeWrapper + copyDesktopItems + ]; + + runtimeLibs = lib.makeLibraryPath ([ + libxxf86vm + libGL + openal + ]); + + runtimeBins = lib.makeBinPath ([ + xrandr + ]); + + desktopItems = [ + (makeDesktopItem { + name = "betacraft"; + desktopName = "Betacraft Launcher"; + exec = "betacraft"; + categories = [ "Game" ]; + }) + ]; + + phases = [ "installPhase" "preFixup" ]; + + installPhase = '' + runHook preInstall + mkdir -p $out/share/betacraft $out/bin + cp -r ${launcherjar} $out/share/betacraft/launcher-${version}.jar + runHook postInstall + ''; + preFixup = '' + makeWrapper ${pulseaudio}/bin/padsp $out/bin/betacraft \ + --prefix LD_LIBRARY_PATH : "${runtimeLibs}" \ + --prefix PATH : "${runtimeBins}" \ + --set DISPLAY ":0" \ + --add-flags ${jre8}/lib/openjdk/jre/bin/java \ + --add-flags -jar \ + --add-flags $out/share/betacraft/launcher-${version}.jar + ''; +} diff --git a/packages/betacraft/default.nix b/packages/betacraft/default.nix new file mode 100644 index 0000000..ecf90ff --- /dev/null +++ b/packages/betacraft/default.nix @@ -0,0 +1,15 @@ +{ + lib, + stdenv, + fetchFromGitHub, + autoreconfHook, +}: +stdenv.mkDerivation (finalAttrs: { + pname = "betacraft"; + version = "1.09_17"; + + src = fetchurl { + url = "https://github.com/betacraftuk/betacraft-launcher/releases/download/${version}/launcher-${version}.jar"; + sha256 = ""; + } +}) 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 + }; +} + |
