podofo: Fix puilding.

This commit is contained in:
Alexey Pavlov
2015-10-29 10:13:20 +03:00
parent 253384ec8f
commit 1801c3a97a
3 changed files with 173 additions and 13 deletions

View File

@@ -9,35 +9,48 @@ pkgdesc="A C++ library to work with the PDF file format (mingw-w64)"
arch=('any')
url="http://podofo.sourceforge.net"
license=('GPL')
depends=("${MINGW_PACKAGE_PREFIX}-lua51" "${MINGW_PACKAGE_PREFIX}-openssl" "${MINGW_PACKAGE_PREFIX}-fontconfig" "${MINGW_PACKAGE_PREFIX}-libtiff" "libidn" "${MINGW_PACKAGE_PREFIX}-libjpeg-turbo")
makedepends=("${MINGW_PACKAGE_PREFIX}-cmake")
source=("http://downloads.sourceforge.net/${_realname}/${_realname}-${pkgver}.tar.gz" "win.patch")
md5sums=('268ca111826757ca7e3f5c4be3547e7a' '4a0006884bd9fd3ad73f3ec3ed0cd886')
depends=("${MINGW_PACKAGE_PREFIX}-fontconfig"
"${MINGW_PACKAGE_PREFIX}-libtiff"
"${MINGW_PACKAGE_PREFIX}-libidn"
"${MINGW_PACKAGE_PREFIX}-libjpeg-turbo"
"${MINGW_PACKAGE_PREFIX}-lua"
"${MINGW_PACKAGE_PREFIX}-openssl")
makedepends=("${MINGW_PACKAGE_PREFIX}-cmake"
"${MINGW_PACKAGE_PREFIX}-cppunit")
source=("http://downloads.sourceforge.net/${_realname}/${_realname}-${pkgver}.tar.gz"
"win.patch"
"test.patch")
md5sums=('268ca111826757ca7e3f5c4be3547e7a'
'b2bcdeff5734e21e8bd615d17f57744f'
'd43b9867c6146f817e2a33adc9fba523')
prepare() {
cd ${_realname}-${pkgver}
patch -p1 -i "$srcdir/win.patch"
patch -p1 -i "${srcdir}/win.patch"
patch -p1 -i "${srcdir}/test.patch"
}
build() {
cd ${_realname}-${pkgver}
rm -rf build-${MINGW_CHOST}
mkdir -p build-${MINGW_CHOST}
cd build-${MINGW_CHOST}
MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \
${MINGW_PREFIX}/bin/cmake.exe -G"MSYS Makefiles" \
${MINGW_PREFIX}/bin/cmake.exe \
-G"MSYS Makefiles" \
-Wno-dev \
-DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} .. \
-DFREETYPE_INCLUDE_DIR=/mingw64/include/freetype2 \
-DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \
-DFREETYPE_INCLUDE_DIR=${MINGW_PREFIX}/include/freetype2 \
-DCMAKE_BUILD_TYPE=Release \
-DPODOFO_BUILD_SHARED=1 \
-DPODOFO_HAVE_JPEG_LIB=1 \
-DPODOFO_HAVE_PNG_LIB=1 \
-DPODOFO_HAVE_TIFF_LIB=1
-DPODOFO_HAVE_TIFF_LIB=1 \
../${_realname}-${pkgver}
make
}
package() {
cd ${_realname}-${pkgver}/build-${MINGW_CHOST}
make DESTDIR=$pkgdir install
cd build-${MINGW_CHOST}
make DESTDIR=${pkgdir} install
}

View File

