Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
c3094da
[libopensp] initial port
wrobelda Sep 27, 2021
0190858
[libopensp] update versions
wrobelda Sep 27, 2021
7b5d704
[libopensp] fix license file location
wrobelda Sep 27, 2021
fbfaac3
[libopensp] update versions
wrobelda Sep 27, 2021
3757f92
[libopensp] need autopoint on Windows
wrobelda Sep 27, 2021
70e4fde
[libopensp] update versions
wrobelda Sep 27, 2021
6d92c5a
[libopensp] also remove debug/include
wrobelda Sep 28, 2021
4f41c07
[libopensp] use KDE's CMakeLists on Windows
wrobelda Sep 28, 2021
16ecab2
[libopensp] remove /bin for static builds
wrobelda Sep 28, 2021
a6ccdeb
[libopensp] update versions
wrobelda Sep 28, 2021
9bb9525
[libopensp] fix Windows/UWP condition
wrobelda Sep 28, 2021
2756d46
[libopensp] update versions
wrobelda Sep 28, 2021
fbe9b7c
[libopensp] align *Nix functionality with Windows
wrobelda Sep 28, 2021
b82f5eb
[libopensp] update versions
wrobelda Sep 28, 2021
9620944
Merge remote-tracking branch 'origin/master' into HEAD
BillyONeal Sep 28, 2021
03dffba
[libopensp] fix compilation on arm64-osx
wrobelda Sep 29, 2021
9a0d968
[libopensp] update versions
wrobelda Sep 29, 2021
af09589
[libopensp] fix getenv failures on UWP
wrobelda Sep 29, 2021
060e2a5
[libopensp] update versions
wrobelda Sep 29, 2021
f4d1d31
[libopensp] add comment on LDFLAGS usage
wrobelda Sep 29, 2021
ed37d5c
[libopensp] update versions
wrobelda Sep 29, 2021
62a5b6a
[libopensp] reduce patch size
wrobelda Oct 6, 2021
f40cb0b
[libopensp] update versions
wrobelda Oct 6, 2021
33f6c76
[libopensp] further reduce patch size
wrobelda Oct 6, 2021
cf330f1
[libopensp] update versions
wrobelda Oct 6, 2021
a7d27b5
[libopensp] don't overwrite vcpkg's own LDFLAGS
wrobelda Oct 18, 2021
2583c75
[libopensp] backport Debian patch with several fixes
wrobelda Oct 18, 2021
1633e1b
[libopensp] update versions
wrobelda Oct 18, 2021
76d917b
[libopensp] fix library name on Windows
wrobelda Oct 19, 2021
a32b6bb
[libopensp] update versions
wrobelda Oct 19, 2021
3ed49de
[libopensp] don't force shared lib on Windows
wrobelda Oct 19, 2021
26cc3c1
[libopensp] update versions
wrobelda Oct 19, 2021
393167f
[libopensp] reduce Debian patch size
wrobelda Oct 20, 2021
4904ae8
[libopensp] update versions
wrobelda Oct 20, 2021
e7cfca0
[libopensp] UWP in platform definition is redundant
wrobelda Oct 20, 2021
068547f
[libopensp] update versions
wrobelda Oct 20, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions ports/libopensp/opensp_1.5.2-13.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
--- opensp-1.5.2.orig/sx/XmlOutputEventHandler.cxx
+++ opensp-1.5.2/sx/XmlOutputEventHandler.cxx
@@ -1199,12 +1199,22 @@
// Check to make sure we haven't passed outside of the
// output directory
char *dirs = strdup (filePath);
+#ifdef MAXPATHLEN
char realDirs[MAXPATHLEN];
char realOutputDir[MAXPATHLEN];
+#else
+ char *realDirs;
+ char *realOutputDir;
+#endif
char *outputDir = strdup(outputDir_);

+#ifdef MAXPATHLEN
realpath((const char *)dirname(dirs), realDirs);
realpath((const char *)dirname(outputDir), realOutputDir);
+#else
+ realDirs = realpath((const char *)dirname(dirs), NULL);
+ realOutputDir = realpath((const char *)dirname(outputDir), NULL);
+#endif

if (strncmp(realDirs, realOutputDir, strlen (realOutputDir)) != 0) {
app_->message(XmlOutputMessages::pathOutsideOutputDirectory,
@@ -1214,6 +1224,11 @@
}
}

+#ifndef MAXPATHLEN
+ free(realDirs);
+ free(realOutputDir);
+#endif
+
// Make the necessary directories
maybeCreateDirectories(dirname(dirs));

56 changes: 56 additions & 0 deletions ports/libopensp/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
set(OPENSP_VERSION 1.5.2)

set(PATCHES opensp_1.5.2-13.diff) # http://deb.debian.org/debian/pool/main/o/opensp/opensp_1.5.2-13.diff.gz
if (VCPKG_TARGET_IS_WINDOWS OR VCPKG_TARGET_IS_UWP)
list(APPEND PATCHES windows_cmake_build.diff) # https://invent.kde.org/packaging/craft-blueprints-kde/-/tree/master/libs/libopensp
endif()
if (VCPKG_TARGET_IS_UWP)
list(APPEND PATCHES uwp_getenv_fix.diff)
endif()

