aesophor / wmderland

🌳 X11 tiling window manager using space partitioning trees
https://www.reddit.com/r/unixporn/comments/fb8ve1/wmderland_104_time_to_move_on/
MIT License
409 stars 15 forks source link

Add a AUR package? #31

Closed Quoteme closed 4 years ago

Quoteme commented 4 years ago

It would be a great convenience to have a package in the arch user repository, which would increase the userbase

aesophor commented 4 years ago

Thanks! I've written a PKGBUILD, could you please help me test it? Sorry for asking because I don't have access to any Arch Linux machine right now.


PKGBUILD:

# Maintainer: Marco Wang <m.aesophor@gmail.com>

pkgname=wmderland-git
_pkgname=wmderland
pkgver=1.0.2
pkgrel=1
pkgdesc='X11 tiling window manager using space partitioning trees'
arch=('x86_64' 'aarch64')
url="https://github.com/aesophor/wmderland"
license=('MIT')
depends=('libx11')
makedepends=('gcc>=6.0' 'cmake>=3.9')
install=${_pkgname}.install
source=('git://github.com/aesophor/wmderland.git')
sha256sums=('SKIP')

build() {
  cd ${_pkgname}/
  ./build.sh
}

package() {
  # Install the executable.
  cd ${_pkgname}/build/
  make DESTDIR="${pkgdir}/" PREFIX="/usr/local/" install

  # Install Wmderlandc (ipc client).
  cd ../ipc-client/build/
  make DESTDIR="${pkgdir}/" PREFIX="/usr/local/" install

  # Install example config file.
  cd ../../
  mkdir -p "${pkgdir}/etc/xdg/Wmderland/"
  install -D -m644 examples/* "${pkgdir}/etc/xdg/Wmderland/"
}


Also wmderland.install for reminding users to get a copy of config file.

post_install() {
  cat << EOF
==> IMPORTANT: Make sure you have a config file in ~/.config/Wmderland/config
==> An example config file has been placed at /etc/xdg/Wmderland/config
EOF
}
Quoteme commented 4 years ago

ok, so I set up a fresh install of arch with qemu and did the following:

sudo pacman -S fakeroot bintools # to get makepkg -si to work
mkdir wmderland && cd wmderland 
# now i copied the PGKBUILD and wmderland.install into this folder
sudo pacman -S gcc cmake # i tried it without this before and it broke my system, because without this, all c++ libraries would be linked weirdly and unusable after trying to install wmderland
makepkg -si # but this resulted in the following error:

[https://imgur.com/8XmdXhy](https://imgur.com/8XmdXhy) [https://i.imgur.com/vUztJLT.png](https://i.imgur.com/vUztJLT.png)

aesophor commented 4 years ago

I searched Killed signal terminated program cc1plus on Google and it turns out the reason for receiving this error message is likely due to insufficient amount of memory. Later on, I found that the default size of RAM of QEMU is 128 MB as stated in Gentoo wiki.


I also spotted a mistake I've made in package() function. The corrected PKGBUILD:

# Maintainer: Marco Wang <m.aesophor@gmail.com>

pkgname=wmderland-git
_pkgname=wmderland
pkgver=1.0.2
pkgrel=1
pkgdesc='X11 tiling window manager using space partitioning trees'
arch=('x86_64' 'aarch64')
url="https://github.com/aesophor/wmderland"
license=('MIT')
depends=('libx11')
makedepends=('gcc>=6.0' 'cmake>=3.9')
install=${_pkgname}.install
source=('git://github.com/aesophor/wmderland.git')
sha256sums=('SKIP')

build() {
  cd ${_pkgname}/
  ./build.sh
}

package() {
  # Install wmderland.
  cd ${_pkgname}/build/
  make DESTDIR="${pkgdir}/" PREFIX="/usr/local/" install

  # Install wmderlandc (ipc client).
  cd ../ipc-client/build/
  make DESTDIR="${pkgdir}/" PREFIX="/usr/local/" install

  # Install example config file.
  cd ../../
  mkdir -p "${pkgdir}/etc/xdg/wmderland/"
  install -D -m644 example/* "${pkgdir}/etc/xdg/wmderland/"
}


I found an old laptop with Arch already installed this morning, so after upgrading the system, I tried building the aur package and it went well.

$ makepkg -si

==> Making package: wmderland-git 1.0.2-1 (Tue 25 Feb 2020 12:27:42 PM CST)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Cloning wmderland git repo...
==> Validating source files with sha256sums...
==> Extracting sources...
  -> Creating working copy of wmderland git repo...
==> Starting build()...
-- Building wmderland (WM)
-- The C compiler identification is GNU 9.2.0
-- The CXX compiler identification is GNU 9.2.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found X11: /usr/include
-- Looking for XOpenDisplay in /usr/lib/libX11.so;/usr/lib/libXext.so
-- Looking for XOpenDisplay in /usr/lib/libX11.so;/usr/lib/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
-- Could NOT find Glog (missing: GLOG_INCLUDE_DIR GLOG_LIBRARY)
-- Configuring done
-- Generating done
-- Build files have been written to: /home/aesophor/Code/temp/wmderland/src/wmderland/build
make[1]: Entering directory '/home/aesophor/Code/temp/wmderland/src/wmderland/build'
make[2]: Entering directory '/home/aesophor/Code/temp/wmderland/src/wmderland/build'
Scanning dependencies of target wmderland
make[2]: Leaving directory '/home/aesophor/Code/temp/wmderland/src/wmderland/build'
make[2]: Entering directory '/home/aesophor/Code/temp/wmderland/src/wmderland/build'
[  7%] Building CXX object CMakeFiles/wmderland.dir/src/action.cc.o
[ 14%] Building CXX object CMakeFiles/wmderland.dir/src/client.cc.o
[ 21%] Building CXX object CMakeFiles/wmderland.dir/src/config.cc.o
[ 28%] Building CXX object CMakeFiles/wmderland.dir/src/cookie.cc.o
[ 35%] Building CXX object CMakeFiles/wmderland.dir/src/ipc.cc.o
[ 42%] Building CXX object CMakeFiles/wmderland.dir/src/main.cc.o
[ 50%] Building CXX object CMakeFiles/wmderland.dir/src/properties.cc.o
[ 57%] Building CXX object CMakeFiles/wmderland.dir/src/snapshot.cc.o
[ 64%] Building CXX object CMakeFiles/wmderland.dir/src/stacktrace.cc.o
[ 71%] Building CXX object CMakeFiles/wmderland.dir/src/tree.cc.o
[ 78%] Building CXX object CMakeFiles/wmderland.dir/src/util.cc.o
[ 85%] Building CXX object CMakeFiles/wmderland.dir/src/window_manager.cc.o
[ 92%] Building CXX object CMakeFiles/wmderland.dir/src/workspace.cc.o
[100%] Linking CXX executable wmderland
make[2]: Leaving directory '/home/aesophor/Code/temp/wmderland/src/wmderland/build'
[100%] Built target wmderland
make[1]: Leaving directory '/home/aesophor/Code/temp/wmderland/src/wmderland/build'
--------------------------------------------------------------------------------------------------------------------------------------------------------
-- Building wmderlandc (client)
-- The C compiler identification is GNU 9.2.0
-- The CXX compiler identification is GNU 9.2.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found X11: /usr/include
-- Looking for XOpenDisplay in /usr/lib/libX11.so;/usr/lib/libXext.so
-- Looking for XOpenDisplay in /usr/lib/libX11.so;/usr/lib/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
-- Configuring done
-- Generating done
-- Build files have been written to: /home/aesophor/Code/temp/wmderland/src/wmderland/ipc-client/build
make[1]: Entering directory '/home/aesophor/Code/temp/wmderland/src/wmderland/ipc-client/build'
make[2]: Entering directory '/home/aesophor/Code/temp/wmderland/src/wmderland/ipc-client/build'
Scanning dependencies of target wmderlandc
make[2]: Leaving directory '/home/aesophor/Code/temp/wmderland/src/wmderland/ipc-client/build'
make[2]: Entering directory '/home/aesophor/Code/temp/wmderland/src/wmderland/ipc-client/build'
[ 50%] Building C object CMakeFiles/wmderlandc.dir/wmderlandc.c.o
[100%] Linking C executable wmderlandc
make[2]: Leaving directory '/home/aesophor/Code/temp/wmderland/src/wmderland/ipc-client/build'
[100%] Built target wmderlandc
make[1]: Leaving directory '/home/aesophor/Code/temp/wmderland/src/wmderland/ipc-client/build'
==> Entering fakeroot environment...
==> Starting package()...
make[1]: Entering directory '/home/aesophor/Code/temp/wmderland/src/wmderland/build'
make[2]: Entering directory '/home/aesophor/Code/temp/wmderland/src/wmderland/build'
make[2]: Leaving directory '/home/aesophor/Code/temp/wmderland/src/wmderland/build'
[100%] Built target wmderland
make[1]: Leaving directory '/home/aesophor/Code/temp/wmderland/src/wmderland/build'
Install the project...
-- Install configuration: "MINSIZEREL"
-- Installing: /home/aesophor/Code/temp/wmderland/pkg/wmderland-git/usr/local/bin/wmderland
make[1]: Entering directory '/home/aesophor/Code/temp/wmderland/src/wmderland/ipc-client/build'
make[2]: Entering directory '/home/aesophor/Code/temp/wmderland/src/wmderland/ipc-client/build'
make[2]: Leaving directory '/home/aesophor/Code/temp/wmderland/src/wmderland/ipc-client/build'
[100%] Built target wmderlandc
make[1]: Leaving directory '/home/aesophor/Code/temp/wmderland/src/wmderland/ipc-client/build'
Install the project...
-- Install configuration: "MINSIZEREL"
-- Installing: /home/aesophor/Code/temp/wmderland/pkg/wmderland-git/usr/local/bin/wmderlandc
==> Tidying install...
  -> Removing libtool files...
  -> Purging unwanted files...
  -> Removing static library files...
  -> Stripping unneeded symbols from binaries and libraries...
  -> Compressing man and info pages...
==> Checking for packaging issues...
==> Creating package "wmderland-git"...
  -> Generating .PKGINFO file...
  -> Generating .BUILDINFO file...
  -> Adding install file...
  -> Generating .MTREE file...
  -> Compressing package...
==> Leaving fakeroot environment.
==> Finished making: wmderland-git 1.0.2-1 (Tue 25 Feb 2020 12:29:11 PM CST)
==> Installing package wmderland-git with pacman -U...
loading packages...
resolving dependencies...
looking for conflicting packages...

Packages (1) wmderland-git-1.0.2-1

Total Installed Size:  0.07 MiB
Net Upgrade Size:      0.00 MiB

checking keyring...
checking package integrity...
loading package files...
checking for file conflicts...
checking available disk space...
:: Processing package changes...
reinstalling wmderland-git...
:: Running post-transaction hooks...
(1/1) Arming ConditionNeedsUpdate...

Edit: I can start wmderland after installation.

aesophor commented 4 years ago

The AUR package is here!

https://aur.archlinux.org/packages/wmderland-git/

I've installed it with yay -S wmderland-git and it worked fine.

Quoteme commented 4 years ago

awesome work! thank you a lot.