-
-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
107 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
{ | ||
stdenv, | ||
cmake, | ||
fetchFromGitHub, | ||
freetype, | ||
pkg-config, | ||
SDL2, | ||
libpng, | ||
libjpeg, | ||
zlib, | ||
libogg, | ||
libvorbis, | ||
libarchive, | ||
iconv, | ||
openssl, | ||
curl, | ||
libcpr, | ||
rapidjson, | ||
writeShellScriptBin, | ||
makeDesktopItem, | ||
lib, | ||
}: | ||
|
||
stdenv.mkDerivation (finalAttrs: { | ||
pname = "unnamed-sdvx-clone"; | ||
version = "0.6.0"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "Drewol"; | ||
repo = "unnamed-sdvx-clone"; | ||
rev = "refs/tags/v${finalAttrs.version}"; | ||
fetchSubmodules = true; | ||
hash = "sha256-wuf7xZztoxzNQJzlJOfH/Dc25/717NevBx7E0RDybho="; | ||
}; | ||
|
||
nativeBuildInputs = [ | ||
cmake | ||
pkg-config | ||
]; | ||
|
||
buildInputs = [ | ||
freetype | ||
SDL2 | ||
libpng | ||
libjpeg | ||
zlib | ||
libogg | ||
libvorbis | ||
libarchive | ||
iconv | ||
openssl | ||
curl | ||
libcpr | ||
rapidjson | ||
]; | ||
|
||
# FIXME: Set new commit hash when updating | ||
cmakeFlags = [ | ||
"-DUSE_SYSTEM_CPR=ON" | ||
"-DCMAKE_BUILD_TYPE=Release" | ||
"-DGIT_COMMIT=260b050569413a04db9d437c5158d2a032873ad6" | ||
]; | ||
|
||
# Wrapper script because the things are hardcoded so we just | ||
# change the game directory via the built in option uhhhhh | ||
wrapperScript = writeShellScriptBin "usc-game-wrapped" '' | ||
DATA_PATH=$HOME/.config/usc | ||
mkdir -p $DATA_PATH | ||
cp -r @out@/bin/audio $DATA_PATH | ||
cp -r @out@/bin/fonts $DATA_PATH | ||
cp -r @out@/bin/skins $DATA_PATH | ||
cp -r @out@/bin/LightPlugins $DATA_PATH | ||
find $DATA_PATH -type d -exec chmod 755 {} + | ||
find $DATA_PATH -type f -exec chmod 644 {} + | ||
@out@/bin/usc-game -gamedir="$DATA_PATH" | ||
''; | ||
|
||
desktopItem = makeDesktopItem { | ||
name = "Unnamed SDVX Clone"; | ||
exec = "usc-game-wrapped"; | ||
comment = "Unnamed SDVX Clone"; | ||
desktopName = "Unnamed SDVX Clone"; | ||
categories = [ "Game" ]; | ||
}; | ||
|
||
installPhase = '' | ||
runHook preInstall | ||
mkdir -p $out/bin | ||
substituteAll $wrapperScript/bin/usc-game-wrapped $out/bin/usc-game-wrapped | ||
chmod +x $out/bin/usc-game-wrapped | ||
mkdir $out/share | ||
ln -s "$desktopItem/share/applications" "$out/share/" | ||
cp -r /build/source/bin $out | ||
runHook postInstall | ||
''; | ||
|
||
meta = { | ||
description = "A game based on K-Shoot MANIA and Sound Voltex"; | ||
license = lib.licenses.mit; | ||
maintainers = with lib.maintainers; [ sako ]; | ||
platforms = with lib.platforms; linux; | ||
}; | ||
|
||
}) |