forked from FemboyOS/fempkg_recipes
53 lines
2.3 KiB
Python
53 lines
2.3 KiB
Python
pkgname = "sqlite"
|
|
pkgver = "3510000"
|
|
source = f"https://sqlite.org/2025/sqlite-autoconf-{pkgver}.tar.gz"
|
|
builddir = f"/tmp/fempkg/build/{pkgname}/{pkgname}-autoconf-{pkgver}"
|
|
fembuilddir = f"/tmp/fempkg/build/{pkgname}"
|
|
outputdir = "/home/gabry/lfs-repo/binpkg"
|
|
manifestdir = "/home/gabry/lfs-repo/manifests"
|
|
destdir = f"{fembuilddir}/DESTDIR"
|
|
deps = ["cmake", "utfcpp"]
|
|
|
|
deps = []
|
|
|
|
build = [
|
|
# Extract
|
|
f"mkdir -p {fembuilddir} && cd {fembuilddir} && tar -xvf /var/lib/fempkg/pkgs/{pkgname}-autoconf-{pkgver}.tar.gz && "
|
|
f"wget https://anduin.linuxfromscratch.org/LFS/sqlite-doc-{pkgver}.tar.xz",
|
|
|
|
# 64-bit build
|
|
f"cd {builddir} && tar -xf ../sqlite-doc-{pkgver}.tar.xz",
|
|
f"cd {builddir} && ./configure --prefix=/usr --disable-static --enable-fts{{4,5}} CPPFLAGS=\"-D SQLITE_ENABLE_COLUMN_METADATA=1 -D "
|
|
f"SQLITE_ENABLE_UNLOCK_NOTIFY=1 -D SQLITE_ENABLE_DBSTAT_VTAB=1 -D SQLITE_SECURE_DELETE=1\"",
|
|
|
|
f"cd {builddir} && make -j$(nproc)",
|
|
f"cd {builddir} && make DESTDIR={destdir} install",
|
|
|
|
# 32-bit build
|
|
f"cd {builddir} && make distclean",
|
|
f"cd {builddir} && CC=\"gcc -m32\" CXX=\"g++ -m32\" ./configure --prefix=/usr --libdir=/usr/lib32 --host=i686-pc-linux-gnu --disable-static --enable-fts{{4,5}} CPPFLAGS=\"-D SQLITE_ENABLE_COLUMN_METADATA=1 -D SQLITE_ENABLE_UNLOCK_NOTIFY=1 -D SQLITE_ENABLE_DBSTAT_VTAB=1 -D SQLITE_SECURE_DELETE=1\"",
|
|
f"cd {builddir} && make -j$(nproc)",
|
|
f"cd {builddir} && make DESTDIR={destdir} install",
|
|
|
|
f"install -v -d -m755 {destdir}/usr/share/licenses/{pkgname}/",
|
|
f"""cat > {destdir}/usr/share/licenses/{pkgname}/PUBLIC-DOMAIN << 'EOF'
|
|
SQLite is in the public domain.
|
|
|
|
For details, see:
|
|
https://sqlite.org/copyright.html
|
|
|
|
The SQLite authors have dedicated the SQLite source code to the public domain.
|
|
Anyone is free to copy, modify, publish, use, compile, sell, or distribute the
|
|
original SQLite code, either in source code form or as a compiled binary, for
|
|
any purpose, commercial or non-commercial, and by any means.
|
|
EOF
|
|
""",
|
|
|
|
# Make tarball + manifests
|
|
f"mkdir -p {outputdir} && cd {destdir} && tar --transform 's|^\\.||' -I zstd -cf {outputdir}/{pkgname}-{pkgver}.tar.zst .",
|
|
f"mkdir -p {manifestdir} && tar -tf {outputdir}/{pkgname}-{pkgver}.tar.zst | grep -v '/$' > {manifestdir}/{pkgname}.txt",
|
|
|
|
# Cleanup
|
|
f"rm -rf {fembuilddir}"
|
|
]
|