vcpkg_download_distfile(ARCHIVE
URLS "https://downloads.sourceforge.net/project/openjade/opensp/${OPENSP_VERSION}/OpenSP-${OPENSP_VERSION}.tar.gz"
FILENAME "OpenSP-${OPENSP_VERSION}.tar.gz"
SHA512 a7dcc246ba7f58969ecd6d107c7b82dede811e65f375b7aa3e683621f2c6ff3e7dccefdd79098fcadad6cca8bb94c2933c63f4701be2c002f9a56f1bbe6b047e
)

vcpkg_extract_source_archive_ex(
OUT_SOURCE_PATH SOURCE_PATH
ARCHIVE "${ARCHIVE}"
REF ${OPENSP_VERSION}
PATCHES ${PATCHES}
)

if (VCPKG_TARGET_IS_WINDOWS OR VCPKG_TARGET_IS_UWP)
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
)

vcpkg_cmake_install()
else()
set(EXTRA_OPTS "")
if(VCPKG_TARGET_IS_OSX)
list(APPEND EXTRA_OPTS "LDFLAGS=-framework CoreFoundation \$LDFLAGS") # libintl links to it
endif()

vcpkg_configure_make(
AUTOCONFIG
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
--disable-doc-build
${EXTRA_OPTS}
)

vcpkg_install_make()
endif()

vcpkg_fixup_pkgconfig()
vcpkg_copy_pdbs()

