diff --git a/Makefile b/Makefile index a311438..b248131 100644 --- a/Makefile +++ b/Makefile @@ -68,24 +68,25 @@ static-%.tar.gz: LD="${ZIG} cc --target=$*"\ AR="${ZIG} ar" RANLIB="${ZIG} ranlib" cd static-$*/nc && ../../ncurses/configure --prefix="`pwd`/../inst"\ - --with-pkg-config-libdir="`pwd`/../inst/pkg"\ --without-cxx --without-cxx-binding --without-ada --without-manpages --without-progs\ - --without-tests --enable-pc-files --without-pkg-config --without-shared --without-debug\ + --without-tests --disable-pc-files --without-pkg-config --without-shared --without-debug\ --without-gpm --without-sysmouse --enable-widec --with-default-terminfo-dir=/usr/share/terminfo\ --with-terminfo-dirs=/usr/share/terminfo:/lib/terminfo:/usr/local/share/terminfo\ --with-fallbacks="screen linux vt100 xterm xterm-256color" --host=$*\ CC="${ZIG} cc --target=$*"\ LD="${ZIG} cc --target=$*"\ AR="${ZIG} ar" RANLIB="${ZIG} ranlib"\ - CPPFLAGS=-D_GNU_SOURCE && make -j8 && make install.libs + CPPFLAGS=-D_GNU_SOURCE && make -j8 @# zig-build - cleaner approach but doesn't work, results in a dynamically linked binary. @#cd static-$* && PKG_CONFIG_LIBDIR="`pwd`/inst/pkg" zig build -Dtarget=$* @# --build-file ../build.zig --search-prefix inst/ --cache-dir zig -Drelease-fast=true @# Alternative approach, bypassing zig-build cd static-$* && ${ZIG} build-exe -target $*\ - -Iinst/include -Iinst/include/ncursesw -Izstd -lc inst/lib/libncursesw.a zstd/libzstd.a\ + -Inc/include -Izstd -lc nc/lib/libncursesw.a zstd/libzstd.a\ --cache-dir zig-cache -static -fstrip -O ReleaseFast ../src/main.zig - strip -R .eh_frame -R .eh_frame_hdr static-$*/main + @# My system's strip can't deal with arm binaries and zig doesn't wrap a strip alternative. + @# Whatever, just let it error for those. + strip -R .eh_frame -R .eh_frame_hdr static-$*/main || true cd static-$* && mv main ncdu && tar -czf ../static-$*.tar.gz ncdu rm -rf static-$* diff --git a/src/bin_export.zig b/src/bin_export.zig index 43a8cf0..e197344 100644 --- a/src/bin_export.zig +++ b/src/bin_export.zig @@ -106,7 +106,7 @@ pub const Thread = struct { var out = std.ArrayList(u8).init(main.allocator); if (t.block_num == std.math.maxInt(u32) or t.off == 0) return out; - out.ensureTotalCapacityPrecise(12 + c.ZSTD_COMPRESSBOUND(t.off)) catch unreachable; + out.ensureTotalCapacityPrecise(12 + @as(usize, @intCast(c.ZSTD_COMPRESSBOUND(@as(c_int, @intCast(t.off)))))) catch unreachable; out.items.len = out.capacity; const bodylen = compressZstd(t.buf[0..t.off], out.items[8..]); out.items.len = 12 + bodylen;