NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.31k stars 13.54k forks source link

Package request: Moondust-Project #247649

Open sOfTheApes opened 1 year ago

sOfTheApes commented 1 year ago

Project description

Moondust Project (formerly known as PGE Project) is a free and open-source game engine and development kit for it, giving developers the ability to create platform games.

Metadata

sOfTheApes commented 1 year ago

A (bad) attempt at packaging this software is below:

{pkgs ? import <nixpkgs> { system = builtins.currentSystem;}}:
pkgs.stdenv.mkDerivation rec {
    pname = "Moondust-Project";
    version  = "master";
    src = pkgs.fetchFromGitHub {
        owner = "WohlSoft";
        repo = "Moondust-Project";
        rev = "5bd3a15b209f71a5d3e90537a0f5d9629b40f409";
        sha256 = "sha256-L84jxpIIWFcTrxV2z72u3zjaq4vL3VrKpfocP85zxtA=";
        fetchSubmodules = true;
    };
    dontUseCmakeConfigure = true;
    buildInputs = with pkgs; [ gcc gnat libGLU cmake ];
    buildPhase = ''
        cp ${pkgs.writeScript "p" "QT_PATH='${pkgs.qt6.full}/bin/;QT_LIB_PATH='$pkgs.{qt6.full}/lib/';QMake='qmake';LRelease='lrelease';flag_cmake_static_qt=true"} _paths.sh
        sed -i '495,499d' build.sh # remove the [[ "$(which cmake)" == "" ]] block
        patchShebangs build.sh; chmod u+x build.sh && ./build.sh no-pause
    '';
    installPhase = ''mkdir $out; cp -r * $out'';
}