morpheus

suckless linux distro
git clone git://git.2f30.org/morpheus
Log | Files | Refs | Submodules | README | LICENSE

commit 82d58abc2c55911dd0abd0b974c3df3602da1c23
parent f56149fa6ff9dda53acf77d78607a0f8545848a3
Author: Daniel Bainton <dpb@driftaway.org>
Date:   Fri, 28 Feb 2014 21:19:02 +0000

Add fetching and unpacking magic

Diffstat:
Mmkfile | 18+++++++++++++++++-
Mpkgs/abduco | 7+++----
Mpkgs/busybox | 4++--
Mpkgs/crossmusl | 10+++++-----
Mpkgs/dvtm | 10++++------
Mpkgs/dwm | 8+++-----
Mpkgs/fs | 9++++-----
Mpkgs/jupp | 10++++------
Mpkgs/kernel | 11++++-------
Dpkgs/kernel-headers | 13-------------
Apkgs/kernel_headers | 11+++++++++++
Mpkgs/libevent | 10++++------
Mpkgs/make | 10++++------
Mpkgs/man | 8+++-----
Mpkgs/mksh | 10++++------
Mpkgs/mpg123 | 10++++------
Mpkgs/ncurses | 10++++------
Rpkgs/prepare-root -> pkgs/prepare_root | 0
Mpkgs/rsync | 10++++------
Mpkgs/sbase | 7+++----
Mpkgs/sdhcp | 8+++-----
Mpkgs/sic | 8+++-----
Mpkgs/sinit | 7+++----
Mpkgs/smdev | 7+++----
Mpkgs/syslinux | 7+++----
Mpkgs/terminus | 10++++------
Mpkgs/tinyalsa | 8+++-----
Mpkgs/tinyxlib | 8+++-----
Mpkgs/tinyxserver | 8+++-----
Mpkgs/tmux | 10++++------
Mpkgs/ubase | 7+++----
Mpkgs/uuterm | 8+++-----
Mpkgs/vim | 10++++------
Mpkgs/zlib | 10++++------
Astuff/cmp-fetch | 4++++
Astuff/fetch-pkg.mk | 26++++++++++++++++++++++++++
36 files changed, 163 insertions(+), 169 deletions(-)

