2022-08-31 12:22:48 +02:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, meson
|
|
|
|
, ninja
|
|
|
|
, pkg-config
|
|
|
|
, python3
|
|
|
|
, SDL2
|
|
|
|
, bzip2
|
|
|
|
, curl
|
|
|
|
, fftwFloat
|
|
|
|
, lua
|
|
|
|
, luajit
|
|
|
|
, zlib
|
2023-11-14 23:57:33 +01:00
|
|
|
, jsoncpp
|
|
|
|
, libpng
|
2022-08-31 12:22:48 +02:00
|
|
|
, Cocoa }:
|
2015-04-08 00:44:39 +02:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "the-powder-toy";
|
2023-11-14 23:57:33 +01:00
|
|
|
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";
|
2023-11-14 23:57:33 +01:00
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "sha256-LYohsqFU9LBgTXMaV6cf8/zf3fBvT+s5A1JBpPHekH8=";
|
2015-04-08 00:44:39 +02:00
|
|
|
};
|
|
|
|
|
2021-07-15 12:59:59 +02:00
|
|
|
nativeBuildInputs = [ meson ninja pkg-config python3 ];
|
2015-04-08 00:44:39 +02:00
|
|
|
|
2023-11-14 23:57:33 +01:00
|
|
|
buildInputs = [ SDL2 bzip2 curl fftwFloat lua luajit zlib jsoncpp libpng ]
|
2022-08-31 12:22:48 +02:00
|
|
|
++ lib.optionals stdenv.isDarwin [ Cocoa ];
|
2015-04-08 00:44:39 +02:00
|
|
|
|
2023-11-14 23:57:33 +01: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
|
2023-11-15 02:39:48 +01:00
|
|
|
'' + lib.optionalString stdenv.isLinux ''
|
|
|
|
mv ./resources/powder.desktop $out/share/applications
|
2015-04-08 00:44:39 +02:00
|
|
|
'';
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2015-04-08 00:44:39 +02:00
|
|
|
description = "A free 2D physics sandbox game";
|
2022-11-09 16:41:13 +01:00
|
|
|
homepage = "https://powdertoy.co.uk/";
|
2022-08-03 03:19:20 +02:00
|
|
|
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
|
|
|
};
|
|
|
|
}
|