Skip to content

Commit

Permalink
mapcode-cpp-2.5.5 (WIP)
Browse files Browse the repository at this point in the history
  • Loading branch information
fd00 committed Jan 26, 2025
1 parent a7397e4 commit dfe73c3
Show file tree
Hide file tree
Showing 3 changed files with 163 additions and 0 deletions.
67 changes: 67 additions & 0 deletions mapcode-cpp/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
mapcode-cpp
------------------------------------------
Mapcode Library for C/C++

Runtime requirements:
cygwin-3.5.4-1
libmapcodelib-devel-2.5.5-1bl1
libmapcodelib2-2.5.5-1bl1
pkg-config-2.3.0-1

Build requirements:
(besides corresponding -devel packages)
binutils-2.43.1-1
cmake-3.28.3-1
cygport-0.36.9-1
gcc-core-12.4.0-3
gcc-g++-12.4.0-3
ninja-1.12.1-1

Canonical website:
https://github.com/mapcode-foundation/mapcode-cpp

Canonical download:
https://github.com/mapcode-foundation/mapcode-cpp/archive/refs/tags/v2.5.5.tar.gz

-------------------------------------------

Build instructions:
1. unpack mapcode-cpp-2.5.5-X-src.tar.xz
2. if you use setup to install this src package,
it will be unpacked under /usr/src automatically
% cd /usr/src
% cygport ./mapcode-cpp-2.5.5-X.cygport all

This will create:
/usr/src/mapcode-cpp-2.5.5-X-src.tar.xz
/usr/src/mapcode-2.5.5-X.tar.xz
/usr/src/libmapcodelib2-2.5.5-X.tar.xz
/usr/src/libmapcodelib-devel-2.5.5-X.tar.xz

-------------------------------------------

Files included in the binary package:

(mapcode)
/usr/bin/mapcode.exe
/usr/share/doc/mapcode-cpp/LICENSE
/usr/share/doc/mapcode-cpp/NOTICE
/usr/share/doc/mapcode-cpp/README.md

(libmapcodelib2)
/usr/bin/cygmapcodelib-2.dll

(libmapcodelib-devel)
/usr/include/mapcodelib/mapcode_alphabets.h
/usr/include/mapcodelib/mapcode_legacy.h
/usr/include/mapcodelib/mapcode_territories.h
/usr/include/mapcodelib/mapcoder.h
/usr/lib/libmapcodelib.dll.a
/usr/lib/pkgconfig/mapcode-cpp.pc

------------------

Port Notes:

----- version 2.5.5-1bl1 -----
Initial release by fd0 <https://github.com/fd00/>
46 changes: 46 additions & 0 deletions mapcode-cpp/mapcode-cpp-2.5.5-1bl1.cygport
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
HOMEPAGE="https://github.com/mapcode-foundation/${PN}"
SRC_URI="https://github.com/mapcode-foundation/${PN}/archive/refs/tags/v${PV}.tar.gz"

CATEGORY="Libs"
SUMMARY="Mapcode Library for C/C++"
DESCRIPTION="${SUMMARY}"

LICENSE="Apache-2.0"
LICENSE_SPDX="SPDX-License-Identifier: Apache-2.0"
LICENSE_URI="LICENSE"

export CPPFLAGS="${CPPFLAGS} -D_GNU_SOURCE"

inherit cmake

CYGCMAKE_ARGS="
-DBUILD_SHARED_LIBS:BOOL=ON
-DSOVERSION:STRING=${PV[1]}
-DVERSION:STRING=${PV}
"

src_test()
{
cd ${B}
./unittest.exe
}

PKG_NAMES="
mapcode
libmapcodelib2
libmapcodelib-devel
"
mapcode_CONTENTS="
usr/bin/*.exe
usr/share
"
libmapcodelib2_CONTENTS="
usr/bin/cyg*-${PV[1]}.dll
"
libmapcodelib_devel_CONTENTS="
usr/include
usr/lib
"
mapcode_SUMMARY="${SUMMARY} (utilities)"
libmapcodelib2_SUMMARY="${SUMMARY} (runtime)"
libmapcodelib_devel_SUMMARY="${SUMMARY} (development)"
50 changes: 50 additions & 0 deletions mapcode-cpp/mapcode-cpp-2.5.5-1bl1.src.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
--- origsrc/mapcode-cpp-2.5.5/CMakeLists.txt 2017-10-04 21:53:33.000000000 +0900
+++ src/mapcode-cpp-2.5.5/CMakeLists.txt 2025-01-26 13:17:49.977440200 +0900
@@ -27,7 +27,7 @@ project(mapcode_cpp)
# NO_FAST_ENCODE - Drop fast encoding support - only for internal use.

set(MAPCODE_OPTIONS "")
-set(MAPCODE_WARNING_OPTIONS "-Wall -Werror -Wextra")
+set(MAPCODE_WARNING_OPTIONS "-Wall -Wextra")
set(MAPCODE_SANITIZER_COMPILER_OPTIONS "-fsanitize=address -fno-common -fno-optimize-sibling-calls -fno-omit-frame-pointer")
set(MAPCODE_SANITIZER_LINKER_OPTIONS "-fsanitize=address")

@@ -99,6 +99,9 @@ add_library(mapcodelib ${SOURCE_FILES_MA
target_include_directories(mapcodelib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(mapcodelib Threads::Threads)
target_link_libraries(mapcodelib ${M_LIB})
+if (DEFINED SOVERSION)
+ set_target_properties(mapcodelib PROPERTIES SOVERSION "${SOVERSION}")
+endif()

add_executable(unittest ${SOURCE_FILES_TEST})
target_link_libraries(unittest LINK_PUBLIC mapcodelib)
@@ -110,4 +113,13 @@ target_link_libraries(mapcode LINK_PUBLI
target_link_libraries(mapcode LINK_PUBLIC Threads::Threads)
target_link_libraries(mapcode LINK_PUBLIC ${M_LIB})

-install(TARGETS mapcode DESTINATION /usr/local/bin)
\ No newline at end of file
+install(TARGETS mapcode DESTINATION bin)
+install(TARGETS mapcodelib RUNTIME DESTINATION bin ARCHIVE DESTINATION lib)
+install(FILES mapcodelib/mapcode_alphabets.h mapcodelib/mapcode_legacy.h mapcodelib/mapcode_territories.h mapcodelib/mapcoder.h DESTINATION include/mapcodelib)
+
+set(prefix ${CMAKE_INSTALL_PREFIX})
+set(exec_prefix ${CMAKE_INSTALL_PREFIX})
+set(libdir ${CMAKE_INSTALL_PREFIX}/lib)
+set(includedir ${CMAKE_INSTALL_PREFIX}/include)
+configure_file(${CMAKE_SOURCE_DIR}/mapcode-cpp.pc.in ${CMAKE_BINARY_DIR}/mapcode-cpp.pc @ONLY)
+install(FILES ${CMAKE_BINARY_DIR}/mapcode-cpp.pc DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/pkgconfig)
--- origsrc/mapcode-cpp-2.5.5/mapcode-cpp.pc.in 1970-01-01 09:00:00.000000000 +0900
+++ src/mapcode-cpp-2.5.5/mapcode-cpp.pc.in 2025-01-26 13:17:59.281395900 +0900
@@ -0,0 +1,10 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: mapcode-cpp
+Description: Mapcode Library for C/C++
+Version: @VERSION@
+Libs: -L${libdir} -lmapcodelib
+Cflags: -I${includedir}

0 comments on commit dfe73c3

Please sign in to comment.