about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Hoeg <peter@hoeg.com>2018-05-10 14:09:15 +0800
committerPeter Hoeg <peter@hoeg.com>2018-05-10 23:11:37 +0800
commit06e394bbb451d7cd35dd3576216a8f2fb5cfdbf4 (patch)
tree8ed5878520b34e7521f2270079dd27317b9ea6c3
parent1d9330d63a5a30f4eb578eda7840be7b11ec6277 (diff)
downloadnixlib-06e394bbb451d7cd35dd3576216a8f2fb5cfdbf4.tar
nixlib-06e394bbb451d7cd35dd3576216a8f2fb5cfdbf4.tar.gz
nixlib-06e394bbb451d7cd35dd3576216a8f2fb5cfdbf4.tar.bz2
nixlib-06e394bbb451d7cd35dd3576216a8f2fb5cfdbf4.tar.lz
nixlib-06e394bbb451d7cd35dd3576216a8f2fb5cfdbf4.tar.xz
nixlib-06e394bbb451d7cd35dd3576216a8f2fb5cfdbf4.tar.zst
nixlib-06e394bbb451d7cd35dd3576216a8f2fb5cfdbf4.zip
ansible: update point releases and unify build
1) We had lots of copy paste - instead use a generic builder for the various reasons.

2) Default version changed to latest (2.5 instead of 2.4)

3) Point release updates to all
-rw-r--r--pkgs/tools/admin/ansible/2.1.nix55
-rw-r--r--pkgs/tools/admin/ansible/2.2.nix57
-rw-r--r--pkgs/tools/admin/ansible/2.3.nix40
-rw-r--r--pkgs/tools/admin/ansible/2.4.nix40
-rw-r--r--pkgs/tools/admin/ansible/2.5.nix40
-rw-r--r--pkgs/tools/admin/ansible/default.nix82
-rw-r--r--pkgs/top-level/all-packages.nix15
7 files changed, 90 insertions, 239 deletions
diff --git a/pkgs/tools/admin/ansible/2.1.nix b/pkgs/tools/admin/ansible/2.1.nix
deleted file mode 100644
index b8b335bd6186..000000000000
--- a/pkgs/tools/admin/ansible/2.1.nix
+++ /dev/null
@@ -1,55 +0,0 @@
-{ stdenv
-, fetchurl
-, fetchFromGitHub
-, pythonPackages
-, windowsSupport ? false
-}:
-
-with pythonPackages;
-
-let
-  jinja = jinja2.overridePythonAttrs (old: rec {
-    version = "2.8.1";
-    name = "${old.pname}-${version}";
-    src = fetchFromGitHub {
-      owner = "pallets";
-      repo = "jinja";
-      rev = version;
-      sha256 = "0m6g6fx6flxb6hrkw757mbx1gxyrmj50w27m2afdsvmvz0zpdi2a";
-    };
-  });
-in buildPythonPackage rec {
-  pname = "ansible";
-  version = "2.1.4.0";
-  name = "${pname}-${version}";
-
-
-  src = fetchurl {
-    url = "http://releases.ansible.com/ansible/${name}.tar.gz";
-    sha256 = "05nc68900qrzqp88970j2lmyvclgrjki66xavcpzyzamaqrh7wg9";
-  };
-
-  prePatch = ''
-    sed -i "s,/usr/,$out," lib/ansible/constants.py
-  '';
-
-  doCheck = false;
-  dontStrip = true;
-  dontPatchELF = true;
-  dontPatchShebangs = false;
-
-  propagatedBuildInputs = [
-    pycrypto paramiko jinja pyyaml httplib2 boto six netaddr dnspython
-  ] ++ stdenv.lib.optional windowsSupport pywinrm;
-
-  meta = with stdenv.lib; {
-    homepage = http://www.ansible.com;
-    description = "A simple automation tool";
-    license = with licenses; [ gpl3] ;
-    maintainers = with maintainers; [
-      jgeerds
-      joamaki
-    ];
-    platforms = with platforms; linux ++ darwin;
-  };
-}
diff --git a/pkgs/tools/admin/ansible/2.2.nix b/pkgs/tools/admin/ansible/2.2.nix
deleted file mode 100644
index ccca64b86b64..000000000000
--- a/pkgs/tools/admin/ansible/2.2.nix
+++ /dev/null
@@ -1,57 +0,0 @@
-{ stdenv
-, fetchurl
-, fetchFromGitHub
-, pythonPackages
-, windowsSupport ? false
-}:
-
-with pythonPackages;
-
-let
-  # Shouldn't be needed anymore in next version
-  # https://github.com/NixOS/nixpkgs/pull/22345#commitcomment-20718521
-  jinja = jinja2.overridePythonAttrs (old: rec {
-    version = "2.8.1";
-    name = "${old.pname}-${version}";
-    src = fetchFromGitHub {
-      owner = "pallets";
-      repo = "jinja";
-      rev = version;
-      sha256 = "0m6g6fx6flxb6hrkw757mbx1gxyrmj50w27m2afdsvmvz0zpdi2a";
-    };
-  });
-in buildPythonPackage rec {
-  pname = "ansible";
-  version = "2.2.1.0";
-  name = "${pname}-${version}";
-
-
-  src = fetchurl {
-    url = "http://releases.ansible.com/ansible/${name}.tar.gz";
-    sha256 = "0gz9i30pdmkchi936ijy873k8di6fmf3v5rv551hxyf0hjkjx8b3";
-  };
-
-  prePatch = ''
-    sed -i "s,/usr/,$out," lib/ansible/constants.py
-  '';
-
-  doCheck = false;
-  dontStrip = true;
-  dontPatchELF = true;
-  dontPatchShebangs = false;
-
-  propagatedBuildInputs = [
-    pycrypto paramiko jinja pyyaml httplib2 boto six netaddr dnspython
-  ] ++ stdenv.lib.optional windowsSupport pywinrm;
-
-  meta = with stdenv.lib; {
-    homepage = http://www.ansible.com;
-    description = "A simple automation tool";
-    license = with licenses; [ gpl3] ;
-    maintainers = with maintainers; [
-      jgeerds
-      joamaki
-    ];
-    platforms = with platforms; linux ++ darwin;
-  };
-}
diff --git a/pkgs/tools/admin/ansible/2.3.nix b/pkgs/tools/admin/ansible/2.3.nix
deleted file mode 100644
index b827bdcc9c31..000000000000
--- a/pkgs/tools/admin/ansible/2.3.nix
+++ /dev/null
@@ -1,40 +0,0 @@
-{ stdenv
-, fetchurl
-, pythonPackages
-, windowsSupport ? false
-}:
-
-pythonPackages.buildPythonPackage rec {
-  pname = "ansible";
-  version = "2.3.2.0";
-  name = "${pname}-${version}";
-
-  src = fetchurl {
-    url = "http://releases.ansible.com/ansible/${name}.tar.gz";
-    sha256 = "1sv8666vw6fi93jlgkwd4lxkfn75yqczfvk129zlh8ll4wjv8qq5";
-  };
-
-  prePatch = ''
-    sed -i "s,/usr/,$out," lib/ansible/constants.py
-  '';
-
-  doCheck = false;
-  dontStrip = true;
-  dontPatchELF = true;
-  dontPatchShebangs = false;
-
-  propagatedBuildInputs = with pythonPackages; [
-    pycrypto paramiko jinja2 pyyaml httplib2 boto six netaddr dnspython
-  ] ++ stdenv.lib.optional windowsSupport pywinrm;
-
-  meta = with stdenv.lib; {
-    homepage = http://www.ansible.com;
-    description = "A simple automation tool";
-    license = with licenses; [ gpl3 ] ;
-    maintainers = with maintainers; [
-      jgeerds
-      joamaki
-    ];
-    platforms = with platforms; linux ++ darwin;
-  };
-}
diff --git a/pkgs/tools/admin/ansible/2.4.nix b/pkgs/tools/admin/ansible/2.4.nix
deleted file mode 100644
index 4f90e80202e4..000000000000
--- a/pkgs/tools/admin/ansible/2.4.nix
+++ /dev/null
@@ -1,40 +0,0 @@
-{ stdenv
-, fetchurl
-, pythonPackages
-, windowsSupport ? false
-}:
-
-pythonPackages.buildPythonPackage rec {
-  pname = "ansible";
-  version = "2.4.2.0";
-  name = "${pname}-${version}";
-
-  src = fetchurl {
-    url = "http://releases.ansible.com/ansible/${name}.tar.gz";
-    sha256 = "0n3n9py4s3aykiii31xq8g4wmd6693jvby0424pjrg0bna01apri";
-  };
-
-  prePatch = ''
-    sed -i "s,/usr/,$out," lib/ansible/constants.py
-  '';
-
-  doCheck = false;
-  dontStrip = true;
-  dontPatchELF = true;
-  dontPatchShebangs = false;
-
-  propagatedBuildInputs = with pythonPackages; [
-    pycrypto paramiko jinja2 pyyaml httplib2 boto six netaddr dnspython
-  ] ++ stdenv.lib.optional windowsSupport pywinrm;
-
-  meta = with stdenv.lib; {
-    homepage = http://www.ansible.com;
-    description = "A simple automation tool";
-    license = with licenses; [ gpl3 ];
-    maintainers = with maintainers; [
-      jgeerds
-      joamaki
-    ];
-    platforms = with platforms; linux ++ darwin;
-  };
-}
diff --git a/pkgs/tools/admin/ansible/2.5.nix b/pkgs/tools/admin/ansible/2.5.nix
deleted file mode 100644
index 32d83861cd8c..000000000000
--- a/pkgs/tools/admin/ansible/2.5.nix
+++ /dev/null
@@ -1,40 +0,0 @@
-{ stdenv
-, fetchurl
-, pythonPackages
-, windowsSupport ? false
-}:
-
-pythonPackages.buildPythonPackage rec {
-  pname = "ansible";
-  version = "2.5.1";
-  name = "${pname}-${version}";
-
-  src = fetchurl {
-    url = "http://releases.ansible.com/ansible/${name}.tar.gz";
-    sha256 = "06h0cmz0cgj1xszzn6rsypfc8lkazgh5g1yxyss1yx242d0wkw2i";
-  };
-
-  prePatch = ''
-    sed -i "s,/usr/,$out," lib/ansible/constants.py
-  '';
-
-  doCheck = false;
-  dontStrip = true;
-  dontPatchELF = true;
-  dontPatchShebangs = false;
-
-  propagatedBuildInputs = with pythonPackages; [
-    pycrypto paramiko jinja2 pyyaml httplib2 boto six netaddr dnspython
-  ] ++ stdenv.lib.optional windowsSupport pywinrm;
-
-  meta = with stdenv.lib; {
-    homepage = http://www.ansible.com;
-    description = "A simple automation tool";
-    license = with licenses; [ gpl3 ];
-    maintainers = with maintainers; [
-      jgeerds
-      joamaki
-    ];
-    platforms = with platforms; linux ++ darwin;
-  };
-}
diff --git a/pkgs/tools/admin/ansible/default.nix b/pkgs/tools/admin/ansible/default.nix
new file mode 100644
index 000000000000..4d9eff899b92
--- /dev/null
+++ b/pkgs/tools/admin/ansible/default.nix
@@ -0,0 +1,82 @@
+{ stdenv, fetchurl, fetchFromGitHub, python2
+, windowsSupport ? false
+}:
+
+let
+  oldJinja = python2.override {
+    packageOverrides = self: super: {
+      jinja2 = super.jinja2.overridePythonAttrs (oldAttrs: rec {
+        version = "2.8.1";
+        src = oldAttrs.src.override {
+          inherit version;
+          sha256 = "14aqmhkc9rw5w0v311jhixdm6ym8vsm29dhyxyrjfqxljwx1yd1m";
+        };
+        doCheck = false;
+      });
+    };
+  };
+
+  generic = { version, sha256, py ? python2 }: py.pkgs.buildPythonPackage rec {
+    pname = "ansible";
+    inherit version;
+
+    src = fetchurl {
+      url = "http://releases.ansible.com/ansible/${pname}-${version}.tar.gz";
+      inherit sha256;
+    };
+
+    prePatch = ''
+      sed -i "s,/usr/,$out," lib/ansible/constants.py
+    '';
+
+    doCheck = false;
+    dontStrip = true;
+    dontPatchELF = true;
+    dontPatchShebangs = false;
+
+    propagatedBuildInputs = with py.pkgs; [
+      pycrypto paramiko jinja2 pyyaml httplib2 boto six netaddr dnspython
+    ] ++ stdenv.lib.optional windowsSupport pywinrm;
+
+    meta = with stdenv.lib; {
+      homepage = http://www.ansible.com;
+      description = "A simple automation tool";
+      license = with licenses; [ gpl3 ] ;
+      maintainers = with maintainers; [ jgeerds joamaki ];
+      platforms = with platforms; linux ++ darwin;
+    };
+  };
+
+in rec {
+  # We will carry all the supported versions
+
+  ansible_2_1 = generic {
+    version = "2.1.6.0";
+    sha256  = "0fhsmarjl9h401pm0gmcy68q80fiq544cxzcxyjzbnxr2a2cimz5";
+    py      = oldJinja;
+  };
+
+  ansible_2_2 = generic {
+    version = "2.2.3.0";
+    sha256  = "141aa76qy9hsc3h02yipyxg39maqq2r2c4nx53lm48kiy0fan66y";
+    py      = oldJinja;
+  };
+
+  ansible_2_3 = generic {
+    version = "2.3.3.0";
+    sha256  = "1yhaqgbx4zlwvi3cklnsqarjhhq28hgbvx603h07cjm1digp2ans";
+  };
+
+  ansible_2_4 = generic {
+    version = "2.4.4.0";
+    sha256  = "0n1k6h0h6av74nw8vq98fmh6q4pq6brpwmx45282vh3bkdmpa0ib";
+  };
+
+  ansible_2_5 = generic {
+    version = "2.5.2";
+    sha256  = "1r9sq30xz3jrvx6yqssj5wmkml1f75rx1amd7g89f3ryngrq6m59";
+  };
+
+  ansible2 = ansible_2_5;
+  ansible  = ansible2;
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 567167fc4605..36532e55f938 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -7518,13 +7518,14 @@ with pkgs;
 
   augeas = callPackage ../tools/system/augeas { };
 
-  ansible_2_1 = callPackage ../tools/admin/ansible/2.1.nix {};
-  ansible_2_2 = callPackage ../tools/admin/ansible/2.2.nix {};
-  ansible_2_3 = callPackage ../tools/admin/ansible/2.3.nix {};
-  ansible_2_4 = callPackage ../tools/admin/ansible/2.4.nix {};
-  ansible_2_5 = callPackage ../tools/admin/ansible/2.5.nix {};
-  ansible  = ansible_2_4;
-  ansible2 = ansible_2_4;
+  inherit (callPackages ../tools/admin/ansible {})
+    ansible_2_1
+    ansible_2_2
+    ansible_2_3
+    ansible_2_4
+    ansible_2_5
+    ansible2
+    ansible;
 
   ansible-lint = callPackage ../development/tools/ansible-lint {};