summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authormach62018-08-31 13:28:43 -0400
committermach62018-08-31 13:28:43 -0400
commitbd75e977842f9a3a46f23fb9e78f83799716f984 (patch)
treef487b1d112180dd2a9f5d0ea6195aa9f6b65a47d
parent8ef8da051072a9ad1c8f562ec234a31081c008ba (diff)
downloadaur-bd75e977842f9a3a46f23fb9e78f83799716f984.tar.gz
Fix the warning
-rw-r--r--.SRCINFO10
-rw-r--r--0001-Fix-some-issues-with-CMake.patch86
-rw-r--r--PKGBUILD41
3 files changed, 118 insertions, 19 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 1a54f52dc96c..d730683149e9 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -5,17 +5,19 @@ pkgbase = mutationpp-git
url = https://sync.vki.ac.be/mpp/mutationpp
arch = i686
arch = x86_64
- license = GPL3
- checkdepends = eigen
- makedepends = python2
+ license = LGPL3
makedepends = git
makedepends = gcc
makedepends = cmake
- depends = eigen
+ makedepends = gcc-fortran
+ depends = eigen3
depends = gcc-libs
provides = mutationpp
+ provides = mutation++
source = mutationpp::git+https://sync.vki.ac.be/mpp/mutationpp.git
+ source = 0001-Fix-some-issues-with-CMake.patch
sha256sums = SKIP
+ sha256sums = d5dbbdbc394eb5725cdc7637768fb3bd6fc189784a4d2ef77cdd4811613565ff
pkgname = mutationpp-git
diff --git a/0001-Fix-some-issues-with-CMake.patch b/0001-Fix-some-issues-with-CMake.patch
new file mode 100644
index 000000000000..8ef2f7d49c47
--- /dev/null
+++ b/0001-Fix-some-issues-with-CMake.patch
@@ -0,0 +1,86 @@
+From b93afe7395e2c011945d910821e09d55fbfd06d6 Mon Sep 17 00:00:00 2001
+From: Han Luo <han.luo@gmail.com>
+Date: Fri, 31 Aug 2018 02:25:58 -0400
+Subject: [PATCH] Fix some issues with CMake - Replace the absolute path
+ provided by __FILE__ to the relative path - Allow user to pass
+ CMAKE_INSTALL_PREFIX now - Remove absolute path in src/CMakeLists.txt (Not
+ necessary)
+
+---
+ CMakeLists.txt | 6 ++++--
+ src/CMakeLists.txt | 5 +++++
+ src/general/Errors.h | 4 ++--
+ 3 files changed, 11 insertions(+), 4 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 3781ef4..22ca3b1 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -79,15 +79,17 @@ endif ()
+ ################################################################################
+ # Install prefix settings
+ ################################################################################
+-SET (CMAKE_INSTALL_PREFIX "../install" CACHE STRING
++if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
++ SET (CMAKE_INSTALL_PREFIX "../install" CACHE STRING
+ "Install path prefix, prepended onto install directories." FORCE)
++endif()
+ MARK_AS_ADVANCED (CMAKE_INSTALL_PREFIX)
+
+ if (CMAKE_COMPILER_IS_GNUCXX)
+ #set (CMAKE_CXX_FLAGS "-Wall -Wextra -Wno-unused-parameter -Wold-style-cast")
+ set (CMAKE_CXX_FLAGS "-g")
+ endif ()
+-
++set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__FILENAME__='\"$(subst ${CMAKE_SOURCE_DIR}/,,$(abspath $<))\"'")
+
+ ################################################################################
+ # Fortran wrapper options
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index d9437f8..8326ffe 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -21,6 +21,9 @@
+
+ cmake_minimum_required(VERSION 2.6)
+
++# Set property to save the path of src
++set_property(GLOBAL PROPERTY MPPSRC_PATH "${CMAKE_CURRENT_SOURCE_DIR}")
++
+ #- Add sources for a target
+ #
+ # ADD_SOURCES(<target> <source1> [<source2> ...])
+@@ -39,6 +42,8 @@ function (add_sources target)
+ if(NOT IS_ABSOLUTE "${src}")
+ get_filename_component(src "${src}" ABSOLUTE)
+ endif()
++ get_property(src_path_local GLOBAL PROPERTY MPPSRC_PATH)
++ file(RELATIVE_PATH src ${src_path_local} ${src})
+ list(APPEND SRCS "${src}")
+ endforeach()
+ # append to global property
+diff --git a/src/general/Errors.h b/src/general/Errors.h
+index 615989a..96377de 100644
+--- a/src/general/Errors.h
++++ b/src/general/Errors.h
+@@ -392,7 +392,7 @@ public:
+ }
+ }; // class LogicError
+
+-#define LogicError() LogicError(__FILE__, __LINE__)
++#define LogicError() LogicError(__FILENAME__, __LINE__)
+
+
+ /// Reports a "function not implemented" error. Includes file, line number, and
+@@ -424,7 +424,7 @@ public:
+ }
+ };
+
+-#define NotImplementedError(_func_) NotImplementedError(_func_, __FILE__, __LINE__)
++#define NotImplementedError(_func_) NotImplementedError(_func_, __FILENAME__, __LINE__)
+
+ } // namespace Mutation
+
+--
+2.18.0
+
diff --git a/PKGBUILD b/PKGBUILD
index 4acfb6261ba9..af5388371c72 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,6 +1,6 @@
# Maintainer: Han Luo <han dot luo at gmail dot com>
pkgname=mutationpp-git
-provides=("${pkgname%-git}")
+provides=("${pkgname%-git}" "mutation++")
_pkgname=${pkgname%-git}
pkgver=r643.b100af0
pkgrel=1
@@ -8,11 +8,13 @@ pkgrel=1
pkgdesc="MUlticomponent Thermodynamic And Transport properties for partially IONized gases in C++"
arch=('i686' 'x86_64')
url="https://sync.vki.ac.be/mpp/mutationpp"
-license=('GPL3')
+license=('LGPL3')
depends=('eigen3' 'gcc-libs')
-makedepends=('git' 'gcc' 'cmake')
-source=("$_pkgname::git+https://sync.vki.ac.be/mpp/mutationpp.git")
-sha256sums=('SKIP')
+makedepends=('git' 'gcc' 'cmake' 'gcc-fortran')
+source=("$_pkgname::git+https://sync.vki.ac.be/mpp/mutationpp.git"
+ 0001-Fix-some-issues-with-CMake.patch)
+sha256sums=('SKIP'
+ 'd5dbbdbc394eb5725cdc7637768fb3bd6fc189784a4d2ef77cdd4811613565ff')
export MAKEFLAGS="-j"$(cat /proc/cpuinfo | awk '/^processor/{print $3}' | wc -l)
pkgver() {
@@ -22,10 +24,14 @@ pkgver() {
}
prepare() {
- # sed -i "s|\.\./install|/usr|" ${_pkgname}/CMakeLists.txt #change install location
- sed -i 's|^\(SET (CMAKE_INSTALL_PREFIX\).*$|\1 /usr CACHE PATH|' \
- ${_pkgname}/CMakeLists.txt #change install location
+ # patch based on https://bitbucket.org/luohan/mutationpp/commits/b93afe7395e2c011945d910821e09d55fbfd06d6
+ cd $srcdir/$_pkgname
+ patch -Np1 -i ${srcdir}/0001-Fix-some-issues-with-CMake.patch
+ # configure the code
+ mkdir -p $srcdir/build
+ cd $srcdir/build
+ cmake ../${_pkgname} -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_FORTRAN_WRAPPER=ON
}
build() {
@@ -35,10 +41,9 @@ build() {
# cd build
# cmake ../ -DCMAKE_INSTALL_PREFIX=/usr
- mkdir -p $srcdir/build
+ # compile the code
cd $srcdir/build
- cmake ../${_pkgname}
- make $MAKEFLAGS
+ make $MAKEFLAGS DESTDIR="$pkgdir"
}
package() {
@@ -46,14 +51,20 @@ package() {
# cd $srcdir/$_pkgname/thirdparty/eigen/build
# make $MAKEFLAGS DESTDIR="$pkgdir" install
-
cd $srcdir/build
make $MAKEFLAGS DESTDIR="$pkgdir" install
+ install -d ${pkgdir}/opt/mutationpp
# mutationpp data
- mkdir -p ${pkgdir}/opt/mutationpp/data
cp -r $srcdir/$_pkgname/data ${pkgdir}/opt/mutationpp/
+ # mutationpp example
+ cp -r $srcdir/$_pkgname/examples ${pkgdir}/opt/mutationpp/
+
+ # mutationpp src, we copy this to ease the diagnose
+ cp -r $srcdir/$_pkgname/src ${pkgdir}/opt/mutationpp/
+
+ # install a file for enviroment variables of mutationpp
mkdir -p ${pkgdir}/etc/profile.d
cat > ${pkgdir}/etc/profile.d/mutationpp.sh << EOF
export MPP_DATA_DIRECTORY=/opt/mutationpp/data
@@ -72,10 +83,10 @@ Name: Mutation++
Description: ${pkgdesc}
Requires: eigen3
Version: ${pkgver}
-Libs: -L\${prefix}/lib -lmutation++
+Libs: -L\${prefix}/lib -lmutation++ -lmutation++_fortran
Cflags: -I\${prefix}/include/mutation++
EOF
# add symbolic link for eigen3 header, this is necessary for coolfluid
- ln -srf ${pkgdir}/usr/include/eigen3 ${pkgdir}/usr/include/mutation++/eigen3
+ # ln -srf ${pkgdir}/usr/include/eigen3 ${pkgdir}/usr/include/mutation++/eigen3
}