Unverified Commit 56a5a89b authored by Michael Daniels's avatar Michael Daniels Committed by GitHub
Browse files

duckmarines: build from source, add love 11 support, move to by-name, fix license (#447796)

parents ed7854dc f3bd9335
Loading
Loading
Loading
Loading
+842 −0

File added.

Preview size limit exceeded, changes collapsed.

+39 −7
Original line number Diff line number Diff line
{
  lib,
  stdenv,
  fetchFromGitHub,
  fetchurl,
  love,
  lua,
  makeWrapper,
  makeDesktopItem,
  strip-nondeterminism,
  zip,
}:

stdenv.mkDerivation rec {
@@ -27,24 +30,40 @@ stdenv.mkDerivation rec {
    categories = [ "Game" ];
  };

  src = fetchurl {
    url = "https://github.com/SimonLarsen/duckmarines/releases/download/v${version}/duckmarines-1.0c.love";
    sha256 = "1rvgpkvi4h9zhc4fwb4knhsa789yjcx4a14fi4vqfdyybhvg5sh9";
  src = fetchFromGitHub {
    owner = "SimonLarsen";
    repo = "duckmarines";
    tag = "v${version}";
    hash = "sha256-0WzqYbK18IL8VY7NsVONwJCI5+me5SPulfkkLCifLvY=";
  };

  nativeBuildInputs = [ makeWrapper ];
  patches = [
    # https://github.com/SimonLarsen/duckmarines/pull/18
    ./love-11-support.patch
  ];

  nativeBuildInputs = [
    makeWrapper
    strip-nondeterminism
    zip
  ];
  buildInputs = [
    lua
    love
  ];

  dontUnpack = true;
  buildPhase = ''
    runHook preBuild
    zip -9 -r duckmarines.love ./*
    strip-nondeterminism --type zip duckmarines.love
    runHook postBuild
  '';

  installPhase = ''
    mkdir -p $out/bin
    mkdir -p $out/share/games/lovegames

    cp -v ${src} $out/share/games/lovegames/duckmarines.love
    cp -v duckmarines.love $out/share/games/lovegames/duckmarines.love

    makeWrapper ${love}/bin/love $out/bin/duckmarines --add-flags $out/share/games/lovegames/duckmarines.love

@@ -57,7 +76,20 @@ stdenv.mkDerivation rec {
    description = "Duck-themed action puzzle video game";
    platforms = lib.platforms.linux;
    hydraPlatforms = [ ];
    license = lib.licenses.free;
    license = with lib.licenses; [
      # code
      zlib

      # assets
      cc-by-sa-40
      cc-by-nc-nd-40

      # slam
      mit

      # tserial
      unfree
    ];
    downloadPage = "http://tangramgames.dk/games/duckmarines";
  };

+0 −2
Original line number Diff line number Diff line
@@ -12607,8 +12607,6 @@ with pkgs;

  ddnet-server = ddnet.override { buildClient = false; };

  duckmarines = callPackage ../games/duckmarines { love = love_0_10; };

  dwarf-fortress-packages = recurseIntoAttrs (callPackage ../games/dwarf-fortress { });

  inherit (dwarf-fortress-packages) dwarf-fortress dwarf-fortress-full dwarf-therapist;