From 912167e3e84b34b080934efda4c47b198b9ac195 Mon Sep 17 00:00:00 2001 From: PapayaJackal <145766029+PapayaJackal@users.noreply.github.com> Date: Sun, 20 Oct 2024 15:28:08 +0000 Subject: [PATCH 1/3] pilot-link: init at unstable-2022-09-26 --- .../pi/pilot-link/configure-checks.patch | 27 +++++ .../pilot-link/format-string-literals.patch | 53 ++++++++++ pkgs/by-name/pi/pilot-link/package.nix | 65 ++++++++++++ .../pi/pilot-link/pilot-link-png14.patch | 100 ++++++++++++++++++ 4 files changed, 245 insertions(+) create mode 100644 pkgs/by-name/pi/pilot-link/configure-checks.patch create mode 100644 pkgs/by-name/pi/pilot-link/format-string-literals.patch create mode 100644 pkgs/by-name/pi/pilot-link/package.nix create mode 100644 pkgs/by-name/pi/pilot-link/pilot-link-png14.patch diff --git a/pkgs/by-name/pi/pilot-link/configure-checks.patch b/pkgs/by-name/pi/pilot-link/configure-checks.patch new file mode 100644 index 000000000000..4533d463cff8 --- /dev/null +++ b/pkgs/by-name/pi/pilot-link/configure-checks.patch @@ -0,0 +1,27 @@ +--- 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 ]), ++ AC_CHECK_LIB(popt, poptStrippedArgv,, ++ [with_included_popt="yes"]), + [with_included_popt="yes"] + ) + LIBS="$save_LIBS" diff --git a/pkgs/by-name/pi/pilot-link/format-string-literals.patch b/pkgs/by-name/pi/pilot-link/format-string-literals.patch new file mode 100644 index 000000000000..203c58717abc --- /dev/null +++ b/pkgs/by-name/pi/pilot-link/format-string-literals.patch @@ -0,0 +1,53 @@ +--- 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: diff --git a/pkgs/by-name/pi/pilot-link/package.nix b/pkgs/by-name/pi/pilot-link/package.nix new file mode 100644 index 000000000000..e8eef25e3652 --- /dev/null +++ b/pkgs/by-name/pi/pilot-link/package.nix @@ -0,0 +1,65 @@ +{ + 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 ]; + }; +} diff --git a/pkgs/by-name/pi/pilot-link/pilot-link-png14.patch b/pkgs/by-name/pi/pilot-link/pilot-link-png14.patch new file mode 100644 index 000000000000..9d753332e830 --- /dev/null +++ b/pkgs/by-name/pi/pilot-link/pilot-link-png14.patch @@ -0,0 +1,100 @@ +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; From e84493b5e155c2c729ce19c754cda46dd5021cae Mon Sep 17 00:00:00 2001 From: PapayaJackal <145766029+PapayaJackal@users.noreply.github.com> Date: Sun, 20 Oct 2024 15:30:12 +0000 Subject: [PATCH 2/3] jpilot: init at 2.0.1 --- pkgs/by-name/jp/jpilot/fix-broken-types.patch | 54 +++++++++++++++++++ pkgs/by-name/jp/jpilot/package.nix | 51 ++++++++++++++++++ 2 files changed, 105 insertions(+) create mode 100644 pkgs/by-name/jp/jpilot/fix-broken-types.patch create mode 100644 pkgs/by-name/jp/jpilot/package.nix diff --git a/pkgs/by-name/jp/jpilot/fix-broken-types.patch b/pkgs/by-name/jp/jpilot/fix-broken-types.patch new file mode 100644 index 000000000000..24177af5d204 --- /dev/null +++ b/pkgs/by-name/jp/jpilot/fix-broken-types.patch @@ -0,0 +1,54 @@ +From 7ec8251e3570decd97b3050c9ba4fa0d59be93e2 Mon Sep 17 00:00:00 2001 +From: Morgan Kesler +Date: Thu, 13 Oct 2022 15:00:20 -0400 +Subject: [PATCH] Fix broken types from latest pilot-link changes + +Last year an update to the pilot link source broke this, it's part of +the patch from here https://github.com/desrod/pilot-link/pull/3 + +This is simply updating the types to match the changes +--- + contact.c | 2 +- + jp-contact.c | 2 +- + jp-pi-contact.h | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/contact.c b/contact.c +index 5ca3df68..f4fd6be1 100644 +--- a/contact.c ++++ b/contact.c +@@ -442,7 +442,7 @@ int copy_address_to_contact(const struct Address *a, struct Contact *c) + c->advance = 0; + c->advanceUnits = 0; + memset(&(c->birthday), 0, sizeof(struct tm)); +- for (i=0; iblob[i] = NULL; + } + c->picture = NULL; +diff --git a/jp-contact.c b/jp-contact.c +index 88d7f7f9..1d02ef2c 100644 +--- a/jp-contact.c ++++ b/jp-contact.c +@@ -54,7 +54,7 @@ int jp_pack_Contact(struct Contact *c, pi_buffer_t *buf) + return pack_Contact(c, buf, contacts_v10); + } + +-int jp_Contact_add_blob(struct Contact *c, struct ContactBlob *blob) ++int jp_Contact_add_blob(struct Contact *c, Blob_t *blob) + { + return Contact_add_blob(c, blob); + } +diff --git a/jp-pi-contact.h b/jp-pi-contact.h +index f36e679d..320dc76a 100644 +--- a/jp-pi-contact.h ++++ b/jp-pi-contact.h +@@ -47,7 +47,7 @@ extern int jp_pack_ContactAppInfo + PI_ARGS((struct ContactAppInfo *, pi_buffer_t *buf)); + + extern int jp_Contact_add_blob +- PI_ARGS((struct Contact *, struct ContactBlob *)); ++ PI_ARGS((struct Contact *, Blob_t *)); + extern int jp_Contact_add_picture + PI_ARGS((struct Contact *, struct ContactPicture *)); + #ifdef __cplusplus \ No newline at end of file diff --git a/pkgs/by-name/jp/jpilot/package.nix b/pkgs/by-name/jp/jpilot/package.nix new file mode 100644 index 000000000000..1b1642ac4ec8 --- /dev/null +++ b/pkgs/by-name/jp/jpilot/package.nix @@ -0,0 +1,51 @@ +{ + lib, + stdenv, + fetchFromGitHub, + autoreconfHook, + gtk3, + intltool, + libgcrypt, + pilot-link, + pkg-config, + slang, +}: + +stdenv.mkDerivation { + pname = "jpilot"; + version = "2.0.1"; + + src = fetchFromGitHub { + owner = "juddmon"; + repo = "jpilot"; + rev = "v2_0_1"; + hash = "sha256-CHCNDoYPi+2zMKkI6JIecmiWMvMF6WsgBZ6Ubfl0RJU="; + }; + + patches = [ ./fix-broken-types.patch ]; + + nativeBuildInputs = [ + autoreconfHook + intltool + pkg-config + ]; + buildInputs = [ + gtk3 + libgcrypt + pilot-link + slang + ]; + + preConfigure = '' + NOCONFIGURE=1 ./autogen.sh + ''; + + configureFlags = [ "--with-pilot-prefix=${pilot-link}" ]; + + meta = { + description = "Desktop organizer software for the Palm Pilot"; + homepage = "https://www.jpilot.org/"; + license = lib.licenses.gpl2; + maintainers = with lib.maintainers; [ PapayaJackal ]; + }; +} From 981f762fefc73bb09e93cd7f6ccea2cc26a83c00 Mon Sep 17 00:00:00 2001 From: PapayaJackal <145766029+PapayaJackal@users.noreply.github.com> Date: Wed, 23 Oct 2024 13:58:35 +0000 Subject: [PATCH 3/3] jpilot: 2.0.1 -> 2.0.2 --- pkgs/by-name/jp/jpilot/darwin-build.patch | 31 +++++++++++ pkgs/by-name/jp/jpilot/fix-broken-types.patch | 54 ------------------- pkgs/by-name/jp/jpilot/package.nix | 19 ++++--- 3 files changed, 42 insertions(+), 62 deletions(-) create mode 100644 pkgs/by-name/jp/jpilot/darwin-build.patch delete mode 100644 pkgs/by-name/jp/jpilot/fix-broken-types.patch diff --git a/pkgs/by-name/jp/jpilot/darwin-build.patch b/pkgs/by-name/jp/jpilot/darwin-build.patch new file mode 100644 index 000000000000..553059263cb0 --- /dev/null +++ b/pkgs/by-name/jp/jpilot/darwin-build.patch @@ -0,0 +1,31 @@ +diff --git a/configure.in b/configure.in +index 98055b7..fff401f 100644 +--- a/configure.in ++++ b/configure.in +@@ -249,6 +249,11 @@ for pilot_libs in $pilot_prefix/lib /usr/lib /usr/local/lib/ /usr/local/lib64 \ + PILOT_LIBS="-L$pilot_libs $PILOT_LIBS" + break + fi ++ if test -r "$pilot_libs/libpisock.dylib" ; then ++ pilotlibs=yes ++ PILOT_LIBS="-L$pilot_libs $PILOT_LIBS" ++ break ++ fi + done + fi + +diff --git a/libsqlite.c b/libsqlite.c +index 9557956..cf0b5ed 100644 +--- a/libsqlite.c ++++ b/libsqlite.c +@@ -3,10 +3,10 @@ + Elmar Klausmeier, 20-Sep-2022: Initial revision + */ + ++#define _GNU_SOURCE + #include + #include + #include +-extern char *strptime (const char *__restrict __s, const char *__restrict __fmt, struct tm *__tp) __THROW; + #include + #include diff --git a/pkgs/by-name/jp/jpilot/fix-broken-types.patch b/pkgs/by-name/jp/jpilot/fix-broken-types.patch deleted file mode 100644 index 24177af5d204..000000000000 --- a/pkgs/by-name/jp/jpilot/fix-broken-types.patch +++ /dev/null @@ -1,54 +0,0 @@ -From 7ec8251e3570decd97b3050c9ba4fa0d59be93e2 Mon Sep 17 00:00:00 2001 -From: Morgan Kesler -Date: Thu, 13 Oct 2022 15:00:20 -0400 -Subject: [PATCH] Fix broken types from latest pilot-link changes - -Last year an update to the pilot link source broke this, it's part of -the patch from here https://github.com/desrod/pilot-link/pull/3 - -This is simply updating the types to match the changes ---- - contact.c | 2 +- - jp-contact.c | 2 +- - jp-pi-contact.h | 2 +- - 3 files changed, 3 insertions(+), 3 deletions(-) - -diff --git a/contact.c b/contact.c -index 5ca3df68..f4fd6be1 100644 ---- a/contact.c -+++ b/contact.c -@@ -442,7 +442,7 @@ int copy_address_to_contact(const struct Address *a, struct Contact *c) - c->advance = 0; - c->advanceUnits = 0; - memset(&(c->birthday), 0, sizeof(struct tm)); -- for (i=0; iblob[i] = NULL; - } - c->picture = NULL; -diff --git a/jp-contact.c b/jp-contact.c -index 88d7f7f9..1d02ef2c 100644 ---- a/jp-contact.c -+++ b/jp-contact.c -@@ -54,7 +54,7 @@ int jp_pack_Contact(struct Contact *c, pi_buffer_t *buf) - return pack_Contact(c, buf, contacts_v10); - } - --int jp_Contact_add_blob(struct Contact *c, struct ContactBlob *blob) -+int jp_Contact_add_blob(struct Contact *c, Blob_t *blob) - { - return Contact_add_blob(c, blob); - } -diff --git a/jp-pi-contact.h b/jp-pi-contact.h -index f36e679d..320dc76a 100644 ---- a/jp-pi-contact.h -+++ b/jp-pi-contact.h -@@ -47,7 +47,7 @@ extern int jp_pack_ContactAppInfo - PI_ARGS((struct ContactAppInfo *, pi_buffer_t *buf)); - - extern int jp_Contact_add_blob -- PI_ARGS((struct Contact *, struct ContactBlob *)); -+ PI_ARGS((struct Contact *, Blob_t *)); - extern int jp_Contact_add_picture - PI_ARGS((struct Contact *, struct ContactPicture *)); - #ifdef __cplusplus \ No newline at end of file diff --git a/pkgs/by-name/jp/jpilot/package.nix b/pkgs/by-name/jp/jpilot/package.nix index 1b1642ac4ec8..430b6fd094b8 100644 --- a/pkgs/by-name/jp/jpilot/package.nix +++ b/pkgs/by-name/jp/jpilot/package.nix @@ -3,37 +3,39 @@ stdenv, fetchFromGitHub, autoreconfHook, + wrapGAppsHook3, gtk3, intltool, libgcrypt, pilot-link, pkg-config, - slang, + sqlite, }: -stdenv.mkDerivation { +stdenv.mkDerivation rec { pname = "jpilot"; - version = "2.0.1"; + version = "2.0.2"; src = fetchFromGitHub { owner = "juddmon"; repo = "jpilot"; - rev = "v2_0_1"; - hash = "sha256-CHCNDoYPi+2zMKkI6JIecmiWMvMF6WsgBZ6Ubfl0RJU="; + rev = "v${lib.replaceStrings [ "." ] [ "_" ] version}"; + hash = "sha256-ja/P6kq53C7drEPWemGMV5fB4BktHrbrxL39jLEGhRI="; }; - patches = [ ./fix-broken-types.patch ]; + patches = [ ./darwin-build.patch ]; # https://github.com/juddmon/jpilot/pull/59 nativeBuildInputs = [ autoreconfHook intltool pkg-config + wrapGAppsHook3 ]; + buildInputs = [ gtk3 libgcrypt - pilot-link - slang + sqlite ]; preConfigure = '' @@ -46,6 +48,7 @@ stdenv.mkDerivation { description = "Desktop organizer software for the Palm Pilot"; homepage = "https://www.jpilot.org/"; license = lib.licenses.gpl2; + mainProgram = "jpilot"; maintainers = with lib.maintainers; [ PapayaJackal ]; }; }