pkg update and first config fix
org-brain not working, add org-roam
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
bin_PROGRAMS = epdfinfo
|
||||
epdfinfo_CFLAGS = -Wall $(glib_CFLAGS) $(poppler_glib_CFLAGS) $(poppler_CFLAGS) \
|
||||
$(png_CFLAGS)
|
||||
epdfinfo_CXXFLAGS = -Wall $(epdfinfo_CFLAGS)
|
||||
# Need -lm to link libm.so.6
|
||||
epdfinfo_LDADD = $(glib_LIBS) $(poppler_glib_LIBS) $(poppler_LIBS) \
|
||||
$(png_LIBS) libsynctex.a $(zlib_LIBS)
|
||||
epdfinfo_SOURCES = epdfinfo.c epdfinfo.h poppler-hack.cc
|
||||
$(png_LIBS) libsynctex.a $(zlib_LIBS) -lm
|
||||
epdfinfo_SOURCES = epdfinfo.c epdfinfo.h
|
||||
|
||||
noinst_LIBRARIES = libsynctex.a
|
||||
libsynctex_a_SOURCES = synctex_parser.c synctex_parser_utils.c synctex_parser.h \
|
||||
|
||||
@@ -157,8 +157,6 @@ have_packages_installed()
|
||||
done
|
||||
which make || return 1
|
||||
which gcc || which cc || return 1
|
||||
which g++ || which c++ || return 1
|
||||
c++ $(pkg-config --cflags poppler) -o /dev/null -E install_test.cpp 2>/dev/null
|
||||
[ $? -eq 0 ] || return 1
|
||||
return 0
|
||||
} >/dev/null 2>&1
|
||||
@@ -221,7 +219,6 @@ os_centos() {
|
||||
PACKAGES="autoconf
|
||||
automake
|
||||
gcc
|
||||
gcc-c++
|
||||
libpng-devel
|
||||
make
|
||||
pkgconfig
|
||||
@@ -242,6 +239,17 @@ os_freebsd() {
|
||||
return 0
|
||||
}
|
||||
|
||||
# NetBSD
|
||||
os_netbsd() {
|
||||
if ! which uname >/dev/null 2>&1 || [ "$(uname -s)" != "NetBSD" ]; then
|
||||
return 1
|
||||
fi
|
||||
PKGCMD=pkgin
|
||||
PKGARGS=install
|
||||
PACKAGES="autoconf automake poppler-glib png pkgconf"
|
||||
return 0
|
||||
}
|
||||
|
||||
# OpenBSD
|
||||
os_openbsd() {
|
||||
if ! which uname >/dev/null 2>&1 || [ "$(uname -s)" != "OpenBSD" ]; then
|
||||
@@ -252,15 +260,6 @@ os_openbsd() {
|
||||
PACKAGES="autoconf%2.69 automake%1.15 poppler poppler-utils png"
|
||||
export AUTOCONF_VERSION=2.69
|
||||
export AUTOMAKE_VERSION=1.15
|
||||
if whereis clang++ ;then
|
||||
export CXX=clang++
|
||||
elif whereis eg++ ;then
|
||||
export CXX=eg++
|
||||
else
|
||||
export CXX=eg++
|
||||
PACKAGES="${PACKAGES} g++"
|
||||
fi
|
||||
export CXXFLAGS="-std=c++11 -I/usr/local/include/poppler -I/usr/local/include"
|
||||
return 0
|
||||
}
|
||||
|
||||
@@ -274,7 +273,6 @@ os_fedora() {
|
||||
PACKAGES="autoconf
|
||||
automake
|
||||
gcc
|
||||
gcc-c++
|
||||
libpng-devel
|
||||
make
|
||||
poppler-devel
|
||||
@@ -296,12 +294,10 @@ os_debian() {
|
||||
fi
|
||||
PACKAGES="autoconf
|
||||
automake
|
||||
g++
|
||||
gcc
|
||||
libpng-dev
|
||||
libpoppler-dev
|
||||
libpoppler-glib-dev
|
||||
libpoppler-private-dev
|
||||
libz-dev
|
||||
make
|
||||
pkg-config"
|
||||
@@ -318,15 +314,23 @@ os_msys2() {
|
||||
case $MSYSTEM in
|
||||
MINGW64)
|
||||
PACKAGES="base-devel
|
||||
autoconf
|
||||
automake
|
||||
mingw-w64-x86_64-libpng
|
||||
mingw-w64-x86_64-poppler
|
||||
mingw-w64-x86_64-imagemagick
|
||||
mingw-w64-x86_64-toolchain
|
||||
mingw-w64-x86_64-openssl
|
||||
mingw-w64-x86_64-zlib" ;;
|
||||
MINGW32)
|
||||
PACKAGES="base-devel
|
||||
autoconf
|
||||
automake
|
||||
mingw-w64-i686-libpng
|
||||
mingw-w64-i686-poppler
|
||||
mingw-w64-i686-imagemagick
|
||||
mingw-w64-i686-toolchain
|
||||
mingw-w64-i686-openssl
|
||||
mingw-w64-i686-zlib" ;;
|
||||
MSYS)
|
||||
case $(uname -m) in
|
||||
@@ -356,15 +360,15 @@ os_macos() {
|
||||
elif which brew >/dev/null 2>&1; then
|
||||
PKGCMD=brew
|
||||
PKGARGS=install
|
||||
PACKAGES="pkg-config poppler automake"
|
||||
PACKAGES="pkg-config poppler autoconf automake"
|
||||
PKG_INSTALL_AS_ROOT=
|
||||
# homebrew install libffi as keg-only, meaning we need to set
|
||||
# brew installs libffi as keg-only, meaning we need to set
|
||||
# PKG_CONFIG_PATH manually so configure can find it
|
||||
export PKG_CONFIG_PATH="$(brew --prefix libffi)/lib/pkgconfig/"
|
||||
export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}:$(brew --prefix libffi)/lib/pkgconfig/:$(brew --prefix zlib)/lib/pkgconfig/"
|
||||
elif which port >/dev/null 2>&1; then
|
||||
PKGCMD=port
|
||||
PKGARGS=install
|
||||
PACKAGES="pkgconfig poppler automake libpng"
|
||||
PACKAGES="pkgconfig poppler autoconf automake libpng"
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
@@ -383,11 +387,15 @@ os_nixos() {
|
||||
if [ -n "$DRY_RUN" ]; then
|
||||
return 0
|
||||
fi
|
||||
if ! nix-instantiate --eval -E "<nixpkgs>" &>/dev/null; then
|
||||
echo "File 'nixpkgs' was not found in the Nix path. Using NixOS/nixpkgs"
|
||||
NIX_PATH="nixpkgs=https://github.com/nixos/nixpkgs/archive/master.tar.gz:$NIX_PATH"
|
||||
fi
|
||||
command="AUTOBUILD_NIX_SHELL=true"
|
||||
command="$command;export AUTOBUILD_NIX_SHELL"
|
||||
command="$command;$(quote "$0" "$@")"
|
||||
exec nix-shell --pure --command "$command" \
|
||||
-p gcc gnumake automake autoconf pkgconfig libpng zlib poppler
|
||||
exec nix-shell --pure --run "$command" \
|
||||
-p automake autoconf pkg-config libpng zlib poppler
|
||||
}
|
||||
|
||||
# Gentoo
|
||||
@@ -404,6 +412,7 @@ os_gentoo() {
|
||||
sys-devel/automake
|
||||
sys-devel/gcc
|
||||
sys-devel/make
|
||||
sys-libs/glibc
|
||||
sys-libs/zlib"
|
||||
return 0
|
||||
}
|
||||
@@ -412,7 +421,7 @@ os_gentoo() {
|
||||
os_void() {
|
||||
if [ -f "/etc/os-release" ]; then
|
||||
. /etc/os-release
|
||||
if [ "$NAME" != "void" ]; then
|
||||
if [ "$ID" != "void" ]; then
|
||||
return 1
|
||||
fi
|
||||
else
|
||||
@@ -428,6 +437,55 @@ os_void() {
|
||||
pkgconf"
|
||||
PKGCMD=xbps-install
|
||||
PKGARGS="-Sy"
|
||||
export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}:/usr/lib/pkgconfig"
|
||||
return 0
|
||||
}
|
||||
|
||||
# openSUSE (TODO: add support for micro versions)
|
||||
os_opensuse() {
|
||||
if [ -f "/etc/os-release" ]; then
|
||||
. /etc/os-release
|
||||
if [ "$ID" != "opensuse-leap" ] && [ "$ID" != "opensuse-tumbleweed" ]; then
|
||||
return 1
|
||||
fi
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
PACKAGES="make
|
||||
automake
|
||||
autoconf
|
||||
gcc
|
||||
libpng16-devel
|
||||
libpng16-compat-devel
|
||||
zlib-devel
|
||||
libpoppler-devel
|
||||
libpoppler-glib-devel
|
||||
glib2-devel
|
||||
pkgconf"
|
||||
PKGCMD=zypper
|
||||
PKGARGS="install"
|
||||
return 0
|
||||
}
|
||||
|
||||
# Alpine Linux
|
||||
os_alpine() {
|
||||
if [ -f "/etc/os-release" ]; then
|
||||
. /etc/os-release
|
||||
if [ "$ID" != "alpine" ]; then
|
||||
return 1
|
||||
fi
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
PACKAGES="autoconf
|
||||
automake
|
||||
libpng-dev
|
||||
poppler-dev
|
||||
glib-dev
|
||||
gcc
|
||||
build-base"
|
||||
PKGCMD=apk
|
||||
PKGARGS="add"
|
||||
return 0
|
||||
}
|
||||
|
||||
@@ -439,6 +497,7 @@ os_argument() {
|
||||
freebsd) os_freebsd "$@";;
|
||||
arch) os_arch "$@";;
|
||||
centos) os_centos "$@";;
|
||||
netbsd) os_netbsd "$@";;
|
||||
openbsd) os_openbsd "$@";;
|
||||
fedora) os_fedora "$@";;
|
||||
debian) os_debian "$@";;
|
||||
@@ -446,6 +505,8 @@ os_argument() {
|
||||
msys2) os_msys2 "$@";;
|
||||
nixos) os_nixos "$@";;
|
||||
void) os_void "$@";;
|
||||
opensuse) os_opensuse "$@";;
|
||||
alpine) os_alpine "$@";;
|
||||
*) echo "Invalid --os argument: $OS"
|
||||
exit 1
|
||||
esac || {
|
||||
@@ -455,7 +516,8 @@ os_argument() {
|
||||
}
|
||||
|
||||
## +-----------------------------------------------------------+
|
||||
## * Figure out were we are, install deps and build the program
|
||||
## * Figure out where we are
|
||||
## ** install deps and build the program
|
||||
## +-----------------------------------------------------------+
|
||||
|
||||
handle_options "$@"
|
||||
@@ -465,6 +527,7 @@ os_macos "$@" || \
|
||||
os_freebsd "$@" || \
|
||||
os_arch "$@" || \
|
||||
os_centos "$@" || \
|
||||
os_netbsd "$@" || \
|
||||
os_openbsd "$@" || \
|
||||
os_fedora "$@" || \
|
||||
os_debian "$@" || \
|
||||
@@ -472,6 +535,8 @@ os_gentoo "$@" || \
|
||||
os_msys2 "$@" || \
|
||||
os_nixos "$@" || \
|
||||
os_void "$@" || \
|
||||
os_opensuse "$@" || \
|
||||
os_alpine "$@" || \
|
||||
{
|
||||
OS_IS_HANDLED=
|
||||
if [ -z "$DRY_RUN" ]; then
|
||||
|
||||
@@ -10,7 +10,6 @@ AC_CONFIG_HEADERS([config.h])
|
||||
# Checks for programs.
|
||||
AC_PROG_CC
|
||||
AM_PROG_CC_C_O
|
||||
AC_PROG_CXX
|
||||
AC_PROG_RANLIB
|
||||
AM_PROG_AR
|
||||
|
||||
@@ -43,22 +42,6 @@ if test "$have_w32" = true; then
|
||||
fi
|
||||
fi
|
||||
|
||||
SAVED_CPPFLAGS=$CPPFLAGS
|
||||
CPPFLAGS=$poppler_CFLAGS
|
||||
AC_LANG_PUSH([C++])
|
||||
# Check if we can use the -std=c++11 option.
|
||||
m4_include([m4/ax_check_compile_flag.m4])
|
||||
AX_CHECK_COMPILE_FLAG([-std=c++11], [HAVE_STD_CXX11=yes])
|
||||
|
||||
if test "$HAVE_STD_CXX11" = yes; then
|
||||
CXXFLAGS="-std=c++11 $CXXFLAGS"
|
||||
fi
|
||||
# Check for private poppler header.
|
||||
AC_CHECK_HEADERS([Annot.h PDFDocEncoding.h], [],
|
||||
AC_MSG_ERROR([cannot find necessary poppler-private header (see README.org)]))
|
||||
AC_LANG_POP([C++])
|
||||
CPPFLAGS=$SAVED_CPPFLAGS
|
||||
|
||||
# Setup compile time features.
|
||||
if test "$HAVE_POPPLER_FIND_OPTS" = yes; then
|
||||
AC_DEFINE([HAVE_POPPLER_FIND_OPTS],1,
|
||||
|
||||
@@ -354,7 +354,7 @@ mktempfile()
|
||||
filename = tempnam(NULL, "epdfinfo");
|
||||
if (filename)
|
||||
{
|
||||
int fd = open(filename, O_CREAT | O_EXCL | O_RDONLY, S_IRWXU);
|
||||
int fd = open(filename, O_CREAT | O_EXCL | O_RDONLY, S_IRUSR | S_IWUSR);
|
||||
if (fd > 0)
|
||||
close (fd);
|
||||
else
|
||||
@@ -1309,25 +1309,6 @@ annotation_get_by_key (document_t *doc, const gchar *key)
|
||||
}
|
||||
|
||||
#ifdef HAVE_POPPLER_ANNOT_MARKUP
|
||||
void
|
||||
annotation_translate_quadrilateral (PopplerPage *page, PopplerQuadrilateral *q, gboolean inverse)
|
||||
{
|
||||
PopplerRectangle cbox;
|
||||
gdouble xs, ys;
|
||||
|
||||
poppler_page_get_crop_box (page, &cbox);
|
||||
xs = MIN (cbox.x1, cbox.x2);
|
||||
ys = MIN (cbox.y1, cbox.y2);
|
||||
|
||||
if (inverse)
|
||||
{
|
||||
xs = -xs; ys = -ys;
|
||||
}
|
||||
|
||||
q->p1.x -= xs, q->p2.x -= xs; q->p3.x -= xs; q->p4.x -= xs;
|
||||
q->p1.y -= ys, q->p2.y -= ys; q->p3.y -= ys; q->p4.y -= ys;
|
||||
}
|
||||
|
||||
static cairo_region_t*
|
||||
annotation_markup_get_text_regions (PopplerPage *page, PopplerAnnotTextMarkup *a)
|
||||
{
|
||||
@@ -1343,7 +1324,6 @@ annotation_markup_get_text_regions (PopplerPage *page, PopplerAnnotTextMarkup *a
|
||||
PopplerQuadrilateral *q = &g_array_index (quads, PopplerQuadrilateral, i);
|
||||
cairo_rectangle_int_t r;
|
||||
|
||||
annotation_translate_quadrilateral (page, q, FALSE);
|
||||
q->p1.y = height - q->p1.y;
|
||||
q->p2.y = height - q->p2.y;
|
||||
q->p3.y = height - q->p3.y;
|
||||
@@ -1398,7 +1378,6 @@ annotation_markup_append_text_region (PopplerPage *page, PopplerRectangle *regio
|
||||
q.p3.x = r->x1;
|
||||
q.p3.y = height - r->y2;
|
||||
|
||||
annotation_translate_quadrilateral (page, &q, TRUE);
|
||||
g_array_append_val (garray, q);
|
||||
}
|
||||
g_list_free (regions);
|
||||
@@ -1567,6 +1546,7 @@ annotation_print (const annotation_t *annot, /* const */ PopplerPage *page)
|
||||
gchar *text;
|
||||
gdouble opacity;
|
||||
cairo_region_t *region = NULL;
|
||||
GDate *date;
|
||||
|
||||
if (! annot || ! page)
|
||||
return;
|
||||
@@ -1668,11 +1648,13 @@ annotation_print (const annotation_t *annot, /* const */ PopplerPage *page)
|
||||
printf ("::");
|
||||
|
||||
/* Creation Date */
|
||||
text = xpoppler_annot_markup_get_created (ma);
|
||||
if (text)
|
||||
date = poppler_annot_markup_get_date (ma);
|
||||
if (date != NULL && g_date_valid(date))
|
||||
{
|
||||
print_response_string (text, NONE);
|
||||
g_free (text);
|
||||
gchar datebuf[128];
|
||||
g_date_strftime (datebuf, 127, "%x", date);
|
||||
print_response_string (datebuf, NONE);
|
||||
g_date_free (date);
|
||||
}
|
||||
|
||||
/* <<< Markup Annotation <<< */
|
||||
@@ -2848,7 +2830,7 @@ cmd_editannot (const epdfinfo_t *ctx, const command_arg_t *args)
|
||||
area->x1 = r.x1 * width;
|
||||
area->y2 = height - (r.y1 * height);
|
||||
|
||||
xpoppler_annot_set_rectangle (pa, area);
|
||||
poppler_annot_set_rectangle (pa, area);
|
||||
}
|
||||
else if (! strcmp (key, "label"))
|
||||
{
|
||||
|
||||
@@ -243,10 +243,4 @@ typedef struct
|
||||
const command_arg_type_t *args_spec;
|
||||
int nargs;
|
||||
} command_t;
|
||||
|
||||
/* Defined in poppler-hack.cc */
|
||||
#ifdef HAVE_POPPLER_ANNOT_WRITE
|
||||
extern void xpoppler_annot_set_rectangle (PopplerAnnot*, PopplerRectangle*);
|
||||
#endif
|
||||
extern gchar *xpoppler_annot_markup_get_created (PopplerAnnotMarkup*);
|
||||
#endif /* _EPDF_H_ */
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
#include <PDFDocEncoding.h>
|
||||
#include <iostream>
|
||||
|
||||
int main() {
|
||||
std::cout << "Hello World, pdf-tools!";
|
||||
return 0;
|
||||
}
|
||||
@@ -1,74 +0,0 @@
|
||||
# ===========================================================================
|
||||
# https://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html
|
||||
# ===========================================================================
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
# AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT])
|
||||
#
|
||||
# DESCRIPTION
|
||||
#
|
||||
# Check whether the given FLAG works with the current language's compiler
|
||||
# or gives an error. (Warnings, however, are ignored)
|
||||
#
|
||||
# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
|
||||
# success/failure.
|
||||
#
|
||||
# If EXTRA-FLAGS is defined, it is added to the current language's default
|
||||
# flags (e.g. CFLAGS) when the check is done. The check is thus made with
|
||||
# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to
|
||||
# force the compiler to issue an error when a bad flag is given.
|
||||
#
|
||||
# INPUT gives an alternative input source to AC_COMPILE_IFELSE.
|
||||
#
|
||||
# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this
|
||||
# macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG.
|
||||
#
|
||||
# LICENSE
|
||||
#
|
||||
# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
|
||||
# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by the
|
||||
# Free Software Foundation, either version 3 of the License, or (at your
|
||||
# option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
# Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
#
|
||||
# As a special exception, the respective Autoconf Macro's copyright owner
|
||||
# gives unlimited permission to copy, distribute and modify the configure
|
||||
# scripts that are the output of Autoconf when processing the Macro. You
|
||||
# need not follow the terms of the GNU General Public License when using
|
||||
# or distributing such scripts, even though portions of the text of the
|
||||
# Macro appear in them. The GNU General Public License (GPL) does govern
|
||||
# all other use of the material that constitutes the Autoconf Macro.
|
||||
#
|
||||
# This special exception to the GPL applies to versions of the Autoconf
|
||||
# Macro released by the Autoconf Archive. When you make and distribute a
|
||||
# modified version of the Autoconf Macro, you may extend this special
|
||||
# exception to the GPL to apply to your modified version as well.
|
||||
|
||||
#serial 5
|
||||
|
||||
AC_DEFUN([AX_CHECK_COMPILE_FLAG],
|
||||
[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF
|
||||
AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl
|
||||
AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [
|
||||
ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS
|
||||
_AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1"
|
||||
AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])],
|
||||
[AS_VAR_SET(CACHEVAR,[yes])],
|
||||
[AS_VAR_SET(CACHEVAR,[no])])
|
||||
_AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags])
|
||||
AS_VAR_IF(CACHEVAR,yes,
|
||||
[m4_default([$2], :)],
|
||||
[m4_default([$3], :)])
|
||||
AS_VAR_POPDEF([CACHEVAR])dnl
|
||||
])dnl AX_CHECK_COMPILE_FLAGS
|
||||
@@ -1,122 +0,0 @@
|
||||
// Copyright (C) 2013, 2014 Andreas Politz
|
||||
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#include <config.h>
|
||||
#include <PDFDocEncoding.h>
|
||||
#include <Annot.h>
|
||||
#include <glib.h>
|
||||
#include <glib-object.h>
|
||||
#include <poppler-features.h>
|
||||
|
||||
extern "C"
|
||||
{
|
||||
|
||||
GType poppler_annot_get_type (void) G_GNUC_CONST;
|
||||
GType poppler_annot_markup_get_type (void) G_GNUC_CONST;
|
||||
|
||||
#define POPPLER_TYPE_ANNOT (poppler_annot_get_type ())
|
||||
#define POPPLER_ANNOT(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST ((obj), POPPLER_TYPE_ANNOT, PopplerAnnot))
|
||||
#define POPPLER_IS_ANNOT_MARKUP(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), POPPLER_TYPE_ANNOT_MARKUP))
|
||||
#define POPPLER_TYPE_ANNOT_MARKUP (poppler_annot_markup_get_type ())
|
||||
|
||||
#if POPPLER_CHECK_VERSION(0,72,0)
|
||||
#define GET_CSTR c_str
|
||||
#else
|
||||
#define GET_CSTR getCString
|
||||
#endif
|
||||
|
||||
struct PopplerAnnot
|
||||
{
|
||||
GObject parent_instance;
|
||||
Annot *annot;
|
||||
};
|
||||
|
||||
struct PopplerAnnotMarkup
|
||||
{
|
||||
GObject parent_instance;
|
||||
};
|
||||
|
||||
struct PopplerRectangle
|
||||
{
|
||||
double x1;
|
||||
double y1;
|
||||
double x2;
|
||||
double y2;
|
||||
};
|
||||
|
||||
// This function does not modify its argument s, but for
|
||||
// compatibility reasons (e.g. getLength in GooString.h before 2015)
|
||||
// with older poppler code, it can't be declared as such.
|
||||
char *_xpoppler_goo_string_to_utf8(/* const */ GooString *s)
|
||||
{
|
||||
char *result;
|
||||
|
||||
if (! s)
|
||||
return NULL;
|
||||
|
||||
if (s->hasUnicodeMarker()) {
|
||||
result = g_convert (s->GET_CSTR () + 2,
|
||||
s->getLength () - 2,
|
||||
"UTF-8", "UTF-16BE", NULL, NULL, NULL);
|
||||
} else {
|
||||
int len;
|
||||
gunichar *ucs4_temp;
|
||||
int i;
|
||||
|
||||
len = s->getLength ();
|
||||
ucs4_temp = g_new (gunichar, len + 1);
|
||||
for (i = 0; i < len; ++i) {
|
||||
ucs4_temp[i] = pdfDocEncoding[(unsigned char)s->getChar(i)];
|
||||
}
|
||||
ucs4_temp[i] = 0;
|
||||
|
||||
result = g_ucs4_to_utf8 (ucs4_temp, -1, NULL, NULL, NULL);
|
||||
|
||||
g_free (ucs4_temp);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
#ifdef HAVE_POPPLER_ANNOT_WRITE
|
||||
// Set the rectangle of an annotation. It was first added in v0.26.
|
||||
void xpoppler_annot_set_rectangle (PopplerAnnot *a, PopplerRectangle *rectangle)
|
||||
{
|
||||
GooString *state = (GooString*) a->annot->getAppearState ();
|
||||
char *ustate = _xpoppler_goo_string_to_utf8 (state);
|
||||
|
||||
a->annot->setRect (rectangle->x1, rectangle->y1,
|
||||
rectangle->x2, rectangle->y2);
|
||||
a->annot->setAppearanceState (ustate);
|
||||
g_free (ustate);
|
||||
}
|
||||
#endif
|
||||
// This function is in the library, but the enforced date parsing is
|
||||
// incomplete (at least in some versions), because it ignores the
|
||||
// timezone.
|
||||
gchar *xpoppler_annot_markup_get_created (PopplerAnnotMarkup *poppler_annot)
|
||||
{
|
||||
AnnotMarkup *annot;
|
||||
GooString *text;
|
||||
|
||||
g_return_val_if_fail (POPPLER_IS_ANNOT_MARKUP (poppler_annot), NULL);
|
||||
|
||||
annot = static_cast<AnnotMarkup *>(POPPLER_ANNOT (poppler_annot)->annot);
|
||||
text = (GooString*) annot->getDate ();
|
||||
|
||||
return text ? _xpoppler_goo_string_to_utf8 (text) : NULL;
|
||||
}
|
||||
}
|
||||
1
lisp/pdf-tools/build/server/test/.gitignore
vendored
Normal file
1
lisp/pdf-tools/build/server/test/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
.start-vm
|
||||
@@ -1,2 +1,3 @@
|
||||
*.Dockerfile
|
||||
*.build
|
||||
*.container
|
||||
|
||||
@@ -2,8 +2,23 @@
|
||||
|
||||
PATH="$(dirname "$0")":$PATH
|
||||
|
||||
set -e
|
||||
run_tests_exit_success()
|
||||
{
|
||||
echo "==============================="
|
||||
echo " Elisp Tests succeeded. :O) "
|
||||
echo "==============================="
|
||||
exit 0
|
||||
}
|
||||
|
||||
yes-or-enter | ./autobuild -i /bin
|
||||
yes-or-enter | ./autobuild -i /usr/bin | \
|
||||
set -e
|
||||
# Check that install completes successfully
|
||||
yes-or-enter | ./server/autobuild -i /bin
|
||||
# Check that re-install skips package installation
|
||||
yes-or-enter | ./server/autobuild -i /usr/bin | \
|
||||
grep -q "Skipping package installation (already installed)"
|
||||
# Check that lisp tests run correctly, if emacs is installed and available on PATH
|
||||
echo
|
||||
if which emacs > /dev/null 2> /dev/null; then
|
||||
echo "Emacs found installed! Running elisp tests"
|
||||
make test && run_tests_exit_success
|
||||
fi
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
COPY . /pdf-tools
|
||||
WORKDIR /pdf-tools
|
||||
RUN make -s distclean || true
|
||||
CMD ["sh", "./server/test/docker/lib/run-tests"]
|
||||
@@ -1,4 +0,0 @@
|
||||
ADD . /epdfinfo
|
||||
WORKDIR /epdfinfo
|
||||
RUN make -s distclean || true
|
||||
CMD ["sh", "./test/docker/lib/run-tests"]
|
||||
@@ -1,4 +0,0 @@
|
||||
# -*- dockerfile -*-
|
||||
FROM archlinux:latest
|
||||
RUN pacman -Syu --noconfirm --noprogressbar && \
|
||||
pacman -S --noconfirm --noprogressbar poppler-glib base-devel
|
||||
@@ -0,0 +1,4 @@
|
||||
# -*- dockerfile -*-
|
||||
FROM archlinux:latest
|
||||
RUN pacman -Syu --noconfirm --noprogressbar
|
||||
# @TODO: The official Archlinux image does not seem to have any form of shell. Marking this as FAILING.
|
||||
@@ -1,3 +0,0 @@
|
||||
# -*- dockerfile -*-
|
||||
FROM centos:7
|
||||
RUN yum update -y && yum install -y gcc gcc-c++ poppler-glib-devel
|
||||
@@ -0,0 +1,6 @@
|
||||
# -*- dockerfile -*-
|
||||
FROM centos:centos7
|
||||
RUN sed -i -e "s|mirrorlist=|#mirrorlist=|g" /etc/yum.repos.d/CentOS-*
|
||||
RUN sed -i -e "s|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g" /etc/yum.repos.d/CentOS-*
|
||||
RUN yum update -y
|
||||
# @TODO: Since CentOS is no more, do I even want to try and fix this?
|
||||
@@ -1,3 +1,6 @@
|
||||
# -*- dockerfile -*-
|
||||
# Debian 10 is known as buster
|
||||
FROM debian:10
|
||||
RUN apt-get update -y && apt-get install -y gcc g++ libpoppler-glib-dev
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
# Need to install make, tzdata here to avoid stupid prompts when running package install via autobuild
|
||||
RUN apt-get update -y && apt-get install -y make tzdata
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
# -*- dockerfile -*-
|
||||
# Debian 11 is known as bullseye
|
||||
FROM debian:11
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
# Need to install make, tzdata here to avoid stupid prompts when running package install via autobuild
|
||||
RUN apt-get update -y && apt-get install -y make tzdata
|
||||
@@ -1,4 +0,0 @@
|
||||
# -*- dockerfile -*-
|
||||
FROM debian:8
|
||||
RUN apt-get update -y && apt-get install -y gcc g++ libpoppler-glib-dev
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
# -*- dockerfile -*-
|
||||
# Debian 9 is known as stretch
|
||||
FROM debian:9
|
||||
RUN apt-get update -y && apt-get install -y gcc g++ libpoppler-glib-dev
|
||||
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
# Need to install make, tzdata here to avoid stupid prompts when running package install via autobuild
|
||||
RUN apt-get update -y && apt-get install -y make tzdata
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
# -*- dockerfile -*-
|
||||
FROM silex/emacs:26-ci-cask
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
# Need to install make, tzdata here to avoid stupid prompts when running package install via autobuild
|
||||
RUN apt-get update -y && apt-get install -y make tzdata
|
||||
@@ -0,0 +1,5 @@
|
||||
# -*- dockerfile -*-
|
||||
FROM silex/emacs:27-ci-cask
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
# Need to install make, tzdata here to avoid stupid prompts when running package install via autobuild
|
||||
RUN apt-get update -y && apt-get install -y make tzdata
|
||||
@@ -0,0 +1,5 @@
|
||||
# -*- dockerfile -*-
|
||||
FROM silex/emacs:28-ci-cask
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
# Need to install make, tzdata here to avoid stupid prompts when running package install via autobuild
|
||||
RUN apt-get update -y && apt-get install -y make tzdata
|
||||
@@ -0,0 +1,5 @@
|
||||
# -*- dockerfile -*-
|
||||
FROM silex/emacs:master-ci-cask
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
# Need to install make, tzdata here to avoid stupid prompts when running package install via autobuild
|
||||
RUN apt-get update -y && apt-get install -y make tzdata
|
||||
@@ -1,3 +0,0 @@
|
||||
# -*- dockerfile -*-
|
||||
FROM fedora:32
|
||||
RUN dnf update -y && dnf install -y gcc gcc-c++ poppler-glib-devel
|
||||
@@ -1,3 +0,0 @@
|
||||
# -*- dockerfile -*-
|
||||
FROM fedora:33
|
||||
RUN dnf update -y && dnf install -y gcc gcc-c++ poppler-glib-devel
|
||||
@@ -1,3 +1,4 @@
|
||||
# -*- dockerfile -*-
|
||||
FROM fedora:34
|
||||
RUN dnf update -y && dnf install -y gcc gcc-c++ poppler-glib-devel
|
||||
# Need to install make, tzdata here to avoid stupid prompts when running package install via autobuild
|
||||
RUN dnf update -y && dnf install -y make tzdata
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# -*- dockerfile -*-
|
||||
FROM fedora:35
|
||||
RUN dnf update -y && dnf install -y gcc gcc-c++ poppler-glib-devel
|
||||
# Need to install make, tzdata here to avoid stupid prompts when running package install via autobuild
|
||||
RUN dnf update -y && dnf install -y make tzdata
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
# -*- dockerfile -*-
|
||||
FROM fedora:36
|
||||
# Need to install make, tzdata here to avoid stupid prompts when running package install via autobuild
|
||||
RUN dnf update -y && dnf install -y make tzdata
|
||||
@@ -1,5 +0,0 @@
|
||||
# -*- dockerfile -*-
|
||||
FROM gentoo/stage3-amd64
|
||||
RUN emerge --sync && emerge sys-devel/gcc app-text/poppler
|
||||
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
# -*- dockerfile -*-
|
||||
FROM gentoo/stage3
|
||||
RUN emerge --sync
|
||||
# IF you see this error, just ignore it: !!! It seems /run is not mounted. Process management may malfunction.
|
||||
# Note that gentoo takes a **long** time to build and run, that's okay.
|
||||
# @TODO: Currently, running this errors out because it cannot find glib-2.0, needs fixing.
|
||||
@@ -1,4 +0,0 @@
|
||||
# -*- dockerfile -*-
|
||||
FROM ubuntu:trusty
|
||||
RUN apt-get update -y && apt-get install -y gcc g++ libpoppler-glib-dev
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
# -*- dockerfile -*-
|
||||
FROM ubuntu:xenial
|
||||
RUN apt-get update -y && apt-get install -y gcc g++ libpoppler-glib-dev
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- dockerfile -*-
|
||||
FROM ubuntu:bionic
|
||||
RUN apt-get update -y && apt-get install -y gcc g++ libpoppler-glib-dev
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
# Need to install make, tzdata here to avoid stupid prompts when running package install via autobuild
|
||||
RUN apt-get update --fix-missing -y && apt-get install -y make tzdata
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
# -*- dockerfile -*-
|
||||
FROM ubuntu:groovy
|
||||
RUN apt-get update -y && apt-get install -y gcc g++ libpoppler-glib-dev
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- dockerfile -*-
|
||||
FROM ubuntu:focal
|
||||
RUN apt-get update -y && apt-get install -y gcc g++ libpoppler-glib-dev
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
# Need to install make, tzdata here to avoid stupid prompts when running package install via autobuild
|
||||
RUN apt-get update --fix-missing -y && apt-get install -y make tzdata
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
# -*- dockerfile -*-
|
||||
FROM ubuntu:hirsute
|
||||
RUN apt-get update -y && apt-get install -y gcc g++ libpoppler-glib-dev
|
||||
@@ -0,0 +1,5 @@
|
||||
# -*- dockerfile -*-
|
||||
FROM ubuntu:jammy
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
# Need to install make, tzdata here to avoid stupid prompts when running package install via autobuild
|
||||
RUN apt-get update --fix-missing -y && apt-get install -y make tzdata
|
||||
Reference in New Issue
Block a user