about summary refs log tree commit diff
diff options
context:
space:
mode:
authorStig Palmquist <stig@stig.io>2019-10-04 15:48:09 +0200
committerStig Palmquist <stig@stig.io>2019-10-04 16:00:57 +0200
commitbd4b0149632529167bdc08292a5ef37f52cddd40 (patch)
treef3e0fa69476f056d214f9d27fa40d2ec27ebffdb
parent85b7d89892a4ea088d541a694addb2e363758e44 (diff)
downloadnixlib-bd4b0149632529167bdc08292a5ef37f52cddd40.tar
nixlib-bd4b0149632529167bdc08292a5ef37f52cddd40.tar.gz
nixlib-bd4b0149632529167bdc08292a5ef37f52cddd40.tar.bz2
nixlib-bd4b0149632529167bdc08292a5ef37f52cddd40.tar.lz
nixlib-bd4b0149632529167bdc08292a5ef37f52cddd40.tar.xz
nixlib-bd4b0149632529167bdc08292a5ef37f52cddd40.tar.zst
nixlib-bd4b0149632529167bdc08292a5ef37f52cddd40.zip
perlPackages.DeviceMAC: init at 1.00
dependencies:
- perlPackages.DeviceOUI: init at 1.04

Patch to prevent random test failures in Device::OUI is included:

  https://rt.cpan.org/Public/Bug/Display.html?id=109209
  https://rt.cpan.org/Ticket/Attachment/1657288/889472/Device-OUI-1.04-hash.patch
-rw-r--r--pkgs/development/perl-modules/Device-OUI-1.04-hash.patch11
-rw-r--r--pkgs/top-level/perl-packages.nix33
2 files changed, 44 insertions, 0 deletions
diff --git a/pkgs/development/perl-modules/Device-OUI-1.04-hash.patch b/pkgs/development/perl-modules/Device-OUI-1.04-hash.patch
new file mode 100644
index 000000000000..6133ab674756
--- /dev/null
+++ b/pkgs/development/perl-modules/Device-OUI-1.04-hash.patch
@@ -0,0 +1,11 @@
+--- Device-OUI-1.04/lib/Device/OUI.pm.orig	2009-03-07 02:23:17.000000000 +0000
++++ Device-OUI-1.04/lib/Device/OUI.pm	2016-08-09 08:19:00.642799675 +0100
+@@ -54,7 +54,7 @@
+         for my $x ( keys %hash ) {
+             if ( not defined $hash{ $x } ) { $hash{ $x } = '' }
+         }
+-        return $handle->{ $oui } = join( "\0", %hash );
++        return $handle->{ $oui } = join( "\0", map {$_,$hash{$_}} sort keys %hash );
+     } elsif ( my $x = $handle->{ $oui } ) {
+         return { split( "\0", $x ) };
+     }
diff --git a/pkgs/top-level/perl-packages.nix b/pkgs/top-level/perl-packages.nix
index eabcff964b9f..e99183a82667 100644
--- a/pkgs/top-level/perl-packages.nix
+++ b/pkgs/top-level/perl-packages.nix
@@ -4544,6 +4544,39 @@ let
     };
   };
 
+  DeviceMAC = buildPerlPackage {
+    pname = "Device-MAC";
+    version = "1.00";
+    src = fetchurl {
+      url = "mirror://cpan/authors/id/J/JA/JASONK/Device-MAC-1.00.tar.gz";
+      sha256 = "c42182a9a8489a314cbfe6e1c8452f32b3b626aa6c89fee1d8925e6dfb64fad5";
+    };
+    buildInputs = [ TestMost TestDifferences TestException TestWarn TestDeep ];
+    propagatedBuildInputs = [ DeviceOUI Moose ];
+    meta = {
+      description = "Handle hardware MAC Addresses (EUI-48 and EUI-64)";
+      license = with stdenv.lib.licenses; [ artistic1 gpl1Plus ];
+      maintainers = [ maintainers.sgo ];
+    };
+  };
+
+  DeviceOUI = buildPerlPackage {
+    pname = "Device-OUI";
+    version = "1.04";
+    src = fetchurl {
+      url = "mirror://cpan/authors/id/J/JA/JASONK/Device-OUI-1.04.tar.gz";
+      sha256 = "4b367e61b1fadde77fb6fb729f3cd5acd1d46e71218d96f406bcba38d43b4bef";
+    };
+    buildInputs = [ TestException ];
+    patches = [ ../development/perl-modules/Device-OUI-1.04-hash.patch ];
+    propagatedBuildInputs = [ ClassAccessorGrouped SubExporter LWP ];
+    meta = {
+      description = "Resolve an Organizationally Unique Identifier";
+      license = with stdenv.lib.licenses; [ artistic1 gpl1Plus ];
+      maintainers = [ maintainers.sgo ];
+    };
+  };
+
   DBDMock = buildPerlModule {
     pname = "DBD-Mock";
     version = "1.45";