iotools: Fix werror and refactor definition

+20 -5
+13
pkgs/by-name/io/iotools/001-fix-werror-in-sprintf.patch
···
··· 1 + diff --git a/commands.c b/commands.c 2 + index a83f1d5..b3f217a 100644 3 + --- a/commands.c 4 + +++ b/commands.c 5 + @@ -152,1 +152,7 @@ build_symlink_name(const char *path_to_bin, const struct cmd_info *cmd) 6 + - snprintf(link_name, FILENAME_MAX, "%s/%s", path_to_bin, cmd->name); 7 + + int result = snprintf(link_name, FILENAME_MAX, "%s/%s", path_to_bin, cmd->name); 8 + + 9 + + if (result >= FILENAME_MAX) { 10 + + link_name[FILENAME_MAX - 1] = '\0'; 11 + + } else if (result < 0) { 12 + + link_name[0] = '\0'; 13 + + }
+7 -5
pkgs/by-name/io/iotools/package.nix
··· 4 fetchFromGitHub, 5 }: 6 7 - stdenv.mkDerivation { 8 pname = "iotools"; 9 version = "unstable-2017-12-11"; 10 ··· 15 hash = "sha256-tlGXJn3n27mQDupMIVYDd86YaWazVwel/qs0QqCy1W8="; 16 }; 17 18 makeFlags = [ 19 "DEBUG=0" 20 "STATIC=0" ··· 24 install -Dm755 iotools -t $out/bin 25 ''; 26 27 - meta = with lib; { 28 description = "Set of simple command line tools which allow access to 29 hardware device registers"; 30 longDescription = '' ··· 35 operations. 36 ''; 37 homepage = "https://github.com/adurbin/iotools"; 38 - license = licenses.gpl2Only; 39 - maintainers = with maintainers; [ felixsinger ]; 40 platforms = [ 41 "x86_64-linux" 42 "i686-linux" 43 ]; 44 mainProgram = "iotools"; 45 }; 46 - }
··· 4 fetchFromGitHub, 5 }: 6 7 + stdenv.mkDerivation (finalAttrs: { 8 pname = "iotools"; 9 version = "unstable-2017-12-11"; 10 ··· 15 hash = "sha256-tlGXJn3n27mQDupMIVYDd86YaWazVwel/qs0QqCy1W8="; 16 }; 17 18 + patches = [ ./001-fix-werror-in-sprintf.patch ]; 19 + 20 makeFlags = [ 21 "DEBUG=0" 22 "STATIC=0" ··· 26 install -Dm755 iotools -t $out/bin 27 ''; 28 29 + meta = { 30 description = "Set of simple command line tools which allow access to 31 hardware device registers"; 32 longDescription = '' ··· 37 operations. 38 ''; 39 homepage = "https://github.com/adurbin/iotools"; 40 + license = lib.licenses.gpl2Only; 41 + maintainers = with lib.maintainers; [ felixsinger ]; 42 platforms = [ 43 "x86_64-linux" 44 "i686-linux" 45 ]; 46 mainProgram = "iotools"; 47 }; 48 + })