From 4c0d152d1ee7c5a5bdb279e65dddf2f25bedd42a Mon Sep 17 00:00:00 2001 From: "William A. Kennington III" Date: Fri, 31 Oct 2014 19:30:09 -0700 Subject: [PATCH] libtorrent-rasterbar: Add generic builder and 0.16.x derivation --- .../libraries/libtorrent-rasterbar/0.16.nix | 6 ++++ .../libtorrent-rasterbar/default.nix | 30 ++++--------------- .../libtorrent-rasterbar/generic.nix | 30 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 7 +++++ 4 files changed, 48 insertions(+), 25 deletions(-) create mode 100644 pkgs/development/libraries/libtorrent-rasterbar/0.16.nix create mode 100644 pkgs/development/libraries/libtorrent-rasterbar/generic.nix diff --git a/pkgs/development/libraries/libtorrent-rasterbar/0.16.nix b/pkgs/development/libraries/libtorrent-rasterbar/0.16.nix new file mode 100644 index 000000000000..6298f2f0c0f3 --- /dev/null +++ b/pkgs/development/libraries/libtorrent-rasterbar/0.16.nix @@ -0,0 +1,6 @@ +{ callPackage, ... } @ args: + +callPackage ./generic.nix (args // { + version = "0.16.17"; + sha256 = "1w5gcizd6jlvzwgy0307az856h0cly685yf275p1v6bdcafd58b7"; +}) diff --git a/pkgs/development/libraries/libtorrent-rasterbar/default.nix b/pkgs/development/libraries/libtorrent-rasterbar/default.nix index 761fe1d94fb2..e1f1fc179d63 100644 --- a/pkgs/development/libraries/libtorrent-rasterbar/default.nix +++ b/pkgs/development/libraries/libtorrent-rasterbar/default.nix @@ -1,26 +1,6 @@ -{ stdenv, fetchurl, boost, openssl, pkgconfig, zlib, python, libiconvOrNull, geoip }: +{ callPackage, ... } @ args: -stdenv.mkDerivation rec { - name = "libtorrent-rasterbar-1.0.2"; - - src = fetchurl { - url = "mirror://sourceforge/libtorrent/${name}.tar.gz"; - sha256 = "1ph4cb6nrk2hiy89j3kz1wj16ph0b9yixrf4f4935rnzhha8x31w"; - }; - - buildInputs = [ boost pkgconfig openssl zlib python libiconvOrNull geoip ]; - - configureFlags = [ - "--enable-python-binding" - "--with-libgeoip=system" - "--with-libiconv=yes" - "--with-boost=${boost.lib}" - ]; - - meta = with stdenv.lib; { - homepage = http://www.rasterbar.com/products/libtorrent/; - description = "A C++ BitTorrent implementation focusing on efficiency and scalability"; - license = licenses.bsd3; - maintainers = [ maintainers.phreedom ]; - }; -} +callPackage ./generic.nix (args // { + version = "1.0.2"; + sha256 = "1ph4cb6nrk2hiy89j3kz1wj16ph0b9yixrf4f4935rnzhha8x31w"; +}) diff --git a/pkgs/development/libraries/libtorrent-rasterbar/generic.nix b/pkgs/development/libraries/libtorrent-rasterbar/generic.nix new file mode 100644 index 000000000000..f47ff1081bc8 --- /dev/null +++ b/pkgs/development/libraries/libtorrent-rasterbar/generic.nix @@ -0,0 +1,30 @@ +{ stdenv, fetchurl, boost, openssl, pkgconfig, zlib, python, libiconvOrNull, geoip +# Version specific options +, version, sha256 +, ... }: + +stdenv.mkDerivation rec { + name = "libtorrent-rasterbar-${version}"; + + src = fetchurl { + url = "mirror://sourceforge/libtorrent/${name}.tar.gz"; + inherit sha256; + }; + + buildInputs = [ boost pkgconfig openssl zlib python libiconvOrNull geoip ]; + + configureFlags = [ + "--enable-python-binding" + "--with-libgeoip=system" + "--with-libiconv=yes" + "--with-boost=${boost.dev}" + "--with-boost-libdir=${boost.lib}/lib" + ] ++ stdenv.lib.optional (libiconvOrNull != null) "--with-libiconv=yes"; + + meta = with stdenv.lib; { + homepage = http://www.rasterbar.com/products/libtorrent/; + description = "A C++ BitTorrent implementation focusing on efficiency and scalability"; + license = licenses.bsd3; + maintainers = [ maintainers.phreedom ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 75dbaa22a883..5e41450296ba 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -6048,6 +6048,13 @@ let else stdenv; }; + libtorrentRasterbar_0_16 = callPackage ../development/libraries/libtorrent-rasterbar/0.16.nix { + # fix "unrecognized option -arch" error + stdenv = if stdenv.isDarwin + then clangStdenv + else stdenv; + }; + libtoxcore = callPackage ../development/libraries/libtoxcore { }; libtsm = callPackage ../development/libraries/libtsm { };