[Nix-dev] [PATCH] Merge two nix exprs for links2, upgrade to 2.5

Yury G. Kudryashov urkud.urkud at gmail.com
Fri Jan 27 15:02:53 CET 2012


---
 .../networking/browsers/links2/default.nix         |   65 +++++++++++--------
 .../networking/browsers/links2/src-for-default.nix |    9 ---
 .../browsers/links2/src-info-for-default.nix       |    4 -
 .../networking/browsers/links2/stdenv.nix          |   41 ------------
 pkgs/top-level/all-packages.nix                    |    8 +--
 5 files changed, 39 insertions(+), 88 deletions(-)

diff --git a/pkgs/applications/networking/browsers/links2/default.nix b/pkgs/applications/networking/browsers/links2/default.nix
index 587a515..1e8ef3e 100644
--- a/pkgs/applications/networking/browsers/links2/default.nix
+++ b/pkgs/applications/networking/browsers/links2/default.nix
@@ -1,33 +1,44 @@
-a :  
-let 
-  s = import ./src-for-default.nix;
-  buildInputs = with a; [
-    libpng libjpeg bzip2 zlib libtiff
-    libX11 libXau xproto gpm
-    openssl libXt pkgconfig
-  ];
-in
-rec {
-  src = a.fetchUrlFromSrcInfo s;
+{ stdenv, fetchurl
+, gpm, openssl, pkgconfig # Misc.
+, libpng, libjpeg, libtiff # graphic formats
+, bzip2, zlib, xz # Transfer encodings
+, enableFB ? true
+, enableDirectFB ? false, directfb
+, enableX11 ? true, libX11, libXt, libXau # GUI support
+}:
 
-  inherit (s) name;
-  inherit buildInputs;
-  configureFlags = [
-    "--enable-graphics"
-    "--with-ssl"
-    "--with-x"
-    "--with-fb"
-    ];
+stdenv.mkDerivation rec {
+  version = "2.5";
+  name = "links2-${version}";
+
+  src = fetchurl {
+    url = "${meta.homepage}/download/links-${version}.tar.bz2";
+    sha256 = "1wlmj8s6bxgznh0pnawihyvhffzryciz3lkagcxhf7fp64zz5izm";
+  };
+
+  buildInputs = 
+    [ libpng libjpeg libtiff gpm openssl xz bzip2 zlib ]
+    ++ stdenv.lib.optionals enableX11 [ libX11 libXau libXt ]
+    ++ stdenv.lib.optional enableDirectFB [ directfb ];
+
+  buildNativeInputs = [ pkgconfig ];
+
+  configureFlags = [ "--with-ssl" ]
+    ++ stdenv.lib.optional (enableX11 || enableFB || enableDirectFB) "--enable-graphics"
+    ++ stdenv.lib.optional enableX11 "--with-x"
+    ++ stdenv.lib.optional enableFB "--with-fb"
+    ++ stdenv.lib.optional enableDirectFB "--with-directfb";
+
+  crossAttrs = {
+    preConfigure = ''
+      export CC=$crossConfig-gcc
+    '';
+  };
 
-  /* doConfigure should be removed if not needed */
-  phaseNames = ["doConfigure" "doMakeInstall"];
-      
   meta = {
+    homepage = http://links.twibright.com/;
     description = "A small browser with some graphics support";
-    maintainers = [
-      a.lib.maintainers.raskin
-    ];
-    platforms = with a.lib.platforms; 
-      linux;
+    maintainers = with stdenv.lib.maintainers; [ raskin urkud viric ];
+    platforms = stdenv.lib.platforms.linux;
   };
 }
diff --git a/pkgs/applications/networking/browsers/links2/src-for-default.nix b/pkgs/applications/networking/browsers/links2/src-for-default.nix
deleted file mode 100644
index 7e7da1a..0000000
--- a/pkgs/applications/networking/browsers/links2/src-for-default.nix
+++ /dev/null
@@ -1,9 +0,0 @@
-rec {
-   version="2.2";
-   name="links2-2.2";
-   hash="188y37rw4s9brl55ncc12q1b45w0caxcnsq1gqyby9byw1sawnq9";
-   url="http://links.twibright.com/download/links-${version}.tar.gz";
-   advertisedUrl="http://links.twibright.com/download/links-2.2.tar.gz";
-  
-  
-}
diff --git a/pkgs/applications/networking/browsers/links2/src-info-for-default.nix b/pkgs/applications/networking/browsers/links2/src-info-for-default.nix
deleted file mode 100644
index b678b25..0000000
--- a/pkgs/applications/networking/browsers/links2/src-info-for-default.nix
+++ /dev/null
@@ -1,4 +0,0 @@
-{
-  downloadPage = "http://links.twibright.com/download.php";
-  baseName = "links2";
-}
diff --git a/pkgs/applications/networking/browsers/links2/stdenv.nix b/pkgs/applications/networking/browsers/links2/stdenv.nix
deleted file mode 100644
index 923d0af..0000000
--- a/pkgs/applications/networking/browsers/links2/stdenv.nix
+++ /dev/null
@@ -1,41 +0,0 @@
-{ stdenv, fetchurl, libpng, libjpeg, bzip2, zlib, libtiff,  gpm, openssl, pkgconfig, directfb 
-, enableX11 ? true, libX11, libXau, xproto, libXt }:
-
-let
-  version="2.2";
-  name="links2-2.2";
-  hash="188y37rw4s9brl55ncc12q1b45w0caxcnsq1gqyby9byw1sawnq9";
-  url="http://links.twibright.com/download/links-${version}.tar.gz";
-  advertisedUrl="http://links.twibright.com/download/links-2.2.tar.gz";
-in
-
-stdenv.mkDerivation {
-  inherit name;
-
-  src = fetchurl {
-    inherit url;
-    sha256 = hash;
-  };
-
-  buildInputs = [ libpng libjpeg bzip2 zlib libtiff  gpm openssl pkgconfig directfb ]
-    ++ stdenv.lib.optionals enableX11 [ libX11 libXau xproto libXt ];
-
-  configureFlags = [
-    "--enable-graphics"
-    "--with-ssl"
-    "--with-fb"
-    ] ++ stdenv.lib.optional enableX11 "--with-x";
-
-  crossAttrs = {
-    preConfigure = ''
-      export CC=$crossConfig-gcc
-    '';
-  };
-
-  meta = {
-    description = "A small browser with some graphics support";
-    maintainers = [
-      stdenv.lib.maintainers.viric
-    ];
-  };
-}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index d40609f..dc83ebc 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -7144,13 +7144,7 @@ let
   ledger = callPackage ../applications/office/ledger/2.6.3.nix { };
   ledger3 = callPackage ../applications/office/ledger/3.0.nix { };
 
-  links2 = (builderDefsPackage ../applications/networking/browsers/links2) {
-    inherit fetchurl stdenv bzip2 zlib libjpeg libpng libtiff
-      gpm openssl SDL SDL_image SDL_net pkgconfig;
-    inherit (xlibs) libX11 libXau xproto libXt;
-  };
-
-  links2Stdenv = callPackage ../applications/networking/browsers/links2/stdenv.nix { };
+  links2 = callPackage ../applications/networking/browsers/links2 { };
 
   linphone = callPackage ../applications/networking/linphone {
     inherit (gnome) libglade gtk;
-- 
tg: (1720dd3..) t/links2-merge (depends on: master)


More information about the nix-dev mailing list