@@ -0,0 +1,23 @@
--- podofo-0.9.3/test/unit/EncryptTest.h.orig 2015-10-29 09:23:29.880214600 +0300
+++ podofo-0.9.3/test/unit/EncryptTest.h 2015-10-29 10:06:57.095159600 +0300
@@ -83,7 +83,7 @@
private:
char* m_pEncBuffer;
- long m_lLen;
+ intptr_t m_lLen;
int m_protection;
};
--- podofo-0.9.3/test/unit/EncryptTest.cpp.orig 2015-10-29 09:24:54.483214600 +0300
+++ podofo-0.9.3/test/unit/EncryptTest.cpp 2015-10-29 10:08:09.945873800 +0300
@@ -208,7 +208,8 @@
// Decrypt buffer
try {
- pEncrypt->Decrypt( pEncryptedBuffer, nOutputLen, pDecryptedBuffer, m_lLen );
+ intptr_t mlen = m_lLen;
+ pEncrypt->Decrypt( pEncryptedBuffer, nOutputLen, pDecryptedBuffer, mlen );
} catch (PdfError &e) {
CPPUNIT_FAIL(e.ErrorMessage(e.GetError()));
}

View File

@@ -12,3 +12,127 @@
SET(PODOFO_HEADERS
podofo-base.h
podofo.h)
--- podofo-0.9.3/cmake/modules/FindCppUnit.cmake.orig 2014-06-15 13:27:21.000000000 +0200
+++ podofo-0.9.3/cmake/modules/FindCppUnit.cmake 2015-10-10 19:24:45.115148986 +0200
@@ -24,9 +24,9 @@
SET(CPPUNIT_LIBRARIES)
IF(CPPUNIT_CONFIG_EXECUTABLE)
- EXEC_PROGRAM(${CPPUNIT_CONFIG_EXECUTABLE} ARGS --cflags RETURN_VALUE _return_VALUE OUTPUT_VARIABLE CPPUNIT_CFLAGS)
- EXEC_PROGRAM(${CPPUNIT_CONFIG_EXECUTABLE} ARGS --libs RETURN_VALUE _return_VALUE OUTPUT_VARIABLE CPPUNIT_LIBRARIES)
- EXEC_PROGRAM(${CPPUNIT_CONFIG_EXECUTABLE} ARGS --version RETURN_VALUE _return_VALUE OUTPUT_VARIABLE CPPUNIT_INSTALLED_VERSION)
+ EXECUTE_PROCESS(COMMAND sh ${CPPUNIT_CONFIG_EXECUTABLE} --cflags OUTPUT_VARIABLE CPPUNIT_CFLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
+ EXECUTE_PROCESS(COMMAND sh ${CPPUNIT_CONFIG_EXECUTABLE} --libs OUTPUT_VARIABLE CPPUNIT_LIBRARIES OUTPUT_STRIP_TRAILING_WHITESPACE)
+ EXECUTE_PROCESS(COMMAND sh ${CPPUNIT_CONFIG_EXECUTABLE} --version OUTPUT_VARIABLE CPPUNIT_INSTALLED_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
STRING(REGEX REPLACE "-I(.+)" "\\1" CPPUNIT_CFLAGS "${CPPUNIT_CFLAGS}")
ELSE(CPPUNIT_CONFIG_EXECUTABLE)
# in case win32 needs to find it the old way?
@@ -50,7 +50,7 @@
endif(NOT CppUnit_FIND_QUIETLY)
IF(CPPUNIT_CONFIG_EXECUTABLE)
- EXEC_PROGRAM(${CPPUNIT_CONFIG_EXECUTABLE} ARGS --version RETURN_VALUE _return_VALUE OUTPUT_VARIABLE CPPUNIT_INSTALLED_VERSION)
+ EXECUTE_PROCESS(COMMAND sh ${CPPUNIT_CONFIG_EXECUTABLE} --version OUTPUT_VARIABLE CPPUNIT_INSTALLED_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
ENDIF(CPPUNIT_CONFIG_EXECUTABLE)
macro_ensure_version( ${CPPUNIT_MIN_VERSION} ${CPPUNIT_INSTALLED_VERSION} CPPUNIT_INSTALLED_VERSION_OK )
--- podofo-0.9.3/cmake/modules/FindLUA.cmake.orig 2015-10-29 09:07:29.384623400 +0300
+++ podofo-0.9.3/cmake/modules/FindLUA.cmake 2015-10-29 09:08:37.431623400 +0300
@@ -1,26 +1,73 @@
-# LUA_FOUND - system has Fontconfig
-# LUA_LIBRARIES - Link these to use LUA
-# LUA_DEFINITIONS - Compiler switches required for using LUA
+# Locate Lua library
+# This module defines
+# LUA_LIBRARIES
+# LUA_FOUND, if false, do not try to link to Lua
+# LUA_INCLUDE_DIR, where to find lua.h
#
-# Based on FindFONTCONFIG.cmake Copyright (c) 2006,2007 Laurent Montel, <montel@kde.org>
-#
-# Redistribution and use is allowed according to the terms of the BSD license.
-# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
-#
-# TODO: Update this code to handle debug/release builds on win32.
-
-if (LUA_LIBRARIES AND LUA_INCLUDE_DIR)
-
- # in cache already
- set(LUA_FOUND TRUE)
-
-else (LUA_LIBRARIES AND LUA_INCLUDE_DIR)
-
- FIND_PACKAGE(Lua51)
-
- include(PoDoFoFindPackageHandleStandardArgs)
- FIND_PACKAGE_HANDLE_STANDARD_ARGS(Lua DEFAULT_MSG LUA_LIBRARIES LUA_INCLUDE_DIR )
-
- mark_as_advanced(LUA_LIBRARIES LUA_INCLUDE_DIR)
+# Note that the expected include convention is
+# #include "lua.h"
+# and not
+# #include <lua/lua.h>
+# This is because, the lua location is not standardized and may exist
+# in locations other than lua/
+
+
+FIND_PATH(LUA_INCLUDE_DIR lua.h
+ PATHS
+ $ENV{LUA_DIR}
+ NO_DEFAULT_PATH
+ PATH_SUFFIXES include/lua include
+)
+
+FIND_PATH(LUA_INCLUDE_DIR lua.h
+ PATHS
+ ~/Library/Frameworks
+ /Library/Frameworks
+ /usr/local
+ /usr
+ /sw # Fink
+ /opt/local # DarwinPorts
+ /opt/csw # Blastwave
+ /opt
+ PATH_SUFFIXES include/lua include
+)
+
+FIND_LIBRARY(LUA_LIBRARY
+ NAMES lua
+ PATHS
+ $ENV{LUA_DIR}
+ NO_DEFAULT_PATH
+ PATH_SUFFIXES lib64 lib
+)
+
+FIND_LIBRARY(LUA_LIBRARY
+ NAMES lua
+ PATHS
+ ~/Library/Frameworks
+ /Library/Frameworks
+ /usr/local
+ /usr
+ /sw
+ /opt/local
+ /opt/csw
+ /opt
+ PATH_SUFFIXES lib64 lib
+)
+
+IF(LUA_LIBRARY)
+ # include the math library for Unix
+ IF(UNIX AND NOT APPLE)
+ FIND_LIBRARY(LUA_MATH_LIBRARY m)
+ SET( LUA_LIBRARIES "${LUA_LIBRARY};${LUA_MATH_LIBRARY}" CACHE STRING "Lua Libraries")
+ # For Windows and Mac, don't need to explicitly include the math library
+ ELSE(UNIX AND NOT APPLE)
+ SET( LUA_LIBRARIES "${LUA_LIBRARY}" CACHE STRING "Lua Libraries")
+ ENDIF(UNIX AND NOT APPLE)
+ENDIF(LUA_LIBRARY)
+
+INCLUDE(PoDoFoFindPackageHandleStandardArgs)
+# handle the QUIETLY and REQUIRED arguments and set LUA_FOUND to TRUE if
+# all listed variables are TRUE
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(Lua DEFAULT_MSG LUA_LIBRARIES LUA_INCLUDE_DIR)
-endif (LUA_LIBRARIES AND LUA_INCLUDE_DIR)
+MARK_AS_ADVANCED(LUA_INCLUDE_DIR LUA_LIBRARIES LUA_LIBRARY LUA_MATH_LIBRARY)