Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: games/foss/ultrastar-play #58

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkgs/games/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ let
packages = (pkgs.lib.evalModules {
modules = [
(if config == null then configFile else config)
baseModule ./humblebundle ./steam ./itch ./gog
baseModule ./humblebundle ./steam ./itch ./gog ./foss
];
}).config.packages;

Expand Down
19 changes: 19 additions & 0 deletions pkgs/games/foss/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{ config, lib, pkgs, ... }:

let
cfg = config.foss;

self = rec {
callPackage = pkgs.lib.callPackageWith (pkgs // self);
callPackage_i686 = pkgs.lib.callPackageWith (pkgs.pkgsi686Linux // self);

ultrastar-play = callPackage ./ultrastar-play.nix {};
};
in {
options.foss = {
};

config.packages = {
foss = self;
};
}
101 changes: 101 additions & 0 deletions pkgs/games/foss/ultrastar-play.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@

{ lib, stdenv, fetchurl
, buildUnity
, autoreconfHook
, unzip
, buildFHSEnv
, writeScript
, fetchFromGitHub
, autoPatchelfHook
, fetchpatch
, pkg-config
, lua
, fpc
, pcre
, portaudio
, freetype
, libpng
, SDL2
, SDL2_image
, SDL2_gfx
, SDL2_mixer
, SDL2_net, SDL2_ttf
, ffmpeg_4
, sqlite
, zlib
, libGLU
, libGL
, xorg
}:

let
sharedLibs = [
pcre portaudio freetype
# SDL2 SDL2_image SDL2_gfx SDL2_mixer SDL2_net SDL2_ttf
sqlite lua zlib xorg.libX11 libGLU libGL ffmpeg_4
];

unpacked = buildUnity {
name = "ultrastar-play";
version = "0.9.0";
fullName = "UltraStar Play";

# src = fetchFromGitHub {
# owner = "UltraStar-Deluxe";
# repo = "Play";
# rev = "v${version}";
# hash = "sha256-KvYf4dpgN72F8Y5iFNba0SCjPoS33O3FAdrrC49xoGo=";
# };
src = fetchurl {
url = "https://github.com/UltraStar-Deluxe/Play/releases/download/v0.9.0/UltraStarPlay-v0.9.0-Linux64.zip";
sha256 = "sha256-kC4jb2KSOyDrAweHzlyWO1tB7D0/wGPXXP+SXF1Rz6k=";
};

# phases = [ "installPhase" "fixupPhase" ];

nativeBuildInputs = [ pkg-config unzip autoPatchelfHook ];
buildInputs = [ libpng ] ++ sharedLibs;

# postPatch = ''
# '';

preInstall = ''
mv 'UltraStar Play' 'UltraStar Play.x86_64'

mkdir -p $out/share/lib
cp -a UnityPlayer.so $out/share/lib
'';

};

in unpacked
# in buildFHSEnv {
# # inherit (unpacked) pname version;

# name = "ultrastar-play";

# runScript = writeScript "run-ultrastar-play" ''
# set -iuo pipefail
# tmp=$(mktemp -d ultrastar-play-XXXXX)

# clean_up() {
# rm -rf "$tmp"
# }
# trap clean_up EXIT SIGINT SIGTERM

# cd "$tmp"
# cp -a --reflink=auto ${unpacked}/ "$tmp"

# chmod --recursive +w "$tmp"

# "$tmp/UltraStar Play";
# '';


# meta = with lib; {
# homepage = "https://ultrastar-play.com";
# description = "Free and open source singing game with song editor for desktop, mobile, and smart TV ";
# license = licenses.mit;
# maintainers = with maintainers; [ Profpatsch ];
# };
# }