superTuxKart: use assets directly from download
This saves ~600MiB per STK build, as long as the assets remain the same.
This commit is contained in:
parent
32e4d072a0
commit
f62e2b24c3
|
@ -1,9 +1,15 @@
|
||||||
{ stdenv, fetchFromGitHub, fetchsvn, cmake, pkgconfig
|
{ stdenv, fetchFromGitHub, fetchsvn, cmake, pkgconfig, makeWrapper
|
||||||
, openal, freealut, libGLU, libGL, libvorbis, libogg, gettext, curl, freetype
|
, openal, freealut, libGLU, libGL, libvorbis, libogg, gettext, curl, freetype
|
||||||
, fribidi, libtool, bluez, libjpeg, libpng, zlib, libX11, libXrandr, enet, harfbuzz }:
|
, fribidi, libtool, bluez, libjpeg, libpng, zlib, libX11, libXrandr, enet, harfbuzz }:
|
||||||
|
|
||||||
let
|
let
|
||||||
dir = "stk-code";
|
dir = "stk-code";
|
||||||
|
assets = fetchsvn {
|
||||||
|
url = "https://svn.code.sf.net/p/supertuxkart/code/stk-assets";
|
||||||
|
rev = "18212";
|
||||||
|
sha256 = "1dyj8r5rfifhnhayga8w8irkpa99vw57xjmy74cp8xz8g7zvdzqf";
|
||||||
|
name = "stk-assets";
|
||||||
|
};
|
||||||
|
|
||||||
in stdenv.mkDerivation rec {
|
in stdenv.mkDerivation rec {
|
||||||
pname = "supertuxkart";
|
pname = "supertuxkart";
|
||||||
|
@ -17,15 +23,9 @@ in stdenv.mkDerivation rec {
|
||||||
sha256 = "01vxxl94583ixswzmi4caz8dk64r56pn3zxh7v63zml60yfvxbvp";
|
sha256 = "01vxxl94583ixswzmi4caz8dk64r56pn3zxh7v63zml60yfvxbvp";
|
||||||
name = dir;
|
name = dir;
|
||||||
})
|
})
|
||||||
(fetchsvn {
|
|
||||||
url = "https://svn.code.sf.net/p/supertuxkart/code/stk-assets";
|
|
||||||
rev = "18212";
|
|
||||||
sha256 = "1dyj8r5rfifhnhayga8w8irkpa99vw57xjmy74cp8xz8g7zvdzqf";
|
|
||||||
name = "stk-assets";
|
|
||||||
})
|
|
||||||
];
|
];
|
||||||
|
|
||||||
nativeBuildInputs = [ cmake gettext libtool pkgconfig ];
|
nativeBuildInputs = [ cmake gettext libtool pkgconfig makeWrapper ];
|
||||||
|
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
libX11 libXrandr
|
libX11 libXrandr
|
||||||
|
@ -38,8 +38,14 @@ in stdenv.mkDerivation rec {
|
||||||
cmakeFlags = [
|
cmakeFlags = [
|
||||||
"-DBUILD_RECORDER=OFF" # libopenglrecorder is not in nixpkgs
|
"-DBUILD_RECORDER=OFF" # libopenglrecorder is not in nixpkgs
|
||||||
"-DUSE_SYSTEM_ANGELSCRIPT=OFF" # doesn't work with 2.31.2 or 2.32.0
|
"-DUSE_SYSTEM_ANGELSCRIPT=OFF" # doesn't work with 2.31.2 or 2.32.0
|
||||||
|
"-DCHECK_ASSETS=OFF"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
# Obtain the assets directly from the fetched store path, to avoid duplicating assets across multiple engine builds
|
||||||
|
preFixup = ''
|
||||||
|
wrapProgram $out/bin/supertuxkart --set-default SUPERTUXKART_ASSETS_DIR "${assets}"
|
||||||
|
'';
|
||||||
|
|
||||||
sourceRoot = dir;
|
sourceRoot = dir;
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
|
|
Loading…
Reference in New Issue