summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMohammad Farzan2021-04-07 18:20:57 +0430
committerMohammad Farzan2021-04-07 18:20:57 +0430
commit6144a85d9c0aa4bd24c90f7f876c797a51f807b4 (patch)
tree04d8d57719db9f718a274bd4ebaa347a88cdab05
downloadaur-6144a85d9c0aa4bd24c90f7f876c797a51f807b4.tar.gz
First commit
-rw-r--r--.SRCINFO21
-rw-r--r--.gitignore1
-rw-r--r--PKGBUILD64
-rw-r--r--mimick_vendor.patch3
-rw-r--r--ros2-git.install26
-rw-r--r--yaml_cpp_vendor.patch6
6 files changed, 121 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..0a81f1c125b1
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,21 @@
+pkgbase = ros2-git
+ pkgdesc = A set of software libraries and tools for building robot applications (Rolling Distro)
+ pkgver = r216.0e58b2b
+ pkgrel = 1
+ url = https://docs.ros.org/en/rolling/
+ install = ros2-git.install
+ arch = any
+ license = Apache
+ depends = ros2-arch-deps
+ depends = gmock
+ depends = sip4
+ depends = foonathan_memory
+ source = ros2::git+https://github.com/ros2/ros2#branch=master
+ source = mimick_vendor.patch
+ source = yaml_cpp_vendor.patch
+ sha256sums = SKIP
+ sha256sums = SKIP
+ sha256sums = SKIP
+
+pkgname = ros2-git
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..72e8ffc0db8a
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+*
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..f317aca9ca06
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,64 @@
+# Maintainer: Mohammad Mostafa Farzan <m2_farzan@yahoo.com>
+# Acknowledgment: This work is hugely based on `ros2-arch-deps` AUR
+# package, maintained by T. Borgert.
+
+pkgname=ros2-git
+pkgver=r216.0e58b2b
+pkgrel=1
+pkgdesc="A set of software libraries and tools for building robot applications (Rolling Distro)"
+url="https://docs.ros.org/en/rolling/"
+arch=('any')
+license=('Apache')
+depends=('ros2-arch-deps'
+ 'gmock'
+ 'sip4'
+ # AUR
+ 'foonathan_memory'
+ )
+source=("ros2::git+https://github.com/ros2/ros2#branch=master"
+ "mimick_vendor.patch"
+ "yaml_cpp_vendor.patch")
+sha256sums=('SKIP'
+ 'SKIP'
+ 'SKIP')
+
+install=ros2-git.install
+
+pkgver() {
+ cd $srcdir/ros2
+ printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
+}
+
+prepare() {
+ # Check locale
+ locale | grep LANG | grep UTF-8
+ if [[ $? -ne 0 ]]; then
+ printf "Locale must support UTF-8. See https://wiki.archlinux.org/index.php/locale
+ or https://wiki.archlinux.org/index.php/locale ."
+ exit 1
+ fi
+
+ # Create required symlinks (see https://wiki.archlinux.org/index.php/ROS)
+ sudo mkdir -p /usr/share/sip
+ sudo ln -sf /usr/lib/python3.9/site-packages/PyQt5 /usr/share/sip/.
+ sudo ln -sf /usr/lib/python3.9/site-packages/PyQt5/bindings/* /usr/share/sip/PyQt5/.
+
+ # Clone the repos
+ mkdir -p $srcdir/ros2/src
+ vcs import $srcdir/ros2/src < $srcdir/ros2/ros2.repos
+
+ # Fix some issues in the code (TODO: Gradually move to upstream)
+ ## mimick_vendor:
+ patch --forward $srcdir/ros2/src/ros2/mimick_vendor/CMakeLists.txt mimick_vendor.patch || true
+ ## yaml_cpp_vendor:
+ patch --forward $srcdir/ros2/src/ros2/yaml_cpp_vendor/CMakeLists.txt yaml_cpp_vendor.patch || true
+}
+
+build() {
+ colcon build --merge-install
+}
+
+package() {
+ mkdir -p $pkgdir/opt/ros2/rolling
+ cp -r $srcdir/install/* $pkgdir/opt/ros2/rolling/
+}
diff --git a/mimick_vendor.patch b/mimick_vendor.patch
new file mode 100644
index 000000000000..d86f3c8d48b5
--- /dev/null
+++ b/mimick_vendor.patch
@@ -0,0 +1,3 @@
+10a11,12
+> list(APPEND cmake_configure_args -DCMAKE_C_FLAGS="-O2")
+> list(APPEND cmake_configure_args -DCMAKE_CXX_FLAGS="-O2")
diff --git a/ros2-git.install b/ros2-git.install
new file mode 100644
index 000000000000..febd921ed06e
--- /dev/null
+++ b/ros2-git.install
@@ -0,0 +1,26 @@
+post_install() {
+ printf "
+ \e[33m\e[1mIMPORTANT NOTE:\e[0m
+ You should add something like this to your ~/.bashrc file:
+
+ export ROS_DOMAIN_ID=42
+ source /opt/ros2/rolling/setup.bash
+
+ This quick command will do it for you:
+
+ printf \"\\\nexport ROS_DOMAIN_ID=42\\\nsource /opt/ros2/rolling/setup.bash\\\n\" >> ~/.bashrc
+
+ Note 1: If you use zsh, replace '.bash' in the above lines with
+ '.zsh' and add the lines to ~/.zshrc .
+
+ Note 2: This will slow down terminal startup for a few seconds on
+ cold start, and a fraction of a second for terminals that open later.
+ If you know a better transparent solution, you are welcome to edit
+ this.
+ \e[33m\e[1mEND OF IMPORTANT NOTE.\e[0m
+ "
+}
+
+post_remove() {
+ printf "You may want to clean up .bashrc and/or .zshrc."
+}
diff --git a/yaml_cpp_vendor.patch b/yaml_cpp_vendor.patch
new file mode 100644
index 000000000000..64be3f331768
--- /dev/null
+++ b/yaml_cpp_vendor.patch
@@ -0,0 +1,6 @@
+18,19c18,19
+< list(APPEND YAML_C_FLAGS "-w")
+< list(APPEND YAML_CXX_FLAGS "-std=c++14 -w")
+---
+> set(YAML_C_FLAGS "${YAML_C_FLAGS} -w")
+> set(YAML_CXX_FLAGS "${YAML_CXX_FLAGS} -std=c++14 -w")