summaryrefslogtreecommitdiff
path: root/repo/system/sbase.xibuild
blob: 38559f8106917411d8dc898430d35b98e96900ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/sh

MAKEDEPS="make "
DEPS="musl acl attr gmp ubase"

SOURCE=https://git.suckless.org/sbase

DESC="sbase from suckless.org"

prepare () {
    # add uname -o since some packages need it

    sed -i "39i case 'o':" uname.c
    sed -i "40i sflag = 1;" uname.c
    sed -i "41i break;" uname.c
}

build () {
    make
}

package () {
    make PREFIX=/usr DESTDIR=$PKG_DEST install 

    # these are provided by other utils
    for p in tar sed find xargs; do
        rm $PKG_DEST/usr/bin/$p
        rm $PKG_DEST/usr/share/man/man1/$p.1
    done

    # quick and dirty realpath replacement
    realpath=$PKG_DEST/usr/bin/realpath

    echo '#!/bin/bash' > $realpath
    echo '[[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"' >> $realpath
    chmod +x $realpath
}