From ad371aaef9e8e22aeb55d364e7d7989dd0d664b9 Mon Sep 17 00:00:00 2001
From: Tuomas Tynkkynen <tuomas@tuxera.com>
Date: Sun, 28 Aug 2016 17:56:16 +0300
Subject: [PATCH 1/5] docbook_xml_dtd_*: Add meta.platforms

---
 pkgs/data/sgml+xml/schemas/xml-dtd/docbook/generic.nix | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/pkgs/data/sgml+xml/schemas/xml-dtd/docbook/generic.nix b/pkgs/data/sgml+xml/schemas/xml-dtd/docbook/generic.nix
index 29a18f4ce69..fc3c4c3c841 100644
--- a/pkgs/data/sgml+xml/schemas/xml-dtd/docbook/generic.nix
+++ b/pkgs/data/sgml+xml/schemas/xml-dtd/docbook/generic.nix
@@ -3,7 +3,11 @@
 assert unzip != null;
 
 stdenv.mkDerivation {
-  inherit src name postInstall meta;
+  inherit src name postInstall;
   builder = ./builder.sh;
   buildInputs = [unzip];
+
+  meta = meta // {
+    platforms = stdenv.lib.platforms.unix;
+  };
 }

From ff9491917f833beb80414380d35c07f9826b6476 Mon Sep 17 00:00:00 2001
From: Tuomas Tynkkynen <tuomas@tuxera.com>
Date: Sun, 28 Aug 2016 17:56:31 +0300
Subject: [PATCH 2/5] stdenv: Add platforms

---
 pkgs/stdenv/generic/default.nix | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/pkgs/stdenv/generic/default.nix b/pkgs/stdenv/generic/default.nix
index b2891030728..cf7894fc005 100644
--- a/pkgs/stdenv/generic/default.nix
+++ b/pkgs/stdenv/generic/default.nix
@@ -274,7 +274,10 @@ let
 
     // rec {
 
-      meta.description = "The default build environment for Unix packages in Nixpkgs";
+      meta = {
+        description = "The default build environment for Unix packages in Nixpkgs";
+        platforms = lib.platforms.all;
+      };
 
       # Utility flags to test the type of platform.
       isDarwin = system == "x86_64-darwin";

From d1c7eb80982544f553afcf45bd93c3b4b6e56926 Mon Sep 17 00:00:00 2001
From: Tuomas Tynkkynen <tuomas@tuxera.com>
Date: Sun, 28 Aug 2016 17:57:17 +0300
Subject: [PATCH 3/5] glibc: Uncomment 'meta.platforms'

---
 pkgs/development/libraries/glibc/common.nix | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pkgs/development/libraries/glibc/common.nix b/pkgs/development/libraries/glibc/common.nix
index d7e91642342..3ee9d2289ac 100644
--- a/pkgs/development/libraries/glibc/common.nix
+++ b/pkgs/development/libraries/glibc/common.nix
@@ -181,6 +181,6 @@ stdenv.mkDerivation ({
     license = lib.licenses.lgpl2Plus;
 
     maintainers = [ lib.maintainers.eelco ];
-    #platforms = lib.platforms.linux;
+    platforms = lib.platforms.linux;
   } // meta;
 })

From 43f576ea1932cda03732a252f34fcca57f843fcb Mon Sep 17 00:00:00 2001
From: Tuomas Tynkkynen <tuomas@tuxera.com>
Date: Sun, 28 Aug 2016 18:03:41 +0300
Subject: [PATCH 4/5] mesa: Add meta.platforms

---
 pkgs/top-level/all-packages.nix | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 6fe5968391e..7241c39fecf 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -8783,6 +8783,9 @@ in
   mesa = mesaDarwinOr (buildEnv {
     name = "mesa-${mesa_noglu.version}";
     paths = [ mesa_noglu.dev mesa_noglu.out mesa_glu ];
+    meta = {
+      platforms = lib.platforms.unix;
+    };
   });
 
   meterbridge = callPackage ../applications/audio/meterbridge { };

From 3cd4808e7d4ca1531ccc86bf0af851d950f41a5b Mon Sep 17 00:00:00 2001
From: Tuomas Tynkkynen <tuomas@tuxera.com>
Date: Sun, 28 Aug 2016 18:05:42 +0300
Subject: [PATCH 5/5] release.nix: Remove lots of explicit package jobs

These are all obsolete since for a long time, the meta.platforms fields
have been used to automatically create the Hydra jobs.
---
 pkgs/top-level/release.nix | 171 -------------------------------------
 1 file changed, 171 deletions(-)

diff --git a/pkgs/top-level/release.nix b/pkgs/top-level/release.nix
index 6abb73491cc..7bb097b3530 100644
--- a/pkgs/top-level/release.nix
+++ b/pkgs/top-level/release.nix
@@ -85,184 +85,13 @@ let
 
     } // (mapTestOn ((packagePlatforms pkgs) // rec {
 
