From 4a6c33d2ba7d7b6d51085fa5e976f1b61d87bc44 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Sun, 19 Sep 2021 16:47:31 +0200 Subject: [PATCH 1/2] stuntrally: switch to fetchFromGitHub --- pkgs/games/stuntrally/default.nix | 57 ++++++++++++++++++++++--------- 1 file changed, 41 insertions(+), 16 deletions(-) diff --git a/pkgs/games/stuntrally/default.nix b/pkgs/games/stuntrally/default.nix index bf9e034d7b4a..64e2dcc379b1 100644 --- a/pkgs/games/stuntrally/default.nix +++ b/pkgs/games/stuntrally/default.nix @@ -1,34 +1,59 @@ -{ lib, fetchurl, stdenv, cmake, boost, ogre, mygui, ois, SDL2, libvorbis, pkg-config -, makeWrapper, enet, libXcursor, bullet, openal }: +{ lib +, fetchFromGitHub +, stdenv +, cmake +, boost +, ogre +, mygui +, ois +, SDL2 +, libvorbis +, pkg-config +, makeWrapper +, enet +, libXcursor +, bullet +, openal +}: stdenv.mkDerivation rec { pname = "stunt-rally"; version = "2.6.1"; - src = fetchurl { - url = "https://github.com/stuntrally/stuntrally/archive/${version}.tar.gz"; - sha256 = "1zxq3x2g9pzafa2awx9jzqd33z6gnqj231cs07paxzrm89y51w4v"; + src = fetchFromGitHub { + owner = "stuntrally"; + repo = "stuntrally"; + rev = version; + hash = "sha256-1+Cc9I6TTa3b++/7Z2V+vAXcmFb2+wX7TnXEH6CRDWU="; }; - - tracks = fetchurl { - url = "https://github.com/stuntrally/tracks/archive/${version}.tar.gz"; - sha256 = "0x6lgpa4c2grl0vrhqrcs7jcysa3mmvpdl1v5xa0dsf6vkvfr0zs"; + tracks = fetchFromGitHub { + owner = "stuntrally"; + repo = "tracks"; + rev = version; + hash = "sha256-FbZc87j/9cp4LxNaEO2wNTvwk1Aq/IWcKD3rTGkzqj0="; }; # include/OGRE/OgreException.h:265:126: error: invalid conversion from # 'int' to 'Ogre::Exception::ExceptionCodes' [-fpermissive] - NIX_CFLAGS_COMPILE="-fpermissive"; + NIX_CFLAGS_COMPILE = "-fpermissive"; preConfigure = '' - pushd data - tar xf ${tracks} - mv tracks-${version} tracks - popd + ln -s ${tracks} data/tracks ''; nativeBuildInputs = [ cmake pkg-config ]; - buildInputs = [ boost ogre mygui ois SDL2 libvorbis - makeWrapper enet libXcursor bullet openal + buildInputs = [ + boost + ogre + mygui + ois + SDL2 + libvorbis + makeWrapper + enet + libXcursor + bullet + openal ]; meta = with lib; { From 4226cedf26c6d1bb24523fbfced700c8906ed126 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Sun, 19 Sep 2021 16:48:02 +0200 Subject: [PATCH 2/2] uqm-3dovideo: switch to fetchFromGitHub --- pkgs/games/uqm/3dovideo.nix | 12 +++++++----- pkgs/games/uqm/default.nix | 4 ++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/pkgs/games/uqm/3dovideo.nix b/pkgs/games/uqm/3dovideo.nix index 4ebbc9c49923..2281688949c8 100644 --- a/pkgs/games/uqm/3dovideo.nix +++ b/pkgs/games/uqm/3dovideo.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, requireFile, writeText, fetchurl, haskellPackages }: +{ stdenv, lib, requireFile, writeText, fetchFromGitHub, haskellPackages }: let makeSpin = num: let @@ -13,13 +13,15 @@ let slides.intro = 3DOVID:addons/3dovideo/intro/intro.duk '' + lib.concatMapStrings makeSpin (lib.range 0 24)); - helper = with haskellPackages; mkDerivation { + helper = with haskellPackages; mkDerivation rec { pname = "uqm3donix"; version = "0.1.0.0"; - src = fetchurl { - url = "https://github.com/aszlig/uqm3donix/archive/v0.1.0.0.tar.gz"; - sha256 = "0d40gpc3bqkw68varjxwgbdzxw0dvwqksijmvij5ixmlcspbjgvb"; + src = fetchFromGitHub { + owner = "aszlig"; + repo = "uqm3donix"; + rev = "v${version}"; + hash = "sha256-rK30u2PBysiSGSA9829F1Nom/wtoVN6rGTBneRKeWEw="; }; isLibrary = false; diff --git a/pkgs/games/uqm/default.nix b/pkgs/games/uqm/default.nix index a06c1b3b6652..5b67b9bce94e 100644 --- a/pkgs/games/uqm/default.nix +++ b/pkgs/games/uqm/default.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, fetchurl, pkg-config, libGLU, libGL +{ stdenv, lib, fetchurl, fetchFromGitHub, pkg-config, libGLU, libGL , SDL, SDL_image, libpng, libvorbis, libogg, libmikmod , use3DOVideos ? false, requireFile ? null, writeText ? null @@ -12,7 +12,7 @@ assert use3DOVideos -> requireFile != null && writeText != null let videos = import ./3dovideo.nix { - inherit stdenv lib requireFile writeText fetchurl haskellPackages; + inherit stdenv lib requireFile writeText fetchFromGitHub haskellPackages; }; remixPacks = lib.imap1 (num: sha256: fetchurl rec {