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