summary refs log tree commit diff
path: root/pkgs/games/uqm
diff options
context:
space:
mode:
authoraszlig <aszlig@nix.build>2017-11-07 22:42:54 +0100
committeraszlig <aszlig@nix.build>2017-11-08 05:55:35 +0100
commit3429d8cbbfd5cb15ab57ee1bbd173411fbee7328 (patch)
tree211661c6016661bcf45535cc3644d57b39718136 /pkgs/games/uqm
parent6b1161ebc01c094b578c1612da4a9721c700ec80 (diff)
downloadnixpkgs-3429d8cbbfd5cb15ab57ee1bbd173411fbee7328.tar
nixpkgs-3429d8cbbfd5cb15ab57ee1bbd173411fbee7328.tar.gz
nixpkgs-3429d8cbbfd5cb15ab57ee1bbd173411fbee7328.tar.bz2
nixpkgs-3429d8cbbfd5cb15ab57ee1bbd173411fbee7328.tar.lz
nixpkgs-3429d8cbbfd5cb15ab57ee1bbd173411fbee7328.tar.xz
nixpkgs-3429d8cbbfd5cb15ab57ee1bbd173411fbee7328.tar.zst
nixpkgs-3429d8cbbfd5cb15ab57ee1bbd173411fbee7328.zip
uqm: Clean up package expression style
The only functional change here is that I've dropped unzip, because that
dependency doesn't seem to be necessary at all. Despite the broken build
state I've tried building and running The Ur-Quan Masters with an older
nixpkgs revision and it works fine.

Other than that there are no references in the source code for unzip
except in the binary installer and some of the INSTALL files.

The reason why I'm removing the "with pkgs.lib;" is that it makes it
easier to quickly check for errors with "nix-instantiate --parse".

