Skip to content

Commit

Permalink
Compile libhybris
Browse files Browse the repository at this point in the history
first steps towards fun
  • Loading branch information
Seshpenguin committed Jan 3, 2024
1 parent dde1d3a commit 475c190
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
39 changes: 39 additions & 0 deletions src/custom-packages/hybris-support.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import exec from "../helpers/exec"
import { BUILD_DIR, ROOTFS_DIR } from "../helpers/consts";
// libhybris is a compatibility layer for Android drivers
export function compileHybrisSupportPackages() {
console.log("Compiling hybris support packages...");
const libhyrbis_url = "https://github.com/droidian/libhybris.git";
const android_headers_url = "http://staging.repo.droidian.org/pool/main/a/android-headers-30/android-headers-30_9.0~1%2Bgit20211206200545.9b0c992.bookworm.tar.xz";
exec(`sudo arch-chroot ${ROOTFS_DIR} /bin/bash -x <<'EOF'
set -e
mkdir -pv /tmp/libhybris-build
cd /tmp/libhybris-build
git clone ${libhyrbis_url} .
wget ${android_headers_url} -O android-headers.tar.xz
tar -xvf android-headers.tar.xz
cd libhybris/hybris
./autogen.sh --enable-wayland \
--with-android-headers=/home/user/headers/src \
--enable-property-cache \
--enable-experimental \
--enable-glvnd \
--enable-clicd \
--enable-arch=arm64 \
--enable-mali-quirks \
--enable-adreno-quirks \
--prefix=/usr
make -j$(nproc)
make -j1 install
cd ..
cd ..
# clean up
rm -rf /tmp/libhybris-build
EOF`);
}
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import axios from 'axios';
import { v4 as uuidv4 } from 'uuid';
import { compileKexecTools } from './custom-packages/kexec-tools';
import { compileSDM845SupportPackages } from './custom-packages/sdm845-support';
import { compileHybrisSupportPackages } from './custom-packages/hybris-support';
import { buildMobileDev } from './os-variants/mobile/mobile-dev';
import { buildEmbedded } from './os-variants/embedded/embedded';
import { buildEmbeddedDev } from './os-variants/embedded/embedded-dev';
Expand Down Expand Up @@ -247,6 +248,7 @@ EOF`);
// kexec-tools (for initramfs)
compileKexecTools();
compileSDM845SupportPackages();
compileHybrisSupportPackages();

/* ------------- Target Devices ------------- */
const buildTargetDeviceSupport = (targetDevice: string) => {
Expand Down

0 comments on commit 475c190

Please sign in to comment.