diff options
author | Joe Baldino | 2022-02-06 06:13:31 +0000 |
---|---|---|
committer | Joe Baldino | 2022-02-06 06:22:27 +0000 |
commit | 6632e556288cd0f4303b4a224015b79be67500ca (patch) | |
tree | 695efb7399430b56257e037f45b68a28460d5a26 | |
parent | 6f581be9dea4cc6347d80130dc7fdbbf9a853e13 (diff) | |
download | aur-6632e556288cd0f4303b4a224015b79be67500ca.tar.gz |
0.2.5-3: change maintainer, patch upstream cmake
Added a heavy-handed patch for upstream CMakeLists.txt. Necessary
because, unmodified, it hardcodes compiler flags. Meaning end-user
makepkg flags are ignored, violating packaging policies. See patch
itself for all the nitty-gritty details.
Minor changes and refinements to the pkgbuild logic. Added a SKIP_RPATH
directive to avoid hard-coding any paths.
TODO: resulting binary contains a string containing the absolute path to
a header used during build time, present even after stripping. Currently
chasing it down.
Signed-off-by: Joe Baldino <pedanticdm@gmx.us>
-rw-r--r-- | .SRCINFO | 8 | ||||
-rw-r--r-- | 0001-ArchLinux-changes-to-CMakeLists.txt.patch | 85 | ||||
-rw-r--r-- | PKGBUILD | 39 |
3 files changed, 113 insertions, 19 deletions
@@ -1,13 +1,15 @@ pkgbase = crex pkgdesc = Explore, test, and check regular expressions in the terminal pkgver = 0.2.5 - pkgrel = 2 + pkgrel = 3 url = https://octobanana.com/software/crex arch = x86_64 license = MIT makedepends = cmake - source = crex-0.2.5.tar.gz::https://github.com/octobanana/crex/archive/0.2.5.tar.gz + depends = gcc-libs + source = crex-0.2.5.tar.gz::https://github.com/octobanana/crex/archive/refs/tags/0.2.5.tar.gz + source = 0001-ArchLinux-changes-to-CMakeLists.txt.patch sha256sums = c6a166b7a1e696a7babeaf7c5728eece1624704a18357f827129fc95ef2ecc56 + sha256sums = 407177d9486ca4758b0853114cfaa88aeafdb862c07c3ba683f017fbc79c9c18 pkgname = crex - diff --git a/0001-ArchLinux-changes-to-CMakeLists.txt.patch b/0001-ArchLinux-changes-to-CMakeLists.txt.patch new file mode 100644 index 000000000000..98b654f2ae1f --- /dev/null +++ b/0001-ArchLinux-changes-to-CMakeLists.txt.patch @@ -0,0 +1,85 @@ +From 8cea8f285e1fa3c60da7003283552b0cbbd3eb2b Mon Sep 17 00:00:00 2001 +From: Joe Baldino <pedanticdm@gmx.us> +Date: Sat, 5 Feb 2022 23:36:51 +0000 +Subject: [PATCH] [ArchLinux] changes to CMakeLists.txt + +Changes needed to comply with ArchLinux's packaging policies and norms. +Makes for a lighter PKGBUILD. + +Removed: + + * upstream-defined [C,CXX]FLAGS + * target_link_libraries directive (unnecessary for crex) + * superfluous message displaying build type + +Added: + + * Variable containing upstream warning flags + * Said flags added to all build types + * CMAKE_CXX_EXTENSIONS OFF + - Inferred from upstream's redundant -std=c++14 flag + +Fixed: + + * hard-coded install path + +Based on tag 0.2.5 +Signed-off-by: Joe Baldino <pedanticdm@gmx.us> +--- + CMakeLists.txt | 34 ++++++++++++---------------------- + 1 file changed, 12 insertions(+), 22 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index bb2d9ed6471b..1564f94ff376 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -12,25 +12,19 @@ endif(CCACHE_FOUND) + + set (CMAKE_CXX_STANDARD 14) + set (CMAKE_CXX_STANDARD_REQUIRED ON) ++set (CMAKE_CXX_EXTENSIONS OFF) + +-set (CMAKE_CXX_FLAGS "-fdiagnostics-color=auto") +-set (CMAKE_C_FLAGS "-fdiagnostics-color=auto") ++set (WARNING_FLAGS "\ ++-Wpedantic -Wall -Wextra -Wcast-align -Wcast-qual -Wctor-dtor-privacy \ ++-Wdisabled-optimization -Wformat=2 -Winit-self -Wlogical-op \ ++-Wmissing-declarations -Wmissing-include-dirs -Wnoexcept -Wold-style-cast \ ++-Woverloaded-virtual -Wredundant-decls -Wshadow -Wsign-conversion \ ++-Wsign-promo -Wstrict-null-sentinel -Wstrict-overflow=5 -Wswitch-default \ ++-Wundef -Wno-unused \ ++") + +-set (DEBUG_FLAGS "-Wpedantic -Wall -Wextra -Wcast-align -Wcast-qual -Wctor-dtor-privacy -Wdisabled-optimization -Wformat=2 -Winit-self -Wlogical-op -Wmissing-declarations -Wmissing-include-dirs -Wnoexcept -Wold-style-cast -Woverloaded-virtual -Wredundant-decls -Wshadow -Wsign-conversion -Wsign-promo -Wstrict-null-sentinel -Wstrict-overflow=5 -Wswitch-default -Wundef -Wno-unused -std=c++14 -g") +-set (DEBUG_LINK_FLAGS "-fprofile-arcs -ftest-coverage -flto") +- +-set (RELEASE_FLAGS "-std=c++14 -s -O3") +-set (RELEASE_LINK_FLAGS "-flto") +- +-set (CMAKE_CXX_FLAGS_DEBUG ${DEBUG_FLAGS}) +-set (CMAKE_C_FLAGS_DEBUG ${DEBUG_FLAGS}) +-set (CMAKE_EXE_LINKER_FLAGS_DEBUG ${DEBUG_LINK_FLAGS}) +- +-set (CMAKE_CXX_FLAGS_RELEASE ${RELEASE_FLAGS}) +-set (CMAKE_C_FLAGS_RELEASE ${RELEASE_FLAGS}) +-set (CMAKE_EXE_LINKER_FLAGS_RELEASE ${RELEASE_LINK_FLAGS}) +- +-message ("CMAKE_BUILD_TYPE is ${CMAKE_BUILD_TYPE}") ++set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNING_FLAGS}") ++set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARNING_FLAGS}") + + include_directories( + ./src +@@ -52,8 +46,4 @@ add_executable ( + ${HEADERS} + ) + +-target_link_libraries ( +- ${TARGET} +-) +- +-install (TARGETS ${TARGET} DESTINATION "/usr/local/bin") ++install (TARGETS ${TARGET} DESTINATION bin) +-- +2.35.1 + @@ -1,30 +1,37 @@ -# Maintainer: Caltlgin Stsodaat <contact@fossdaily.xyz> +# Maintainer: Joe Baldino <pedanticdm@gmx.us> +# Contributor: Caltlgin Stsodaat <contact@fossdaily.xyz> pkgname=crex pkgver=0.2.5 -pkgrel=2 +pkgrel=3 pkgdesc='Explore, test, and check regular expressions in the terminal' arch=('x86_64') url='https://octobanana.com/software/crex' license=('MIT') makedepends=('cmake') -source=("${pkgname}-${pkgver}.tar.gz::https://github.com/octobanana/${pkgname}/archive/${pkgver}.tar.gz") -sha256sums=('c6a166b7a1e696a7babeaf7c5728eece1624704a18357f827129fc95ef2ecc56') +depends=('gcc-libs') +source=("${pkgname}-${pkgver}.tar.gz::https://github.com/octobanana/${pkgname}/archive/refs/tags/${pkgver}.tar.gz" + '0001-ArchLinux-changes-to-CMakeLists.txt.patch') +sha256sums=('c6a166b7a1e696a7babeaf7c5728eece1624704a18357f827129fc95ef2ecc56' + '407177d9486ca4758b0853114cfaa88aeafdb862c07c3ba683f017fbc79c9c18') + +prepare() { + cd "${pkgname}-${pkgver}" + patch --forward --strip=1 \ + --input="${srcdir}/0001-ArchLinux-changes-to-CMakeLists.txt.patch" +} build() { - export CFLAGS+=" ${CPPFLAGS}" - export CXXFLAGS+=" ${CPPFLAGS}" - cmake -B build -S "${pkgname}-${pkgver}" \ - -DCMAKE_BUILD_TYPE='None' \ - -DCMAKE_INSTALL_PREFIX='/usr' \ - -Wno-dev - make -C build + cmake -B build -S "${pkgname}-${pkgver}" \ + -DCMAKE_BUILD_TYPE='None' \ + -DCMAKE_INSTALL_PREFIX='/usr' \ + -DCMAKE_SKIP_RPATH='TRUE' + cmake --build build } package() { - install -Dm755 "build/${pkgname}" "${pkgdir}/usr/bin/${pkgname}" - install -Dm644 -t "${pkgdir}/usr/share/doc/${pkgname}" "${pkgname}-${pkgver}/README.md" - install -Dm644 -t "${pkgdir}/usr/share/licenses/${pkgname}" "${pkgname}-${pkgver}/LICENSE" -} + DESTDIR="${pkgdir}" cmake --install build -# vim: ts=2 sw=2 et: + install -Dm644 -t "${pkgdir}/usr/share/doc/${pkgname}" "${pkgname}-${pkgver}/README.md" + install -Dm644 -t "${pkgdir}/usr/share/licenses/${pkgname}" "${pkgname}-${pkgver}/LICENSE" +} |