Skip to content
This repository has been archived by the owner on Feb 27, 2021. It is now read-only.

Commit

Permalink
Added linux
Browse files Browse the repository at this point in the history
  • Loading branch information
Ella-0 committed Jan 13, 2021
1 parent 3182a6f commit 81f080d
Show file tree
Hide file tree
Showing 9 changed files with 4,921 additions and 13 deletions.
14 changes: 10 additions & 4 deletions lazypkg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,17 @@ export CXX=clang++
. ./build.sh
dir=$(pwd)
stat out > /dev/null && rm -rf out
mkdir -p src
cd src
srcdir=$(pwd)
mkdir out

function do_fetch() {
mkdir -p src
cd src
srcdir=$(pwd) fetch
}

stat src > /dev/null 2>/dev/null || do_fetch
srcdir=$(pwd)/src

fetch
cd $srcdir

build
Expand Down
16 changes: 8 additions & 8 deletions pkgs/doas/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,23 @@ fetch() {

build() {
cd $pkgname-$pkgver
./configure --prefix=/
./configure --prefix=/usr
gmake
}

package() {
cd $pkgname-$pkgver
install -d $pkgdir/bin
install -Dm4755 doas $pkgdir/bin
install -d $pkgdir/usr/bin
install -Dm4755 doas $pkgdir/usr/bin
}

package_doc() {
cd $pkgname-$pkgver
install -d $pkgdir/share/man/
install -d $pkgdir/share/man/man1
install -d $pkgdir/share/man/man5
install -Dm644 doas.1 $pkgdir/share/man/man1
install -Dm644 doas.conf.5 $pkgdir/share/man/man5
install -d $pkgdir/usr/share/man/
install -d $pkgdir/usr/share/man/man1
install -d $pkgdir/usr/share/man/man5
install -Dm644 doas.1 $pkgdir/usr/share/man/man1
install -Dm644 doas.conf.5 $pkgdir/usr/share/man/man5
}

license() {
Expand Down
36 changes: 36 additions & 0 deletions pkgs/flex/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
pkgver=2.6.4
pkgname=flex
bad=""
ext="doc"

fetch() {
curl -L https://github.com/westes/flex/releases/download/v2.6.4/flex-2.6.4.tar.gz -o $pkgname-$pkgver.tar.gz
tar -xf $pkgname-$pkgver.tar.gz
}

build() {
cd $pkgname-$pkgver
./configure \
--prefix=/usr
make
}

package() {
cd $pkgname-$pkgver
make install DESTDIR=$pkgdir
ln -sr $pkgdir/usr/bin/flex $pkgdir/usr/bin/lex
rm -r $pkgdir/usr/share
rm -r $pkgdir/usr/lib/*.a
rm -r $pkgdir/usr/lib/*.la
}

package_doc() {
cd $pkgname-$pkgver
make install DESTDIR=$pkgdir
rm -r $pkgdir/usr/bin
}

license() {
cd $pkgname-$pkgver
cat LICENSE
}
33 changes: 33 additions & 0 deletions pkgs/linux/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
pkgver=5.10.7
pkgname=linux
pkgrel=1

fetch() {
curl "https://k1ss.org/wiki/kernel/patches/kernel-no-perl.patch" -o kernel-no-perl.patch
curl "https://cdn.kernel.org/pub/linux/kernel/v5.x/$pkgname-$pkgver.tar.xz" -o $pkgname-$pkgver.tar.xz
tar -xf $pkgname-$pkgver.tar.xz
cd $pkgname-$pkgver
patch -p1 < ../kernel-no-perl.patch
patch -p1 < ../../kernel-byacc.patch
cp ../../x86_64.config .config
}

build() {
cd $pkgname-$pkgver
#gmake CC=cc CXX=c++ HOSTCC=cc HOSTCXX=c++ YACC=yacc LLVM_IAS=1 defconfig
#gmake CC=cc CXX=c++ HOSTCC=cc HOSTCXX=c++ YACC=yacc LLVM_IAS=1 menuconfig
gmake CC=cc CXX=c++ HOSTCC=cc HOSTCXX=c++ YACC=yacc LLVM_IAS=1 oldconfig
gmake CC=cc CXX=c++ HOSTCC=cc HOSTCXX=c++ YACC=yacc LLVM_IAS=1
}

package() {
cd $pkgname-$pkgver
install -d $pkgdir/boot
gmake CC=cc CXX=c++ HOSTCC=cc HOSTCXX=c++ YACC=yacc LLVM_IAS=1 INSTALL_PATH=$pkgdir/boot install
gmake CC=cc CXX=c++ HOSTCC=cc HOSTCXX=c++ YACC=yacc LLVM_IAS=1 INSTALL_MOD_PATH=$pkgdir/ modules_install
}

license() {
cd $pkgname-$pkgver
cat COPYING
}
13 changes: 13 additions & 0 deletions pkgs/linux/kernel-byacc.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/scripts/Makefile.host b/scripts/Makefile.host
index 4c51c95d40f4..64e98e1d4825 100644
--- a/scripts/Makefile.host
+++ b/scripts/Makefile.host
@@ -11,7 +11,7 @@ $(obj)/%.lex.c: $(src)/%.l FORCE
# YACC
# ---------------------------------------------------------------------------
quiet_cmd_bison = YACC $(basename $@).[ch]
- cmd_bison = $(YACC) -o $(basename $@).c --defines=$(basename $@).h -t -l $<
+ cmd_bison = $(YACC) -b $(basename $(basename $@)) -d -t -l $<

$(obj)/%.tab.c $(obj)/%.tab.h: $(src)/%.y FORCE
$(call if_changed,bison)
Loading

0 comments on commit 81f080d

Please sign in to comment.