Skip to content

Commit

Permalink
[libosip2]Add new port. (#8261)
Browse files Browse the repository at this point in the history
* [libosip2]Add new port.

* [libosip2]Use macro LIBOSIP2_VER.
  • Loading branch information
JackBoosY authored and dan-shaw committed Sep 25, 2019
1 parent 39104b4 commit 2419d39
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ports/libosip2/CONTROL
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Source: libosip2
Version: 5.1.0
Homepage: https://www.gnu.org/software/osip/
Description: oSIP is an LGPL implementation of SIP. It's stable, portable, flexible and compliant! -may be more-! It is used mostly with eXosip2 stack (GPL) which provides simpler API for User-Agent implementation.
73 changes: 73 additions & 0 deletions ports/libosip2/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
include(vcpkg_common_functions)

set(LIBOSIP2_VER "5.1.0")

if (VCPKG_TARGET_IS_WINDOWS)
message(FATAL_ERROR "libosio2 only support unix currently.")
endif()

vcpkg_download_distfile(ARCHIVE
URLS "http://ftp.gnu.org/gnu/osip/libosip2-${LIBOSIP2_VER}.tar.gz"
FILENAME "libosip2-${LIBOSIP2_VER}.tar.gz"
SHA512 391c9a0ea399f789d7061b0216d327eecba5bbf0429659f4f167604b9e703e1678ba6f58079aa4f84b3636a937064ecfb92e985368164fcb679e95654e43d65b
)

vcpkg_extract_source_archive_ex(
ARCHIVE ${ARCHIVE}
OUT_SOURCE_PATH SOURCE_PATH
)

find_program(autoreconf autoreconf)
if (NOT autoreconf)
message(FATAL_ERROR "autoreconf must be installed before libx11 can build. Install them with \"apt-get dh-autoreconf\".")
endif()

find_program(MAKE make)
if (NOT MAKE)
message(FATAL_ERROR "MAKE not found")
endif()

vcpkg_execute_required_process(
COMMAND "./autogen.sh"
WORKING_DIRECTORY ${SOURCE_PATH}
LOGNAME autoreconf-${TARGET_TRIPLET}
)

message(STATUS "Configuring ${TARGET_TRIPLET}")
set(OUT_PATH ${CURRENT_BUILDTREES_DIR}/make-build-${TARGET_TRIPLET})

file(REMOVE_RECURSE ${OUT_PATH})
file(MAKE_DIRECTORY ${OUT_PATH})

vcpkg_execute_required_process(
COMMAND "./configure" --prefix=${OUT_PATH}
WORKING_DIRECTORY ${SOURCE_PATH}
LOGNAME config-${TARGET_TRIPLET}
)

message(STATUS "Building ${TARGET_TRIPLET}")
vcpkg_execute_required_process(
COMMAND make
WORKING_DIRECTORY ${SOURCE_PATH}
LOGNAME build-${TARGET_TRIPLET}-release
)

message(STATUS "Installing ${TARGET_TRIPLET}")
vcpkg_execute_required_process(
COMMAND make install
WORKING_DIRECTORY ${SOURCE_PATH}
LOGNAME install-${TARGET_TRIPLET}-release
)
file(COPY ${OUT_PATH}/include DESTINATION ${CURRENT_PACKAGES_DIR})
file(COPY ${OUT_PATH}/lib DESTINATION ${CURRENT_PACKAGES_DIR})

file(GLOB_RECURSE LIBOSIP2_BINARIES ${CURRENT_PACKAGES_DIR}/lib *.so)
foreach(LIBOSIP2_BINARY LIBOSIP2_BINARIES)
if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
file(COPY ${LIBOSIP2_BINARY} DESTINATION ${CURRENT_PACKAGES_DIR}/bin)
endif()
file(REMOVE ${LIBOSIP2_BINARY})
endforeach()

# Handle copyright
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)

0 comments on commit 2419d39

Please sign in to comment.