Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
4c38ade
Started work on adding static dwarfs
CalebQ42 May 3, 2025
c13abcc
More tweaks to dwarfs compilation (still not working)
CalebQ42 May 3, 2025
9d11fd0
Dwarfs compilation is now working
CalebQ42 May 21, 2025
92ecc8a
Fixed glog build
CalebQ42 May 21, 2025
8647c9e
Attempt build on platforms without avx2 support
CalebQ42 May 21, 2025
7ba5fe8
Fixed avx2 check
CalebQ42 May 21, 2025
26534e4
Try again?
CalebQ42 May 21, 2025
4c8c754
Disable folly memcpy for compatibility.
CalebQ42 May 21, 2025
00cf32e
Remove FOLLY_MEMCPY from build.ninja
CalebQ42 May 21, 2025
0c04722
Let's try some stuff
CalebQ42 May 21, 2025
e8ffabb
Trigger re-build
CalebQ42 May 21, 2025
4c687e3
Let's try some more things
CalebQ42 May 21, 2025
56204a7
Force i686 on cmake command
CalebQ42 May 21, 2025
e19d01a
git.savannah.gnu.org links keep failing
CalebQ42 May 21, 2025
0569ee7
Added diff to remove avx2 instructions
CalebQ42 May 21, 2025
5e8129b
Always use dwarfs patch
CalebQ42 May 21, 2025
ec9527a
Fixed wrong patch location
CalebQ42 May 21, 2025
bc41a49
Tweak when dwarfs patch is used
CalebQ42 May 21, 2025
33cb5c6
Add retries to wget git.savannah.gnu.org files
CalebQ42 May 21, 2025
29d9ed0
Tweak wget
CalebQ42 May 21, 2025
bafaa97
Well that's a fail
CalebQ42 May 21, 2025
64b90ed
(Hopefully) corrected bash if statement for dwarfs patch
CalebQ42 May 21, 2025
23963a9
Tweak patch... again
CalebQ42 May 21, 2025
0529dd8
Return to ninja
CalebQ42 May 21, 2025
41fedfa
Forgot cmake ninja argument
CalebQ42 May 21, 2025
59770d3
Add a copy of config.guess and config.sub due to 502 error
CalebQ42 May 21, 2025
46ed6d2
Try using llvm-libunwind
CalebQ42 May 21, 2025
9745770
file & strip compiled dwarfs binary
CalebQ42 May 21, 2025
48910f3
Add building libunwind
CalebQ42 May 21, 2025
44659ee
Fixed libunwind compilation
CalebQ42 May 21, 2025
04b9ab4
Return to root after building libunwind
CalebQ42 May 21, 2025
21cc314
Add static flags to libunwind
CalebQ42 May 21, 2025
cd502e2
Do we need libunwind?
CalebQ42 May 21, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 55 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,9 @@ wget -c https://gitlab.freedesktop.org/xdg/desktop-file-utils/-/archive/56d220dd
tar xf desktop-file-utils-*.tar.gz
cd desktop-file-utils-*/
# The next 2 lines are a workaround for: checking build system type... ./config.guess: unable to guess system type
wget 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD' -O config.guess
wget 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD' -O config.sub
# These files were downloaded from https://git.savannah.gnu.org/gitweb/?p=config.git.
# https://git.savannah.gnu.org often gets overloaded and returns a 502 error, so we use a local copy.
cp /patches/desktop-file-utils/config.* ./
autoreconf --install # https://github.com/shendurelab/LACHESIS/issues/31#issuecomment-283963819
./configure CFLAGS=-no-pie LDFLAGS=-static
make -j$(nproc)
Expand Down Expand Up @@ -142,6 +143,57 @@ gcc -static -o bsdtar tar/bsdtar-bsdtar.o tar/bsdtar-cmdline.o tar/bsdtar-creati
strip bsdtar
cd -

# Build static dwarfs
# We first need newer packages
echo "http://dl-cdn.alpinelinux.org/alpine/v3.20/main
http://dl-cdn.alpinelinux.org/alpine/v3.20/community" >> /etc/apk/repositories
apk update && apk upgrade
apk add cmake \
xz-static \
lz4-dev lz4-static \
acl-dev acl-static \
libevent-dev libevent-static \
zstd-dev zstd-static \
nlohmann-json \
date-dev \
utfcpp \
openssl-dev openssl-libs-static \
libarchive-dev libarchive-static \
bzip2-static \
expat-static \
upx \
boost1.77-dev boost1.77-chrono boost1.77-context boost1.77-filesystem boost-iostreams boost1.77-program_options boost1.77-regex boost1.77-system boost1.77-thread boost1.77-static
# We also need to build a static version of double-conversion
git clone --depth=1 --branch v3.3.1 https://github.com/google/double-conversion
cd double-conversion
cmake . && make && make install
cd /
# And glog
git clone --depth=1 --branch v0.7.1 https://github.com/google/glog
cd glog
cmake -S . -DBUILD_SHARED_LIBS=OFF
make && make install
cd /
# And xxhash
git clone --depth=1 --branch=v0.8.3 https://github.com/Cyan4973/xxHash
cd xxHash
make && make install
cd /
# Actually build dwarfs
wget https://github.com/mhx/dwarfs/releases/download/v0.12.4/dwarfs-0.12.4.tar.xz
tar xf dwarfs-*.tar.xz
cd dwarfs-*/
# Patch out avx2 requirement
patch -i /patches/dwarfs/libdwarfs_tool.diff ./cmake/libdwarfs_tool.cmake
mkdir build
cd build
cmake .. -GNinja -DSTATIC_BUILD_DO_NOT_USE=ON -DWITH_UNIVERSAL_BINARY=ON
ninja
file universal/dwarfs-universal
strip universal/dwarfs-universal
cd /


mkdir -p out
cp src/runtime/runtime-fuse3 out/runtime-fuse3-$ARCHITECTURE
cp patchelf-*/patchelf out/patchelf-$ARCHITECTURE
Expand All @@ -153,3 +205,4 @@ cp desktop-file-utils-*/src/desktop-file-install out/desktop-file-install-$ARCHI
cp desktop-file-utils-*/src/desktop-file-validate out/desktop-file-validate-$ARCHITECTURE
cp desktop-file-utils-*/src/update-desktop-database out/update-desktop-database-$ARCHITECTURE
cp appstream-*/prefix/bin/appstreamcli out/appstreamcli-$ARCHITECTURE
cp dwarfs-*/build/universal/dwarfs-universal out/dwarfs-$ARCHITECTURE
1 change: 1 addition & 0 deletions chroot_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,6 @@ sudo find miniroot/ -type f -executable -name 'bsdtar' -exec cp {} out/bsdtar-$A
sudo find miniroot/ -type f -executable -name 'desktop-file-install' -exec cp {} out/desktop-file-install-$ARCHITECTURE \;
sudo find miniroot/ -type f -executable -name 'desktop-file-validate' -exec cp {} out/desktop-file-validate-$ARCHITECTURE \;
sudo find miniroot/ -type f -executable -name 'update-desktop-database' -exec cp {} out/update-desktop-database-$ARCHITECTURE \;
sudo find miniroot/ -type f -executable -name 'dwarfs-universal' -exec cp {} out/dwarfs-$ARCHITECTURE \;
sudo cp miniroot/appstream-0.12.9/prefix/bin/appstreamcli out/appstreamcli-$ARCHITECTURE
sudo rm -rf miniroot/
Loading