summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorTarn Burton2018-03-25 09:51:12 -0400
committerTarn Burton2018-03-25 09:51:12 -0400
commit6af7991de585b78ead27517a5f8a27fb088ab923 (patch)
treece3adeb1790f8724d44398c7866205f9c2129fd2
downloadaur-6af7991de585b78ead27517a5f8a27fb088ab923.tar.gz
Initial commit
-rw-r--r--.SRCINFO28
-rw-r--r--.gitignore5
-rw-r--r--FindZeroMQ.cmake17
-rw-r--r--Findcppzmq.cmake16
-rw-r--r--Findcryptopp.cmake25
-rw-r--r--PKGBUILD42
-rw-r--r--package.patch44
7 files changed, 177 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..ce4962d6ceed
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,28 @@
+# Generated by mksrcinfo v8
+# Sun Mar 25 13:34:51 UTC 2018
+pkgbase = xeus
+ pkgdesc = C++ implementation of the Jupyter kernel protocol
+ pkgver = 0.11.0
+ pkgrel = 1
+ url = https://github.com/QuantStack/xeus
+ arch = x86_64
+ license = BSD
+ depends = crypto++
+ depends = nlohmann-json
+ depends = xtl
+ depends = zeromq
+ source = xeus::https://github.com/QuantStack/xeus/archive/{0.11.0}.tar.gz
+ source = https://raw.githubusercontent.com/zeromq/cppzmq/master/zmq_addon.hpp
+ source = Findcppzmq.cmake
+ source = Findcryptopp.cmake
+ source = FindZeroMQ.cmake
+ source = package.patch
+ sha256sums = 479bf8ed915d325efe3b237697b50d8113f74928130a35be7f44dce87912d7a8
+ sha256sums = f3ad054859fa34c214f25d850c3103816c63b835f3c34a753e878b87307ea945
+ sha256sums = 9f2f6f73af088945f0c6610d6e3024083b7dee89b0f5df2d816cd7925564108e
+ sha256sums = 1b00b80c30a17d917ce5374d870e15f5a5fa60e1120b1c485b87e4b88ef6f0f3
+ sha256sums = c0d3f386032d07adcf3ee9a39cfc8df643f182d2b1190c1e7e4a3014a4f01a04
+ sha256sums = fd016c48aad15e7425705c0412fa811240c3a3a055dc25a0c0cb20d23fa0111a
+
+pkgname = xeus
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..318a53fa2efd
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,5 @@
+pkg/
+src/
+*.pkg.tar.xz
+xeus.tar.gz
+zmq_addon.hpp
diff --git a/FindZeroMQ.cmake b/FindZeroMQ.cmake
new file mode 100644
index 000000000000..40cc0eb0ac9f
--- /dev/null
+++ b/FindZeroMQ.cmake
@@ -0,0 +1,17 @@
+# - Try to find ZMQ
+# Once done this will define
+# ZMQ_FOUND - System has ZMQ
+# ZMQ_INCLUDE_DIRS - The ZMQ include directories
+# ZMQ_LIBRARIES - The libraries needed to use ZMQ
+# ZMQ_DEFINITIONS - Compiler switches required for using ZMQ
+
+find_path ( ZMQ_INCLUDE_DIR zmq.h )
+find_library ( ZMQ_LIBRARY NAMES zmq )
+
+set ( ZMQ_LIBRARIES ${ZMQ_LIBRARY} )
+set ( ZMQ_INCLUDE_DIRS ${ZMQ_INCLUDE_DIR} )
+
+include ( FindPackageHandleStandardArgs )
+# handle the QUIETLY and REQUIRED arguments and set ZMQ_FOUND to TRUE
+# if all listed variables are TRUE
+find_package_handle_standard_args ( ZMQ DEFAULT_MSG ZMQ_LIBRARY ZMQ_INCLUDE_DIR )
diff --git a/Findcppzmq.cmake b/Findcppzmq.cmake
new file mode 100644
index 000000000000..77dfbc19af77
--- /dev/null
+++ b/Findcppzmq.cmake
@@ -0,0 +1,16 @@
+# - Find CPPZMQ
+# Find CPPZMQ library.
+# Once done this will define
+#
+# CPPZMQ_INCLUDE_DIR - where to find CPPZMQ header files, etc.
+# CPPZMQ_FOUND - True if CPPZMQ found.
+#
+
+find_path(CPPZMQ_INCLUDE_DIR NAMES zmq.hpp HINTS ${CPPZMQ_ROOT_DIR} ${CMAKE_SOURCE_DIR}/external/cppzmq)
+
+# handle the QUIETLY and REQUIRED arguments and set CPPZMQ_FOUND to TRUE if
+# all listed variables are TRUE
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(CPPZMQ REQUIRED_VARS CPPZMQ_INCLUDE_DIR)
+
+mark_as_advanced(CPPZMQ_INCLUDE_DIR)
diff --git a/Findcryptopp.cmake b/Findcryptopp.cmake
new file mode 100644
index 000000000000..7f62fa9c01ae
--- /dev/null
+++ b/Findcryptopp.cmake
@@ -0,0 +1,25 @@
+find_path(CryptoPP_INCLUDE_DIR NAMES cryptopp/config.h DOC "CryptoPP include directory")
+find_library(CryptoPP_LIBRARY NAMES cryptopp DOC "CryptoPP library")
+
+if(CryptoPP_INCLUDE_DIR)
+ file(STRINGS ${CryptoPP_INCLUDE_DIR}/cryptopp/config.h _config_version REGEX "CRYPTOPP_VERSION")
+ string(REGEX MATCH "([0-9])([0-9])([0-9])" _match_version ${_config_version})
+ set(CryptoPP_VERSION_STRING "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}.${CMAKE_MATCH_3}")
+endif()
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(CryptoPP
+ REQUIRED_VARS CryptoPP_INCLUDE_DIR CryptoPP_LIBRARY
+ FOUND_VAR CryptoPP_FOUND
+ VERSION_VAR CryptoPP_VERSION_STRING)
+
+if(CryptoPP_FOUND AND NOT TARGET CryptoPP::CryptoPP)
+ add_library(CryptoPP::CryptoPP UNKNOWN IMPORTED)
+ set_target_properties(CryptoPP::CryptoPP PROPERTIES
+ IMPORTED_LOCATION "${CryptoPP_LIBRARY}"
+ INTERFACE_INCLUDE_DIRECTORIES "${CryptoPP_INCLUDE_DIR}")
+endif()
+
+mark_as_advanced(CryptoPP_INCLUDE_DIR CryptoPP_LIBRARY)
+set(CryptoPP_INCLUDE_DIRS ${CryptoPP_INCLUDE_DIR})
+set(CryptoPP_LIBRARIES ${CryptoPP_LIBRARY})
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..83e8cd835f6f
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,42 @@
+# Maintainer: Tarn Burton <twburton at gmail dot com>
+pkgname=xeus
+pkgver=0.11.0
+pkgrel=1
+pkgdesc="C++ implementation of the Jupyter kernel protocol"
+arch=("x86_64")
+url="https://github.com/QuantStack/xeus"
+license=('BSD')
+depends=('crypto++' 'nlohmann-json' 'xtl' 'zeromq')
+makedepend=('cmake')
+source=(
+ "$pkgname.tar.gz::https://github.com/QuantStack/xeus/archive/{$pkgver}.tar.gz"
+ "https://raw.githubusercontent.com/zeromq/cppzmq/master/zmq_addon.hpp"
+ 'Findcppzmq.cmake'
+ 'Findcryptopp.cmake'
+ 'FindZeroMQ.cmake'
+ 'package.patch')
+sha256sums=('479bf8ed915d325efe3b237697b50d8113f74928130a35be7f44dce87912d7a8'
+ 'f3ad054859fa34c214f25d850c3103816c63b835f3c34a753e878b87307ea945'
+ '9f2f6f73af088945f0c6610d6e3024083b7dee89b0f5df2d816cd7925564108e'
+ '1b00b80c30a17d917ce5374d870e15f5a5fa60e1120b1c485b87e4b88ef6f0f3'
+ 'c0d3f386032d07adcf3ee9a39cfc8df643f182d2b1190c1e7e4a3014a4f01a04'
+ 'fd016c48aad15e7425705c0412fa811240c3a3a055dc25a0c0cb20d23fa0111a')
+
+prepare() {
+ cd "$srcdir/$pkgname-$pkgver"
+ patch -Np1 -i ../package.patch
+ cp ../../zmq_addon.hpp include
+}
+
+build() {
+ cd "$pkgname-$pkgver"
+ mkdir -p build
+ cd build
+ cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DCMAKE_MODULE_PATH=$PWD/../.. ..
+ make
+}
+
+package() {
+ cd "$pkgname-$pkgver/build"
+ make DESTDIR="${pkgdir}" install
+}
diff --git a/package.patch b/package.patch
new file mode 100644
index 000000000000..a405790addbc
--- /dev/null
+++ b/package.patch
@@ -0,0 +1,44 @@
+diff -aur -bZwB -x .git xeus-0.11.0.old/CMakeLists.txt xeus-0.11.0/CMakeLists.txt
+--- xeus-0.11.0.old/CMakeLists.txt 2018-03-25 09:33:11.000929782 -0400
++++ xeus-0.11.0/CMakeLists.txt 2018-03-25 09:34:42.577890245 -0400
+@@ -107,8 +107,8 @@
+ target_include_directories(xeus PUBLIC $<BUILD_INTERFACE:${XEUS_INCLUDE_DIR}>
+ $<INSTALL_INTERFACE:include>)
+ target_link_libraries(xeus
+- PUBLIC cppzmq
+- PRIVATE cryptopp-static
++ PUBLIC zmq
++ PRIVATE cryptopp
+ PRIVATE xtl)
+
+ if(NOT MSVC)
+diff -aur -bZwB -x .git xeus-0.11.0.old/src/xauthentication.cpp xeus-0.11.0/src/xauthentication.cpp
+--- xeus-0.11.0.old/src/xauthentication.cpp 2018-03-25 09:33:11.001928616 -0400
++++ xeus-0.11.0/src/xauthentication.cpp 2018-03-25 09:33:15.811442497 -0400
+@@ -24,7 +24,7 @@
+ public:
+
+ using hmac_type = CryptoPP::HMAC<T>;
+- using signature_type = std::array<byte, hmac_type::DIGESTSIZE>;
++ using signature_type = std::array<CryptoPP::byte, hmac_type::DIGESTSIZE>;
+
+ explicit xauthentication_impl(const std::string& key);
+ virtual ~xauthentication_impl() = default;
+@@ -101,7 +101,7 @@
+ template <class T>
+ xauthentication_impl<T>::xauthentication_impl(const std::string& key)
+ {
+- m_hmac = hmac_type(reinterpret_cast<const byte*>(key.c_str()), key.size());
++ m_hmac = hmac_type(reinterpret_cast<const CryptoPP::byte*>(key.c_str()), key.size());
+ }
+
+ template <class T>
+@@ -137,7 +137,7 @@
+ std::string hex_sig = hex_string(sig);
+
+ // Reduces the vulnerability to timing attacks.
+- bool res = CryptoPP::VerifyBufsEqual(reinterpret_cast<const byte*>(hex_sig.c_str()),
++ bool res = CryptoPP::VerifyBufsEqual(reinterpret_cast<const CryptoPP::byte*>(hex_sig.c_str()),
+ signature.data<const unsigned char>(),
+ hex_sig.size());
+ return res;