libical: add package
authorHenrik Grimler <Henrik@Grimler.se>
Thu, 7 Dec 2017 20:45:03 +0000 (21:45 +0100)
committerFredrik Fornwall <fredrik@fornwall.net>
Fri, 8 Dec 2017 23:23:12 +0000 (00:23 +0100)
packages/libical/build.sh [new file with mode: 0644]
packages/libical/stow.c.patch [new file with mode: 0644]

diff --git a/packages/libical/build.sh b/packages/libical/build.sh
new file mode 100644 (file)
index 0000000..3773b30
--- /dev/null
@@ -0,0 +1,5 @@
+TERMUX_PKG_DESCRIPTION="Libical is an Open Source implementation of the iCalendar protocols and protocol data units"
+TERMUX_PKG_VERSION=3.0.1
+TERMUX_PKG_SRCURL=https://github.com/libical/libical/releases/download/v$TERMUX_PKG_VERSION/libical-$TERMUX_PKG_VERSION.tar.gz
+TERMUX_PKG_DEPENDS="libxml2"
+TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" -DSHARED_ONLY=true -DICAL_GLIB=false"
diff --git a/packages/libical/stow.c.patch b/packages/libical/stow.c.patch
new file mode 100644 (file)
index 0000000..f87984c
--- /dev/null
@@ -0,0 +1,69 @@
+--- ./src/test/stow.c  2017-11-19 14:32:53.000000000 +0000
++++ ../stow.c  2017-12-07 20:41:54.498696535 +0000
+@@ -572,40 +572,41 @@
+     if (opt->storage == STORE_IN_FILE && opt->output_file == 0) {
+         char file[MAXPATHLEN];
+         char *user = getenv("USER");
+-        struct passwd *pw;
++      #ifndef __ANDROID__
++           struct passwd *pw;
++      #endif
+         if (!user) {
+-            fprintf(stderr,
+-                    "%s: Can't get username. Try explicitly specifying the output file with -o",
+-                    program_name);
+-            exit(1);
++          user = "TERMUX";
+         }
+         /* Find password entry for user */
+         /* cppcheck-suppress getpwentCalled as we don't care about multi-threaded in a test prog */
+-        while ((pw = getpwent()) != 0) {
+-            if (strcmp(user, pw->pw_name) == 0) {
+-                break;
++      #ifndef __ANDROID__
++            while ((pw = getpwent()) != 0) {
++                if (strcmp(user, pw->pw_name) == 0) {
++                    break;
++                }
++           }
++
++            if (pw == 0) {
++                fprintf(stderr,
++                        "%s: Can't get get password entry for user \"%s\" "
++                       "Try explicitly specifying the output file with -o",
++                        program_name, user);
++                exit(1);
+             }
+-        }
+-
+-        if (pw == 0) {
+-            fprintf(stderr,
+-                    "%s: Can't get get password entry for user \"%s\" "
+-                    "Try explicitly specifying the output file with -o",
+-                    program_name, user);
+-            exit(1);
+-        }
+-        if (pw->pw_dir == 0) {
+-            fprintf(stderr,
+-                    "%s: User \"%s\" has no home directory. "
+-                    "Try explicitly specifying the output file with -o",
+-                    program_name, user);
+-            exit(1);
+-        }
++            if (pw->pw_dir == 0) {
++                fprintf(stderr,
++                        "%s: User \"%s\" has no home directory. "
++                        "Try explicitly specifying the output file with -o",
++                        program_name, user);
++                exit(1);
++            }
+-        snprintf(file, MAXPATHLEN, "%s/.facs/%s", pw->pw_dir, opt->calid);
++            snprintf(file, MAXPATHLEN, "%s/.facs/%s", pw->pw_dir, opt->calid);
++      #endif
+         opt->output_file = strdup(file);
+     }