diff --git a/mkfile b/mkfile @@ -12,13 +12,29 @@ all world:VQ: $pkgs clean:V: rm -f .state/* pkgs.mk +fetchpkgs = ${pkgs:%=%-fetch} + +fetch-all fetch-world:VQ: ${fetchpkgs} + # generate a pkgs.mk file with the tarkets for all packages in pkgs/ `{ mkdir -p src } `{ mkdir -p .state } `{ echo '# auto-generated file, do not edit' > pkgs.mk } -`{ cd pkgs && for pkg in *; do cat $pkg | sed -e "s,^build:,$pkg:QP./stuff/cmp-pkgs: pkgs/$pkg," >> ../pkgs.mk && echo -e '\tcd $top && cp pkgs/$target .state/$target\n' >> ../pkgs.mk; done } +`{ cd pkgs && for pkg in *; do cat $pkg ../stuff/fetch-pkg.mk |\ + sed -e "s,^build:,$pkg:QP./stuff/cmp-pkgs: $pkg-fetch pkgs/$pkg," |\ + sed -e "s,^fetch-target:,$pkg-fetch:," |\ + sed -e "s,^v=,${pkg}_v=," |\ + sed -e "s,\$v,\${${pkg}_v}," |\ + sed -e "s,\$url,\${${pkg}_url}," |\ + sed -e "s, url=, ${pkg}_url=," |\ + sed -e "s,\$git,\${${pkg}_git}," |\ + sed -e "s,^git=,${pkg}_git=," |\ + sed -e "s,^url=,${pkg}_url=," >> ../pkgs.mk; done } <pkgs.mk +test:VQ: + echo test + bootable:V: stuff/create-bootable "$root" morpheus-$arch-$version.img diff --git a/pkgs/abduco b/pkgs/abduco @@ -1,8 +1,7 @@ +git="git://repo.or.cz/abduco.git" + build: crossmusl - url="git://repo.or.cz/abduco.git" - cd src - [ -d abduco ] || git clone $url - cd abduco + cd src/abduco make clean sed -i "s@PREFIX = /usr/local@PREFIX = /@" config.mk sed -i "s@INCS = -I. -I/usr/include -I/usr/local/include@INCS = -I. -I$libcroot/include@" config.mk diff --git a/pkgs/busybox b/pkgs/busybox @@ -1,7 +1,7 @@ +url="$mirror/busybox" + build: crossmusl - url="$mirror/busybox" cd src - wget -c ${url} chmod +x busybox cp busybox "${root}/bin" cd "${root}/bin" diff --git a/pkgs/crossmusl b/pkgs/crossmusl @@ -1,10 +1,10 @@ -build: prepare-root - v="0.9.15" - url="$mirror/crossx86-$arch-linux-musl-$v.tar.xz" +v="0.9.15" +url="$mirror/crossx86-$arch-linux-musl-$v.tar.xz" + +build: prepare_root targets="ar as c++ g++ gcc ld ld.bfd nm objcopy objdump ranlib strip" cd src - wget -c $url - tar xJf crossx86-$arch-linux-musl-$v.tar.xz -C "$root/opt/cross" + cp -r $arch-linux-musl "$root/opt/cross/" if test "$arch" = "x86_64"; then mv "$root/opt/cross/$arch-linux-musl/$arch-linux-musl/lib64"/* "$root/opt/cross/$arch-linux-musl/$arch-linux-musl/lib" fi diff --git a/pkgs/dvtm b/pkgs/dvtm @@ -1,10 +1,8 @@ +v="0.10" +url="http://www.brain-dump.org/projects/dvtm/dvtm-$v.tar.gz" + build: ncurses - v="0.10" - url="http://www.brain-dump.org/projects/dvtm/dvtm-$v.tar.gz" - cd src - wget -c $url - [ -d dvtm-$v ] || tar -xzf dvtm-$v.tar.gz - cd dvtm-$v + cd src/dvtm-$v make clean sed -i "s@PREFIX = /usr/local@PREFIX = /@" config.mk sed -i "s@INCS = -I. -I/usr/include -I/usr/local/include@INCS = -I. -I$libcroot/include -I$libcroot/include/ncursesw@" config.mk diff --git a/pkgs/dwm b/pkgs/dwm @@ -1,9 +1,7 @@ +url="$mirror/dwm-git.tar.gz" + build: tinyxlib - url="$mirror/dwm-git.tar.gz" - cd src - wget -c $url - [ -d dwm ] || tar xzf dwm-git.tar.gz - cd dwm + cd src/dwm make clean sed -i 's@PREFIX = /usr/local@PREFIX = @' config.mk sed -i "s@X11INC = /usr/X11R6/include@X11INC = $libcroot/include @" config.mk diff --git a/pkgs/fs b/pkgs/fs @@ -1,6 +1,5 @@ -build: prepare-root - url="git://git.2f30.org/fs" - cd src - [ -d fs ] || git clone ${url} - cd fs +git="git://git.2f30.org/fs" + +build: prepare_root + cd src/fs cp -r * "${root}/" diff --git a/pkgs/jupp b/pkgs/jupp @@ -1,10 +1,8 @@ +v="3.1jupp26" +url="$mirror/joe-$v.tgz" + build: crossmusl - v="3.1jupp26" - url="$mirror/joe-$v.tgz" - cd src - wget -c $url - [ -d jupp ] || tar xzf joe-$v.tgz - cd jupp + cd src/jupp CC=$CC sh configure --prefix="/" || return 1 make || return 1 cp joe termidx "$root/bin" diff --git a/pkgs/kernel b/pkgs/kernel @@ -1,10 +1,7 @@ -build: crossmusl - v="3.10.32" - url="$mirror/kernel.tar.gz" - cd src - wget -c $url - [ -d linux-$v ] || tar xzf kernel.tar.gz - cd linux-$v +v="3.10.32" + +build: crossmusl kernel_headers + cd src/linux-$v cp $top/stuff/kernel-config .config #make menuconfig make oldconfig diff --git a/pkgs/kernel-headers b/pkgs/kernel-headers @@ -1,13 +0,0 @@ -build: - v="3.10.32" - url="$mirror/kernel.tar.gz" - cd src - wget -c $url - [ -d linux-$v ] || tar xzf kernel.tar.gz - cd linux-$v - if test "$arch" = x86_64; then - A=$arch - else - A=x86 - fi - make ARCH="$A" INSTALL_HDR_PATH="$root" headers_install diff --git a/pkgs/kernel_headers b/pkgs/kernel_headers @@ -0,0 +1,11 @@ +v="3.10.32" +url="$mirror/kernel.tar.gz" + +build: + cd src/linux-$v + if test "$arch" = x86_64; then + A=$arch + else + A=x86 + fi + make ARCH="$A" INSTALL_HDR_PATH="$root" headers_install diff --git a/pkgs/libevent b/pkgs/libevent @@ -1,10 +1,8 @@ +v="2.0.21" +url="$mirror/libevent-$v-stable.tar.gz" + build: crossmusl - v="2.0.21" - url="$mirror/libevent-$v-stable.tar.gz" - cd src - wget -c $url - [ -d libevent-$v-stable ] || tar xzf libevent-$v-stable.tar.gz - cd libevent-$v-stable + cd src/libevent-$v-stable CC="$CC -static" ./configure --prefix="$libcroot" --disable-shared --enable-static || return 1 make -j$nprocs || return 1 make install || return 1 diff --git a/pkgs/make b/pkgs/make @@ -1,10 +1,8 @@ +v="3.82" +url="$mirror/make-$v.tar.bz2" + build: crossmusl - v="3.82" - url="$mirror/make-$v.tar.bz2" - cd src - wget -c $url - [ -d make-$v ] || tar xjf make-$v.tar.bz2 - cd make-$v + cd src/make-$v CC="$CC -static" ./configure --prefix="$root" --disable-nls || return 1 make -j$nprocs || return 1 make install || return 1 diff --git a/pkgs/man b/pkgs/man @@ -1,8 +1,6 @@ +url="$mirror/man.tar.gz" + build: crossmusl - url="$mirror/man.tar.gz" - cd src - wget -c $url - [ -d man ] || tar xzf man.tar.gz - cd man + cd src/man $CC -std=gnu99 -o man man.c -static || return 1 cp man "$root/bin" diff --git a/pkgs/mksh b/pkgs/mksh @@ -1,10 +1,8 @@ +v="R47" +url="$mirror/mksh-$v.tar.gz" + build: crossmusl - v="R47" - url="$mirror/mksh-$v.tar.gz" - cd src - wget -c $url - [ -d mksh ] || tar xzf mksh-$v.tar.gz - cd mksh + cd src/mksh CC=$CC sh Build.sh || return 1 mkdir -p "$root/share/man/man1" "$root/share/man/cat1" cp mksh "$root/bin" diff --git a/pkgs/mpg123 b/pkgs/mpg123 @@ -1,10 +1,8 @@ +v="1.18.0" +url="$mirror/mpg123-$v.tar.bz2" + build: tinyalsa - v="1.18.0" - url="$mirror/mpg123-$v.tar.bz2" - cd src - wget -c $url - [ -d mpg123-$v ] || tar xjf mpg123-$v.tar.bz2 - cd mpg123-$v + cd src/mpg123-$v CC=$CC ./configure --prefix="$root" --with-default-audio=tinyalsa \ --enable-static=yes --enable-shared=no || return 1 make || return 1 diff --git a/pkgs/ncurses b/pkgs/ncurses @@ -1,10 +1,8 @@ +v="5.9" +url="$mirror/ncurses.tar.gz" + build: crossmusl - v="5.9" - url="$mirror/ncurses.tar.gz" - cd src - wget -c $url - [ -d ncurses-$v ] || tar xzf ncurses.tar.gz - cd ncurses-$v + cd src/ncurses-$v cp $top/stuff/ncurses-fallback.c ncurses/fallback.c CC="$CC -static" ./configure --prefix="${libcroot}" --mandir="$root/share" --without-tests \ --with-normal --enable-sigwinch --disable-nls --without-dlsym \ diff --git a/pkgs/prepare-root b/pkgs/prepare_root diff --git a/pkgs/rsync b/pkgs/rsync @@ -1,10 +1,8 @@ +v="3.0.9" +url="$mirror/rsync-$v.tar.gz" + build: crossmusl - v="3.0.9" - url="$mirror/rsync-$v.tar.gz" - cd src - wget -c $url - [ -d rsync-$v ] || tar xzf rsync-$v.tar.gz - cd rsync-$v + cd src/rsync-$v CC=$CC ./configure --prefix="$root" || return 1 make -j$nprocs || return 1 make install || return 1 diff --git a/pkgs/sbase b/pkgs/sbase @@ -1,8 +1,7 @@ +git="git://git.2f30.org/sbase" + build: crossmusl - url="git://git.2f30.org/sbase" - cd src - [ -d sbase ] || git clone $url - cd sbase + cd src/sbase make clean make -j$nprocs CC=$CC LDFLAGS="$LDFLAGS" || return 1 make PREFIX="$root" install diff --git a/pkgs/sdhcp b/pkgs/sdhcp @@ -1,9 +1,7 @@ +url="$mirror/sdhcp.tar.gz" + build: crossmusl - url="$mirror/sdhcp.tar.gz" - cd src - wget -c $url - [ -d sdhcp ] || tar xzf sdhcp.tar.gz - cd sdhcp + cd src/sdhcp make clean make CC=$CC || return 1 cp sdhcp "$root/bin" || return 1 diff --git a/pkgs/sic b/pkgs/sic @@ -1,9 +1,7 @@ +url="$mirror/sic.tar.gz" + build: crossmusl - url="$mirror/sic.tar.gz" - cd src - wget -c $url - [ -d sic ] || tar xzf sic.tar.gz - cd sic + cd src/sic make clean make CC=$CC LDFLAGS="$LDFLAGS" || return 1 cp sic "$root/bin" diff --git a/pkgs/sinit b/pkgs/sinit @@ -1,8 +1,7 @@ +git="git://git.2f30.org/sinit" + build: crossmusl - url="git://git.2f30.org/sinit" - cd src - [ -d sinit ] || git clone $url - cd sinit + cd src/sinit make clean make -j$nprocs CC=$CC LDFLAGS="$LDFLAGS" || return 1 make PREFIX="$root" install diff --git a/pkgs/smdev b/pkgs/smdev @@ -1,8 +1,7 @@ +git="git://git.2f30.org/smdev" + build: crossmusl - url="git://git.2f30.org/smdev" - cd src - [ -d smdev ] || git clone $url - cd smdev + cd src/smdev make clean make CC=$CC LDFLAGS="$LDFLAGS" || return 1 make PREFIX="$root" install || return 1 diff --git a/pkgs/syslinux b/pkgs/syslinux @@ -1,6 +1,5 @@ -build: prepare-root - url="$mirror/syslinux.tar.gz" +url="$mirror/syslinux.tar.gz" + +build: prepare_root cd src - wget -c $url - [ -d syslinux ] || tar xzf syslinux.tar.gz cp -r syslinux/* $root/ diff --git a/pkgs/terminus b/pkgs/terminus @@ -1,10 +1,8 @@ +v="4.38" +url="$mirror/terminus-font-$v.tar.gz" + build: crossmusl - v="4.38" - url="$mirror/terminus-font-$v.tar.gz" - cd src - wget -c $url - [ -d terminus-font-$v ] || tar xzf terminus-font-$v.tar.gz - cd terminus-font-$v + cd src/terminus-font-$v sh configure --psfdir="$root/share/fonts/console" \ --x11dir="$root/share/fonts/misc" || return 1 make || return 1 diff --git a/pkgs/tinyalsa b/pkgs/tinyalsa @@ -1,9 +1,7 @@ +url="$mirror/tinyalsa.tar.gz" + build: crossmusl - url="$mirror/tinyalsa.tar.gz" - cd src - wget -c $url - [ -d tinyalsa ] || tar xzf tinyalsa.tar.gz - cd tinyalsa + cd src/tinyalsa make clean 2>/dev/null make CC=$CC || return 1 cp tinycap tinymix tinypcminfo tinyplay "$root/bin" diff --git a/pkgs/tinyxlib b/pkgs/tinyxlib @@ -1,9 +1,7 @@ +url="$mirror/tinyxlib.tar.gz" + build: crossmusl - url="$mirror/tinyxlib.tar.gz" - cd src - wget -c $url - [ -d tinyxlib ] || tar xzf tinyxlib.tar.gz - cd tinyxlib + cd src/tinyxlib make clean make CC=$CC BINDIR="/bin" LIBDIR="/lib" STATIC=1 \ FONT_ENCODINGS_DIRECTORY="/share/fonts/encodings/encodings.dir" || return 1 diff --git a/pkgs/tinyxserver b/pkgs/tinyxserver @@ -1,9 +1,7 @@ +url="$mirror/tinyxserver.tar.gz" + build: tinyxlib zlib - url="$mirror/tinyxserver.tar.gz" - cd src - wget -c $url - [ -d tinyxserver ] || tar xzf tinyxserver.tar.gz - cd tinyxserver + cd src/tinyxserver make clean make CC=$CC EXTRA_CFLAGS="-D_XSERVER64=1 $CFLAGS" \ FONTDIR="/usr/share/fonts" || return 1 diff --git a/pkgs/tmux b/pkgs/tmux @@ -1,10 +1,8 @@ +v="1.8" +url="$mirror/tmux-$v.tar.gz" + build: ncurses libevent - v="1.8" - url="$mirror/tmux-$v.tar.gz" - cd src - wget -c $url - [ -d tmux-$v ] || tar xzf tmux-$v.tar.gz - cd tmux-$v + cd src/tmux-$v CC=$CC ./configure --prefix="$root" \ CFLAGS="-I$libcroot/include/ncursesw $CFLAGS" || return 1 make -j$nprocs || return 1 diff --git a/pkgs/ubase b/pkgs/ubase @@ -1,8 +1,7 @@ +git="git://git.2f30.org/ubase" + build: crossmusl - url="git://git.2f30.org/ubase" - cd src - [ -d ubase ] || git clone $url - cd ubase + cd src/ubase make clean make -j$nprocs CC=$CC LDFLAGS="$LDFLAGS" || return 1 make PREFIX="$root" install || return 1 diff --git a/pkgs/uuterm b/pkgs/uuterm @@ -1,9 +1,7 @@ +url="$mirror/uuterm.tar.gz" + build: tinyxlib - url="$mirror/uuterm.tar.gz" - cd src - wget -c $url - [ -d uuterm ] || tar xzf uuterm.tar.gz - cd uuterm + cd src/uuterm make clean make CC=$CC LDFLAGS_X11="$LDFLAGS" uuterm-x11 || return 1 cp uuterm-x11 "$root/bin" diff --git a/pkgs/vim b/pkgs/vim @@ -1,10 +1,8 @@ +v="7.4" +url="http://ftp.vim.org/pub/vim/unix/vim-$v.tar.bz2" + build: ncurses - v="7.4" - url="http://ftp.vim.org/pub/vim/unix/vim-$v.tar.bz2" - cd src - wget -c $url - [ -d vim74 ] || tar xjf vim-$v.tar.bz2 - cd vim74 + cd src/vim74 make clean CC=$CC ./configure --prefix=/ \ --enable-multibyte --disable-gui --with-x=no \ diff --git a/pkgs/zlib b/pkgs/zlib @@ -1,10 +1,8 @@ +v="1.2.8" +url="$mirror/zlib-$v.tar.gz" + build: crossmusl - v="1.2.8" - url="$mirror/zlib-$v.tar.gz" - cd src - wget -c $url - [ -d zlib-$v ] || tar xzf zlib-$v.tar.gz - cd zlib-$v + cd src/zlib-$v CC=$CC ./configure --prefix="$libcroot" --static || return 1 make -j$nprocs || return 1 make install || return 1 diff --git a/stuff/cmp-fetch b/stuff/cmp-fetch @@ -0,0 +1,4 @@ +#!/bin/sh + +pkg=`echo $1 | sed -e 's,-fetch$,,'` +cmp -s .state/$1 pkgs/$pkg diff --git a/stuff/fetch-pkg.mk b/stuff/fetch-pkg.mk @@ -0,0 +1,26 @@ + cp $top/pkgs/$target $top/.state/$target + +fetch-target:QP./stuff/cmp-fetch: . + cd src + pkg=`echo $target | sed -e 's,-fetch$,,'` + eval url=$url + if test "$url" = ""; then + if test "$git" = ""; then + echo $target: nothing to download + else + [ -d $pkg ] || git clone $git $pkg + fi + else + wget -c $url + file=`basename $url` + type=`file -b $file | cut -d ' ' -f 1` + if test "$type" = "gzip"; then + tar -xzf $file + elif test "$type" = "bzip2"; then + tar -xjf $file + elif test "$type" = "XZ"; then + tar -xJf $file + fi + fi + cp $top/pkgs/$pkg $top/.state/$target +