diff options
author | Joe Baldino | 2022-02-06 18:37:46 +0000 |
---|---|---|
committer | Joe Baldino | 2022-02-06 18:53:01 +0000 |
commit | 5bda743b6d7a5be9fa910700d1fb6bc56e6e3fa7 (patch) | |
tree | 1ab7bc52ebc81e56b6236564fc495f4a5da37a17 | |
parent | 6632e556288cd0f4303b4a224015b79be67500ca (diff) | |
download | aur-crex.tar.gz |
0.2.5-4: keep file paths out of binary
Found out why makepkg was griping about:
==> WARNING: Package contains reference to $srcdir
usr/bin/crex
My local setup particulars aside, here's what I saw:
$ strings crex | grep src
/run/user/1000/makepkg/crex/src/crex-0.2.5/src/parg.hh
A hard-coded path to... a header file. And only that particular file.
Searched the code base high and low. Searched the clang and gcc
preprocessor output in the hopes of finding a magic macro. Nothing.
I happened to notice that assert() was being used in the codebase. On a
lark I passed in -DNDEBUG as a CXXFLAG. And voila, no more hard-coded
header file path. Sneaky.
See: https://wiki.archlinux.org/title/CMake_package_guidelines
Signed-off-by: Joe Baldino <pedanticdm@gmx.us>
-rw-r--r-- | .SRCINFO | 2 | ||||
-rw-r--r-- | PKGBUILD | 5 |
2 files changed, 5 insertions, 2 deletions
@@ -1,7 +1,7 @@ pkgbase = crex pkgdesc = Explore, test, and check regular expressions in the terminal pkgver = 0.2.5 - pkgrel = 3 + pkgrel = 4 url = https://octobanana.com/software/crex arch = x86_64 license = MIT @@ -3,7 +3,7 @@ pkgname=crex pkgver=0.2.5 -pkgrel=3 +pkgrel=4 pkgdesc='Explore, test, and check regular expressions in the terminal' arch=('x86_64') url='https://octobanana.com/software/crex' @@ -22,6 +22,9 @@ prepare() { } build() { + # -DNDEBUG prevents (assert) file paths being compiled into the binary + # See: https://wiki.archlinux.org/title/CMake_package_guidelines#CMake_undesired_behaviors + CFLAGS="${CFLAGS} -DNDEBUG" CXXFLAGS="${CXXFLAGS} -DNDEBUG" \ cmake -B build -S "${pkgname}-${pkgver}" \ -DCMAKE_BUILD_TYPE='None' \ -DCMAKE_INSTALL_PREFIX='/usr' \ |