From 7298dd8cca8f575586fc7026b388f3928abeeb56 Mon Sep 17 00:00:00 2001 From: zimbatm Date: Thu, 30 Jun 2016 10:12:24 +0100 Subject: [PATCH 1/3] ronn: init at 0.7.3 --- pkgs/development/tools/ronn/Gemfile | 3 +++ pkgs/development/tools/ronn/Gemfile.lock | 19 +++++++++++++ pkgs/development/tools/ronn/default.nix | 31 +++++++++++++++++++++ pkgs/development/tools/ronn/gemset.nix | 34 ++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 5 files changed, 89 insertions(+) create mode 100644 pkgs/development/tools/ronn/Gemfile create mode 100644 pkgs/development/tools/ronn/Gemfile.lock create mode 100644 pkgs/development/tools/ronn/default.nix create mode 100644 pkgs/development/tools/ronn/gemset.nix diff --git a/pkgs/development/tools/ronn/Gemfile b/pkgs/development/tools/ronn/Gemfile new file mode 100644 index 00000000000..64f1df743ab --- /dev/null +++ b/pkgs/development/tools/ronn/Gemfile @@ -0,0 +1,3 @@ +source "https://rubygems.org" + +gem "ronn" diff --git a/pkgs/development/tools/ronn/Gemfile.lock b/pkgs/development/tools/ronn/Gemfile.lock new file mode 100644 index 00000000000..c2b90f63494 --- /dev/null +++ b/pkgs/development/tools/ronn/Gemfile.lock @@ -0,0 +1,19 @@ +GEM + remote: https://rubygems.org/ + specs: + hpricot (0.8.6) + mustache (1.0.3) + rdiscount (2.2.0.1) + ronn (0.7.3) + hpricot (>= 0.8.2) + mustache (>= 0.7.0) + rdiscount (>= 1.5.8) + +PLATFORMS + ruby + +DEPENDENCIES + ronn + +BUNDLED WITH + 1.11.2 diff --git a/pkgs/development/tools/ronn/default.nix b/pkgs/development/tools/ronn/default.nix new file mode 100644 index 00000000000..7720c4f2bf2 --- /dev/null +++ b/pkgs/development/tools/ronn/default.nix @@ -0,0 +1,31 @@ +{ stdenv, lib, bundlerEnv, makeWrapper, groff }: + +stdenv.mkDerivation rec { + name = "ronn-${version}"; + version = env.gems.ronn.version; + + env = bundlerEnv rec { + name = "ronn-gems"; + gemfile = ./Gemfile; + lockfile = ./Gemfile.lock; + gemset = ./gemset.nix; + }; + + phases = ["installPhase"]; + + buildInputs = [ makeWrapper ]; + + installPhase = '' + mkdir -p $out/bin + makeWrapper ${env}/bin/ronn $out/bin/ronn \ + --set PATH ${groff}/bin + ''; + + meta = with lib; { + description = "markdown-based tool for building manpages"; + homepage = https://rtomayko.github.io/ronn/; + license = licenses.mit; + maintainers = with maintainers; [ zimbatm ]; + platforms = env.ruby.meta.platforms; + }; +} diff --git a/pkgs/development/tools/ronn/gemset.nix b/pkgs/development/tools/ronn/gemset.nix new file mode 100644 index 00000000000..ce804e1f9f5 --- /dev/null +++ b/pkgs/development/tools/ronn/gemset.nix @@ -0,0 +1,34 @@ +{ + hpricot = { + source = { + remotes = ["https://rubygems.org"]; + sha256 = "1jn8x9ch79gqmnzgyz78kppavjh5lqx0y0r6frykga2b86rz9s6z"; + type = "gem"; + }; + version = "0.8.6"; + }; + mustache = { + source = { + remotes = ["https://rubygems.org"]; + sha256 = "1v4pdvgvs8gw0zbh5sy3l308amlsjg8sdfrkml0g0m0wwj4x7naf"; + type = "gem"; + }; + version = "1.0.3"; + }; + rdiscount = { + source = { + remotes = ["https://rubygems.org"]; + sha256 = "1arvk3k06prxasq1djbj065ixar4zl171340g7wr1ww4gj9makx3"; + type = "gem"; + }; + version = "2.2.0.1"; + }; + ronn = { + source = { + remotes = ["https://rubygems.org"]; + sha256 = "07plsxxfx5bxdk72ii9za6km0ziqlq8jh3bicr4774dalga6zpw2"; + type = "gem"; + }; + version = "0.7.3"; + }; +} \ No newline at end of file diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index b2cbe0fd03f..8bc98f1933b 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -9037,6 +9037,8 @@ in rote = callPackage ../development/libraries/rote { }; + ronn = callPackage ../development/tools/ronn { }; + rubberband = callPackage ../development/libraries/rubberband { inherit (vamp) vampSDK; }; From 4932524080c8e187f698927b21cb667b814cf0cd Mon Sep 17 00:00:00 2001 From: zimbatm Date: Thu, 30 Jun 2016 11:12:20 +0100 Subject: [PATCH 2/3] zerotierone: build manpages --- pkgs/tools/networking/zerotierone/default.nix | 34 ++++++++++++------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/pkgs/tools/networking/zerotierone/default.nix b/pkgs/tools/networking/zerotierone/default.nix index 29d131b509b..69529e8ba73 100644 --- a/pkgs/tools/networking/zerotierone/default.nix +++ b/pkgs/tools/networking/zerotierone/default.nix @@ -1,6 +1,4 @@ -{ stdenv, fetchurl, openssl, lzo, zlib, gcc, iproute }: - -with stdenv.lib; +{ stdenv, fetchurl, openssl, lzo, zlib, gcc, iproute, ronn }: stdenv.mkDerivation rec { version = "1.1.6"; @@ -13,28 +11,38 @@ stdenv.mkDerivation rec { preConfigure = '' substituteInPlace ./make-linux.mk \ - --replace 'CC=$(shell which clang gcc cc 2>/dev/null | head -n 1)' "CC=${gcc}/bin/gcc"; + --replace 'CC=$(shell which clang gcc cc 2>/dev/null | head -n 1)' "CC=${gcc}/bin/gcc"; substituteInPlace ./make-linux.mk \ - --replace 'CXX=$(shell which clang++ g++ c++ 2>/dev/null | head -n 1)' "CC=${gcc}/bin/g++"; + --replace 'CXX=$(shell which clang++ g++ c++ 2>/dev/null | head -n 1)' "CC=${gcc}/bin/g++"; substituteInPlace ./osdep/LinuxEthernetTap.cpp \ - --replace 'execlp("ip",' 'execlp("${iproute}/bin/ip",' + --replace 'execlp("ip",' 'execlp("${iproute}/bin/ip",' + + patchShebangs ./doc/build.sh + substituteInPlace ./doc/build.sh \ + --replace '/usr/bin/ronn' '${ronn}/bin/ronn' \ + --replace 'ronn -r' '${ronn}/bin/ronn -r' ''; - buildInputs = [ openssl lzo zlib gcc iproute ]; - - buildFlags = [ "one" ]; # TODO: Add support for building and installing manpages as well. + buildInputs = [ openssl lzo zlib gcc iproute ronn ]; installPhase = '' install -Dt "$out/bin/" zerotier-one ln -s $out/bin/zerotier-one $out/bin/zerotier-idtool ln -s $out/bin/zerotier-one $out/bin/zerotier-cli + + mkdir -p $man/share/man/man8 + for cmd in zerotier-one.8 zerotier-cli.1 zerotier-idtool.1; do + cat doc/$cmd | gzip -9 > $man/share/man/man8/$cmd.gz + done ''; - meta = { + outputs = [ "out" "man" ]; + + meta = with stdenv.lib; { description = "Create flat virtual Ethernet networks of almost unlimited size"; homepage = https://www.zerotier.com; - license = stdenv.lib.licenses.gpl3; - maintainers = [ stdenv.lib.maintainers.sjmackenzie ]; - platforms = with stdenv.lib; platforms.allBut [ "i686-linux" ]; + license = licenses.gpl3; + maintainers = [ sjmackenzie ]; + platforms = platforms.allBut [ "i686-linux" ]; }; } From cbe5813e8433b76254f33a389f2bba6dd4b10253 Mon Sep 17 00:00:00 2001 From: zimbatm Date: Thu, 30 Jun 2016 12:28:50 +0100 Subject: [PATCH 3/3] zerotierone: use compile from the stdenv --- pkgs/tools/networking/zerotierone/default.nix | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/pkgs/tools/networking/zerotierone/default.nix b/pkgs/tools/networking/zerotierone/default.nix index 69529e8ba73..55be87f6a88 100644 --- a/pkgs/tools/networking/zerotierone/default.nix +++ b/pkgs/tools/networking/zerotierone/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, openssl, lzo, zlib, gcc, iproute, ronn }: +{ stdenv, fetchurl, openssl, lzo, zlib, iproute, which, ronn }: stdenv.mkDerivation rec { version = "1.1.6"; @@ -10,10 +10,6 @@ stdenv.mkDerivation rec { }; preConfigure = '' - substituteInPlace ./make-linux.mk \ - --replace 'CC=$(shell which clang gcc cc 2>/dev/null | head -n 1)' "CC=${gcc}/bin/gcc"; - substituteInPlace ./make-linux.mk \ - --replace 'CXX=$(shell which clang++ g++ c++ 2>/dev/null | head -n 1)' "CC=${gcc}/bin/g++"; substituteInPlace ./osdep/LinuxEthernetTap.cpp \ --replace 'execlp("ip",' 'execlp("${iproute}/bin/ip",' @@ -23,7 +19,7 @@ stdenv.mkDerivation rec { --replace 'ronn -r' '${ronn}/bin/ronn -r' ''; - buildInputs = [ openssl lzo zlib gcc iproute ronn ]; + buildInputs = [ openssl lzo zlib iproute which ronn ]; installPhase = '' install -Dt "$out/bin/" zerotier-one