From b0f328427ddc5cf2017c76739f5fdc4e7e34721c Mon Sep 17 00:00:00 2001 From: Jakob Odersky Date: Tue, 29 Apr 2014 21:16:53 +0200 Subject: move sbt native wrapper to separate project and remove erronous .pkg files --- documentation/building.md | 4 ++-- flow-native/.gitignore | 1 + flow-native/pkg/mkpkg | 6 +++++- project/FlowBuild.scala | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/documentation/building.md b/documentation/building.md index 4c95b85..0f48cf5 100644 --- a/documentation/building.md +++ b/documentation/building.md @@ -13,9 +13,9 @@ Run `sbt flow/packageBin` in the base directory. This simply compiles any scala The back-end is managed by GNU Autotools and all releveant files are contained in 'flow-native'. The first time, run `./bootstrap`, then `./configure && make` to compile the back-end. After completing this step, native libraries for the different platforms are available to be copied and included in end-user applications or installed on the system. To copy the binaries to a local directory, run ```DESTDIR=`pwd`/ make install```. To install them system-wide, simply run `make install` as an administrator. ## Creating a fat jar -The native binaries produced in the previous step may be bundled in a "fat" jar so that they can be included in sbt projects through its regular dependency mechanisms. In this process, sbt basically acts as a wrapper script around autotools, calling the native build process and packaging generated binaries. Running `sbt flow-native/packageBin` in the base directory produces the fat jar in 'flow-native/target'. +The native binaries produced in the previous step may be bundled in a "fat" jar so that they can be included in sbt projects through its regular dependency mechanisms. In this process, sbt basically acts as a wrapper script around autotools, calling the native build process and packaging generated binaries. Running `sbt flow-native-scala/packageBin` in the base directory produces the fat jar in 'flow-native-scala/target'. Note: an important feature of fat jars is to include binaries for several platforms. To copy binaries compiled on other platforms to the fat jar, place them in a subfolder of 'flow-native/lib_native'. The subfolder should have the name `$(os.name)-$(os.arch)`, where `os.name` and `os.arch` are the java system properties of the respective platforms. # Note about versioning -When building and locally publishing projects, the usual convention is to append "-SNAPSHOT" to the version string. This practice however breaks version identification and badly hurts git (bisecting becomes a nightmare). Therefore, to identify a build artifact with a specific commit in the repository, a sha1 hash is appended to the version instead. When publishing a new release, this hash may be ommited by setting the java system property "release=true", simply by running sbt -Drelease=true. \ No newline at end of file +When building and locally publishing projects, the usual convention is to append "-SNAPSHOT" to the version string. This practice however breaks version identification and badly hurts git (bisecting becomes a nightmare). Therefore, to identify a build artifact with a specific commit in the repository, a sha1 hash is appended to the version instead. When publishing a new release, this hash may be ommited by setting the java system property "release=true", simply by running sbt -Drelease=true. diff --git a/flow-native/.gitignore b/flow-native/.gitignore index fff12d4..b8d894c 100644 --- a/flow-native/.gitignore +++ b/flow-native/.gitignore @@ -13,6 +13,7 @@ /ltmain.sh /missing /stamp-h1 +/compile /m4 !/m4/ax_jni_include_dir.m4 diff --git a/flow-native/pkg/mkpkg b/flow-native/pkg/mkpkg index 03e42c6..c82d9cb 100755 --- a/flow-native/pkg/mkpkg +++ b/flow-native/pkg/mkpkg @@ -8,9 +8,13 @@ PACKAGE=flow3 # Place to install libraries (should be on java.library.path) LIBDIR=/Library/Java/Extensions +# Temporary directory to install libraries +TEMPDIR=`pwd`/out + +mkdir ${TEMPDIR} && \ cd .. && \ ./configure --libdir=${LIBDIR} && \ make && \ -DESTDIR=`pwd`/pkg make install && \ +DESTDIR=${TEMPDIR} make install && \ productbuild --root=pkg ${PACKAGE}.pkg diff --git a/project/FlowBuild.scala b/project/FlowBuild.scala index d6ba6fa..a43d375 100644 --- a/project/FlowBuild.scala +++ b/project/FlowBuild.scala @@ -76,7 +76,7 @@ object FlowBuild extends Build { ) lazy val flowNative: Project = ( - Project("flow-native", file("flow-native")) + Project("flow-native", file("flow-native-scala")) settings(commonSettings: _*) settings(publishSettings: _*) settings(NativeDefaults.settings: _*) -- cgit v1.2.3