-
Notifications
You must be signed in to change notification settings - Fork 11
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
Add antichamber, an humble (indie!) bundle game #14
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
{ stdenv, lib, fetchHumbleBundle, unzip | ||
, xorg, libpulseaudio, libvorbis, libogg, mesa }: | ||
|
||
stdenv.mkDerivation rec { | ||
name = "antichamber-1.1"; | ||
|
||
src = fetchHumbleBundle { | ||
name = "antichamber_1.01_linux_1392664980.sh"; | ||
machineName = "antichamber_linux"; | ||
md5 = "37bca01c411d813c8729259b7db2dba0"; | ||
}; | ||
|
||
dontStrip = true; | ||
phases = ["installPhase"]; | ||
|
||
installPhase = let | ||
rpath = lib.makeLibraryPath [ | ||
"$dest/Binaries/Linux" | ||
xorg.libX11 | ||
xorg.libXi | ||
stdenv.cc.cc.lib | ||
libpulseaudio | ||
libvorbis | ||
libogg | ||
mesa | ||
]; | ||
in '' | ||
dest="$out/share/antichamber" | ||
|
||
# Unpack binaries and data into $dest | ||
mkdir -p "$dest" | ||
${unzip}/bin/unzip $src "data/*" -d $dest && [ $? -le 2 ] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What about There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Even better: just There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's an habit I started with archlinux & AUR. I want to unzip in $dest because it is in the nix store partition, while $CWD will be on a temporary partition. For big binary/data archives, this is faster because it remains on the same partition, and mv operations are mostly immediate. This could however go in the unpackPhase, but the generic build script requires the unpack phase to unpack into the temporary directory used for the build. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay, fair enough, for very large files this would take ages. |
||
mv $dest/data/*/* $dest | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd assume here that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, it's directories + files, but I only want the directories (no readme and installer stuffs) |
||
rm -r $dest/data | ||
|
||
# Patch heavily :-) | ||
patchelf \ | ||
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ | ||
--set-rpath "${rpath}" "$dest/Binaries/Linux/UDKGame-Linux" | ||
for exe in $dest/Binaries/Linux/lib/*.so{,.*} ; do | ||
patchelf --set-rpath "${rpath}" "$exe" | ||
done | ||
|
||
# Fixup permissions, just to be sure. | ||
find "$dest" -type f -exec chmod 644 "{}" + | ||
find "$dest/Binaries" -type f -exec chmod 755 "{}" + | ||
|
||
mkdir -p "$out/bin" | ||
cat > $out/bin/antichamber <<EOF | ||
#!${stdenv.shell} | ||
cd $dest/Binaries/Linux/ | ||
exec ./UDKGame-Linux "$@" | ||
EOF | ||
chmod 755 $out/bin/antichamber | ||
''; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add these dependencies to the package function arguments explicitly.