diff options
| author | Victor Romero <romerosanchezv@gmail.com> | 2019-10-14 12:21:09 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-10-14 12:21:09 -0700 |
| commit | 630b8fe66f58f8550658bdb417c9591cf8fa3b09 (patch) | |
| tree | 41b44f448d8c4f07958b17972b61b527e12e7e43 | |
| parent | d5e29e9dfb3cfe9ea33b7d09ccf023c9479ee2f5 (diff) | |
| parent | f34bf600685d1a219cfe8502e91874954be9f369 (diff) | |
| download | vcpkg-630b8fe66f58f8550658bdb417c9591cf8fa3b09.tar.gz vcpkg-630b8fe66f58f8550658bdb417c9591cf8fa3b09.zip | |
Merge pull request #8568 from NancyLi1013/dev/NancyLi/7580-add-libcrafter
[libcrafter] Add new port
| -rw-r--r-- | ports/libcrafter/CONTROL | 5 | ||||
| -rw-r--r-- | ports/libcrafter/fix-build-error.patch | 20 | ||||
| -rw-r--r-- | ports/libcrafter/portfile.cmake | 27 |
3 files changed, 52 insertions, 0 deletions
diff --git a/ports/libcrafter/CONTROL b/ports/libcrafter/CONTROL new file mode 100644 index 000000000..76c3c1bc2 --- /dev/null +++ b/ports/libcrafter/CONTROL @@ -0,0 +1,5 @@ +Source: libcrafter +Version: 0.3 +Homepage: https://github.com/pellegre/libcrafter +Description: Libcrafter is a high level library for C++ designed to create and decode network packets. +Build-Depends: libpcap
\ No newline at end of file diff --git a/ports/libcrafter/fix-build-error.patch b/ports/libcrafter/fix-build-error.patch new file mode 100644 index 000000000..cc97b4a63 --- /dev/null +++ b/ports/libcrafter/fix-build-error.patch @@ -0,0 +1,20 @@ +diff --git a/libcrafter/configure.ac b/libcrafter/configure.ac
+index 860d98b..b04ccce 100644
+--- a/libcrafter/configure.ac
++++ b/libcrafter/configure.ac
+@@ -35,14 +35,13 @@ AC_ARG_WITH(libpcap,
+ PCAPINC="-I$withval -I$withval/bpf"
+ PCAPLIB="-L$withval -lpcap"
+ elif test -f $withval/include/pcap.h -a \
+- -f $withval/include/net/bpf.h -a \
+ -f $withval/lib/libpcap.a; then
+ owd=`pwd`
+ if cd $withval; then withval=`pwd`; cd $owd; fi
+ PCAPINC="-I$withval/include"
+ PCAPLIB="-L$withval/lib -lpcap"
+ else
+- AC_ERROR(pcap.h, net/bpf.h, or libpcap.a not found in $withval)
++ AC_ERROR(pcap.h, or libpcap.a not found in $withval)
+ fi
+ ;;
+ esac ],
diff --git a/ports/libcrafter/portfile.cmake b/ports/libcrafter/portfile.cmake new file mode 100644 index 000000000..57427906b --- /dev/null +++ b/ports/libcrafter/portfile.cmake @@ -0,0 +1,27 @@ +vcpkg_fail_port_install(MESSAGE "${PORT} currently only supports Linux platforms" ON_TARGET "Windows" "OSX") + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO pellegre/libcrafter + REF version-0.3 + SHA512 7c396ba942b304dddfaa569adb44697f75568d3ef2ed48dda758e281f3b7c172439309033bbf5498069a4a61a952f93e41af99b129ce874ce76b5ec08da58116 + HEAD_REF master + PATCHES fix-build-error.patch +) + +vcpkg_configure_make( + SOURCE_PATH ${SOURCE_PATH} + AUTOCONFIG + PROJECT_SUBPATH libcrafter + OPTIONS + --with-libpcap=${CURRENT_INSTALLED_DIR} +) + +vcpkg_install_make() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +vcpkg_copy_pdbs() + +# Handle copyright +file(INSTALL ${SOURCE_PATH}/libcrafter/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright)
\ No newline at end of file |
