Skip to content

Commit

Permalink
freesweep: 1.0.2 -> 1.1.0-unstable-2024-04-19
Browse files Browse the repository at this point in the history
freesweep has a new version in development and it seems to be usable,
let's update to it. I added myself as a maintainer and included a few
patches to allow it to build with and without mlibc (which I'm working
on in NixOS#371092).
  • Loading branch information
lzcunt committed Jan 14, 2025
1 parent fea33d6 commit 86fdc6f
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 9 deletions.
15 changes: 15 additions & 0 deletions pkgs/by-name/fr/freesweep/0001-include-strings.h.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/sweep.h b/sweep.h
index 198349d..549f39f 100644
--- a/sweep.h
+++ b/sweep.h
@@ -32,6 +32,10 @@
#include <string.h>
#endif /* HAVE_STRING_H */

+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif /* HAVE_STRINGS_H */
+
#ifdef HAVE_GETOPT_H
#include <getopt.h>
#endif /* HAVE_GETOPT_H */
13 changes: 13 additions & 0 deletions pkgs/by-name/fr/freesweep/0002-fix-Wformat-security.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/logs.c b/logs.c
index 5e87f52..29ad433 100644
--- a/logs.c
+++ b/logs.c
@@ -128,7 +128,7 @@ static void log_display(const char *mesg) {
// Display the message on the screen.
if (log_win) {
wclear(log_win);
- mvwprintw(log_win, 0, 0, mesg);
+ mvwprintw(log_win, 0, 0, "%s", mesg);
wnoutrefresh(log_win);
wrefresh(log_win);
}
12 changes: 12 additions & 0 deletions pkgs/by-name/fr/freesweep/0003-remove-ac_func_malloc.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/configure.ac b/configure.ac
index ae08308..5262e56 100644
--- a/configure.ac
+++ b/configure.ac
@@ -32,7 +32,6 @@ AC_TYPE_SIZE_T
AC_TYPE_UID_T

# Checks for library functions.
-AC_FUNC_MALLOC
AC_CHECK_FUNCS([alarm getcwd memset mkdir setlocale strdup strncasecmp
fileno flock lockf getopt getopt_long])

28 changes: 19 additions & 9 deletions pkgs/by-name/fr/freesweep/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,41 @@
ncurses,
lib,
stdenv,
updateAutotoolsGnuConfigScriptsHook,
autoconf,
automake,
pkg-config,
installShellFiles,
}:

stdenv.mkDerivation rec {
stdenv.mkDerivation {
pname = "freesweep";
version = "1.0.2";
version = "1.1.0-unstable-2024-04-19";

src = fetchFromGitHub {
owner = "rwestlund";
repo = "freesweep";
rev = "v${version}";
hash = "sha256-iuu81yHbNrjdPsimBrPK58PJ0d8i3ySM7rFUG/d8NJM";
rev = "68c0ee5b29d1087d216d95875a7036713cd25fc0";
hash = "sha256-ZnAH7mIuBMFLdrtJOY8PzNbxv+GDEFAgyEtWCpTH2Us=";
};

patches = [
./0001-include-strings.h.patch
./0002-fix-Wformat-security.patch
./0003-remove-ac_func_malloc.patch
];

nativeBuildInputs = [
updateAutotoolsGnuConfigScriptsHook
autoconf
automake
pkg-config
installShellFiles
];
buildInputs = [ ncurses ];

configureFlags = [ "--with-prefsdir=$out/share" ];

enableParallelBuilding = true;

preConfigure = "./autogen.sh";

installPhase = ''
runHook preInstall
install -D -m 0555 freesweep $out/bin/freesweep
Expand All @@ -41,7 +51,7 @@ stdenv.mkDerivation rec {
mainProgram = "freesweep";
homepage = "https://github.com/rwestlund/freesweep";
license = licenses.gpl2Only;
maintainers = with maintainers; [ ];
maintainers = [ maintainers.sanana ];
platforms = platforms.unix;
};
}

0 comments on commit 86fdc6f

Please sign in to comment.