morpheus

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

commit 8aab0e9013874e8343845f8cde5975c0553e359e
parent a264666ff2ba01ef4bd3f643de3a3e5e7e0c6995
Author: sin <sin@2f30.org>
Date:   Fri, 27 Sep 2013 11:21:42 +0100

Add gzip

Diffstat:
MDEPS | 1+
Mpkgs/busybox | 1-
Apkgs/gzip | 27+++++++++++++++++++++++++++
Mprepare-env | 2+-
Astuff/bin/gnulibfix | 182+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
5 files changed, 211 insertions(+), 2 deletions(-)

diff --git a/DEPS b/DEPS @@ -1,2 +1,3 @@ dropbear zlib +gzip zlib tmux libevent ncurses diff --git a/pkgs/busybox b/pkgs/busybox @@ -27,7 +27,6 @@ install() { ln -sf busybox fsck ln -sf busybox fuser ln -sf busybox getty - ln -sf busybox gzip ln -sf busybox hexdump ln -sf busybox hwclock ln -sf busybox ifconfig diff --git a/pkgs/gzip b/pkgs/gzip @@ -0,0 +1,27 @@ +url=$mirror/gzip-1.4.tar.xz + +fetch() { + wget -c $url -O src/gzip-1.4.tar.xz +} + +unpack() { + pushd src + [ -d gzip-1.4 ] || tar xJf gzip-1.4.tar.xz + popd +} + +build() { + pushd src/gzip-1.4 + gnulibfix lib + CC="x86_64-linux-musl-gcc -static" ./configure --prefix=$root --libdir=$libcroot/lib || return 1 + echo "#define __printf__ printf" >> lib/config.h + echo "#define rpl_fprintf fprintf" >> lib/config.h + make -j$nprocs || return 1 + popd +} + +install() { + pushd src/gzip-1.4 + make install || return 1 + popd +} diff --git a/prepare-env b/prepare-env @@ -7,5 +7,5 @@ version=0.0 mirror=http://dl.2f30.org/morpheus-pkgs/$arch/$version export top root libcroot nprocs mirror -PATH=$root/opt/cross/x86_64-linux-musl/bin:$PATH +PATH=$root/opt/cross/x86_64-linux-musl/bin:$top/stuff/bin:$PATH export PATH diff --git a/stuff/bin/gnulibfix b/stuff/bin/gnulibfix @@ -0,0 +1,182 @@ +#!/bin/sh +empty_file() { + rm -f "$1" + touch "$1" +} + +dir="$1" + +# fix files breaking the build entirely +for i in freadahead.c fseterr.c ; do empty_file "$dir"/$i ; done +echo "void close_stdin(void) {}" > "$dir"/closein.c + +# fix stuff trying to reimplement libc +culprits=`cat << EOF +accept4 +acosl +alloca +alphasort +asinl +asprintf +atanl +atexit +atoll +bcopy +btowc +chown +closedir +cosl +dirfd +dprintf +dup2 +dup3 +_Exit +expl +fchdir +fchown-stub +fdatasync +fdopendir +ffs +flock +fnmatch +forkpty +fpending +fprintf +freeaddrinfo +fsync +ftell +ftruncate +futimens +gai_strerror +getaddrinfo +getdelim +getdtablesize +getgroups +gethostname +getline +getlogin +getlogin_r +getnameinfo +getpagesize +getpass +getsubopt +gettimeofday +getusershell +gmtime_r +grantpt +imaxabs +imaxdiv +inet_ntop +inet_pton +isblank +iswblank +lchmod +lchown +ldexp +ldexpl +link +linkat +logl +mbrlen +mbrtowc +mbsinit +memmove +mempcpy +mkdtemp +mkfifo +mkfifoat +mknod +mknodat +mkstemp +mktime +nanosleep +nl_langinfo +open +openat +opendir +openpty +pclose +perror +pipe +pipe2 +poll +popen +pread +printf +pselect +ptsname +pwrite +raise +readdir +readlink +renameat +rewinddir +setenv +sigaction +sigaddset +sigdelset +sigemptyset +sigfillset +sigismember +sigpending +sigprocmask +sinl +snprintf +spawnattr_destroy +spawnattr_getdefault +spawnattr_getflags +spawnattr_getpgroup +spawnattr_getsigmask +spawnattr_init +spawnattr_setdefault.c +spawnattr_setflags +spawnattr_setpgroup +spawnattr_setsigmask +spawn_faction_addclose +spawn_faction_adddup2 +spawn_faction_addopen +spawn_faction_destroy +spawn_faction_init +spawn_factions_addopen +spawn_factions_destroy +spawn_factions_init +sprintf +sqrtl +stdio-read +stdio-write +strcasecmp +strcasestr +strchrnul +strcspn +strncasecmp +strndup +strnlen +strpbrk +strsep +strsignal +strstr +strtod +strtoimax +strtol +symlink +symlinkat +tanl +tcgetsid +timegm +time_r +times +tmpfile +uname +unlockpt +unsetenv +usleep +vasprintf +vdprintf +vfprintf +waitpid +wcrtomb +wctob +EOF +` +#fixme check fsusage +for i in $culprits ; do empty_file "$dir"/$i.c ; done