-
-
Notifications
You must be signed in to change notification settings - Fork 13.9k
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
vvvvvv: init at 2.3-git-2020-11-22 #79068
Conversation
Could you please squash commits into one? |
Should there not be separate |
Idea: If someone implements the ability to load data.zip from a custom location, the binary could be factored out into a separate derivation, which might be redistributable.
The last of the three derivations would simply be a wrapper script that calls vvvvvv-bin with the right assets.
|
I can do this when I get home in about 30 minutes. |
On the legal side of things: @TerryCavanagh, are you OK with us redistributing the full-version binary without redistributing the assets? |
diff --git a/desktop_version/src/FileSystemUtils.cpp b/desktop_version/src/FileSystemUtils.cpp
index 2a1d2df..a7db5ca 100644
--- a/desktop_version/src/FileSystemUtils.cpp
+++ b/desktop_version/src/FileSystemUtils.cpp
@@ -39,7 +39,7 @@ void PLATFORM_getOSDirectory(char* output);
void PLATFORM_migrateSaveData(char* output);
void PLATFORM_copyFile(const char *oldLocation, const char *newLocation);
-int FILESYSTEM_init(char *argvZero)
+int FILESYSTEM_init(char *argvZero, char *dataPath)
{
char output[MAX_PATH];
int mkdirResult;
@@ -79,9 +79,7 @@ int FILESYSTEM_init(char *argvZero)
}
/* Mount the stock content last */
- strcpy(output, PHYSFS_getBaseDir());
- strcat(output, "data.zip");
- if (!PHYSFS_mount(output, NULL, 1))
+ if (!PHYSFS_mount(dataPath, NULL, 1))
{
puts("Error: data.zip missing!");
puts("You do not have data.zip!");
diff --git a/desktop_version/src/FileSystemUtils.h b/desktop_version/src/FileSystemUtils.h
index d3c551e..404896b 100644
--- a/desktop_version/src/FileSystemUtils.h
+++ b/desktop_version/src/FileSystemUtils.h
@@ -6,7 +6,7 @@
#include "tinyxml.h"
-int FILESYSTEM_init(char *argvZero);
+int FILESYSTEM_init(char *argvZero, char *dataPath);
void FILESYSTEM_deinit();
char *FILESYSTEM_getUserSaveDirectory();
diff --git a/desktop_version/src/main.cpp b/desktop_version/src/main.cpp
index 4dba0fa..76c79f3 100644
--- a/desktop_version/src/main.cpp
+++ b/desktop_version/src/main.cpp
@@ -44,7 +44,7 @@ entityclass obj;
int main(int argc, char *argv[])
{
- if(!FILESYSTEM_init(argv[0]))
+ if(!FILESYSTEM_init(argv[0], argv[1]))
{
return 1;
}
@@ -55,9 +55,9 @@ int main(int argc, char *argv[])
SDL_INIT_GAMECONTROLLER
);
- if (argc > 2 && strcmp(argv[1], "-renderer") == 0)
+ if (argc > 3 && strcmp(argv[2], "-renderer") == 0)
{
- SDL_SetHintWithPriority(SDL_HINT_RENDER_DRIVER, argv[2], SDL_HINT_OVERRIDE);
+ SDL_SetHintWithPriority(SDL_HINT_RENDER_DRIVER, argv[3], SDL_HINT_OVERRIDE);
}
NETWORK_init(); |
Remember that you’ll probably want to make sure that that can be merged into upstream, as otherwise this package will have to be marked as modified. From the license:
Edit: What I mean is that it is important that the syntax is compatible with the old invocation syntax, as otherwise it probably won’t be merged into VVVVVV itself. |
@jakobrs Yep, it's fine to distribute the full version binary without the data.zip assets included. |
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 squash the commits as well please:
git reset HEAD^^^
git add pkgs/
git commit --amend --no-edit
git push .. .. --forcce
The PR adding |
can't that be done in all-packages.nix? vvvvvvFull = callPackage ../games/vvvvvv { fullGame = true }; |
here's the problem: the officially distributed data.zip is the same as the Make and Play Edition data.zip, they have the same hash. the only difference between these two versions of the game is the flags used to build the game. if -DMAKEANDPLAY is set then the game runs in the Make and Play mode. if the binary version is distributed with the make and play flag disabled, you can use the zip from the make and play version to play the game. therefore, if you have the full game, you must supply the zip yourself and the binary is built locally as it is not allowed to be redistributed. if you do not have the full game, you get the make and play binary which can be redistributed with the make and play zip (again, this is the same as the standard zip) |
Doesn't Github have an option to automatically do that when merging a pull request? |
Yes, but it doesn't follow the commit naming scheme used for nixpkgs. |
That problem (with the Make and Play edition using the same zip file) already exists:
The obvious solution is either not to fetch the data.zip in either case, or somehow change the hash of the data.zip file. |
This problem already exists outside nixpkgs though; anyone can take the publicly available source and the publicly available make and play edition data.zip, and compile a complete version of the game. |
Maybe have fetchurl rename the Make & Play data.zip so they have different hashes? |
We could also do |
Yep, this seems to work: 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;
sha256 = "0vnb4zyzp8jpayxrgs6mw98wxpcpqdcfx04j1g5s0hm378xwmxm6";
postFetch = "echo nixpkgs | ${zip}/bin/zip -z $out";
}; |
@TerryCavanagh The license only applies to the binaries, right? That would make this hack of adding a zip file comment to the Make & Play nix-env -iA nixos.vvvvvvFull # errors, no data.zip
nix-env -iA nixos.vvvvvv # downloads binaries and data.zip
nix-env -iA nixos.vvvvvvFull # succeeds, downloads binaries and uses data.zip already on system Adding a zip file comment while downloading
|
Actually, v2.3's release date got bumped to October 1st. The current master branch of the repository builds cleanly and has some substantial feature improvements over version 2.2. I'll bump the package to the latest revision and make the changes required to separate the full game and Make and Play Mode. |
Adds a package for VVVVVV, a platform game based on inverting gravity.
- changed version to be a date instead of a fragment of the commit id - quoted homepage url - if user does not own the full game, build the redistributable "make and play version" instead - using sourceRoot instead of manually changing directory
homepage = "https://thelettervsixtim.es"; | ||
license = if fullGame then licenses.unfree else licenses.unfreeRedistributable; | ||
maintainers = [ maintainers.dkudriavtsev ]; | ||
platforms = [ platforms.linux platforms.darwin ]; |
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.
this makes [[string]]
we want [string]
platforms = [ platforms.linux platforms.darwin ]; | |
platforms = platforms.linux ++ platforms.darwin; |
SDL2 SDL2_mixer | ||
] + stdenv.lib.optionalPlatform stdenv.lib.platforms.darwin [ Foundation ]; | ||
|
||
sourceRoot = "source/desktop_version"; |
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.
sourceRoot = "source/desktop_version"; | |
sourceRoot = "source/desktop_version"; |
nativeBuildInputs = [ cmake ninja ]; | ||
buildInputs = [ | ||
SDL2 SDL2_mixer | ||
] + stdenv.lib.optionalPlatform stdenv.lib.platforms.darwin [ Foundation ]; |
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.
optionalPlatform doesn't exist, i think you want
] + stdenv.lib.optionalPlatform stdenv.lib.platforms.darwin [ Foundation ]; | |
] + stdenv.lib.optionals stdenv.hostPlatform.isDarwin [ Foundation ]; |
}; | ||
|
||
# if the user does not own the full game, build the Make and Play edition | ||
flags = if fullGame then [] else [ "-DMAKEANDPLAY" ]; |
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.
flags = if fullGame then [] else [ "-DMAKEANDPLAY" ]; | |
flags = lib.optionals fullGame [ "-DMAKEANDPLAY" ]; |
''; | ||
} else fetchurl { | ||
# the data file for the free Make and Play edition | ||
url = https://thelettervsixtim.es/makeandplay/data.zip; |
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.
Is there a versioned link?
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.
No.
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.
data.zip
has never changed since it was first introduced in 2014. Due to compatibility and the fact that this is an 11-year-old game, it probably won't ever be changed either. (But new zips will probably be introduced.)
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.
Also please squash the commits together and address the reviewer feedback.
I plan on completely reworking this PR once 2.3 releases. |
I'm pretty sure that due to the |
Is there no way to have a license-restricted requireFile? |
@@ -24712,6 +24712,8 @@ in | |||
libpng = libpng12; | |||
}; | |||
|
|||
vvvvvv = callPackage ../games/vvvvvv { }; |
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.
vvvvvv = callPackage ../games/vvvvvv { }; | |
vvvvvv = callPackage ../games/vvvvvv { | |
inherit (darwin.apple_sdk.frameworks) Foundation; | |
}; |
I marked this as stale due to inactivity. → More info |
Still planning to work on this as soon as 2.3 releases. |
2.3.1 is released now |
Just saw this. I plan to work on this |
Closing because of lack of activity from the author. Please re-open if you plan to work on this. |
Adds a package for VVVVVV, a platform game based on inverting gravity.
Motivation for this change
Adds the game VVVVVV to nixpkgs.
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)Notes
Fixed version of #78319 which was broken after a bad merge into my nixpkgs fork.