if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
endif()

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
13 changes: 13 additions & 0 deletions ports/libopensp/uwp_getenv_fix.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/config.h b/config.h
index 6a2b097..7db8a93 100644
--- a/config.h
+++ b/config.h
@@ -64,6 +64,8 @@
#pragma warning ( disable : 4251 ) // __declspec(dllexport)
#pragma warning ( disable : 4275 )
#pragma warning ( disable : 4237 ) // future reserved keyword
+#pragma warning ( disable : 4996 ) // 'getenv': This function or variable may be unsafe (on UWP)
+#pragma warning ( disable : 4703 ) // potentially uninitialized local pointer variable 'declaredValue'
#define huge verybig
#if _MSC_VER == 900
#define SP_DECLARE_PLACEMENT_OPERATOR_NEW
22 changes: 22 additions & 0 deletions ports/libopensp/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "libopensp",
"version": "1.5.2",
"description": "SGML parser algorithm",
"homepage": "http://openjade.sourceforge.net",
"dependencies": [
{
"name": "gettext",
"platform": "!(windows | uwp)"
},
{
"name": "vcpkg-cmake",
"host": true,
"platform": "windows"
},
{
"name": "vcpkg-cmake-config",
"host": true,
"platform": "windows"
}
]
}
142 changes: 142 additions & 0 deletions ports/libopensp/windows_cmake_build.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
diff -Nru -x '*~' OpenSP-1.5.2.orig/CMakeLists.txt OpenSP-1.5.2/CMakeLists.txt
--- OpenSP-1.5.2.orig/CMakeLists.txt 1970-01-01 02:00:00.000000000 +0200
+++ OpenSP-1.5.2/CMakeLists.txt 2014-08-24 17:23:19.941495700 +0300
@@ -0,0 +1,24 @@
+project(opensp)
+
+set (VERSION_MAJOR 1)
+set (VERSION_MINOR 5)
+set (VERSION_PATH 2)
+
+cmake_minimum_required(VERSION 2.6)
+
+include_directories(
+ .
+ include
+ generic
+)
+
+file(GLOB SRC_SOURCES lib/*.cxx)
+file(GLOB libopensp_HEADERS config.h generic/*.h include/*.h)
+
+add_library(opensp ${SRC_SOURCES})
+set_target_properties(opensp PROPERTIES OUTPUT_NAME "osp")
+target_link_libraries(opensp)
+
+install(TARGETS opensp RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib)
+install(FILES ${libopensp_HEADERS} DESTINATION include/opensp)
+
diff -Nru -x '*~' OpenSP-1.5.2.orig/config.h OpenSP-1.5.2/config.h
--- OpenSP-1.5.2.orig/config.h 2005-12-23 16:16:30.000000000 +0200
+++ OpenSP-1.5.2/config.h 2014-08-24 17:26:33.724698900 +0300
@@ -26,6 +26,12 @@
#endif
#endif /* __GNUG__ */

+#ifdef __MINGW32__
+#define SP_HAVE_BOOL
+#define SP_HAVE_TYPENAME
+#define SP_DEFINE_TEMPLATES
+#endif /* __MINGW32__ */
+
#if defined(sun) || defined(__sun)
// struct stat has st_blksize member
#define SP_STAT_BLKSIZE
@@ -80,6 +86,11 @@
#define SP_HAVE_TYPENAME
#endif

+#if _MSC_VER >=1800
+// Visual Studio 2013
+#define SP_ANSI_FOR_SCOPE
+#endif
+
#define SP_HAVE_SETMODE
#define SP_DLLEXPORT __declspec(dllexport)
#define SP_DLLIMPORT __declspec(dllimport)
@@ -301,15 +312,8 @@
#define PATH_SEPARATOR ':'
#endif

-
-/* new stuff */
-
-#ifndef HAVE_MUTABLE
-#define mutable
-#endif
-
// NOTE: This is processed as a Makefile, not as a header by autoconf.
-#define SP_PACKAGE "OpenSP"
-#define SP_VERSION "1.5.2"
+#define SP_PACKAGE "@PACKAGE@"
+#define SP_VERSION "@VERSION@"

#endif /* not config_INCLUDED */
diff -Nru -x '*~' OpenSP-1.5.2.orig/generic/SGMLApplication.h OpenSP-1.5.2/generic/SGMLApplication.h
--- OpenSP-1.5.2.orig/generic/SGMLApplication.h 2005-05-14 12:17:41.000000000 +0300
+++ OpenSP-1.5.2/generic/SGMLApplication.h 2014-08-24 17:23:19.957120700 +0300
@@ -269,6 +269,7 @@
unsigned count_;
friend class OpenEntityPtr;
};
+ SGMLApplication();
virtual ~SGMLApplication();
virtual void appinfo(const AppinfoEvent &);
virtual void startDtd(const StartDtdEvent &);
diff -Nru -x '*~' OpenSP-1.5.2.orig/include/OutputCharStream.h OpenSP-1.5.2/include/OutputCharStream.h
--- OpenSP-1.5.2.orig/include/OutputCharStream.h 2005-07-21 17:04:39.000000000 +0300
+++ OpenSP-1.5.2/include/OutputCharStream.h 2014-08-24 17:23:19.957120700 +0300
@@ -31,6 +31,7 @@
OutputCharStream &operator<<(const char *);
OutputCharStream &operator<<(const StringC &);
OutputCharStream &operator<<(unsigned long);
+ OutputCharStream &operator<<(unsigned long long);
OutputCharStream &operator<<(int);
OutputCharStream &operator<<(Newline);
private:
diff -Nru -x '*~' OpenSP-1.5.2.orig/lib/MessageReporter.cxx OpenSP-1.5.2/lib/MessageReporter.cxx
--- OpenSP-1.5.2.orig/lib/MessageReporter.cxx 2005-07-21 17:05:17.000000000 +0300
+++ OpenSP-1.5.2/lib/MessageReporter.cxx 2014-08-24 17:23:19.957120700 +0300
@@ -123,7 +123,11 @@
os() << ':';
}
if (options_ & messageNumbers)
+#ifdef _WIN64
+ os() << (unsigned long long)message.type->module() << "."
+#else
os() << (unsigned long)message.type->module() << "."
+#endif
<< (unsigned long)message.type->number() << ":";
switch (message.type->severity()) {
case MessageType::info:
diff -Nru -x '*~' OpenSP-1.5.2.orig/lib/OutputCharStream.cxx OpenSP-1.5.2/lib/OutputCharStream.cxx
--- OpenSP-1.5.2.orig/lib/OutputCharStream.cxx 2005-07-21 17:05:17.000000000 +0300
+++ OpenSP-1.5.2/lib/OutputCharStream.cxx 2014-08-24 17:23:19.957120700 +0300
@@ -61,6 +61,13 @@
return *this << buf;
}

+OutputCharStream &OutputCharStream::operator<<(unsigned long long n)
+{
+ char buf[sizeof(unsigned long long)*3 + 1];
+ sprintf(buf, "%I64u", n);
+ return *this << buf;
+}
+
OutputCharStream &OutputCharStream::operator<<(int n)
{
char buf[sizeof(int)*3 + 2];
diff -Nru -x '*~' OpenSP-1.5.2.orig/lib/SGMLApplication.cxx OpenSP-1.5.2/lib/SGMLApplication.cxx
--- OpenSP-1.5.2.orig/lib/SGMLApplication.cxx 2005-07-21 17:05:18.000000000 +0300
+++ OpenSP-1.5.2/lib/SGMLApplication.cxx 2014-08-24 17:23:19.972745700 +0300
@@ -9,6 +9,10 @@
#include "Boolean.h"
#include "SGMLApplication.h"

+SGMLApplication::SGMLApplication()
+{
+}
+
SGMLApplication::~SGMLApplication()
{
}
4 changes: 4 additions & 0 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -3660,6 +3660,10 @@
"baseline": "2017-01-28-cf2390140",
"port-version": 2
},
"libopensp": {
"baseline": "1.5.2",
"port-version": 0
},
"libopusenc": {
"baseline": "0.2.1",
"port-version": 1
Expand Down
9 changes: 9 additions & 0 deletions versions/l-/libopensp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "c52391221569480b2e639b0e07a9e809e7711320",
"version": "1.5.2",
"port-version": 0
}
]
}