-      # TODO: most (but possibly not all) of the jobs specified here are unnecessary now that we have release-lib.nix
-      # traversing all packages and looking at their meta.platform attributes. Someone who's better at this than I am
-      # should go through these and kill the ones that are safe to kill.
-      #
-      # <niksnut> note that all that " = linux" stuff in release.nix is legacy, from before we had meta.platforms
-      # <copumpkin> niksnut: so should I just kill all the obsolete jobs in release.nix?
-      # <niksnut> I don't know if they're all covered
-      abcde = linux;
-      aspell = all;
-      atlas = linux;
-      bazaar = linux; # first let sqlite3 work on darwin
-      binutils = linux;
-      bind = linux;
-      bvi = all;
-      cdrkit = linux;
-      classpath = linux;
-      ddrescue = linux;
-      dhcp = linux;
-      dico = linux;
-      diffutils = all;
-      disnix = all;
-      disnixos = linux;
-      DisnixWebService = linux;
-      docbook5 = all;
-      docbook5_xsl = all;
-      docbook_xml_dtd_42 = all;
-      docbook_xml_dtd_43 = all;
-      docbook_xsl = all;
-      dosbox = linux;
-      dovecot = linux;
-      doxygen = linux;
-      drgeo = linux;
-      ejabberd = linux;
-      elinks = linux;
-      eprover = linux;
-      expect = linux;
-      exult = linux;
-      flex = all;
-      fontforge = linux;
-      gajim = linux;
-      gawk = all;
-      gcc = linux;
-      gcj = linux;
-      ghostscript = linux;
-      ghostscriptX = linux;
-      glibc = linux;
-      glibcLocales = linux;
-      glxinfo = linux;
-      gnum4 = all;
-      gnupg = linux;
-      gnuplot = allBut cygwin;
-      gnutls = linux;
-      gogoclient = linux;
-      gphoto2 = linux;
-      gpscorrelate = linux;
-      gqview = gtkSupported;
-      gsl = linux;
-      guile = linux;  # tests fail on Cygwin
-      html-tidy = all;
-      icewm = linux;
-      inkscape = linux;
-      irssi = linux;
-      jnettop = linux;
-      keen4 = ["i686-linux"];
-      lftp = all;
-      libarchive = linux;
-      libtool = all;
-      libtool_2 = all;
-      lout = linux;
-      lsof = linux;
-      ltrace = linux;
-      lynx = linux;
-      lzma = linux;
-      man = linux;
-      man-pages = linux;
-      maxima = linux;
-      mc = linux;
-      mcabber = linux;
-      mcron = linux;
-      mdadm = linux;
-      mercurial = unix;
-      mercurialFull = linux;
-      mesa = mesaPlatforms;
-      mk = linux;
-      mktemp = all;
-      mod_python = linux;
-      mupen64plus = linux;
-      mutt = linux;
-      nano = allBut cygwin;
-      netcat = all;
-      nss_ldap = linux;
-      nssmdns = linux;
-      ocaml = linux;
-      pciutils = linux;
-      pdf2xml = all;
-      php = linux;
-      pltScheme = linux;
-      pmccabe = linux;
-      ppl = all;
-      procps = linux;
-      pygtk = linux;
-      python = allBut cygwin;
-      pythonFull = linux;
-      sbcl = linux;
-      qt3 = linux;
-      qt4_clang = ["i686-linux"];
-      quake3demo = linux;
-      reiserfsprogs = linux;
-      rubber = allBut cygwin;
-      rxvt_unicode = linux;
-      scrot = linux;
-      sdparm = linux;
-      seccure = linux;
-      sgtpuzzles = linux;
-      sloccount = allBut cygwin;
-      spidermonkey = linux;
-      squid = linux;
-      ssmtp = linux;
-      stdenv = all;
-      stlport = linux;
-      superTuxKart = linux;
-      swig = linux;
-      tahoelafs = linux;
-      tangogps = linux;
-      tcl = linux;
-      teeworlds = linux;
-      tightvnc = linux;
-      time = linux;
-      tinycc = linux;
-      uae = linux;
-      viking = linux;
-      vice = linux;
-      vimHugeX = linux;
-      vncrec = linux;
-      vorbis-tools = linux;
-      vsftpd = linux;
-      w3m = all;
-      weechat = linux;
-      wicd = linux;
-      wine = ["i686-linux"];
-      wirelesstools = linux;
-      wxGTK = linux;
-      x11_ssh_askpass = linux;
-      xchm = linux;
-      xfig = x11Supported;
-      xfsprogs = linux;
-      xineUI = linux;
-      xkeyboard_config = linux;
-      xlockmore = linux;
-      xpdf = linux;
-      xscreensaver = linux;
-      xsel = linux;
-      xterm = linux;
-      zdelta = linux;
-      zsh = linux;
-      zsnes = ["i686-linux"];
-
       #emacs24PackagesNg = packagePlatforms pkgs.emacs24PackagesNg;
 
-      gnome = {
-        gnome_panel = linux;
-        metacity = linux;
-        gnome_vfs = linux;
-      };
-
       haskell.compiler = packagePlatforms pkgs.haskell.compiler;
       haskellPackages = packagePlatforms pkgs.haskellPackages;
 
       #rPackages = packagePlatforms pkgs.rPackages;
 
-      strategoPackages = {
-        sdf = linux;
-        strategoxt = linux;
-        javafront = linux;
-        strategoShell = linux ++ darwin;
-        dryad = linux;
-      };
-
       ocamlPackages = { };
 
       perlPackages = { };