Signed-off-by: aszlig <aszlig@nix.build>
Cc: @jcumming
Diffstat (limited to 'pkgs/games/uqm')
-rw-r--r--pkgs/games/uqm/3dovideo.nix7
-rw-r--r--pkgs/games/uqm/default.nix43
2 files changed, 24 insertions, 26 deletions
diff --git a/pkgs/games/uqm/3dovideo.nix b/pkgs/games/uqm/3dovideo.nix
index ca5a1197a32..0eb6e02eac5 100644
--- a/pkgs/games/uqm/3dovideo.nix
+++ b/pkgs/games/uqm/3dovideo.nix
@@ -41,9 +41,10 @@ in stdenv.mkDerivation {
     sha256 = "044h0cl69r0kc43vk4n0akk0prwzb7inq324h5yfqb38sd4zkds1";
     message = ''
       In order to get the intro and ending sequences from the 3DO version, you
-      need to have the original 3DO Star Control II CD. Create an image from the
-      CD and use uqm3donix* to extract a tarball with the videos from it. The
-      reason for this is because the 3DO uses its own proprietary disk format.
+      need to have the original 3DO Star Control II CD. Create an image from
+      the CD and use uqm3donix* to extract a tarball with the videos from it.
+      The reason for this is because the 3DO uses its own proprietary disk
+      format.
 
       Save the file as videos.tar and use "nix-prefetch-url file://${name}" to
       add it to the Nix store.
diff --git a/pkgs/games/uqm/default.nix b/pkgs/games/uqm/default.nix
index c6f4b57a033..22a0418d4ca 100644
--- a/pkgs/games/uqm/default.nix
+++ b/pkgs/games/uqm/default.nix
@@ -1,6 +1,5 @@
-{ stdenv, fetchurl
-, pkgconfig, mesa
-, SDL, SDL_image, libpng, zlib, libvorbis, libogg, libmikmod, unzip
+{ stdenv, lib, fetchurl, pkgconfig, mesa
+, SDL, SDL_image, libpng, zlib, libvorbis, libogg, libmikmod
 
 , use3DOVideos ? false, requireFile ? null, writeText ? null
 , haskellPackages ? null
@@ -11,14 +10,12 @@
 assert use3DOVideos -> requireFile != null && writeText != null
                     && haskellPackages != null;
 
-with stdenv.lib;
-
 let
   videos = import ./3dovideo.nix {
     inherit stdenv requireFile writeText fetchurl haskellPackages;
   };
 
-  remixPacks = imap1 (num: sha256: fetchurl rec {
+  remixPacks = lib.imap1 (num: sha256: fetchurl rec {
     name = "uqm-remix-disc${toString num}.uqm";
     url = "mirror://sourceforge/sc2/${name}";
     inherit sha256;
@@ -53,14 +50,13 @@ in stdenv.mkDerivation rec {
     sha256 = "10nbvcrr0lc0mxivxfkcbxnibwk3vwmamabrlvwdsjxd9pk8aw65";
   };
 
-
- /* uses pthread_cancel(), which requires libgcc_s.so.1 to be
-    loadable at run-time. Adding the flag below ensures that the
-    library can be found. Obviously, though, this is a hack. */
-  NIX_LDFLAGS="-lgcc_s";
+  /* uses pthread_cancel(), which requires libgcc_s.so.1 to be
+     loadable at run-time. Adding the flag below ensures that the
+     library can be found. Obviously, though, this is a hack. */
+  NIX_LDFLAGS = "-lgcc_s";
 
   nativeBuildInputs = [ pkgconfig ];
-  buildInputs = [SDL SDL_image libpng libvorbis libogg libmikmod unzip mesa];
+  buildInputs = [ SDL SDL_image libpng libvorbis libogg libmikmod mesa ];
 
   postUnpack = ''
     mkdir -p uqm-${version}/content/packages
@@ -68,15 +64,14 @@ in stdenv.mkDerivation rec {
     ln -s "$content" "uqm-${version}/content/packages/uqm-0.7.0-content.uqm"
     ln -s "$music" "uqm-${version}/content/addons/uqm-0.7.0-3domusic.uqm"
     ln -s "$voice" "uqm-${version}/content/addons/uqm-0.7.0-voice.uqm"
-  '' + optionalString useRemixPacks (concatMapStrings (disc: ''
+  '' + lib.optionalString useRemixPacks (lib.concatMapStrings (disc: ''
     ln -s "${disc}" "uqm-$version/content/addons/${disc.name}"
-  '') remixPacks) + optionalString use3DOVideos ''
+  '') remixPacks) + lib.optionalString use3DOVideos ''
     ln -s "${videos}" "uqm-${version}/content/addons/3dovideo"
   '';
 
-  /* uqm has a 'unique' build system with a root script incidentally called
- * 'build.sh'. */
-
+  # uqm has a 'unique' build system with a root script incidentally called
+  # 'build.sh'.
   configurePhase = ''
     echo "INPUT_install_prefix_VALUE='$out'" >> config.state
     echo "INPUT_install_bindir_VALUE='$out/bin'" >> config.state
@@ -97,14 +92,16 @@ in stdenv.mkDerivation rec {
   meta = {
     description = "Remake of Star Control II";
     longDescription = ''
-    The goals for the The Ur-Quan Masters project are:
-      - to bring Star Control II to modern platforms, thereby making a lot of people happy
-      - to make game translations easy, thereby making even more people happy
-      - to adapt the code so that people can more easily make their own spin-offs, thereby making zillions more people happy!
+      The goals for the The Ur-Quan Masters project are:
+        - to bring Star Control II to modern platforms, thereby making a lot of
+          people happy
+        - to make game translations easy, thereby making even more people happy
+        - to adapt the code so that people can more easily make their own
+          spin-offs, thereby making zillions more people happy!
     '';
     homepage = http://sc2.sourceforge.net/;
     license = stdenv.lib.licenses.gpl2;
-    maintainers = with maintainers; [ jcumming aszlig ];
-    platforms = with platforms; linux;
+    maintainers = with lib.maintainers; [ jcumming aszlig ];
+    platforms = with lib.platforms; linux;
   };
 }