Commit 912167e3 authored by PapayaJackal's avatar PapayaJackal
Browse files

pilot-link: init at unstable-2022-09-26

parent 93df0d6b
Loading
Loading
Loading
Loading
+27 −0
Original line number Diff line number Diff line
--- pilot-link/configure.ac
+++ pilot-link/configure.ac
@@ -63,8 +63,8 @@
 dnl Eat -Werror so configure will run properly, if the user provided it
 enable_werror=no
 save_CFLAGS="$CFLAGS"
-CFLAGS=$(echo $save_CFLAGS | sed -e s/-Werror//g)
-CXXFLAGS=$(echo $save_CXXFLAGS | sed -e s/-Werror//g)
+CFLAGS=$(echo "$save_CFLAGS" | sed -e 's/-Werror[^=]//g')
+CXXFLAGS=$(echo "$save_CXXFLAGS" | sed -e 's/-Werror[^=]//g')
 if test "x$CFLAGS" != "x$save_CFLAGS"; then
 	dnl -Werror was set; treat it as implicit --enable-werror below
 	enable_werror="yes"
@@ -392,11 +392,8 @@
 		dnl Determine if system popt is good enough
 		save_LIBS="$LIBS"
 		AC_CHECK_HEADER(popt.h,
-			AC_CHECK_DECL(POPT_BIT_SET,
-				AC_CHECK_LIB(popt, poptStrippedArgv,,
-					[with_included_popt="yes"]),
-				[with_included_popt="yes"],
-				[#include <popt.h>]),
+			AC_CHECK_LIB(popt, poptStrippedArgv,,
+				[with_included_popt="yes"]),
 			[with_included_popt="yes"]
 		)
 		LIBS="$save_LIBS"
+53 −0
Original line number Diff line number Diff line
--- pilot-link/src/pilot-dlpsh.c
+++ pilot-link/src/pilot-dlpsh.c
@@ -389,7 +389,7 @@
 
 	strftime(timebuf, 80, "Now setting Palm time from desktop to: "
 			      "%a %b %d %H:%M:%S %Z %Y\n", tm_ptr);
-	printf(timebuf);
+	printf("%s", timebuf);
 	gettimeofday(&tv, 0);
 	ltime = tv.tv_sec + 1;
 	usleep(1000000 - tv.tv_usec);
--- pilot-link/src/pilot-hinotes.c
+++ pilot-link/src/pilot-hinotes.c
@@ -79,9 +79,7 @@
 		printf("...\n");
 	else
 		printf("\n");
-	printf("\n");
-	printf(m.text);
-	printf("\n");
+	printf("\n%s\n", m.text);
 }
 
 void write_memo_in_directory(char *dirname, struct HiNoteNote m,
--- pilot-link/src/pilot-xfer.c
+++ pilot-link/src/pilot-xfer.c
@@ -2477,8 +2477,7 @@
 				{
 					fprintf(stderr, "   ERROR: '%s' is not a directory or does not exist.\n"
 							"   Please supply a directory name when performing a "
-							"backup or restore and try again.\n\n", dirname);
-					fprintf(stderr,gracias);
+							"backup or restore and try again.\n\n%s", dirname, gracias);
 					return 1;
 				}
 			}
@@ -2487,14 +2486,12 @@
 		case palm_op_list:
 			if (rargc > 0)
 			{
-				fprintf(stderr,"   ERROR: Do not pass additional arguments to -busrlLC.\n");
-				fprintf(stderr,gracias);
+				fprintf(stderr,"   ERROR: Do not pass additional arguments to -busrlLC.\n%s", gracias);
 				return 1;
 			}
 			break;
 		case palm_op_noop:
-			fprintf(stderr,"   ERROR: Must specify one of -bursimfdlC.\n");
-			fprintf(stderr,gracias);
+			fprintf(stderr,"   ERROR: Must specify one of -bursimfdlC.\n%s", gracias);
 			return 1;
 			break;
 		case palm_op_merge:
+65 −0
Original line number Diff line number Diff line
{
  lib,
  stdenv,
  fetchFromGitHub,
  autoreconfHook,
  pkg-config,
  darwin,
  popt,
  bluezSupport ? stdenv.hostPlatform.isLinux,
  bluez,
  readlineSupport ? true,
  readline,
  enableConduits ? true,
  bison,
  enableLibpng ? true,
  libpng,
  enableLibusb ? true,
  libusb-compat-0_1,
}:

stdenv.mkDerivation {
  pname = "pilot-link";
  version = "0.12.3-unstable-2022-09-26";

  src = fetchFromGitHub {
    owner = "desrod";
    repo = "pilot-link";
    rev = "14338868111ce592c7ca7918a1f8a32ceecb7caf";
    hash = "sha256-3b5T/QnRZawnjTgwvQKUbJTE/NiJ93eU2+qbRFuI13I";
  };

  # Resolve build issues on modern systems.
  # https://github.com/desrod/pilot-link/issues/16
  # https://aur.archlinux.org/packages/pilot-link-git
  patches =
    [ ./configure-checks.patch ]
    ++ lib.optionals enableConduits [ ./format-string-literals.patch ]
    ++ lib.optionals enableLibpng [ ./pilot-link-png14.patch ];

  nativeBuildInputs = [
    autoreconfHook
    pkg-config
  ] ++ lib.optionals enableConduits [ bison ];

  buildInputs =
    [ popt ]
    ++ lib.optionals bluezSupport [ bluez ]
    ++ lib.optionals enableLibpng [ libpng ]
    ++ lib.optionals enableLibusb [ libusb-compat-0_1 ]
    ++ lib.optionals readlineSupport [ readline ]
    ++ lib.optionals stdenv.hostPlatform.isDarwin (with darwin.apple_sdk.frameworks; [ IOKit ]);

  configureFlags =
    [ "--with-libiconv" ]
    ++ lib.optionals enableConduits [ "--enable-conduits" ]
    ++ lib.optionals enableLibpng [ "--enable-libpng" ]
    ++ lib.optionals enableLibusb [ "--enable-libusb" ];

  meta = {
    description = "Suite of tools for connecting to PalmOS handheld devices";
    homepage = "https://github.com/desrod/pilot-link";
    license = lib.licenses.gpl2;
    maintainers = with lib.maintainers; [ PapayaJackal ];
  };
}
+100 −0
Original line number Diff line number Diff line
diff -ru pilot-link-0.12.4/src/pilot-read-notepad.c pilot-link-0.12.4.png14/src/pilot-read-notepad.c
--- pilot-link-0.12.4/src/pilot-read-notepad.c	2007-02-05 00:06:02.000000000 +0100
+++ pilot-link-0.12.4.png14/src/pilot-read-notepad.c	2010-01-17 15:04:33.000000000 +0100
@@ -39,10 +39,6 @@
 
 #ifdef HAVE_PNG
 #include "png.h"
-#if (PNG_LIBPNG_VER < 10201)
- #define png_voidp_NULL (png_voidp)NULL
- #define png_error_ptr_NULL (png_error_ptr)NULL
-#endif
 #endif
 
 const char *progname;
@@ -166,8 +162,8 @@
    width = n->body.width + 8;
 
    png_ptr = png_create_write_struct
-     ( PNG_LIBPNG_VER_STRING, png_voidp_NULL,
-       png_error_ptr_NULL, png_error_ptr_NULL);
+     ( PNG_LIBPNG_VER_STRING, NULL,
+       NULL, NULL);
 
    if(!png_ptr)
      return;
diff -ru pilot-link-0.12.4/src/pilot-read-palmpix.c pilot-link-0.12.4.png14/src/pilot-read-palmpix.c
--- pilot-link-0.12.4/src/pilot-read-palmpix.c	2007-02-05 00:06:03.000000000 +0100
+++ pilot-link-0.12.4.png14/src/pilot-read-palmpix.c	2010-01-17 15:03:20.000000000 +0100
@@ -42,10 +42,6 @@
 
 #ifdef HAVE_PNG
 #include "png.h"
-#if (PNG_LIBPNG_VER < 10201)
- #define png_voidp_NULL (png_voidp)NULL
- #define png_error_ptr_NULL (png_error_ptr)NULL
-#endif
 #endif
 
 const char *progname;
@@ -223,8 +219,8 @@
 	png_infop info_ptr;
 
 	png_ptr = png_create_write_struct
-		( PNG_LIBPNG_VER_STRING, png_voidp_NULL,
-		png_error_ptr_NULL, png_error_ptr_NULL);
+		( PNG_LIBPNG_VER_STRING, NULL,
+		NULL, NULL);
 
 	if(!png_ptr)
 		return;
diff -ru pilot-link-0.12.4/src/pilot-read-screenshot.c pilot-link-0.12.4.png14/src/pilot-read-screenshot.c
--- pilot-link-0.12.4/src/pilot-read-screenshot.c	2006-11-02 15:54:31.000000000 +0100
+++ pilot-link-0.12.4.png14/src/pilot-read-screenshot.c	2010-01-17 15:03:52.000000000 +0100
@@ -40,10 +40,6 @@
 
 #ifdef HAVE_PNG
 # include "png.h"
-# if (PNG_LIBPNG_VER < 10201)
-#  define png_voidp_NULL (png_voidp)NULL
-#  define png_error_ptr_NULL (png_error_ptr)NULL
-# endif
 #endif
 
 #define pi_mktag(c1,c2,c3,c4) (((c1)<<24)|((c2)<<16)|((c3)<<8)|(c4))
@@ -87,8 +83,8 @@
 		gray_buf = malloc( state->w );
 
 	png_ptr = png_create_write_struct
-		(PNG_LIBPNG_VER_STRING, png_voidp_NULL,
-		png_error_ptr_NULL, png_error_ptr_NULL);
+		(PNG_LIBPNG_VER_STRING, NULL,
+		NULL, NULL);
 
 	if (!png_ptr)
 		return;
diff -ru pilot-link-0.12.4/src/pilot-read-veo.c pilot-link-0.12.4.png14/src/pilot-read-veo.c
--- pilot-link-0.12.4/src/pilot-read-veo.c	2007-02-05 00:06:03.000000000 +0100
+++ pilot-link-0.12.4.png14/src/pilot-read-veo.c	2010-01-17 15:04:14.000000000 +0100
@@ -41,10 +41,6 @@
 
 #ifdef HAVE_PNG
 # include "png.h"
-# if (PNG_LIBPNG_VER < 10201)
-#  define png_voidp_NULL (png_voidp)NULL
-#  define png_error_ptr_NULL (png_error_ptr)NULL
-# endif
 #endif
 
 #define pi_mktag(c1,c2,c3,c4) (((c1)<<24)|((c2)<<16)|((c3)<<8)|(c4))
@@ -856,8 +852,8 @@
    png_infop info_ptr;
 
    png_ptr = png_create_write_struct
-	 (PNG_LIBPNG_VER_STRING, png_voidp_NULL,
-	  png_error_ptr_NULL, png_error_ptr_NULL);
+	 (PNG_LIBPNG_VER_STRING, NULL,
+	  NULL, NULL);
 
    if (!png_ptr)
 	 return;