From 9d3b5807a53e8820b25c9fec54f305603c101cdc Mon Sep 17 00:00:00 2001 From: Ben Wolsieffer Date: Tue, 10 Sep 2019 00:11:13 -0400 Subject: [PATCH] Fix aws-common for ROS 2 --- dashing/overrides.nix | 29 +++++++++++++++++++++++++++++ distro-overlay.nix | 38 +++++++++++++++++++++----------------- 2 files changed, 50 insertions(+), 17 deletions(-) diff --git a/dashing/overrides.nix b/dashing/overrides.nix index 42771bf0cb..87ea9a307a 100644 --- a/dashing/overrides.nix +++ b/dashing/overrides.nix @@ -2,6 +2,35 @@ self: # Distro package set rosSelf: rosSuper: { + aws-common = (rosSelf.patchVendorUrl rosSuper.aws-common { + url = "https://github.com/aws/aws-sdk-cpp/archive/1.6.53.tar.gz"; + originalUrl = "https://github.com/aws/aws-sdk-cpp/archive/\${AWSSDK_VERSION}.tar.gz"; + sha256 = "0va0yxbjxa9sy2dlvfi0nm9d12jvr1d4dlp5vqr7i28jf0fjxjw0"; + file = "awssdk/CMakeLists.txt"; + }).overrideDerivation ({ + cmakeFlags ? [], + postPatch ? "", ... + }: { + cmakeFlags = cmakeFlags ++ [ "-DCMAKE_INSTALL_LIBDIR=lib" ]; + + postPatch = '' + sed 's#\(CMAKE_ARGS .*$\)#\1 -DCMAKE_INSTALL_LIBDIR=lib#' \ + -i awssdk/CMakeLists.txt + '' + postPatch; + }); + + aws-ros2-common = rosSuper.aws-ros2-common.overrideAttrs ({ + patches ? [], ... + }: { + patches = patches ++ [ + (self.fetchpatch { + url = "https://github.com/aws-robotics/utils-ros2/commit/d782a734e5937134397592f9b5aa757353659362.patch"; + sha256 = "01bgkd8wbnkcnhz9p88lhnpk0wdxg4lw8m48bplb7gv15pyahp1d"; + stripLen = 1; + }) + ]; + }); + nav2-util = rosSuper.nav2-util.overrideAttrs ({ patches ? [], ... }: { diff --git a/distro-overlay.nix b/distro-overlay.nix index 8be97bafb5..f437d9b87a 100644 --- a/distro-overlay.nix +++ b/distro-overlay.nix @@ -20,6 +20,19 @@ let python = rosSelf.python; enablePython = true; }; + + patchVendorUrl = pkg: { + url, sha256, + originalUrl ? url, + file ? "CMakeLists.txt" + }: pkg.overrideAttrs ({ + postPatch ? "", ... + }: { + postPatch = '' + substituteInPlace '${file}' \ + --replace '${originalUrl}' '${self.fetchurl { inherit url sha256; }}' + '' + postPatch; + }); }; overrides = rosSelf: rosSuper: let @@ -30,15 +43,6 @@ let sed -Ei CMakeLists.txt \ -e 's/(Boost [^)]*)python[^ )]*([ )])/\1${pythonLib}\2/' ''; - - patchVendorUrl = pkg: args: pkg.overrideAttrs ({ - postPatch ? "", ... - }: { - postPatch = '' - substituteInPlace CMakeLists.txt \ - --replace '${args.url}' '${self.fetchurl args}' - '' + postPatch; - }); in { # ROS package overrides/fixups @@ -108,7 +112,7 @@ let ''; }); - fmilibrary-vendor = patchVendorUrl rosSuper.fmilibrary-vendor { + fmilibrary-vendor = rosSelf.patchVendorUrl rosSuper.fmilibrary-vendor { url = "https://jmodelica.org/fmil/FMILibrary-2.0.3-src.zip"; sha256 = "16lx6355zskrb7wgw2bzdzms36pcjyl2ry03wgsac5215jg1zhjc"; }; @@ -117,7 +121,7 @@ let setupHook = ./gazebo-ros-setup-hook.sh; }); - libyaml-vendor = patchVendorUrl rosSuper.libyaml-vendor { + libyaml-vendor = rosSelf.patchVendorUrl rosSuper.libyaml-vendor { url = "https://github.com/yaml/libyaml/archive/10c907871f1ccd779c7fccf6b81a62762b5c4e7b.zip"; sha256 = "0v6ks4hpxmakgymcfvafynla76gl3866grgwf4vjdsb4rsvr13vx"; }; @@ -186,7 +190,7 @@ let '' + postFixup; }); - rviz-ogre-vendor = (patchVendorUrl rosSuper.rviz-ogre-vendor { + rviz-ogre-vendor = (rosSelf.patchVendorUrl rosSuper.rviz-ogre-vendor { url = "https://github.com/OGRECave/ogre/archive/v1.10.12.zip"; sha256 = "1nafqazv396y97z0rgrn0dmkddq7y4zgfszvmi3aw6hr6zwyrpa3"; }).overrideAttrs ({ @@ -199,12 +203,12 @@ let '' + preFixup; }); - rxcpp-vendor = patchVendorUrl rosSuper.rxcpp-vendor { + rxcpp-vendor = rosSelf.patchVendorUrl rosSuper.rxcpp-vendor { url = "https://github.com/ReactiveX/RxCpp/archive/v4.1.0.tar.gz"; sha256 = "1smxrcm0s6bz05185dx1i2xjgn47rq7m247pblil6p3bmk3lkfyk"; }; - shared-queues-vendor = patchVendorUrl (patchVendorUrl rosSuper.shared-queues-vendor { + shared-queues-vendor = rosSelf.patchVendorUrl (rosSelf.patchVendorUrl rosSuper.shared-queues-vendor { url = "https://github.com/cameron314/concurrentqueue/archive/8f65a8734d77c3cc00d74c0532efca872931d3ce.zip"; sha256 = "0cmsmgc87ndd9hiv187xkvjkn8fipn3hsijjc864h2lfcyigbxq1"; }) { @@ -212,12 +216,12 @@ let sha256 = "1255n51y1bjry97n4w60mgz6b9h14flfrxb01ihjf6pwvvfns8ag"; }; - tinydir-vendor = patchVendorUrl rosSuper.tinydir-vendor { + tinydir-vendor = rosSelf.patchVendorUrl rosSuper.tinydir-vendor { url = "https://github.com/cxong/tinydir/archive/1.2.4.tar.gz"; sha256 = "1qjwky7v4b9d9dmxzsybnhiz6xgx94grc67sdyvlp1d4kfkfsl4w"; }; - uncrustify-vendor = patchVendorUrl rosSuper.uncrustify-vendor { + uncrustify-vendor = rosSelf.patchVendorUrl rosSuper.uncrustify-vendor { url = "https://github.com/uncrustify/uncrustify/archive/uncrustify-0.68.1.tar.gz"; sha256 = "04ndwhcn9iv3cy4p5wgh5z0vx2sywqlydyympn9m3h5458w1aijh"; }; @@ -228,7 +232,7 @@ let postPatch = postPatch + patchBoostPython; }); - yaml-cpp-vendor = patchVendorUrl rosSuper.yaml-cpp-vendor { + yaml-cpp-vendor = rosSelf.patchVendorUrl rosSuper.yaml-cpp-vendor { url = "https://github.com/jbeder/yaml-cpp/archive/0f9a586ca1dc29c2ecb8dd715a315b93e3f40f79.zip"; sha256 = "1g45f71mk4gyca550177qf70v5cvavlsalmg7x8bi59j6z6f0mgz"; };