nixpkgs/pkgs/games/the-powder-toy/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

66 lines
1.5 KiB
Nix
Raw Permalink Normal View History

{ lib
, stdenv
, fetchFromGitHub
, fetchpatch
, meson
, ninja
, pkg-config
, python3
, SDL2
, bzip2
, curl
, fftwFloat
, lua
, luajit
, zlib
, jsoncpp
, libpng
, Cocoa }:
2015-04-08 00:44:39 +02:00
stdenv.mkDerivation rec {
pname = "the-powder-toy";
version = "97.0.352";
2016-08-13 02:15:04 +02:00
2015-04-08 00:44:39 +02:00
src = fetchFromGitHub {
2020-08-08 02:57:13 +02:00
owner = "The-Powder-Toy";
2015-04-08 00:44:39 +02:00
repo = "The-Powder-Toy";
rev = "v${version}";
sha256 = "sha256-LYohsqFU9LBgTXMaV6cf8/zf3fBvT+s5A1JBpPHekH8=";
2015-04-08 00:44:39 +02:00
};
patches = [
# Fix gcc-13 build failure:
# https://github.com/The-Powder-Toy/The-Powder-Toy/pull/898
(fetchpatch {
name = "gcc-13.patch";
url = "https://github.com/The-Powder-Toy/The-Powder-Toy/commit/162bce9a1036e0c233399941410364c4a4370980.patch";
hash = "sha256-oQNwKemV3BjMLSUd6zMCKqiClcc3Ouxwn3jagf/Q1/I=";
})
];
2021-07-15 12:59:59 +02:00
nativeBuildInputs = [ meson ninja pkg-config python3 ];
2015-04-08 00:44:39 +02:00
buildInputs = [ SDL2 bzip2 curl fftwFloat lua luajit zlib jsoncpp libpng ]
++ lib.optionals stdenv.isDarwin [ Cocoa ];
2015-04-08 00:44:39 +02:00
mesonFlags = [ "-Dworkaround_elusive_bzip2=false" ];
2015-04-08 00:44:39 +02:00
installPhase = ''
2021-07-15 12:59:59 +02:00
install -Dm 755 powder $out/bin/powder
2021-11-05 09:04:27 +01:00
mkdir -p $out/share/applications
mv ../resources $out/share
'' + lib.optionalString stdenv.isLinux ''
mv ./resources/powder.desktop $out/share/applications
2015-04-08 00:44:39 +02:00
'';
meta = with lib; {
2015-04-08 00:44:39 +02:00
description = "A free 2D physics sandbox game";
homepage = "https://powdertoy.co.uk/";
platforms = platforms.unix;
2021-07-06 07:43:22 +02:00
license = licenses.gpl3Plus;
2020-08-08 02:57:13 +02:00
maintainers = with maintainers; [ abbradar siraben ];
2021-07-06 06:36:48 +02:00
mainProgram = "powder";
2015-04-08 00:44:39 +02:00
};
}