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

frogatto: init at 0.0.2018-12-09 #52989

Merged
merged 11 commits into from Jan 2, 2019
Merged

frogatto: init at 0.0.2018-12-09 #52989

merged 11 commits into from Jan 2, 2019

Conversation

astro
Copy link
Contributor

@astro astro commented Dec 27, 2018

Motivation for this change

First time submission, please review thoroughly.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@worldofpeace
Copy link
Contributor

Here's some little things that needed correction

diff --git a/pkgs/games/frogatto/data.nix b/pkgs/games/frogatto/data.nix
index dc63b650d9c..273e8ef35cf 100644
--- a/pkgs/games/frogatto/data.nix
+++ b/pkgs/games/frogatto/data.nix
@@ -1,18 +1,16 @@
-{ stdenv, fetchFromGitHub,
-}:
-
-let
-  version = "0.0.2018-12-09";
-  source = fetchFromGitHub {
+{ stdenv, fetchFromGitHub }:
+  
+stdenv.mkDerivation rec {
+  pname = "frogatto-data";
+  version = "unstable-2018-12-18";
+  
+  src = fetchFromGitHub {
     owner = "frogatto";
     repo = "frogatto";
     # master branch as of 2018-12-18
     rev = "8f261b5d3fca3c88e6a534316a28378cf687d3e5";
     sha256 = "0nyfwfyy5gxp61ydna299nq9p5wra9mk0bf1drdngg6bwws1hrqx";
   };
-in stdenv.mkDerivation {
-  name = "frogatto-data-${version}";
-  src = source;
 
   installPhase = ''
     mkdir -p $out/share/frogatto/modules
diff --git a/pkgs/games/frogatto/default.nix b/pkgs/games/frogatto/default.nix
index f76d5723423..292314b9ced 100644
--- a/pkgs/games/frogatto/default.nix
+++ b/pkgs/games/frogatto/default.nix
@@ -15,9 +15,9 @@ let
     genericName = "frogatto";
     categories = "Application;Game;ArcadeGame;";
   };
-  version = "0.0.2018-12-09";
 in buildEnv rec {
   name = "frogatto-${version}";
+  version = "unstable-2018-12-18";
 
   buildInputs = [ makeWrapper ];
   paths = [ engine data desktopItem ];
@@ -34,8 +34,8 @@ in buildEnv rec {
   meta = with stdenv.lib; {
     homepage = https://frogatto.com;
     description = description;
-    license = [ licenses.cc-by-30 licenses.unfree ];
+    license = with licenses; [ cc-by-30 unfree ];
     platforms = platforms.linux;
-    maintainers = with stdenv.lib.maintainers; [ astro ];
+    maintainers = with maintainers; [ astro ];
   };
 }
diff --git a/pkgs/games/frogatto/engine.nix b/pkgs/games/frogatto/engine.nix
index f30ed82439f..c6a9aa485e2 100644
--- a/pkgs/games/frogatto/engine.nix
+++ b/pkgs/games/frogatto/engine.nix
@@ -3,20 +3,18 @@
   glew, zlib, icu, pkgconfig, cairo, libvpx,
 }:
 
-let
-  version = "0.0.2018-11-28";
-  source = fetchFromGitHub {
+stdenv.mkDerivation rec {
+  pname = "anura-engine";
+  version = "unstable-2018-11-28";
+
+  src = fetchFromGitHub {
     owner = "anura-engine";
     repo = "anura";
-    fetchSubmodules = true;
     # trunk branch as of 2018-11-28
     rev = "8070111467802dc772c0a6c7806ecd16b0bcdaa9";
     sha256 = "0xbqwfmws69n7iiz17n93h4jiw39cwyf7hxw0qi2c8cccr37b1nr";
+    fetchSubmodules = true;
   };
-in stdenv.mkDerivation {
-  name = "anura-${version}";
-
-  src = source;
 
   buildInputs = [
     bash
@@ -33,6 +31,7 @@ in stdenv.mkDerivation {
     cairo
     libvpx
   ];
+
   enableParallelBuilding = true;
 
   installPhase = ''
@@ -46,6 +45,6 @@ in stdenv.mkDerivation {
     description = "Game engine used by Frogatto";
     license = licenses.zlib;
     platforms = platforms.linux;
-    maintainers = with stdenv.lib.maintainers; [ astro ];
+    maintainers = with maintainers; [ astro ];
   };
 }

Main things were:

  • Make source the src
  • Use pname and version, also correct version
    When both those attributes exist they get combined into name.
    Also versions that are not a release are formatted like unstable-YYYY-MM-DD.

https://nixos.org/nixpkgs/manual/#sec-package-naming

@astro
Copy link
Contributor Author

astro commented Dec 29, 2018

@worldofpeace Thank you very much. I added your changes.

Should I squash into one commit immediately or do you prefer added commits for this PR's discussion?

@worldofpeace
Copy link
Contributor

worldofpeace commented Dec 29, 2018

@worldofpeace Thank you very much. I added your changes.

You're very welcome 😄

Should I squash into one commit immediately or do you prefer added commits for this PR's discussion?

I do prefer added commits for the discussion. Once we think it's mergeable we'll squash it back into one.

@worldofpeace
Copy link
Contributor

I think this is good 👍

Last comment for improvement would be that the data package and the engine aren't exposed in all-packages.nix. I think we should do this.

And if you do that be sure to add meta attributes to the data derivation. Also specify that it's just data files in the description.

@astro
Copy link
Contributor Author

astro commented Jan 1, 2019

Last comment for improvement would be that the data package and the engine aren't exposed in all-packages.nix. I think we should do this.

They are not?

And if you do that be sure to add meta attributes to the data derivation. Also specify that it's just data files in the description.

Ok

let
description = "Action-adventure game, starring a certain quixotic frog";
engine = callPackage ./engine.nix { };
data = callPackage ./data.nix { };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#52989 (comment)

These attributes are only accessible in this derivation.

You'd need move these to all-packages.nix like

anura-engine = callPackage ../games/frogatto/engine.nix { }; # remember alphabetical

 
frogatto-data = callPackage ../games/frogatto/data.nix { };

And then use that attribute in here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be ok, as frogatto seems to be its only user.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The engine in its current form would not be useful for other consumers of the engine anyway.

@Mic92
Copy link
Member

Mic92 commented Jan 2, 2019

@GrahamcOfBorg build frogato

@Mic92 Mic92 changed the title add games/frogatto frogatto: init at 0.0.2018-12-09 Jan 2, 2019
@Mic92
Copy link
Member

Mic92 commented Jan 2, 2019

@GrahamcOfBorg build frogatto

@Mic92 Mic92 merged commit 108588b into NixOS:master Jan 2, 2019
@astro astro deleted the frogatto branch January 2, 2019 11:54
@worldofpeace
Copy link
Contributor

@Mic92 The version was incorrect in the commit msg

Water off a ducks back now 😄

@Mic92
Copy link
Member

Mic92 commented Jan 3, 2019

close enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants