Skip to content

Commit

Permalink
jinx: Upgrade to 0.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mintsuki committed Sep 23, 2024
1 parent a122bfd commit 5c628d3
Show file tree
Hide file tree
Showing 146 changed files with 536 additions and 284 deletions.
40 changes: 4 additions & 36 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,16 @@ all:
$(MAKE) vinix.iso

vinix.iso: jinx
rm -f builds/kernel.built builds/kernel.packaged
$(MAKE) distro-base
./build-support/makeiso.sh

.PHONY: debug
debug:
JINX_CONFIG_FILE=jinx-config-debug $(MAKE) all

jinx:
curl -Lo jinx https://github.com/mintsuki/jinx/raw/35af34f2d105bf27478112706de08bd98c316be7/jinx
curl -Lo jinx https://github.com/mintsuki/jinx/raw/31bafe0d84332bf20388420f3c16879e63314cfe/jinx
chmod +x jinx

.PHONY: distro-full
distro-full: jinx
./jinx build-all

.PHONY: distro-base
distro-base: jinx
./jinx build base-files kernel init bash binutils bzip2 coreutils diffutils findutils gawk gcc gmp grep gzip less make mpc mpfr nano ncurses pcre2 readline sed tar tzdata util-vinix xz zlib zstd

.PHONY: run-kvm
run-kvm: vinix.iso
qemu-system-x86_64 -enable-kvm -cpu host $(QEMUFLAGS)
Expand Down Expand Up @@ -67,33 +57,11 @@ run-lingemu: vinix.iso
run: vinix.iso
qemu-system-x86_64 $(QEMUFLAGS)

.PHONY: kernel-clean
kernel-clean:
make -C kernel clean
rm -rf builds/kernel* pkgs/kernel*

.PHONY: util-vinix-clean
util-vinix-clean:
make -C util-vinix clean
rm -rf builds/util-vinix* pkgs/util-vinix*

.PHONY: init-clean
init-clean:
rm -rf init/init
rm -rf builds/init* pkgs/init*

.PHONY: base-files-clean
base-files-clean:
rm -rf builds/base-files* pkgs/base-files*

.PHONY: clean
clean: kernel-clean util-vinix-clean init-clean base-files-clean
clean:
rm -rf iso_root sysroot vinix.iso initramfs.tar

.PHONY: distclean
distclean: jinx
distclean: clean
make -C kernel distclean
./jinx clean
rm -rf iso_root sysroot vinix.iso initramfs.tar jinx ovmf
chmod -R 777 .jinx-cache
rm -rf .jinx-cache
rm -rf .jinx-cache jinx builds host-builds host-pkgs pkgs sources ovmf
12 changes: 10 additions & 2 deletions build-support/makeiso.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,18 @@

set -ex

if [ -z "$PKGS_TO_INSTALL" ]; then
PKGS_TO_INSTALL=base
fi

# Build the sysroot with jinx and build limine.
rm -rf sysroot
./jinx sysroot
./jinx host-build limine
set -f
./jinx install "sysroot" $PKGS_TO_INSTALL
set +f
if ! [ -d host-pkgs/limine ]; then
./jinx host-build limine
fi

# Make an initramfs with the sysroot.
( cd sysroot && tar cf ../initramfs.tar * )
Expand Down
4 changes: 3 additions & 1 deletion host-recipes/autoconf
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ name=autoconf
from_source=autoconf
revision=1

build() {
configure() {
CFLAGS="$HOST_CFLAGS" \
CXXFLAGS="$HOST_CXXFLAGS" \
LDFLAGS="$HOST_LDFLAGS" \
"${source_dir}"/configure --prefix="${prefix}"
}

build() {
make -j${parallelism}
}

Expand Down
4 changes: 3 additions & 1 deletion host-recipes/autoconf-2.69
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ name=autoconf-2.69
from_source=autoconf-2.69
revision=1

build() {
configure() {
CFLAGS="$HOST_CFLAGS" \
CXXFLAGS="$HOST_CXXFLAGS" \
LDFLAGS="$HOST_LDFLAGS" \
"${source_dir}"/configure --prefix="${prefix}"
}

build() {
make -j${parallelism}
}

Expand Down
4 changes: 3 additions & 1 deletion host-recipes/automake
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ revision=1
hostdeps="autoconf"
imagedeps="build-essential"

build() {
configure() {
CFLAGS="$HOST_CFLAGS" \
CXXFLAGS="$HOST_CXXFLAGS" \
LDFLAGS="$HOST_LDFLAGS" \
"${source_dir}"/configure --prefix="${prefix}"
}

build() {
make -j${parallelism}
}

Expand Down
4 changes: 3 additions & 1 deletion host-recipes/binutils
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ revision=1
imagedeps="build-essential"
hostdeps="autoconf-2.69 automake libtool pkg-config"

build() {
configure() {
CFLAGS="$HOST_CFLAGS" \
CXXFLAGS="$HOST_CXXFLAGS" \
LDFLAGS="$HOST_LDFLAGS" \
Expand All @@ -25,7 +25,9 @@ build() {
--disable-nls \
--disable-werror \
--with-pic
}

build() {
make -j${parallelism}
}

Expand Down
5 changes: 4 additions & 1 deletion host-recipes/gcc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ hostdeps="autoconf-2.69 automake libtool pkg-config"
hostrundeps="binutils"
deps="mlibc-headers"

build() {
configure() {
cp -rp "${source_dir}"/. ./
mkdir -p build && cd build

Expand All @@ -29,7 +29,10 @@ build() {
--enable-initfini-array \
--enable-shared \
--enable-host-shared
}

build() {
cd build
make -j${parallelism} all-gcc
}

Expand Down
4 changes: 3 additions & 1 deletion host-recipes/libtool
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,17 @@ revision=1
hostdeps="autoconf automake"
imagedeps="help2man build-essential"

build() {
configure() {
cp -rp "${source_dir}"/. ./

CFLAGS="$HOST_CFLAGS" \
CXXFLAGS="$HOST_CXXFLAGS" \
LDFLAGS="$HOST_LDFLAGS" \
./configure \
--prefix="${prefix}"
}

build() {
make -j${parallelism}
}

Expand Down
4 changes: 3 additions & 1 deletion host-recipes/limine
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ revision=1
hostdeps="gcc autoconf automake libtool pkg-config"
imagedeps="nasm build-essential mtools"

build() {
configure() {
if [ "$ARCHITECTURE" = "x86_64" ]; then
X86_FLAGS="--enable-bios \
--enable-bios-cd \
Expand All @@ -22,7 +22,9 @@ build() {
$X86_FLAGS \
--enable-uefi-$ARCHITECTURE \
--enable-uefi-cd
}

build() {
LDFLAGS="$LDFLAGS -static" \
make -j${parallelism}
}
Expand Down
4 changes: 3 additions & 1 deletion host-recipes/pkg-config
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ revision=1
imagedeps="build-essential"
hostdeps="automake autoconf libtool"

build() {
configure() {
CFLAGS="$HOST_CFLAGS" \
CXXFLAGS="$HOST_CXXFLAGS" \
LDFLAGS="$HOST_LDFLAGS" \
"${source_dir}"/configure \
--prefix="${prefix}"
}

build() {
make -j${parallelism}
}

Expand Down
2 changes: 1 addition & 1 deletion jinx-config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
JINX_MAJOR_VER=0.3
JINX_MAJOR_VER=0.4

HOST_CFLAGS="-O2 -pipe -fstack-clash-protection"
HOST_CXXFLAGS="${HOST_CFLAGS} -Wp,-D_GLIBCXX_ASSERTIONS"
Expand Down
6 changes: 4 additions & 2 deletions recipes/ace-of-penguins
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,18 @@ imagedeps="build-essential libpng-dev"
hostdeps="gcc autoconf automake pkg-config libtool"
deps="core-libs libx11 libxpm libpng zlib"

regenerate() {
prepare() {
autotools_recursive_regen
}

build() {
configure() {
autotools_configure \
BUILD_CFLAGS="$HOST_CFLAGS" \
BUILD_CPPFLAGS="$HOST_CPPFLAGS" \
BUILD_LDFLAGS="$HOST_LDFLAGS"
}

build() {
make -j${parallelism}
}

Expand Down
4 changes: 3 additions & 1 deletion recipes/at-spi2-core
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ imagedeps="meson ninja-build libglib2.0-dev"
hostdeps="gcc pkg-config"
deps="core-libs bash dbus glib gsettings-desktop-schemas libx11 libxi libxkbcommon libxml libxtst"

build() {
configure() {
meson_configure \
-Dsystemd_user_dir=/tmp \
-Dintrospection=disabled
}

build() {
ninja -j${parallelism}
}

Expand Down
3 changes: 3 additions & 0 deletions recipes/base
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name=base
revision=1
deps="base-files kernel init bash binutils bzip2 coreutils diffutils findutils gawk gcc gmp grep gzip less make mpc mpfr nano ncurses pcre2 readline sed tar tzdata util-vinix xz zlib zstd"
6 changes: 4 additions & 2 deletions recipes/bash
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ imagedeps="build-essential"
hostdeps="gcc autoconf automake libtool pkg-config"
deps="core-libs ncurses readline"

regenerate() {
prepare() {
curl -Lo bash52-022 https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-022
curl -Lo bash52-023 https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-023
curl -Lo bash52-024 https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-024
Expand All @@ -25,7 +25,7 @@ regenerate() {
autotools_recursive_regen
}

build() {
configure() {
autotools_configure \
CFLAGS="$TARGET_CFLAGS \
-DDEFAULT_PATH_VALUE='\"/usr/local/sbin:/usr/local/bin:/usr/bin\"' \
Expand All @@ -38,7 +38,9 @@ build() {
--enable-readline \
--without-bash-malloc \
--with-installed-readline="${sysroot}/usr/lib"
}

build() {
make -j${parallelism}
}

Expand Down
6 changes: 4 additions & 2 deletions recipes/binutils
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ imagedeps="build-essential"
hostdeps="gcc autoconf-2.69 automake libtool pkg-config"
deps="core-libs zlib zstd"

regenerate() {
prepare() {
autotools_recursive_regen -I"$(realpath ./config)"

cp -pv /usr/local/share/libtool/build-aux/{config.sub,config.guess,install-sh} libiberty/
}

build() {
configure() {
autotools_configure \
--target=${OS_TRIPLET} \
--with-build-sysroot=${sysroot_dir} \
Expand All @@ -32,7 +32,9 @@ build() {
--disable-werror \
--with-pic \
--with-system-zlib
}

build() {
make -j${parallelism}
}

Expand Down
2 changes: 1 addition & 1 deletion recipes/bzip2
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ hostdeps="gcc pkg-config"
deps="core-libs"

build() {
cp -r ${source_dir}/. .
cp -rp ${source_dir}/. .

make -f Makefile-libbz2_so CC="${OS_TRIPLET}-gcc $TARGET_CFLAGS $TARGET_CPPFLAGS $TARGET_LDFLAGS"
make bzip2 bzip2recover CC="${OS_TRIPLET}-gcc $TARGET_CFLAGS $TARGET_CPPFLAGS $TARGET_LDFLAGS" AR="${OS_TRIPLET}-ar"
Expand Down
4 changes: 3 additions & 1 deletion recipes/cairo
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ imagedeps="meson ninja-build binutils"
hostdeps="gcc pkg-config"
deps="core-libs fontconfig freetype2 glib libpng libx11 libxcb libxext libxrender pixman zlib"

build() {
configure() {
meson_configure \
-Dxlib-xcb=enabled \
-Dzlib=enabled \
-Dtee=enabled \
-Dtests=disabled
}

build() {
ninja -j${parallelism}
}

Expand Down
6 changes: 4 additions & 2 deletions recipes/cglm
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ source_hostdeps="automake autoconf libtool pkg-config"
hostdeps="gcc autoconf automake libtool pkg-config"
deps="core-libs"

regenerate() {
prepare() {
autotools_recursive_regen
}

build() {
configure() {
autotools_configure
}

build() {
make -j${parallelism}
}

Expand Down
6 changes: 4 additions & 2 deletions recipes/coreutils
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,19 @@ source_hostdeps="automake autoconf libtool pkg-config"
hostdeps="gcc automake autoconf libtool pkg-config"
deps="core-libs tzdata"

regenerate() {
prepare() {
autotools_recursive_regen
}

build() {
configure() {
cp -rp "${source_dir}"/. ./

configure_script_path=./configure \
autotools_configure \
CFLAGS="$TARGET_CFLAGS -DSLOW_BUT_NO_HACKS"
}

build() {
make -j${parallelism}
}

Expand Down
Loading

0 comments on commit 5c628d3

Please sign in to comment.