Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leo60228/15533e667703b8fbd392a9cd9757f758 to your computer and use it in GitHub Desktop.
Save leo60228/15533e667703b8fbd392a9cd9757f758 to your computer and use it in GitHub Desktop.
From d6b1188f3e305e3b861bc40c8a095c8be553c162 Mon Sep 17 00:00:00 2001
From: leo60228 <iakornfeld@gmail.com>
Date: Sat, 8 Feb 2020 10:16:40 -0500
Subject: [PATCH] vvvvvv: fully split vvvvvv and vvvvvv-bin
---
pkgs/games/vvvvvv/default.nix | 110 +++++++++-----------------------
pkgs/games/vvvvvv/wrapper.nix | 49 ++++++++++++++
pkgs/top-level/all-packages.nix | 9 ++-
3 files changed, 84 insertions(+), 84 deletions(-)
create mode 100644 pkgs/games/vvvvvv/wrapper.nix
diff --git a/pkgs/games/vvvvvv/default.nix b/pkgs/games/vvvvvv/default.nix
index b95239a3..23513ed4 100644
--- a/pkgs/games/vvvvvv/default.nix
+++ b/pkgs/games/vvvvvv/default.nix
@@ -3,92 +3,44 @@
, fullGame ? false }:
let
- dataZip = if fullGame then requireFile {
- # the data file for the full game
- name = "data.zip";
- sha256 = "1q2pzscrglmwfgdl8yj300wymwskh51iq66l4xcd0qk0q3g3rbkg";
- message = ''
- In order to install VVVVVV, you must first download the game's
- data file (data.zip) as it is not released freely.
- Once you have downloaded the file, place it in your current
- directory, use the following command and re-run the installation:
- nix-prefetch-url file://\$PWD/data.zip
- '';
- } else fetchurl {
- # the data file for the free Make and Play edition
- url = https://thelettervsixtim.es/makeandplay/data.zip;
- name = "mapdata.zip";
- sha256 = "1q2pzscrglmwfgdl8yj300wymwskh51iq66l4xcd0qk0q3g3rbkg";
- };
-
# if the user does not own the full game, build the Make and Play edition
flags = if fullGame then [] else [ "-DMAKEANDPLAY" ];
- vvvvvv-bin = stdenv.mkDerivation rec {
- pname = "vvvvvv-bin";
- version = "unstable-2020-02-02";
-
- src = fetchFromGitHub {
- owner = "TerryCavanagh";
- repo = "VVVVVV";
- rev = "4bc76416f551253452012d28e2bc049087e2be73";
- sha256 = "1sc64f7sxf063bdgnkg23vc170chq2ix25gs836hyswx98iyg5ly";
- };
-
- CFLAGS = flags;
- CXXFLAGS = flags;
-
- nativeBuildInputs = [ cmake ninja ];
- buildInputs = [ SDL2 SDL2_mixer ];
-
- sourceRoot = "source/desktop_version";
-
- installPhase = ''
- mkdir -p $out/bin
- cp VVVVVV $out/bin/VVVVVV
- '';
-
- meta = with stdenv.lib; {
- description = "A retro-styled platform game";
- longDescription = ''
- VVVVVV is a platform game all about exploring one simple mechanical
- idea - what if you reversed gravity instead of jumping?
- '';
- homepage = "https://thelettervsixtim.es";
- license = licenses.unfreeRedistributable;
- maintainers = [ maintainers.dkudriavtsev ];
- platforms = platforms.all;
- };
+in stdenv.mkDerivation rec {
+ pname = "vvvvvv-bin";
+ version = "unstable-2020-02-02";
+
+ src = fetchFromGitHub {
+ owner = "TerryCavanagh";
+ repo = "VVVVVV";
+ rev = "4bc76416f551253452012d28e2bc049087e2be73";
+ sha256 = "1sc64f7sxf063bdgnkg23vc170chq2ix25gs836hyswx98iyg5ly";
};
- vvvvvv = stdenvNoCC.mkDerivation rec {
- pname = "vvvvvv";
- version = "unstable-2020-02-02";
+ CFLAGS = flags;
+ CXXFLAGS = flags;
- dontUnpack = true;
+ nativeBuildInputs = [ cmake ninja ];
+ buildInputs = [ SDL2 SDL2_mixer ];
- installPhase = ''
- mkdir -p $out/bin
- cat > $out/bin/VVVVVV << EOF
- #!/bin/sh
- exec -a "\$0" ${vvvvvv-bin}/bin/VVVVVV -assets ${dataZip} "\$@"
- EOF
- chmod a+x $out/bin/VVVVVV
- '';
+ sourceRoot = "source/desktop_version";
- meta = with stdenv.lib; {
- description = "A retro-styled platform game";
- longDescription = ''
- VVVVVV is a platform game all about exploring one simple mechanical
- idea - what if you reversed gravity instead of jumping?
- '';
- homepage = "https://thelettervsixtim.es";
- license = if fullGame then licenses.unfree else licenses.unfreeRedistributable;
- maintainers = [ maintainers.dkudriavtsev ];
- platforms = platforms.all;
- };
- };
+ installPhase = ''
+ mkdir -p $out/bin
+ cp VVVVVV $out/bin/VVVVVV
+ '';
+
+ passthru.fullGame = fullGame;
-in {
- inherit vvvvvv-bin vvvvvv;
+ meta = with stdenv.lib; {
+ description = "A retro-styled platform game";
+ longDescription = ''
+ VVVVVV is a platform game all about exploring one simple mechanical
+ idea - what if you reversed gravity instead of jumping?
+ '';
+ homepage = "https://thelettervsixtim.es";
+ license = licenses.unfreeRedistributable;
+ maintainers = [ maintainers.dkudriavtsev ];
+ platforms = platforms.all;
+ };
}
diff --git a/pkgs/games/vvvvvv/wrapper.nix b/pkgs/games/vvvvvv/wrapper.nix
new file mode 100644
index 00000000..ec3fd3e1
--- /dev/null
+++ b/pkgs/games/vvvvvv/wrapper.nix
@@ -0,0 +1,49 @@
+{ stdenvNoCC, stdenv, vvvvvv-bin, fetchurl, requireFile }:
+
+let
+ fullGame = vvvvvv-bin.fullGame;
+ dataZip = if fullGame then requireFile {
+ # the data file for the full game
+ name = "data.zip";
+ sha256 = "1q2pzscrglmwfgdl8yj300wymwskh51iq66l4xcd0qk0q3g3rbkg";
+ message = ''
+ In order to install VVVVVV, you must first download the game's
+ data file (data.zip) as it is not released freely.
+ Once you have downloaded the file, place it in your current
+ directory, use the following command and re-run the installation:
+ nix-prefetch-url file://\$PWD/data.zip
+ '';
+ } else fetchurl {
+ # the data file for the free Make and Play edition
+ url = https://thelettervsixtim.es/makeandplay/data.zip;
+ name = "mapdata.zip";
+ sha256 = "1q2pzscrglmwfgdl8yj300wymwskh51iq66l4xcd0qk0q3g3rbkg";
+ };
+
+in stdenvNoCC.mkDerivation rec {
+ pname = "vvvvvv";
+ version = "unstable-2020-02-02";
+
+ dontUnpack = true;
+
+ installPhase = ''
+ mkdir -p $out/bin
+ cat > $out/bin/VVVVVV << EOF
+ #!/bin/sh
+ exec -a "\$0" ${vvvvvv-bin}/bin/VVVVVV -assets ${dataZip} "\$@"
+ EOF
+ chmod a+x $out/bin/VVVVVV
+ '';
+
+ meta = with stdenv.lib; {
+ description = "A retro-styled platform game";
+ longDescription = ''
+ VVVVVV is a platform game all about exploring one simple mechanical
+ idea - what if you reversed gravity instead of jumping?
+ '';
+ homepage = "https://thelettervsixtim.es";
+ license = if fullGame then licenses.unfree else licenses.unfreeRedistributable;
+ maintainers = [ maintainers.dkudriavtsev ];
+ platforms = platforms.all;
+ };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index feda09cc..f88fe7e5 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -7587,7 +7587,7 @@ in
zpaqd = callPackage ../tools/archivers/zpaq/zpaqd.nix { };
zsh-autoenv = callPackage ../tools/misc/zsh-autoenv { };
-
+
zsh-bd = callPackage ../shells/zsh/zsh-bd { };
zsh-git-prompt = callPackage ../shells/zsh/zsh-git-prompt { };
@@ -23521,12 +23521,11 @@ in
libpng = libpng12;
};
- vvvvvvPackages = callPackages ../games/vvvvvv { };
-
- inherit (vvvvvvPackages) vvvvvv-bin vvvvvv;
+ vvvvvv-bin = callPackage ../games/vvvvvv { };
+ vvvvvv = callPackage ../games/vvvvvv/wrapper.nix { };
vvvvvv-bin-full = vvvvvv-bin.override { fullGame = true; };
- vvvvvv-full = vvvvvv.override { fullGame = true; };
+ vvvvvv-full = vvvvvv.override { vvvvvv-bin = vvvvvv-bin-full; };
warmux = callPackage ../games/warmux { };
--
2.23.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment