Date: Monday, January 23, 2023 @ 15:15:09
  Author: daurnimator
Revision: 1387944

upgpkg: ncdu 2.2.2-1

  - recompile with zig 0.10.1
  - relro is now supported upstream, so we can use `zig build`
  - need to introduce pie patch

Added:
  ncdu/trunk/ncdu-pie.patch
Modified:
  ncdu/trunk/PKGBUILD

----------------+
 PKGBUILD       |   52 +++++++++++++++++++++++++++++-----------------------
 ncdu-pie.patch |   10 ++++++++++
 2 files changed, 39 insertions(+), 23 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD    2023-01-23 15:05:29 UTC (rev 1387943)
+++ PKGBUILD    2023-01-23 15:15:09 UTC (rev 1387944)
@@ -1,6 +1,6 @@
 # Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
 # Maintainer: Andreas 'Segaja' Schleifer <segaja at archlinux dot org>
-# Contributor: Daurnimator <[email protected]>
+# Maintainer: Daurnimator <[email protected]>
 # Contributor: Eli Schwartz <[email protected]>
 # Contributor: lp76 <[email protected]>
 # Contributor: Daenyth <Daenyth+Arch AT gmail DOT com>
@@ -7,7 +7,7 @@
 # Contributor: Gaetan Bisson <[email protected]>
 
 pkgname='ncdu'
-pkgver=2.2.1
+pkgver=2.2.2
 pkgrel=1
 pkgdesc='Disk usage analyzer with an ncurses interface'
 url='https://dev.yorhel.nl/ncdu'
@@ -15,42 +15,48 @@
 depends=('ncurses')
 makedepends=('zig')
 arch=('x86_64')
-source=("https://dev.yorhel.nl/download/${pkgname}-${pkgver}.tar.gz"{,.asc})
-sha256sums=('5e4af8f6bcd8cf7ad8fd3d7900dab1320745a0453101e9e374f9a77f72aed141'
-            'SKIP')
-b2sums=('ac7f281b2fd12144a3498b105594a60478c49049eabeb7b3951c4aac4d5b9c025f823806dc948327e4a6608e629da9d7b15a8073bdb79043116ba095d3becdce'
-        'SKIP')
+source=("https://dev.yorhel.nl/download/${pkgname}-${pkgver}.tar.gz"{,.asc}
+        "ncdu-pie.patch")
+sha256sums=('90d920024e752318b469776ce57e03b3c702d49329ad9825aeeab36c3babf993'
+            'SKIP'
+            '05e2a1809dc62fe85b5b47f1e6fff3487f7302da72889ac6d2a73d0aa5bba886')
+b2sums=('fca41e74e4eb2509496276aa964ecf6a20db860d0b1d6bab9a169d8d6c5c7c2d41f088241cf57c92d7cf51bb5d84642c2a3a6db99410e6332061e6d35efa94e6'
+        'SKIP'
+        
'0c42f7d004b8293c3d5a937cdc850e63ecb3133e38cdbdb36e89832250d75b6423b5f3da3b1b91c304e8a2ec44dfca3f9f0c84c253ce610e1e5d8c68da0a95b4')
 validpgpkeys=('74460D32B80810EBA9AFA2E962394C698C2739FA') # Yoran Heling 
<[email protected]>
 
+prepare() {
+    cd "${pkgname}-${pkgver}"
+
+    patch -i ../ncdu-pie.patch
+}
+
 build() {
     cd "${pkgname}-${pkgver}"
 
-    # since RELRO is not doable in the zig.build file 
(https://github.com/ziglang/zig/issues/6977)
-    # we are running zig build-exe directly
-    zig build-exe \
-        -target x86_64-linux.5.10-gnu.2.34 -mcpu baseline \
-        -L /usr/local/lib -L /usr/lib \
-        -isystem /usr/local/include -isystem /usr/include \
-        ./src/main.zig ./src/ncurses_refs.c \
-        -lc -lncursesw \
-        -OReleaseSafe \
-        --name ncdu \
-        -D _DEFAULT_SOURCE -D _XOPEN_SOURCE=600 \
-        -fPIE \
-        -z relro -z now \
-        -fno-each-lib-rpath
+    DESTDIR="build" zig build \
+      --prefix /usr \
+      --search-prefix /usr \
+      -Dtarget=native-linux.5.15 \
+      -Dcpu=baseline \
+      -Drelease-safe
 }
 
 check() {
     cd "${pkgname}-${pkgver}"
 
-    zig build test
+    zig build test \
+      --prefix /usr \
+      --search-prefix /usr \
+      -Dtarget=native-linux.5.15 \
+      -Dcpu=baseline \
+      -Drelease-safe
 }
 
 package() {
     cd "${pkgname}-${pkgver}"
 
-    install --verbose -D --mode=755 "./${pkgname}" 
"${pkgdir}/usr/bin/${pkgname}"
+    cp -a build/* "$pkgdir"
 
     make install-doc PREFIX="${pkgdir}/usr"
 

Added: ncdu-pie.patch
===================================================================
--- ncdu-pie.patch                              (rev 0)
+++ ncdu-pie.patch      2023-01-23 15:15:09 UTC (rev 1387944)
@@ -0,0 +1,10 @@
+--- build.zig  2023-01-19 17:57:48.000000000 +1100
++++ build.zig  2023-01-24 02:06:07.803838292 +1100
+@@ -10,6 +10,7 @@
+     const exe = b.addExecutable("ncdu", "src/main.zig");
+     exe.setTarget(target);
+     exe.setBuildMode(mode);
++    exe.pie = true;
+     exe.addCSourceFile("src/ncurses_refs.c", &[_][]const u8{});
+     exe.linkLibC();
+     exe.linkSystemLibrary("ncursesw");

Reply via email to