-
-
Save obadz/8f621b6fc6e3efce949d8a21fa4c603c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/default.nix b/default.nix | |
index 75844cb..50394db 100644 | |
--- a/default.nix | |
+++ b/default.nix | |
@@ -1,22 +1,27 @@ | |
{ pkgs ? import <nixpkgs> {} }: | |
-pkgs.stdenv.mkDerivation { | |
+with pkgs; | |
+with stdenv.lib; | |
+ | |
+let | |
+ makeSDLCFlags = concatMap (p: [ "-I${getDev p}/include/SDL2" "-I${getDev p}/include" ]); | |
+ makeSDLDFlags = concatMap (p: [ "-L${getLib p}/lib" ]); | |
+ SDLlibs = [ SDL2 SDL2_image SDL2_mixer ]; | |
+ | |
+in pkgs.stdenv.mkDerivation { | |
name = "rainbow-joe-git"; | |
- src = pkgs.fetchFromGitHub { | |
- owner = "mupfelofen-de"; | |
- repo = "rainbow-joe"; | |
- rev = "68cd98ac0cdbeb8f78e650b13ae0efa5c726f56e"; | |
- sha256 = "0w1jbkshzxvphmis1gsb91v5qk1ckjdhcg1ywfhgbqw73s87vn2g"; | |
- }; | |
+ # src = pkgs.fetchFromGitHub { | |
+ # owner = "mupfelofen-de"; | |
+ # repo = "rainbow-joe"; | |
+ # rev = "68cd98ac0cdbeb8f78e650b13ae0efa5c726f56e"; | |
+ # sha256 = "0w1jbkshzxvphmis1gsb91v5qk1ckjdhcg1ywfhgbqw73s87vn2g"; | |
+ # }; | |
+ | |
+ src = ./.; | |
- buildInputs = with pkgs; [ | |
- libxml2 | |
- SDL2 | |
- SDL2_image | |
- SDL2_mixer | |
- zlib | |
- ]; | |
+ NIX_CFLAGS_COMPILE = (makeSDLCFlags SDLlibs) ++ [ "-I${getDev zlib}/include" "-I${getDev libxml2}/include/libxml2" ]; | |
+ NIX_CFLAGS_LINK = (makeSDLDFlags SDLlibs) ++ [ "-L${getLib zlib}/lib" "-L${getLib libxml2}/lib" "-L${getLib lzma}/lib" "-L${getLib icu}/lib" ]; | |
installPhase = '' | |
install -Dsm 755 rainbow-joe $out/bin/rainbow-joe |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment