From 0ebc2e75f130048e6e4aad99cce5ff467412f3cf Mon Sep 17 00:00:00 2001 From: Jussi Maki Date: Wed, 21 May 2014 09:36:29 +0200 Subject: [PATCH 1/4] ansible: add package --- pkgs/tools/system/ansible/default.nix | 27 +++++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 29 insertions(+) create mode 100644 pkgs/tools/system/ansible/default.nix diff --git a/pkgs/tools/system/ansible/default.nix b/pkgs/tools/system/ansible/default.nix new file mode 100644 index 000000000000..4d12801b87ad --- /dev/null +++ b/pkgs/tools/system/ansible/default.nix @@ -0,0 +1,27 @@ +{ stdenv, pythonPackages, fetchurl, python }: + +pythonPackages.buildPythonPackage rec { + name = "ansible-1.6.1"; + namePrefix = ""; + + src = fetchurl { + url = "https://github.com/ansible/ansible/archive/v1.6.1.tar.gz"; + sha256 = "1iz1q2h0zll4qsxk0pndc59knasw663kv53sm21q57qz7lf30q9z"; + }; + + prePatch = '' + sed -i "s,\/usr\/share\/ansible\/,$out/share/ansible," lib/ansible/constants.py + ''; + + doCheck = false; + + pythonPath = with pythonPackages; [ + paramiko jinja2 pyyaml httplib2 + ]; + + meta = { + homepage = "http://www.ansible.com"; + description = "Ansible simple automation tool"; + license = "GPLv3"; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 70cab717c169..cdabeae8420a 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -11046,5 +11046,7 @@ let # Attributes for backward compatibility. adobeReader = adobe-reader; + ansible = callPackage ../tools/system/ansible { }; + }; in self; in pkgs From 92d8001c255f6ab98365d0e60be4f13f6b014a7a Mon Sep 17 00:00:00 2001 From: Jussi Maki Date: Wed, 21 May 2014 09:41:48 +0200 Subject: [PATCH 2/4] ansible: Add maintainer --- lib/maintainers.nix | 1 + pkgs/tools/system/ansible/default.nix | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/maintainers.nix b/lib/maintainers.nix index 80d0bed23dce..f49d8485ad10 100644 --- a/lib/maintainers.nix +++ b/lib/maintainers.nix @@ -98,4 +98,5 @@ zef = "Zef Hemel "; zimbatm = "zimbatm "; zoomulator = "Kim Simmons "; + joamaki = "Jussi Maki "; } diff --git a/pkgs/tools/system/ansible/default.nix b/pkgs/tools/system/ansible/default.nix index 4d12801b87ad..31d8bf40f51c 100644 --- a/pkgs/tools/system/ansible/default.nix +++ b/pkgs/tools/system/ansible/default.nix @@ -22,6 +22,8 @@ pythonPackages.buildPythonPackage rec { meta = { homepage = "http://www.ansible.com"; description = "Ansible simple automation tool"; - license = "GPLv3"; + license = stdenv.lib.licenses.gpl3; + maintainers = [ stdenv.lib.maintainers.joamaki ]; + platforms = stdenv.lib.platforms.linux; # Only tested on Linux }; } From 75cb4857180b2afbcee7e12273ad87928c4d4395 Mon Sep 17 00:00:00 2001 From: Jussi Maki Date: Wed, 21 May 2014 14:46:37 +0200 Subject: [PATCH 3/4] ansible: conventions, fix module execution --- lib/maintainers.nix | 3 +- .../python-modules/generic/default.nix | 3 +- pkgs/tools/system/ansible/default.nix | 28 ++++++++++++------- pkgs/top-level/all-packages.nix | 4 +-- 4 files changed, 23 insertions(+), 15 deletions(-) diff --git a/lib/maintainers.nix b/lib/maintainers.nix index f49d8485ad10..2af2e65a0d58 100644 --- a/lib/maintainers.nix +++ b/lib/maintainers.nix @@ -43,6 +43,7 @@ iElectric = "Domen Kozar "; iyzsong = "Song Wenwu "; jcumming = "Jack Cummings "; + joamaki = "Jussi Maki "; jwiegley = "John Wiegley "; kkallio = "Karn Kallio "; ktosiek = "Tomasz Kontusz "; @@ -98,5 +99,5 @@ zef = "Zef Hemel "; zimbatm = "zimbatm "; zoomulator = "Kim Simmons "; - joamaki = "Jussi Maki "; + } diff --git a/pkgs/development/python-modules/generic/default.nix b/pkgs/development/python-modules/generic/default.nix index 9dedd3ceae73..59b18d772cf4 100644 --- a/pkgs/development/python-modules/generic/default.nix +++ b/pkgs/development/python-modules/generic/default.nix @@ -135,8 +135,7 @@ python.stdenv.mkDerivation (attrs // { runHook postInstall ''; - postFixup = - '' + postFixup = attrs.postFixup or '' wrapPythonPrograms # If a user installs a Python package, they probably also wants its diff --git a/pkgs/tools/system/ansible/default.nix b/pkgs/tools/system/ansible/default.nix index 31d8bf40f51c..241bd75fd292 100644 --- a/pkgs/tools/system/ansible/default.nix +++ b/pkgs/tools/system/ansible/default.nix @@ -1,11 +1,12 @@ -{ stdenv, pythonPackages, fetchurl, python }: +{ stdenv, fetchurl, pythonPackages, python }: pythonPackages.buildPythonPackage rec { - name = "ansible-1.6.1"; + version = "1.6.1"; + name = "ansible-${version}"; namePrefix = ""; - + src = fetchurl { - url = "https://github.com/ansible/ansible/archive/v1.6.1.tar.gz"; + url = "https://github.com/ansible/ansible/archive/v${version}.tar.gz"; sha256 = "1iz1q2h0zll4qsxk0pndc59knasw663kv53sm21q57qz7lf30q9z"; }; @@ -14,16 +15,23 @@ pythonPackages.buildPythonPackage rec { ''; doCheck = false; + dontStrip = true; + dontPatchELF = true; + dontPatchShebangs = true; - pythonPath = with pythonPackages; [ + propagatedBuildInputs = with pythonPackages; [ paramiko jinja2 pyyaml httplib2 ]; - meta = { + postFixup = '' + wrapPythonProgramsIn $out/bin "$out $pythonPath" + ''; + + meta = with stdenv.lib; { homepage = "http://www.ansible.com"; - description = "Ansible simple automation tool"; - license = stdenv.lib.licenses.gpl3; - maintainers = [ stdenv.lib.maintainers.joamaki ]; - platforms = stdenv.lib.platforms.linux; # Only tested on Linux + description = "A simple automation tool"; + license = licenses.gpl3; + maintainers = [ maintainers.joamaki ]; + platforms = platforms.linux; # Only tested on Linux }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index cdabeae8420a..5d2249ff3338 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -3647,6 +3647,8 @@ let ### DEVELOPMENT / TOOLS + ansible = callPackage ../tools/system/ansible { }; + antlr = callPackage ../development/tools/parsing/antlr/2.7.7.nix { }; antlr3 = callPackage ../development/tools/parsing/antlr { }; @@ -11046,7 +11048,5 @@ let # Attributes for backward compatibility. adobeReader = adobe-reader; - ansible = callPackage ../tools/system/ansible { }; - }; in self; in pkgs From 9ebb53c0e3b0bb391ff03cbc5a85ba80af494035 Mon Sep 17 00:00:00 2001 From: Jussi Maki Date: Mon, 26 May 2014 10:29:17 +0200 Subject: [PATCH 4/4] ansible: add boto as dependency for s3 module --- pkgs/tools/system/ansible/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/tools/system/ansible/default.nix b/pkgs/tools/system/ansible/default.nix index 241bd75fd292..7d96092a3ceb 100644 --- a/pkgs/tools/system/ansible/default.nix +++ b/pkgs/tools/system/ansible/default.nix @@ -20,7 +20,7 @@ pythonPackages.buildPythonPackage rec { dontPatchShebangs = true; propagatedBuildInputs = with pythonPackages; [ - paramiko jinja2 pyyaml httplib2 + paramiko jinja2 pyyaml httplib2 boto ]; postFixup = ''