From 91184d159d000f74505eae336eeae5999e82b177 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Wed, 6 Jun 2018 17:05:02 -0400 Subject: [PATCH] dwarf-fortress: move themes to .json file This will make it easier to automate. --- pkgs/games/dwarf-fortress/default.nix | 12 ++-- pkgs/games/dwarf-fortress/themes/cla.nix | 33 --------- pkgs/games/dwarf-fortress/themes/default.nix | 25 +++++++ pkgs/games/dwarf-fortress/themes/phoebus.nix | 34 --------- pkgs/games/dwarf-fortress/themes/themes.json | 72 ++++++++++++++++++++ 5 files changed, 105 insertions(+), 71 deletions(-) delete mode 100644 pkgs/games/dwarf-fortress/themes/cla.nix create mode 100644 pkgs/games/dwarf-fortress/themes/default.nix delete mode 100644 pkgs/games/dwarf-fortress/themes/phoebus.nix create mode 100644 pkgs/games/dwarf-fortress/themes/themes.json diff --git a/pkgs/games/dwarf-fortress/default.nix b/pkgs/games/dwarf-fortress/default.nix index 82710256c631..ee2e442daa28 100644 --- a/pkgs/games/dwarf-fortress/default.nix +++ b/pkgs/games/dwarf-fortress/default.nix @@ -1,14 +1,14 @@ -{ pkgs, pkgsi686Linux, stdenv }: +{ pkgs, stdenv, stdenvNoCC, gccStdenv }: let callPackage = pkgs.newScope self; - callPackage_i686 = pkgsi686Linux.newScope self; self = rec { dwarf-fortress-original = callPackage ./game.nix { }; dfhack = callPackage ./dfhack { inherit (pkgs.perlPackages) XMLLibXML XMLLibXSLT; + stdenv = gccStdenv; }; soundSense = callPackage ./soundsense.nix { }; @@ -32,9 +32,13 @@ let dwarf-therapist = callPackage ./dwarf-therapist/wrapper.nix { }; - phoebus-theme = callPackage ./themes/phoebus.nix { }; + themes = callPackage ./themes { + stdenv = stdenvNoCC; + }; - cla-theme = callPackage ./themes/cla.nix { }; + phoebus-theme = themes.phoebus; + + cla-theme = themes.cla; }; in self diff --git a/pkgs/games/dwarf-fortress/themes/cla.nix b/pkgs/games/dwarf-fortress/themes/cla.nix deleted file mode 100644 index c7d85c48ce8e..000000000000 --- a/pkgs/games/dwarf-fortress/themes/cla.nix +++ /dev/null @@ -1,33 +0,0 @@ -{ stdenv, fetchFromGitHub }: - -# On upgrade check https://github.com/DFgraphics/CLA/blob/master/manifest.json -# for compatibility information. - -stdenv.mkDerivation rec { - name = "cla-theme-${version}"; - version = "44.xx-v25"; - - src = fetchFromGitHub { - owner = "DFgraphics"; - repo = "CLA"; - rev = version; - sha256 = "1h8nwa939qzqklbi8vwsq9p2brvv7sc0pbzzrdjnb221lr9p58zk"; - }; - - installPhase = '' - mkdir $out - cp -r data raw $out - ''; - - passthru.dfVersion = "0.44.09"; - - preferLocalBuild = true; - - meta = with stdenv.lib; { - description = "CLA graphics set for Dwarf Fortress"; - homepage = http://www.bay12forums.com/smf/index.php?topic=105376.0; - platforms = platforms.all; - maintainers = with maintainers; [ abbradar ]; - license = licenses.free; - }; -} diff --git a/pkgs/games/dwarf-fortress/themes/default.nix b/pkgs/games/dwarf-fortress/themes/default.nix new file mode 100644 index 000000000000..90f46d052618 --- /dev/null +++ b/pkgs/games/dwarf-fortress/themes/default.nix @@ -0,0 +1,25 @@ +{stdenv, lib, fetchFromGitHub}: + +with builtins; + +listToAttrs (map (v: { + inherit (v) name; + value = stdenv.mkDerivation { + name = "${v.name}-${v.version}"; + src = fetchFromGitHub { + owner = "DFgraphics"; + repo = v.name; + rev = v.version; + sha256 = v.sha256; + }; + installPhase = '' + mkdir -p $out + cp -r data raw $out + ''; + meta = with lib; { + platforms = platforms.all; + maintainers = [ maintainers.matthewbauer ]; + license = licenses.free; + }; + }; +}) (fromJSON (readFile ./themes.json))) diff --git a/pkgs/games/dwarf-fortress/themes/phoebus.nix b/pkgs/games/dwarf-fortress/themes/phoebus.nix deleted file mode 100644 index 8641e15fa864..000000000000 --- a/pkgs/games/dwarf-fortress/themes/phoebus.nix +++ /dev/null @@ -1,34 +0,0 @@ -{ stdenv, fetchFromGitHub }: - -# On upgrade check https://github.com/DFgraphics/Phoebus/blob/master/manifest.json -# for compatibility information. - -stdenv.mkDerivation rec { - name = "phoebus-theme-${version}"; - version = "44.07"; - - src = fetchFromGitHub { - owner = "DFgraphics"; - repo = "Phoebus"; - rev = version; - sha256 = "114yc0s7j57i4rq6iq295gggbgzx4qb389xip8lkzfg4dnp6klns"; - }; - - installPhase = '' - mkdir $out - cp -r data raw $out - ''; - - passthru.dfVersion = "0.44.09"; - - preferLocalBuild = true; - - meta = with stdenv.lib; { - description = "Phoebus graphics set for Dwarf Fortress"; - homepage = http://www.bay12forums.com/smf/index.php?topic=137096.0; - platforms = platforms.all; - maintainers = with maintainers; [ a1russell abbradar ]; - # https://github.com/fricy/Phoebus/issues/5 - license = licenses.free; - }; -} diff --git a/pkgs/games/dwarf-fortress/themes/themes.json b/pkgs/games/dwarf-fortress/themes/themes.json new file mode 100644 index 000000000000..f2cc4ed3ac7d --- /dev/null +++ b/pkgs/games/dwarf-fortress/themes/themes.json @@ -0,0 +1,72 @@ +[ + { + "name": "taffer", + "version": "44.10a", + "sha256": "0gp8hmv55bp34db0caksdpd3kn2glh7sz03gyxknzdymh1cpy0qv" + }, + { + "name": "spacefox", + "version": "44.10a", + "sha256": "0ngipq1aha8cd34k4hkrfbi238gp36qpymr2f87d3nwbj2vi9hmh" + }, + { + "name": "gemset", + "version": "44.10a", + "sha256": "14q69dyqzhxsfv1a4vh17fx7r7mylfimmjrydz6ygdypblgc9zm6" + }, + { + "name": "wanderlust", + "version": "44.10", + "sha256": "016acv0ab2wj4rn9slhbf626977zas6q4372f7avaf99ihcmwi85" + }, + { + "name": "rally-ho", + "version": "44.10", + "sha256": "1pij5llnc8hfsqgyrwj1ak123wxhhk7yhlpnj033gwbpp0lnqz2x" + }, + { + "name": "phoebus", + "version": "44.10", + "sha256": "1fvl5251wzjns159snhw01p214k53vpdlyj7piv545r23q7wg2ji" + }, + { + "name": "obsidian", + "version": "44.10", + "sha256": "06lixlkprjd829zn10g5zljnxymsh81g31dj86hn2jvlch4dh98q" + }, + { + "name": "mayday", + "version": "44.10", + "sha256": "1g15ha0w93iyj5ni2pavhwrsckhnw80xvwrvw4dbp5zx1y41f3x9" + }, + { + "name": "jolly-bastion", + "version": "44.10", + "sha256": "038qvr08776rinlqa6zwb8qqxyrc75nnyyqjsasr2rf9d2f9yf8j" + }, + { + "name": "ironhand", + "version": "44.10", + "sha256": "14hngixd4gkw0lzqzlkj9ljmrxr8b3wgjk67n6zysgyi3f38f5j2" + }, + { + "name": "afro-graphics", + "version": "44.10", + "sha256": "050mrpy9q6g9y4133al7rdsj6c9hy2wva7jqmc56babvmmcpcc2j" + }, + { + "name": "cla", + "version": "44.xx-v25", + "sha256": "1h8nwa939qzqklbi8vwsq9p2brvv7sc0pbzzrdjnb221lr9p58zk" + }, + { + "name": "tergel", + "version": "44.03", + "sha256": "1kgk0cav5b6v7mca36gm84b2p556ibd8yy4rwbfc4i6i3hlsdw07" + }, + { + "name": "autoreiv", + "version": "44.03", + "sha256": "03w9dp42718p5gnswynw3p9wz85y61gkzz60jf71arw1zhf23wm0" + } +]