summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Hill <ahill@breadpudding.dev>2025-12-20 23:17:09 -0500
committerAlexander Hill <ahill@breadpudding.dev>2025-12-20 23:17:09 -0500
commitd640c01cb14377d8a95dec1a1c5c53d83f46c334 (patch)
tree74d84a603ba116fc8e5225f95ae6133d463660ff
parent7c52f81b903d61ba8749a679525e9d4be8884d81 (diff)
Added libelf
-rw-r--r--STATUS.md1
-rwxr-xr-xrootbuild.sh2
-rw-r--r--sources/libelf/libelf.spec31
3 files changed, 33 insertions, 1 deletions
diff --git a/STATUS.md b/STATUS.md
index e43b6e2..6b23ede 100644
--- a/STATUS.md
+++ b/STATUS.md
@@ -15,6 +15,7 @@ Definitions:
| `flex` | Yes | Yes |
| `groff` | Yes | Yes |
| `libarchive` | Yes | Yes |
+| `libelf` | Yes | Yes |
| `libressl` | Yes | Yes |
| `libtool` | Yes | Yes |
| `libyaml` | Yes | Yes |
diff --git a/rootbuild.sh b/rootbuild.sh
index 1fbc33b..ee8aa1c 100755
--- a/rootbuild.sh
+++ b/rootbuild.sh
@@ -36,7 +36,7 @@ echo "Done!"
# NOTE: groff requires Perl to build. ~ahill
# NOTE: nasm requires autoconf and automake to build. ~ahill
cd /maple
-PACKAGES="bzip2 busybox byacc libressl m4 make muon musl perl pkgconf xz zlib autoconf automake flex groff libarchive libtool nasm cmake mold"
+PACKAGES="bzip2 busybox byacc libelf libressl m4 make muon musl perl pkgconf xz zlib autoconf automake flex groff libarchive libtool nasm cmake mold"
for pkg in $PACKAGES; do
treetap fetch /maple/sources/$pkg/$pkg.spec
treetap build /maple/sources/$pkg/$pkg.spec
diff --git a/sources/libelf/libelf.spec b/sources/libelf/libelf.spec
new file mode 100644
index 0000000..876cc90
--- /dev/null
+++ b/sources/libelf/libelf.spec
@@ -0,0 +1,31 @@
+# Maintainer: Alexander Hill <ahill@breadpudding.dev>
+SRC_FILENAME="libelf-0.193.tar.gz"
+SRC_HASH="6253395679c2bb2156d926b3d8b7e3b2bbeb40a56d2bea29e1c73e40ed9de4ba"
+SRC_NAME="libelf"
+SRC_URL="https://github.com/arachsys/libelf/archive/refs/tags/v0.193.tar.gz"
+SRC_VERSION="0.193"
+
+build() {
+ tar xf ../$SRC_FILENAME
+ cd libelf-$SRC_VERSION/
+ # NOTE: This version of libelf was extracted from elfutils, which means a
+ # good chunk of the project is missing. We use this version instead of
+ # elfutils since the original relies on libargp. Since Maple Linux is
+ # a musl-based system and it lacks an implementation of libargp, I
+ # chose this version. As a result, the source we are compiling is
+ # pre-configured and lacks a proper configuration script. Since our
+ # current configuration relies on libzstd, we need to manually modify
+ # the configuration to remove it as a dependency. ~ahill
+ sed -i "s/-lzstd//" Makefile
+ sed -i "/#define USE_ZSTD/d" src/config.h
+ make -O -j $TT_PROCS
+}
+
+clean() {
+ rm -rf libelf-$SRC_VERSION/
+}
+
+package() {
+ cd libelf-$SRC_VERSION/
+ make -O -j $TT_PROCS install DESTDIR=$TT_INSTALLDIR INCDIR=/usr/include
+}