diff options
author | Tyler Veness | 2022-10-20 20:18:03 -0700 |
---|---|---|
committer | Tyler Veness | 2022-10-20 20:18:03 -0700 |
commit | 9ba60bdb81a5b2733beb4170650d634332f94969 (patch) | |
tree | 606113474ed8cec4734b4159b78fd02e3db2081e | |
parent | ab70d7401ae007a543f4750de6a03a90fb8853d6 (diff) | |
download | aur-9ba60bdb81a5b2733beb4170650d634332f94969.tar.gz |
Patch allwpilib to use correct install path
-rw-r--r-- | .SRCINFO | 8 | ||||
-rw-r--r-- | 0001-build-Remove-wpilib-prefix-from-CMake-flat-install.patch | 67 | ||||
-rw-r--r-- | PKGBUILD | 17 |
3 files changed, 80 insertions, 12 deletions
@@ -1,7 +1,7 @@ pkgbase = wpimath pkgdesc = WPILib's mathematics and controls library pkgver = 2023.1.1a - pkgrel = 4 + pkgrel = 5 url = https://github.com/wpilibsuite/allwpilib arch = x86_64 license = BSD @@ -12,12 +12,14 @@ pkgbase = wpimath options = !strip options = staticlibs source = git+https://github.com/wpilibsuite/allwpilib#tag=v2023.1.1-alpha-1 - source = 0001-build-Fix-CMake-system-library-opt-ins.patch source = 0001-build-Allow-disabling-ntcore-CMake-build.patch + source = 0001-build-Fix-CMake-system-library-opt-ins.patch + source = 0001-build-Remove-wpilib-prefix-from-CMake-flat-install.patch source = Suppress-Eigen-warning.patch md5sums = SKIP - md5sums = cac7f90b51f6a710bca065b6edc0b996 md5sums = 32b2c74c1c5434ef1241537a0ee8e0f9 + md5sums = cac7f90b51f6a710bca065b6edc0b996 + md5sums = 5fbf5e6bab1592c7f0a0f17474ef9550 md5sums = 0116ecb4c78683a00db29f15c23b2920 pkgname = wpimath diff --git a/0001-build-Remove-wpilib-prefix-from-CMake-flat-install.patch b/0001-build-Remove-wpilib-prefix-from-CMake-flat-install.patch new file mode 100644 index 000000000000..b787cc65d289 --- /dev/null +++ b/0001-build-Remove-wpilib-prefix-from-CMake-flat-install.patch @@ -0,0 +1,67 @@ +From 4414bdbd81a96c07de7a1791f3d30c36be064da9 Mon Sep 17 00:00:00 2001 +From: Tyler Veness <calcmogul@gmail.com> +Date: Thu, 20 Oct 2022 19:49:38 -0700 +Subject: [PATCH] [build] Remove wpilib prefix from CMake flat install + +For system installs, `DESTDIR=/usr cmake --install buildfolder` installs +libraries to `/usr/lib` with the correct rpath. Example structure: +``` +/usr/include/wpimath/frc/controller/LinearQuadraticRegulator.h +/usr/lib/libwpimath.so +``` + +Users need to provide `-I/usr/include/wpimath` in their projects. This +is an artifact of the install() commands being in the subdirectory CMake +files. + +For other locations, `DESTDIR=/opt/wpilib cmake --install buildfolder` +installs libraries to `/opt/wpilib/lib`. Example structure: +``` +/opt/wpilib/include/wpimath/frc/controller/LinearQuadraticRegulator.h +/opt/wpilib/lib/libwpimath.so +``` +--- + CMakeLists.txt | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c65eaf376..53d901f4c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -36,16 +36,16 @@ SET(CMAKE_SKIP_BUILD_RPATH FALSE) + # (but later on when installing) + SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) + +-SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/wpilib/lib") ++SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") + + # add the automatically determined parts of the RPATH + # which point to directories outside the build tree to the install RPATH + SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) + + # the RPATH to be used when installing, but only if it's not a system directory +-LIST(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/wpilib/lib" isSystemDir) ++LIST(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir) + IF("${isSystemDir}" STREQUAL "-1") +- SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/wpilib/lib") ++ SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") + ENDIF("${isSystemDir}" STREQUAL "-1") + + # Options for building certain parts of the repo. Everything is built by default. +@@ -153,11 +153,11 @@ FATAL: Cannot build wpilib without wpimath. + ") + endif() + +-set( wpilib_dest wpilib) +-set( include_dest wpilib/include ) +-set( main_lib_dest wpilib/lib ) +-set( java_lib_dest wpilib/java ) +-set( jni_lib_dest wpilib/jni ) ++set( wpilib_dest "") ++set( include_dest include ) ++set( main_lib_dest lib ) ++set( java_lib_dest java ) ++set( jni_lib_dest jni ) + + if (WITH_FLAT_INSTALL) + set (wpilib_config_dir ${wpilib_dest}) @@ -2,7 +2,7 @@ pkgname=wpimath pkgver=2023.1.1a -pkgrel=4 +pkgrel=5 pkgdesc="WPILib's mathematics and controls library" arch=('x86_64') url='https://github.com/wpilibsuite/allwpilib' @@ -11,19 +11,22 @@ makedepends=('cmake') license=('BSD' 'MIT') options=('!strip' 'staticlibs') source=('git+https://github.com/wpilibsuite/allwpilib#tag=v2023.1.1-alpha-1' - '0001-build-Fix-CMake-system-library-opt-ins.patch' '0001-build-Allow-disabling-ntcore-CMake-build.patch' + '0001-build-Fix-CMake-system-library-opt-ins.patch' + '0001-build-Remove-wpilib-prefix-from-CMake-flat-install.patch' 'Suppress-Eigen-warning.patch') #source=("https://github.com/wpilibsuite/allwpilib/archive/refs/tags/v${pkgver}.tar.gz") md5sums=('SKIP' - 'cac7f90b51f6a710bca065b6edc0b996' '32b2c74c1c5434ef1241537a0ee8e0f9' + 'cac7f90b51f6a710bca065b6edc0b996' + '5fbf5e6bab1592c7f0a0f17474ef9550' '0116ecb4c78683a00db29f15c23b2920') prepare() { - cd "$srcdir"/allwpilib - patch -p1 < "$srcdir"/0001-build-Fix-CMake-system-library-opt-ins.patch + cd allwpilib patch -p1 < "$srcdir"/0001-build-Allow-disabling-ntcore-CMake-build.patch + patch -p1 < "$srcdir"/0001-build-Fix-CMake-system-library-opt-ins.patch + patch -p1 < "$srcdir"/0001-build-Remove-wpilib-prefix-from-CMake-flat-install.patch patch -p1 < "$srcdir"/Suppress-Eigen-warning.patch } @@ -52,8 +55,4 @@ check() { package() { DESTDIR="$pkgdir" cmake --install build - - mv "$pkgdir"/usr/wpilib/include "$pkgdir"/usr/include - mv "$pkgdir"/usr/wpilib/lib "$pkgdir"/usr/lib - rm -r "$pkgdir"/usr/wpilib } |