Commit 11676f8a authored by 06kellyjac's avatar 06kellyjac Committed by Francesco Gazzetta
Browse files

minetest: format

Format to match the new standards in nixpkgs
parent 55c14498
Loading
Loading
Loading
Loading
+103 −89
Original line number Diff line number Diff line
{ lib
, stdenv
, fetchFromGitHub
, gitUpdater
, cmake
, coreutils
, libpng
, bzip2
, curl
, libogg
, jsoncpp
, libjpeg
, libGLU
, openal
, libvorbis
, sqlite
, luajit
, freetype
, gettext
, doxygen
, ncurses
, graphviz
, xorg
, gmp
, libspatialindex
, leveldb
, postgresql
, hiredis
, libiconv
, ninja
, prometheus-cpp
, OpenGL
, OpenAL ? openal
, Carbon
, Cocoa
, Kernel
, buildClient ? true
, buildServer ? true
, SDL2
, useSDL2 ? false
{
  lib,
  stdenv,
  fetchFromGitHub,
  gitUpdater,
  cmake,
  coreutils,
  libpng,
  bzip2,
  curl,
  libogg,
  jsoncpp,
  libjpeg,
  libGLU,
  openal,
  libvorbis,
  sqlite,
  luajit,
  freetype,
  gettext,
  doxygen,
  ncurses,
  graphviz,
  xorg,
  gmp,
  libspatialindex,
  leveldb,
  postgresql,
  hiredis,
  libiconv,
  ninja,
  prometheus-cpp,
  OpenGL,
  OpenAL ? openal,
  Carbon,
  Cocoa,
  Kernel,
  buildClient ? true,
  buildServer ? true,
  SDL2,
  useSDL2 ? false,
}:

stdenv.mkDerivation (finalAttrs: {
@@ -81,7 +82,8 @@ stdenv.mkDerivation (finalAttrs: {
    ninja
  ];

  buildInputs = [
  buildInputs =
    [
      jsoncpp
      gettext
      freetype
@@ -91,7 +93,8 @@ stdenv.mkDerivation (finalAttrs: {
      ncurses
      gmp
      libspatialindex
  ] ++ lib.optional (lib.meta.availableOn stdenv.hostPlatform luajit) luajit
    ]
    ++ lib.optional (lib.meta.availableOn stdenv.hostPlatform luajit) luajit
    ++ lib.optionals stdenv.hostPlatform.isDarwin [
      libiconv
      OpenGL
@@ -99,35 +102,43 @@ stdenv.mkDerivation (finalAttrs: {
      Carbon
      Cocoa
      Kernel
  ] ++ lib.optionals buildClient [
    ]
    ++ lib.optionals buildClient [
      libpng
      libjpeg
      libGLU
      openal
      libogg
      libvorbis
  ] ++ lib.optionals (buildClient && useSDL2) [
    ]
    ++ lib.optionals (buildClient && useSDL2) [
      SDL2
  ] ++ lib.optionals (buildClient && !stdenv.hostPlatform.isDarwin && !useSDL2) [
    ]
    ++ lib.optionals (buildClient && !stdenv.hostPlatform.isDarwin && !useSDL2) [
      xorg.libX11
      xorg.libXi
  ] ++ lib.optionals buildServer [
    ]
    ++ lib.optionals buildServer [
      leveldb
      postgresql
      hiredis
      prometheus-cpp
    ];

  postPatch = ''
  postPatch =
    ''
      substituteInPlace src/filesys.cpp \
        --replace-fail "/bin/rm" "${coreutils}/bin/rm"
  '' + lib.optionalString stdenv.hostPlatform.isDarwin ''
    ''
    + lib.optionalString stdenv.hostPlatform.isDarwin ''
      sed -i '/pagezero_size/d;/fixup_bundle/d' src/CMakeLists.txt
    '';

  postInstall = lib.optionalString stdenv.hostPlatform.isLinux ''
  postInstall =
    lib.optionalString stdenv.hostPlatform.isLinux ''
      patchShebangs $out
  '' + lib.optionalString stdenv.hostPlatform.isDarwin ''
    ''
    + lib.optionalString stdenv.hostPlatform.isDarwin ''
      mkdir -p $out/Applications
      mv $out/minetest.app $out/Applications
    '';
@@ -144,7 +155,10 @@ stdenv.mkDerivation (finalAttrs: {
    description = "Infinite-world block sandbox game";
    license = licenses.lgpl21Plus;
    platforms = platforms.linux ++ platforms.darwin;
    maintainers = with maintainers; [ fpletz fgaz ];
    maintainers = with maintainers; [
      fpletz
      fgaz
    ];
    mainProgram = if buildClient then "minetest" else "minetestserver";
  };
})