mirror of
https://github.com/SebastianWendel/nixpkgs.git
synced 2024-09-22 13:29:00 +02:00
Merge pull request #225008 from juspay/osrm-backend
osrm-backend: support for mac
This commit is contained in:
commit
203c1604d0
|
@ -1,23 +0,0 @@
|
|||
diff --git a/luabind/object.hpp b/luabind/object.hpp
|
||||
index f7b7ca5..1c18e04 100644
|
||||
--- a/luabind/object.hpp
|
||||
+++ b/luabind/object.hpp
|
||||
@@ -536,6 +536,8 @@ namespace detail
|
||||
handle m_key;
|
||||
};
|
||||
|
||||
+#if BOOST_VERSION < 105700
|
||||
+
|
||||
// Needed because of some strange ADL issues.
|
||||
|
||||
#define LUABIND_OPERATOR_ADL_WKND(op) \
|
||||
@@ -557,7 +559,8 @@ namespace detail
|
||||
LUABIND_OPERATOR_ADL_WKND(!=)
|
||||
|
||||
#undef LUABIND_OPERATOR_ADL_WKND
|
||||
-
|
||||
+
|
||||
+#endif // BOOST_VERSION < 105700
|
||||
} // namespace detail
|
||||
|
||||
namespace adl
|
|
@ -1,22 +0,0 @@
|
|||
diff --git a/Jamroot b/Jamroot
|
||||
index 94494bf..83dfcbb 100755
|
||||
--- a/Jamroot
|
||||
+++ b/Jamroot
|
||||
@@ -64,7 +64,7 @@ else if [ os.name ] in LINUX MACOSX FREEBSD
|
||||
$(LUA_PATH) $(HOME)/Library/Frameworks /Library/Frameworks /usr /usr/local /opt/local /opt ;
|
||||
|
||||
local possible-suffixes =
|
||||
- include/lua5.1 include/lua51 include/lua include ;
|
||||
+ include/lua5.1 include/lua51 include/lua include include/luajit-2.0 ;
|
||||
|
||||
local includes = [ GLOB $(possible-prefixes)/$(possible-suffixes) : lua.h ] ;
|
||||
|
||||
@@ -83,7 +83,7 @@ else if [ os.name ] in LINUX MACOSX FREEBSD
|
||||
|
||||
local lib = $(prefix)/lib ;
|
||||
|
||||
- local names = liblua5.1 liblua51 liblua ;
|
||||
+ local names = liblua5.1 liblua51 liblua libluajit-5.1 ;
|
||||
local extensions = .a .so ;
|
||||
|
||||
library = [ GLOB $(lib)/lua51 $(lib)/lua5.1 $(lib)/lua $(lib) :
|
|
@ -1,59 +0,0 @@
|
|||
diff --git luabind-0.9.1/luabind/detail/call_function.hpp luabind-0.9.1-fixed/luabind/detail/call_function.hpp
|
||||
index 1b45ec1..8f5afff 100644
|
||||
--- luabind-0.9.1/luabind/detail/call_function.hpp
|
||||
+++ luabind-0.9.1-fixed/luabind/detail/call_function.hpp
|
||||
@@ -323,7 +323,8 @@ namespace luabind
|
||||
|
||||
#endif // LUABIND_CALL_FUNCTION_HPP_INCLUDED
|
||||
|
||||
-#elif BOOST_PP_ITERATION_FLAGS() == 1
|
||||
+#else
|
||||
+#if BOOST_PP_ITERATION_FLAGS() == 1
|
||||
|
||||
#define LUABIND_TUPLE_PARAMS(z, n, data) const A##n *
|
||||
#define LUABIND_OPERATOR_PARAMS(z, n, data) const A##n & a##n
|
||||
@@ -440,4 +441,5 @@ namespace luabind
|
||||
|
||||
|
||||
#endif
|
||||
+#endif
|
||||
|
||||
diff --git luabind-0.9.1/luabind/detail/call_member.hpp luabind-0.9.1-fixed/luabind/detail/call_member.hpp
|
||||
index de8d563..e63555b 100644
|
||||
--- luabind-0.9.1/luabind/detail/call_member.hpp
|
||||
+++ luabind-0.9.1-fixed/luabind/detail/call_member.hpp
|
||||
@@ -316,7 +316,8 @@ namespace luabind
|
||||
|
||||
#endif // LUABIND_CALL_MEMBER_HPP_INCLUDED
|
||||
|
||||
-#elif BOOST_PP_ITERATION_FLAGS() == 1
|
||||
+#else
|
||||
+#if BOOST_PP_ITERATION_FLAGS() == 1
|
||||
|
||||
#define LUABIND_TUPLE_PARAMS(z, n, data) const A##n *
|
||||
#define LUABIND_OPERATOR_PARAMS(z, n, data) const A##n & a##n
|
||||
@@ -360,4 +361,5 @@ namespace luabind
|
||||
#undef LUABIND_TUPLE_PARAMS
|
||||
|
||||
#endif
|
||||
+#endif
|
||||
|
||||
diff --git luabind-0.9.1/luabind/wrapper_base.hpp luabind-0.9.1-fixed/luabind/wrapper_base.hpp
|
||||
index d54c668..0f88cc5 100755
|
||||
--- luabind-0.9.1/luabind/wrapper_base.hpp
|
||||
+++ luabind-0.9.1-fixed/luabind/wrapper_base.hpp
|
||||
@@ -89,7 +89,8 @@ namespace luabind
|
||||
|
||||
#endif // LUABIND_WRAPPER_BASE_HPP_INCLUDED
|
||||
|
||||
-#elif BOOST_PP_ITERATION_FLAGS() == 1
|
||||
+#else
|
||||
+#if BOOST_PP_ITERATION_FLAGS() == 1
|
||||
|
||||
#define LUABIND_TUPLE_PARAMS(z, n, data) const A##n *
|
||||
#define LUABIND_OPERATOR_PARAMS(z, n, data) const A##n & a##n
|
||||
@@ -188,3 +189,4 @@ namespace luabind
|
||||
#undef N
|
||||
|
||||
#endif
|
||||
+#endif
|
|
@ -1,26 +1,22 @@
|
|||
{ lib, stdenv, fetchFromGitHub, boost-build, lua, boost }:
|
||||
{ lib, stdenv, fetchFromGitHub, lua, boost, cmake }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "luabind";
|
||||
version = "0.9.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "luabind";
|
||||
owner = "Oberon00";
|
||||
repo = "luabind";
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-sK1ca2Oj9yXdmxyXeDO3k8YZ1g+HxIXLhvdTWdPDdag=";
|
||||
rev = "49814f6b47ed99e273edc5198a6ebd7fa19e813a";
|
||||
sha256 = "sha256-JcOsoQHRvdzF2rsZBW6egOwIy7+7C4wy0LiYmbV590Q";
|
||||
};
|
||||
|
||||
patches = [ ./0.9.1_modern_boost_fix.patch ./0.9.1_boost_1.57_fix.patch ./0.9.1_discover_luajit.patch ];
|
||||
nativeBuildInputs = [ cmake ];
|
||||
|
||||
buildInputs = [ boost-build lua boost ];
|
||||
buildInputs = [ boost ];
|
||||
|
||||
propagatedBuildInputs = [ lua ];
|
||||
|
||||
buildPhase = "LUA_PATH=${lua} bjam release";
|
||||
|
||||
installPhase = "LUA_PATH=${lua} bjam --prefix=$out release install";
|
||||
|
||||
passthru = {
|
||||
inherit lua;
|
||||
};
|
||||
|
@ -29,6 +25,6 @@ stdenv.mkDerivation rec {
|
|||
homepage = "https://github.com/luabind/luabind";
|
||||
description = "A library that helps you create bindings between C++ and Lua";
|
||||
license = lib.licenses.mit;
|
||||
platforms = lib.platforms.linux;
|
||||
platforms = lib.platforms.unix;
|
||||
};
|
||||
}
|
||||
|
|
30
pkgs/servers/osrm-backend/darwin.patch
Normal file
30
pkgs/servers/osrm-backend/darwin.patch
Normal file
|
@ -0,0 +1,30 @@
|
|||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index e49fac2..25e3302 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -34,6 +34,14 @@ option(ENABLE_GLIBC_WORKAROUND "Workaround GLIBC symbol exports" OFF)
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
||||
|
||||
+IF(APPLE)
|
||||
+ set(CMAKE_THREAD_LIBS_INIT "-lpthread")
|
||||
+ set(CMAKE_HAVE_THREADS_LIBRARY 1)
|
||||
+ set(CMAKE_USE_WIN32_THREADS_INIT 0)
|
||||
+ set(CMAKE_USE_PTHREADS_INIT 1)
|
||||
+ set(THREADS_PREFER_PTHREAD_FLAG ON)
|
||||
+ENDIF()
|
||||
+
|
||||
if(ENABLE_MASON)
|
||||
# versions in use
|
||||
set(MASON_BOOST_VERSION "1.65.1")
|
||||
@@ -405,7 +413,8 @@ endif()
|
||||
if(APPLE)
|
||||
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.10")
|
||||
execute_process(COMMAND xcrun --sdk macosx --show-sdk-path OUTPUT_VARIABLE CMAKE_OSX_SYSROOT OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
+ execute_process(COMMAND uname -m OUTPUT_VARIABLE JAMBA_OSX_NATIVE_ARCHITECTURE OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
- set(CMAKE_OSX_ARCHITECTURES "x86_64")
|
||||
+ set(CMAKE_OSX_ARCHITECTURES "${JAMBA_OSX_NATIVE_ARCHITECTURE}")
|
||||
+ message(STATUS "Set Architecture to ${JAMBA_OSX_NATIVE_ARCHITECTURE} on OS X")
|
||||
- message(STATUS "Set Architecture to x64 on OS X")
|
||||
exec_program(uname ARGS -v OUTPUT_VARIABLE DARWIN_VERSION)
|
||||
string(REGEX MATCH "[0-9]+" DARWIN_VERSION ${DARWIN_VERSION})
|
|
@ -15,6 +15,8 @@ stdenv.mkDerivation rec {
|
|||
|
||||
buildInputs = [ bzip2 libxml2 libzip boost lua luabind tbb expat ];
|
||||
|
||||
patches = [ ./darwin.patch ];
|
||||
|
||||
env.NIX_CFLAGS_COMPILE = toString [
|
||||
# Needed with GCC 12
|
||||
"-Wno-error=stringop-overflow"
|
||||
|
@ -28,6 +30,6 @@ stdenv.mkDerivation rec {
|
|||
description = "Open Source Routing Machine computes shortest paths in a graph. It was designed to run well with map data from the Openstreetmap Project";
|
||||
license = lib.licenses.bsd2;
|
||||
maintainers = with lib.maintainers;[ erictapen ];
|
||||
platforms = lib.platforms.linux;
|
||||
platforms = lib.platforms.unix;
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue