about summary refs log tree commit diff
path: root/pkgs/games/etlegacy
diff options
context:
space:
mode:
authorPol Dellaiera <pol.dellaiera@protonmail.com>2023-08-19 22:30:28 +0200
committerPol Dellaiera <pol.dellaiera@protonmail.com>2023-08-20 23:43:37 +0200
commit2836fd6fce609d0fb1b01a9cb75500750a6ea5f3 (patch)
tree5537fdc821148b225019c379007be6e5ed28194c /pkgs/games/etlegacy
parentbc586df93d44ce2a672e2afb3ea60f67a62ddf39 (diff)
etlegacy: reformat files
Diffstat (limited to 'pkgs/games/etlegacy')
-rw-r--r--pkgs/games/etlegacy/default.nix199
1 files changed, 103 insertions, 96 deletions
diff --git a/pkgs/games/etlegacy/default.nix b/pkgs/games/etlegacy/default.nix
index cf22db9024d9a..ee5d31874c685 100644
--- a/pkgs/games/etlegacy/default.nix
+++ b/pkgs/games/etlegacy/default.nix
@@ -1,28 +1,28 @@
-{
-  stdenv,
-  lib,
-  makeWrapper,
-  writeShellApplication,
-  fetchFromGitHub,
-  fetchurl,
-  cmake,
-  git,
-  glew,
-  SDL2,
-  zlib,
-  minizip,
-  libjpeg,
-  curl,
-  lua,
-  libogg,
-  libtheora,
-  freetype,
-  libpng,
-  sqlite,
-  openal,
-  unzip,
-  cjson,
-}: let
+{ lib
+, stdenv
+, fetchurl
+, writeShellApplication
+, fetchFromGitHub
+, cjson
+, cmake
+, git
+, makeWrapper
+, unzip
+, curl
+, freetype
+, glew
+, libjpeg
+, libogg
+, libpng
+, libtheora
+, lua
+, minizip
+, openal
+, SDL2
+, sqlite
+, zlib
+}:
+let
   version = "2.81.1";
 
   fetchAsset = { asset, hash }: fetchurl {
@@ -55,81 +55,88 @@
     '';
   };
 in
