summaryrefslogtreecommitdiff
path: root/opt/wlmaker/MAKEPKG
blob: 2153670e7820ca1725002b643768a5bf903e34f8 (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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/mkpkg
# description: Wayland compositor inspired by Window Maker
# url: https://github.com/phkaeser/wlmaker

name=wlmaker
version=0.8.1
release=1
depends=(wlroots cairo libxkbcommon libxdg-basedir ncurses musl-fts)
makedeps=(cmake bison flex wayland-protocols)
source=(https://github.com/phkaeser/$name/releases/download/v$version/$name-$version.tar.gz
        no-x11-backend.patch)

patch() {
    cd $name-$version

    # Guard X11 backend code for pure Wayland builds
    patch -p1 -i $SRC/no-x11-backend.patch

    # Fix ELSE/ELSEIF build logic (from AUR)
    for i in CMakeLists.txt submodules/libbase/CMakeLists.txt; do
        sed -i 's/^\s*ELSE\s*(config_OPTIM)$/  ELSEIF (config_DEBUG)/' "$i"
    done

    # musl has no fts(3); link libbase against musl-fts and propagate it
    printf '\npkg_check_modules(MUSL_FTS IMPORTED_TARGET musl-fts)\nif(MUSL_FTS_FOUND)\n  target_link_libraries(libbase PUBLIC PkgConfig::MUSL_FTS)\nendif()\n' >> submodules/libbase/src/CMakeLists.txt
}

sha256sums=(
    "aa7c23b6ea501df412101aaaa022576f05eefa56bdde33c0f6eb6d34aa5a2389"
    "dcc530ef531a6de0eef1e04aced332f5e6e51db08493612ae9c7b947fe6e77eb"
)

build() {
    cd $name-$version

    cmake -B build \
        -DCMAKE_INSTALL_PREFIX=/ \
        -DCMAKE_BUILD_TYPE=Release \
        -DCMAKE_C_COMPILER=clang \
        -Dconfig_DEBUG=OFF \
        -Dconfig_OPTIM=OFF

    cmake --build build
    DESTDIR=$PKG cmake --install build

    # Remove Debian wrapper
    #rm -f $PKG/usr/bin/wrap-wlmaker.sh

    # Remove Debian theme and menu
    #rm -f $PKG/etc/xdg/$name/Themes/Debian.plist
    rm -f $PKG/etc/xdg/$name/RootMenuDebian.plist
}

signify() {
    untrusted comment: public key
    RWTZ9IduCSQ/mL8337TEUinPwT92xFEUpD92hkS7IxcOnzTt9QdpohT3
}

# vim: filetype=sh