summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authoréclairevoyant2023-01-27 00:48:06 -0500
committeréclairevoyant2023-01-27 00:48:52 -0500
commit2223c7c3a22bc19c1d4ec81c428ac5a9d79e62b0 (patch)
tree7e6321a9ce6b3fad82519a7f1612dfa548cc035c
parentf9638df8427e6fa3e237cf470301d8ecdbeec0bb (diff)
downloadaur-2223c7c3a22bc19c1d4ec81c428ac5a9d79e62b0.tar.gz
pal: fix compilation and patch most warnings
Signed-off-by: éclairevoyant <848000+eclairevoyant@users.noreply.github.com>
-rw-r--r--.SRCINFO22
-rw-r--r--.gitignore5
-rw-r--r--0001-respect-cflags.patch32
-rw-r--r--0002-remove-hacky-cast.patch26
-rw-r--r--0003-replace-deprecated-constants.patch40
-rw-r--r--0004-use-g_memdup2.patch40
-rw-r--r--0005-fix-pointer-comparison.patch26
-rw-r--r--PKGBUILD43
8 files changed, 214 insertions, 20 deletions
diff --git a/.SRCINFO b/.SRCINFO
index c0918f40bee5..8550d94ceb61 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,17 +1,27 @@
pkgbase = pal
pkgdesc = A command-line calendar program.
pkgver = 0.4.3
- pkgrel = 6
- url = http://palcal.sourceforge.net
+ pkgrel = 7
+ url = https://palcal.sourceforge.net
arch = i686
arch = x86_64
- license = GPL
+ license = GPL2
depends = pkg-config
depends = glib2
depends = readline
depends = gettext
- source = http://iweb.dl.sourceforge.net/project/palcal/pal/0.4.3/pal-0.4.3.tgz
- sha256sums = ce470cb7be76522ff58cd0325ad7817b6cc2132a5e0cea55de8c9eb63b54551c
+ optdepends = texlive: PS/PDF/DVI calendars
+ source = https://master.dl.sourceforge.net/project/palcal/pal/0.4.3/pal-0.4.3.tgz
+ source = 0001-respect-cflags.patch
+ source = 0002-remove-hacky-cast.patch
+ source = 0003-replace-deprecated-constants.patch
+ source = 0004-use-g_memdup2.patch
+ source = 0005-fix-pointer-comparison.patch
+ b2sums = 3d2629b534a644a3f760f64176340ffd73c0f33b6717e726662d6888a8007160a2978560f1e5f40140f128036e57a53e5b3c930fa07802f7170c1dc6fbce745d
+ b2sums = c205beed29c17c39e839c61bd7205cb93cb6823e6eb5fa78f4caa8f8f37477e23c3d613d54f0d8b39e40e0b1f3be1d9c9395fe5e00968290d972cf3b27f7b012
+ b2sums = b01f37a293f8d6271d5515372b57fab1da30b4b3a9398ba6d0ea52382f370db1bfb053a4607a4eb1dc9e5f7c3121de6058a9a81d0a43f90ffcbb477b49dc30aa
+ b2sums = 9700348c30a576759cf79e18e3ab660bd58131849870fbde0e59e630667dfb6a8f75dfca2290ca08842b30029764c9fe833bd86683bf0097de788a533fc663f5
+ b2sums = 0d6bbcd6b149306280f14c869cfc27e8073cba87785de13b53676f102c6a632d12c2e12bb7403a78824e603032388ee67414e49d3a95609d948849329d87b5a8
+ b2sums = 832a30a51e324b24bf0e383dfb55cffe345756a1df2fc3c04443b087bbfed16c3043c4bdd7a674f57439d8a03be45ef6cd3d9685663d43ac13cc805e7262fab0
pkgname = pal
-
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..fb1076b778a3
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,5 @@
+*
+!.gitignore
+!.SRCINFO
+!PKGBUILD
+!000*.patch
diff --git a/0001-respect-cflags.patch b/0001-respect-cflags.patch
new file mode 100644
index 000000000000..0fe4bf38221a
--- /dev/null
+++ b/0001-respect-cflags.patch
@@ -0,0 +1,32 @@
+From 60035e19b8046d7104677fc663f5d24bd768a111 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?=C3=A9clairevoyant?=
+ <848000+eclairevoyant@users.noreply.github.com>
+Date: Fri, 27 Jan 2023 00:26:17 -0500
+Subject: [PATCH 1/5] respect cflags
+
+---
+ src/Makefile.defs | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/src/Makefile.defs b/src/Makefile.defs
+index d75a0a9..b5ab160 100644
+--- a/src/Makefile.defs
++++ b/src/Makefile.defs
+@@ -12,7 +12,6 @@ PAL_VERSION = 0.4.3
+ DESTDIR =
+
+ # optimizations/warnings
+-OPT = -O2 -Wall
+ ifeq ($(DEBUG),1)
+ OPT = -g -Wall -pedantic -Wstrict-prototypes
+ endif
+@@ -23,6 +22,5 @@ ifeq ($(DEBUG),1)
+ DEFS += -DG_DISABLE_DEPRECATED -DDEBUG
+ endif
+
+-CFLAGS = ${OPT}
+ CPPFLAGS = ${INCLDIR} ${DEFS}
+ LDFLAGS = ${LIBDIR} ${LIBS}
+--
+2.39.0
+
diff --git a/0002-remove-hacky-cast.patch b/0002-remove-hacky-cast.patch
new file mode 100644
index 000000000000..26964325b9b0
--- /dev/null
+++ b/0002-remove-hacky-cast.patch
@@ -0,0 +1,26 @@
+From 927b459d8eb4738ff87cc4d4d97f01873aaed685 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?=C3=A9clairevoyant?=
+ <848000+eclairevoyant@users.noreply.github.com>
+Date: Fri, 27 Jan 2023 00:18:41 -0500
+Subject: [PATCH 2/5] remove hacky cast
+
+---
+ src/manage.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/manage.c b/src/manage.c
+index 96f05b3..ccee7a4 100644
+--- a/src/manage.c
++++ b/src/manage.c
+@@ -403,7 +403,7 @@ void pal_manage(void)
+ rl_initialize(); /* Initialise readline so we can fiddle stuff */
+ rl_already_prompted = 1;
+ rl_redisplay_function = pal_rl_ncurses_hack;
+- rl_pre_input_hook = (Function*) pal_rl_ncurses_hack;
++ rl_pre_input_hook = pal_rl_ncurses_hack;
+
+
+ /* initialize curses */
+--
+2.39.0
+
diff --git a/0003-replace-deprecated-constants.patch b/0003-replace-deprecated-constants.patch
new file mode 100644
index 000000000000..4faf59d700ab
--- /dev/null
+++ b/0003-replace-deprecated-constants.patch
@@ -0,0 +1,40 @@
+From f29f5e45f9907b213284efa5eeded3df974eedef Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?=C3=A9clairevoyant?=
+ <848000+eclairevoyant@users.noreply.github.com>
+Date: Fri, 27 Jan 2023 00:19:16 -0500
+Subject: [PATCH 3/5] replace deprecated constants
+
+---
+ src/main.c | 2 +-
+ src/remind.c | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/main.c b/src/main.c
+index 9e8284a..dcbb312 100644
+--- a/src/main.c
++++ b/src/main.c
+@@ -702,7 +702,7 @@ void pal_main_reload(void)
+
+ int main(gint argc, gchar** argv)
+ {
+- G_CONST_RETURN gchar *charset = NULL;
++ const gchar *charset = NULL;
+ gint on_arg = 1;
+ GDate* today = g_date_new();
+
+diff --git a/src/remind.c b/src/remind.c
+index 4dcbafd..cd96bdf 100644
+--- a/src/remind.c
++++ b/src/remind.c
+@@ -56,7 +56,7 @@ static void pal_remind_event(void)
+ FILE* tmp_stream;
+ int return_val;
+ gchar* email_add;
+- G_CONST_RETURN gchar *charset;
++ const gchar *charset;
+ at_string = g_malloc(1024*sizeof(gchar));
+
+ pal_output_fg(BRIGHT, GREEN, "* * * ");
+--
+2.39.0
+
diff --git a/0004-use-g_memdup2.patch b/0004-use-g_memdup2.patch
new file mode 100644
index 000000000000..0a066d844657
--- /dev/null
+++ b/0004-use-g_memdup2.patch
@@ -0,0 +1,40 @@
+From a34f3813ee22f0065f551636926cf43adcc95149 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?=C3=A9clairevoyant?=
+ <848000+eclairevoyant@users.noreply.github.com>
+Date: Fri, 27 Jan 2023 00:28:53 -0500
+Subject: [PATCH 4/5] use g_memdup2
+
+---
+ src/event.c | 2 +-
+ src/main.c | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/event.c b/src/event.c
+index aaecf3c..703e9e1 100644
+--- a/src/event.c
++++ b/src/event.c
+@@ -729,7 +729,7 @@ GDate* get_date(const gchar* key)
+
+ static gboolean last_weekday_of_month(const GDate* date)
+ {
+- GDate* local = g_memdup(date,sizeof(GDate));
++ GDate* local = g_memdup2(date,sizeof(GDate));
+
+ g_date_add_days(local,7);
+ if(g_date_get_month(local) != g_date_get_month(date))
+diff --git a/src/main.c b/src/main.c
+index dcbb312..62850ee 100644
+--- a/src/main.c
++++ b/src/main.c
+@@ -396,7 +396,7 @@ static void view_details(void)
+ g_date_set_time_t(starting_date, time(NULL));
+ }
+ else /* otherwise, start from date specified */
+- starting_date = g_memdup(to_show, sizeof(GDate));
++ starting_date = g_memdup2(to_show, sizeof(GDate));
+
+ g_date_subtract_days(starting_date, settings->range_neg_days);
+
+--
+2.39.0
+
diff --git a/0005-fix-pointer-comparison.patch b/0005-fix-pointer-comparison.patch
new file mode 100644
index 000000000000..4de3bf8d8aa5
--- /dev/null
+++ b/0005-fix-pointer-comparison.patch
@@ -0,0 +1,26 @@
+From df34ba0eaf2e3c4cbcb1f69b72c4e44d0c97ba4a Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?=C3=A9clairevoyant?=
+ <848000+eclairevoyant@users.noreply.github.com>
+Date: Fri, 27 Jan 2023 00:30:41 -0500
+Subject: [PATCH 5/5] fix pointer comparison
+
+---
+ src/input.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/input.c b/src/input.c
+index 79db485..c7bc2d2 100644
+--- a/src/input.c
++++ b/src/input.c
+@@ -100,7 +100,7 @@ static PalTime* pal_input_get_time(gchar* s, gint n)
+
+ /* get the minutes digits */
+ m2 = g_utf8_find_next_char(s, NULL);
+- if(m2 == '\0')
++ if (*m2 == '\0')
+ return NULL; /* hit end of line, done */
+ m1 = g_utf8_find_next_char(m2, NULL);
+
+--
+2.39.0
+
diff --git a/PKGBUILD b/PKGBUILD
index 1e689102a4da..da5427230e91 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,29 +1,44 @@
-# Maintainer: juantascon <juantascon.aur@horlux.org>
-# Contributor: damir <damir@archlinux.org>
+# Maintainer: éclairevoyant
+# Contributor: juantascon <juantascon dot aur at horlux dot org>
+# Contributor: damir <damir at archlinux dot org>
pkgname=pal
pkgver=0.4.3
-pkgrel=6
+pkgrel=7
pkgdesc="A command-line calendar program."
arch=('i686' 'x86_64')
-url="http://palcal.sourceforge.net"
-license=('GPL')
+url="https://palcal.sourceforge.net"
+license=('GPL2')
depends=('pkg-config' 'glib2' 'readline' 'gettext')
-source=(http://iweb.dl.sourceforge.net/project/palcal/pal/$pkgver/$pkgname-$pkgver.tgz)
-sha256sums=('ce470cb7be76522ff58cd0325ad7817b6cc2132a5e0cea55de8c9eb63b54551c')
+optdepends=('texlive: PS/PDF/DVI calendars')
+source=(
+ "https://master.dl.sourceforge.net/project/palcal/$pkgname/$pkgver/$pkgname-$pkgver.tgz"
+ 0001-respect-cflags.patch
+ 0002-remove-hacky-cast.patch
+ 0003-replace-deprecated-constants.patch
+ 0004-use-g_memdup2.patch
+ 0005-fix-pointer-comparison.patch
+)
+b2sums=('3d2629b534a644a3f760f64176340ffd73c0f33b6717e726662d6888a8007160a2978560f1e5f40140f128036e57a53e5b3c930fa07802f7170c1dc6fbce745d'
+ 'c205beed29c17c39e839c61bd7205cb93cb6823e6eb5fa78f4caa8f8f37477e23c3d613d54f0d8b39e40e0b1f3be1d9c9395fe5e00968290d972cf3b27f7b012'
+ 'b01f37a293f8d6271d5515372b57fab1da30b4b3a9398ba6d0ea52382f370db1bfb053a4607a4eb1dc9e5f7c3121de6058a9a81d0a43f90ffcbb477b49dc30aa'
+ '9700348c30a576759cf79e18e3ab660bd58131849870fbde0e59e630667dfb6a8f75dfca2290ca08842b30029764c9fe833bd86683bf0097de788a533fc663f5'
+ '0d6bbcd6b149306280f14c869cfc27e8073cba87785de13b53676f102c6a632d12c2e12bb7403a78824e603032388ee67414e49d3a95609d948849329d87b5a8'
+ '832a30a51e324b24bf0e383dfb55cffe345756a1df2fc3c04443b087bbfed16c3043c4bdd7a674f57439d8a03be45ef6cd3d9685663d43ac13cc805e7262fab0')
prepare() {
- cd ${srcdir}/${pkgname}-${pkgver}/src
- sed -i "s:-O2 -Wall:${CFLAGS}:g" Makefile.defs
- sed -i "s: (Function\*)::" manage.c
+ cd $pkgname-$pkgver
+ patch -Np1 -i ../0001-respect-cflags.patch
+ patch -Np1 -i ../0002-remove-hacky-cast.patch
+ patch -Np1 -i ../0003-replace-deprecated-constants.patch
+ patch -Np1 -i ../0004-use-g_memdup2.patch
+ patch -Np1 -i ../0005-fix-pointer-comparison.patch
}
build() {
- cd ${srcdir}/${pkgname}-${pkgver}/src
- make
+ make -C $pkgname-$pkgver/src CFLAGS="$CFLAGS -Wno-format-security"
}
package() {
- cd ${srcdir}/${pkgname}-${pkgver}/src
- make DESTDIR=${pkgdir} install-no-rm
+ make -C $pkgname-$pkgver/src DESTDIR="$pkgdir" install-no-rm
}