-  stdenv.mkDerivation {
-    pname = "etlegacy";
-    inherit version;
+stdenv.mkDerivation {
+  pname = "etlegacy";
+  inherit version;
 
-    src = fetchFromGitHub {
-      owner = "etlegacy";
-      repo = "etlegacy";
-      rev = "refs/tags/v" + version;
-      sha256 = "sha256-CGXtc51vaId/SHbD34ZeT0gPsrl7p2DEw/Kp+GBZIaA="; # 2.81.1
-    };
+  src = fetchFromGitHub {
+    owner = "etlegacy";
+    repo = "etlegacy";
+    rev = "refs/tags/v${version}";
+    hash = "sha256-CGXtc51vaId/SHbD34ZeT0gPsrl7p2DEw/Kp+GBZIaA="; # 2.81.1
+  };
 
-    nativeBuildInputs = [cmake fakeGit git makeWrapper unzip cjson];
-    buildInputs = [
-      glew
-      SDL2
-      zlib
-      minizip
-      libjpeg
-      curl
-      lua
-      libogg
-      libtheora
-      freetype
-      libpng
-      sqlite
-      openal
-    ];
+  nativeBuildInputs = [
+    cjson
+    cmake
+    fakeGit
+    git
+    makeWrapper
+    unzip
+  ];
 
-    preBuild = ''
-      # Required for build time to not be in 1980
-      export SOURCE_DATE_EPOCH=$(date +%s)
-      # This indicates the build was by a CI pipeline and prevents the resource
-      # files from being flagged as 'dirty' due to potentially being custom built.
-      export CI="true"
-    '';
+  buildInputs = [
+    curl
+    freetype
+    glew
+    libjpeg
+    libogg
+    libpng
+    libtheora
+    lua
+    minizip
+    openal
+    SDL2
+    sqlite
+    zlib
+  ];
 
-    cmakeFlags = [
-      "-DCMAKE_BUILD_TYPE=Release"
-      "-DCROSS_COMPILE32=0"
-      "-DBUILD_SERVER=1"
-      "-DBUILD_CLIENT=1"
-      "-DBUNDLED_JPEG=0"
-      "-DBUNDLED_LIBS=0"
-      "-DINSTALL_EXTRA=0"
-      "-DINSTALL_OMNIBOT=0"
-      "-DINSTALL_GEOIP=0"
-      "-DINSTALL_WOLFADMIN=0"
-      "-DFEATURE_AUTOUPDATE=0"
-      "-DINSTALL_DEFAULT_BASEDIR=${placeholder "out"}/lib/etlegacy"
-      "-DINSTALL_DEFAULT_BINDIR=${placeholder "out"}/bin"
-    ];
+  preBuild = ''
+    # Required for build time to not be in 1980
+    export SOURCE_DATE_EPOCH=$(date +%s)
+    # This indicates the build was by a CI pipeline and prevents the resource
+    # files from being flagged as 'dirty' due to potentially being custom built.
+    export CI="true"
+  '';
 
-    postInstall = ''
-      ETMAIN=$out/lib/etlegacy/etmain
-      mkdir -p $ETMAIN
-      ln -s ${pak0} $ETMAIN/pak0.pk3
-      ln -s ${pak1} $ETMAIN/pak1.pk3
-      ln -s ${pak2} $ETMAIN/pak2.pk3
-      makeWrapper $out/bin/etl.* $out/bin/etl
-      makeWrapper $out/bin/etlded.* $out/bin/etlded
-    '';
+  cmakeFlags = [
+    "-DCMAKE_BUILD_TYPE=Release"
+    "-DCROSS_COMPILE32=0"
+    "-DBUILD_SERVER=1"
+    "-DBUILD_CLIENT=1"
+    "-DBUNDLED_JPEG=0"
+    "-DBUNDLED_LIBS=0"
+    "-DINSTALL_EXTRA=0"
+    "-DINSTALL_OMNIBOT=0"
+    "-DINSTALL_GEOIP=0"
+    "-DINSTALL_WOLFADMIN=0"
+    "-DFEATURE_AUTOUPDATE=0"
+    "-DINSTALL_DEFAULT_BASEDIR=${placeholder "out"}/lib/etlegacy"
+    "-DINSTALL_DEFAULT_BINDIR=${placeholder "out"}/bin"
+  ];
+
+  postInstall = ''
+    ln -s ${pak0} $out/lib/etlegacy/etmain/pak0.pk3
+    ln -s ${pak1} $out/lib/etlegacy/etmain/pak1.pk3
+    ln -s ${pak2} $out/lib/etlegacy/etmain/pak2.pk3
 
-    hardeningDisable = [ "fortify" ];
+    makeWrapper $out/bin/etl.* $out/bin/etl
+    makeWrapper $out/bin/etlded.* $out/bin/etlded
+  '';
 
-    meta = with lib; {
-      description = "ET: Legacy is an open source project based on the code of Wolfenstein: Enemy Territory which was released in 2010 under the terms of the GPLv3 license";
-      homepage = "https://etlegacy.com";
-      platforms = ["i686-linux" "x86_64-linux"];
-      license = [licenses.gpl3 licenses.cc-by-nc-sa-30];
-      longDescription = ''
-        ET: Legacy, an open source project fully compatible client and server
-        for the popular online FPS game Wolfenstein: Enemy Territory - whose
-        gameplay is still considered unmatched by many, despite its great age.
-      '';
-      mainProgram = "etl";
-      maintainers = with maintainers; [ashleyghooper drupol];
-    };
-  }
+  hardeningDisable = [ "fortify" ];
+
+  meta = {
+    description = "ET: Legacy is an open source project based on the code of Wolfenstein: Enemy Territory which was released in 2010 under the terms of the GPLv3 license";
+    homepage = "https://etlegacy.com";
+    license = with lib.licenses; [ gpl3 cc-by-nc-sa-30 ];
+    longDescription = ''
+      ET: Legacy, an open source project fully compatible client and server
+      for the popular online FPS game Wolfenstein: Enemy Territory - whose
+      gameplay is still considered unmatched by many, despite its great age.
+    '';
+    mainProgram = "etl";
+    maintainers = with lib.maintainers; [ ashleyghooper drupol ];
+    platforms = lib.platforms.linux;
+  };
+}