diff options
-rw-r--r-- | .SRCINFO | 21 | ||||
-rw-r--r-- | PKGBUILD | 42 | ||||
-rw-r--r-- | patch_addLLVM.patch | 19 | ||||
-rw-r--r-- | patch_fix_build_dir.patch | 11 |
4 files changed, 93 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..e538ef6eb184 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,21 @@ +pkgbase = tor-shadow + pkgdesc = an open-source network simulator/emulator hybrid (e.g. for Tor and Bitcoin) + pkgver = 1.11.2 + pkgrel = 1 + url = https://shadow.github.io/ + arch = i686 + arch = x86_64 + license = custom + makedepends = llvm>=3.2 + makedepends = cmake>=2.8.8 + depends = igraph>=0.5.4 + depends = glib2>=2.32.0 + source = https://github.com/shadow/shadow/archive/v1.11.2.tar.gz + source = patch_addLLVM.patch + source = patch_fix_build_dir.patch + md5sums = 72a65ce92c311117fa80f9309824dfe3 + md5sums = ad343433a279cc78a54f6eecffb92b36 + md5sums = bc3c5e1e79c0fcf8600a30e2cb8e0fe0 + +pkgname = tor-shadow + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..9fc6b9b9fbea --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,42 @@ +# Maintainer: Max Beikirch <max.beikirch (at) unitybox (dot) de> +pkgname=tor-shadow +pkgver=1.11.2 +pkgrel=1 +pkgdesc="an open-source network simulator/emulator hybrid (e.g. for Tor and Bitcoin)" +arch=('i686' 'x86_64') +url="https://shadow.github.io/" +license=('custom') +depends=('igraph>=0.5.4' 'glib2>=2.32.0') +makedepends=('llvm>=3.2' 'cmake>=2.8.8') +source=("https://github.com/shadow/shadow/archive/v$pkgver.tar.gz" + "patch_addLLVM.patch" + "patch_fix_build_dir.patch") +md5sums=('72a65ce92c311117fa80f9309824dfe3' + 'ad343433a279cc78a54f6eecffb92b36' + 'bc3c5e1e79c0fcf8600a30e2cb8e0fe0') + +prepare() { + cd "shadow-$pkgver" + patch -p1 -i "$srcdir/patch_addLLVM.patch" + patch -p1 -i "$srcdir/patch_fix_build_dir.patch" + mkdir -p build +} + +build() { + cd "shadow-$pkgver" + python2 setup build --include /usr/lib/cmake/llvm --prefix "/usr" + cd build + cmake -DCMAKE_SKIP_INSTALL_RPATH=ON .. + make +} + +package() { + cd "shadow-$pkgver/build" + make DESTDIR="${pkgdir}" install + + mv "$pkgdir/usr/plugins/libshadow-plugin-tgen.so" "$pkgdir/usr/lib" + rm -rf "$pkgdir/usr/plugins" + + mkdir -p $pkgdir/usr/share/licenses/$pkgname + install -Dm644 ../LICENSE $pkgdir/usr/share/licenses/$pkgname/ +} diff --git a/patch_addLLVM.patch b/patch_addLLVM.patch new file mode 100644 index 000000000000..9969533d6ef1 --- /dev/null +++ b/patch_addLLVM.patch @@ -0,0 +1,19 @@ +diff -ura shadow-1.11.2.orig/src/plugin/llvm-hoist-pass/CMakeLists.txt shadow-1.11.2.new/src/plugin/llvm-hoist-pass/CMakeLists.txt +--- shadow-1.11.2.orig/src/plugin/llvm-hoist-pass/CMakeLists.txt 2016-09-19 16:29:30.000000000 +0200 ++++ shadow-1.11.2.new/src/plugin/llvm-hoist-pass/CMakeLists.txt 2017-05-06 01:05:46.468807662 +0200 +@@ -23,6 +23,10 @@ + set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin) + set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib) + set(LLVM_PLUGIN_EXT ".so") ++ ++cmake_policy(PUSH) ++# needed by AddLLVM ++cmake_policy(SET CMP0057 NEW) + include(AddLLVM) + + #message(STATUS "Found components for LLVM") +@@ -42,3 +46,4 @@ + ## The LLVM plugin to hoist out static and global variables + ## adds a 'LLVMHoistGlobals' target + add_llvm_loadable_module(LLVMHoistGlobals HoistGlobals.cpp) ++cmake_policy(POP) diff --git a/patch_fix_build_dir.patch b/patch_fix_build_dir.patch new file mode 100644 index 000000000000..6431a151fd66 --- /dev/null +++ b/patch_fix_build_dir.patch @@ -0,0 +1,11 @@ +diff -ura shadow-1.11.2.orig/setup shadow-1.11.2.new/setup +--- shadow-1.11.2.orig/setup 2016-09-19 16:29:30.000000000 +0200 ++++ shadow-1.11.2.new/setup 2017-05-06 13:24:41.106253464 +0200 +@@ -126,7 +126,6 @@ + + # create directories + if not os.path.exists(builddir): os.makedirs(builddir) +- if not os.path.exists(installdir): os.makedirs(installdir) + + # build up args string for the cmake command + cmake_cmd = "cmake " + rootdir + " -DCMAKE_INSTALL_PREFIX=" + installdir |