Here the pkgbuild for toxcore, i post here this pkgbuild because i don't want to maintain it. Well, you have the base, you can build it and maintain as you wish
# Maintainer: Eric Vidal <eric@ obarun.org>
# based on the original https://git.archlinux.org/svntogit/community.git/tree/trunk?h=packages/toxcore
# 						Maintainer: Felix Yan <felixonmars@ archlinux.org>
# 						Contributor: Håvard Pettersson <mail@ haavard.me>
# 						Contributor: naxuroqa <naxuroqa at gmail.com>
# 						Contributor: Boohbah <boohbah at gmail.com>
# 						Contributor: Kevin MacMartin <prurigro at gmail dot com>

pkgname=toxcore-nosystemd
pkgver=3747
_commit=c510e2407f8caa880f38d77386cebc52ae7c1360
pkgrel=1
pkgdesc='Secure, configuration-free, P2P Skype replacement backend'
arch=('i686' 'x86_64')
url='https://tox.chat'
license=('GPL3')
depends=('libconfig' 'libsodium' 'libvpx' 'opus')
makedepends=('git' 'check')
conflicts=('tox' 'toxcore')
provides=('tox' 'toxcore')
replaces=('toxcore')
backup=('etc/tox-bootstrapd.conf')
install=$pkgname.install
source=("git+https://github.com/irungentoo/toxcore.git# commit=$_commit")
sha512sums=('SKIP')

build() {
  cd ${pkgname%-nosystemd}
  autoreconf -if
  ./configure \
    --prefix=/usr \
    --disable-daemon \
    --disable-ntox \
    --disable-static 
    
  make
}

check() {
  cd ${pkgname%-nosystemd}
  # Tests hang as of 3638
  # make check || warning "Tests failed"
}

package() {
  cd ${pkgname%-nosystemd}
  make DESTDIR="$pkgdir" install
  install -Dm644 ./other/bootstrap_daemon/tox-bootstrapd.conf "$pkgdir/etc/tox-bootstrapd.conf"
}
and the necessary toxcore-nosystemd.install
post_install() {
	getent group tox-bootstrapd &>/dev/null || groupadd -r tox-bootstrapd
	getent passwd tox-bootstrapd &>/dev/null || useradd -r --home-dir /var/lib/tox-bootstrapd  -s /usr/sbin/nologin -c "Tox bootstrapd" -g tox-bootstrapd tox-bootstrapd

  [[ -d var/lib/tox-bootstrapd ]] || install -dm 750 -o tox-bootstrapd -g tox-bootstrapd var/lib/tox-bootstrapd
}

post_upgrade() {
  (( $(vercmp $2 '3523-3') < 0 )) && (	

	post_install
	
  ) || true
}
enjoy :)
a year later
Hi all,

Just for fun and better understatnding arch without systemd, let's try to build toxcore again step-by-step.
I don't know how to do it, so your valuable comments are indispensable. It may be a general example.

Well, here's a general outline:
- Download a PKGBUID, then run in terminal: $ makepkg -o
- Go to the src directory: $ cd path_of_the_pkgbuild/src/name_of_the_package
- Look for a file named configure. Then run command: $ ./configure --help
This should give you options to compile the package.
Make the change to suit your needs in the PKGBUILD build function, then try to build.
Do not forget to check the depends and makedepends field to see if systemd/libsystemd is declared on it.
Obviously, you need to check the package function to see if some components should be removed.

Here's an output if I try to install toxcore from arch repo:
vn@ lx ~ % sudo pacman -S toxcore
resolving dependencies...
warning: ignoring package systemd-235.38-1
warning: cannot resolve "systemd", a dependency of "toxcore"
:: The following package cannot be upgraded due to unresolvable dependencies:
      toxcore

:: Do you want to skip the above package for this upgrade? [y/N] y
looking for conflicting packages...
 there is nothing to do
vn@ lx ~ % 
So we need to make toxcore-nosystemd PKGBUILD, and install it by "# pacman -U toxcore-nosystemd.pkg.tar.xz" command.

According to Wiki :
... Packages in Arch Linux are built using the makepkg utility. When makepkg is run, it searches for a PKGBUILD file
in the current directory and follows the instructions therein to either compile or otherwise acquire the files
to build a package archive (pkgname.pkg.tar.xz).

So, let's start.
Step 1: Download toxcore PKGBUILD

According to Arch Build System
...Each package has its own subdirectory in SVN repository. Within it there are repos and trunk directories.
repos is further broken down by repository name (e.g., core) and architecture. PKGBUILD's and files found in repos
are used in official builds. Files found in trunk are used by developers in preparation before being copied to repos.

Path for downloading:
Toxcore > Source Files > root > repos > community-x86_64 >
Download files PKGBUILD, toxcore.conf and toxcore.install by mouse right click on "plain" of each file > Save Link As...

Step 2: Download and extract files only
In a folder with the downloaded files, run:
$makepkg -o

Here's an output:
vn@ lx [127] zbuild % makepkg -o 
==> Making package: toxcore 1:0.1.10-2 (Thu Nov 16 11:57:31 EET 2017)
==> Checking runtime dependencies...
==> Missing dependencies:
  -> systemd
==> Checking buildtime dependencies...
==> ERROR: Could not resolve all dependencies.

==> ERROR: An unknown error has occurred. Exiting...
vn@ lx [1] zbuild % 
So, here is PKGBUILD https://git.archlinux.org/svntogit/community.git/tree/repos/community-x86_64?h=packages/toxcore .
And we stopped at getting the sources downloaded. What should be edited in the PKGBUILD to move a step further?

P.S. It would be good to have a possibility of [/spoiler] function on the forum. Is it possible?
So, the first step as you said is to be able to have the source of the package. As you can see , pacman complaint about system:D dependency and so, it do not want to download the sources. You can avoid this with two different way :
  • First removing the system:D dependency declaration in the depends field onto the PKGBUILD.
  • Second, an option with makepkg is provided to not check dependency.
We will use this last one, so :
$ makepkg -o --nodeps
now we have a src/ directory containing the source of the package.
The next step is to know with option we need to change to build the package without system:D. Obviously, that means that the upstream provide this option. Some package cannot be compiled without system:D e.g. libgdm which have a hard dependency with it. Well it's not the case here.
To know the options provided by upstream, we need to open a terminal and go into the src/ directory e.g.:
$ cd tmp/community-packages-toxcore/community-packages/toxcore/repos/community-x86_64/src/c-toxcore-0.1.10/
Well, depending of the projects, the option can be displayed by ./configure --help or , in your case, with cmake -LH command. Some other projects use different program like ninja. We need to use the good command in fonction of that.
So (refer to the cmake man pages to see option):
$ cmake -LH
cmake will perform some check and finally :
// Path to a program.
APIDSL:FILEPATH=APIDSL-NOTFOUND

// Enable address-sanitizer to detect invalid memory accesses
ASAN:BOOL=OFF

// Path to a program.
ASTYLE:FILEPATH=ASTYLE-NOTFOUND

// Enable building of tox-bootstrapd
BOOTSTRAP_DAEMON:BOOL=ON

// Build toxav test
BUILD_AV_TEST:BOOL=ON

// Build nTox client
BUILD_NTOX:BOOL=OFF

// Build the testing tree.
BUILD_TESTING:BOOL=ON

// Whether to build the tox AV library
BUILD_TOXAV:BOOL=ON

// Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.
CMAKE_BUILD_TYPE:STRING=

// Install path prefix, prepended onto install directories.
CMAKE_INSTALL_PREFIX:PATH=/usr/local

// Compile all C code as C++ code
COMPILE_AS_CXX:BOOL=OFF

// Enable assertions and other debugging facilities
DEBUG:BOOL=OFF

// Enable building of DHT_bootstrap
DHT_BOOTSTRAP:BOOL=ON

// Build shared (dynamic) libraries for all modules
ENABLE_SHARED:BOOL=ON

// Build static libraries for all modules
ENABLE_STATIC:BOOL=ON

// Make compilation error on a warning
ERROR_ON_WARNING:BOOL=OFF

// Require the format_test to be executed; fail cmake if it can't
FORMAT_TEST:BOOL=OFF

// Path to a library.
NCURSES_LIBRARIES:FILEPATH=/usr/lib/libncurses.so

// Path to a library.
RT_LIBRARIES:FILEPATH=/usr/lib/librt.so

// Path to a program.
SPECTEST:FILEPATH=SPECTEST-NOTFOUND

// Path to a program.
STACK:FILEPATH=STACK-NOTFOUND

// Enforce strict ABI export in dynamic libraries
STRICT_ABI:BOOL=OFF

// Limit runtime of each test to the number of seconds specified
TEST_TIMEOUT_SECONDS:STRING=

// Enable TRACE level logging (expensive, for network debugging)
TRACE:BOOL=OFF

// Path to a library.
UTIL_LIBRARIES:FILEPATH=/usr/lib/libutil.so

// Enable additional compiler warnings
WARNINGS:BOOL=ON
This is give us the option which can be changed to build the package(not all the option but the main one). As you can see for this package we do not have any system:D stuff here.
So, we do not have to change anything on the build function into the PKGBUILD to be able to build the package correctly without system:D.

The next step is to change/check every field/function onto the PKGBUILD to remove system:D tricks.
The first field is the pkgname variable. We have two manner to operate here.
  • keeping the same name. that mean that we need to change the release field to avoid trouble with pacman when we perform a system update. Pacman only refer to package version to know if a package is out of date comparing to the database. So , the package need to have a least the release ahead comparing the Arch database.
  • changing the name by a another one e.g toxcore-nosystemd. In this case, we need to add 3 more field onto the PKGBUILD named conflicts, replaces, provides.
In your case, and to simplify the example , we will use the first option.
So, we just need to change the pkgrel field and set it to 3 :
pkgrel=3
the next field to change is the depends field. We need to remove the system:D dependency, so removing this name on it :
depends=('libconfig' 'libsodium' 'libvpx' 'opus')
sometime , the field source need to be change to remove some components which is specific for system:D. For example the file toxcore.conf declared on this field is a file used by system:D program to create the user and group tox-bootstrapd. On other system which do not have wrapper for this specific action of system:D , we would have to remove it. By luck, on Obarun we have this kind of wrapper. So, let it in place.

The function prepare can be changed a little bit to remove the sed concerning the system:D service. we will not use this service, so we don't care about this sed command :
prepare() {
  cd $_pkgname-$pkgver
  sed -i "/Rpath/d;/RPATH/d" CMakeLists.txt
}
we saw that the function build to do require any changements.

It's equal for the function check(i didn't see any packages, for the moment, which require a changements concerning system:D on this field)

We need to remove components on the package function. Normally the installation of toxcore.conf and tox-bootstrapd.conf should be removed, not the case here because we use Obarun (we are lucky :D ).
So we just need to remove the system:D service installation.
package() {
  cd $_pkgname-$pkgver
  make DESTDIR="$pkgdir" install
  install -Dm644 "$srcdir/toxcore.conf" "$pkgdir/usr/lib/sysusers.d/toxcore.conf"
  install -Dm644 ./other/bootstrap_daemon/tox-bootstrapd.conf "$pkgdir/etc/tox-bootstrapd.conf"
}
So, normally, we are ready to build the package, let's do it(refer to the man page of makepkg)
$ makepkg -C
be sure to be on the directory where the PKGBUILD file is.

Now, we can install the package with pacman using the -U option.

Hope this help.

NOTE: In fact, this package can be installed safely with the --assume-installed pacman option because this package do not need to be builded with system:D dependency. System:D is only declared as dependency for the service but the program itself do not require system:D to work properly, so we can do :
# pacman -S toxcore --assume-installed systemd
finall version of the PKGBUILD
# Maintainer: Jiachen Yang <farseerfc@ gmail.com>
# $Id$
# Maintainer: Felix Yan <felixonmars@ archlinux.org>
# Contributor: Håvard Pettersson <mail@ haavard.me>
# Contributor: naxuroqa <naxuroqa at gmail.com>
# Contributor: Boohbah <boohbah at gmail.com>
# Contributor: Kevin MacMartin <prurigro at gmail dot com>

pkgname=toxcore
_pkgname=c-toxcore
epoch=1
pkgver=0.1.10
pkgrel=3
pkgdesc='Secure, configuration-free, P2P Skype replacement backend'
arch=('i686' 'x86_64')
url='https://tox.chat'
license=('GPL3')
depends=('libconfig' 'libsodium' 'libvpx' 'opus')
makedepends=('check' 'cmake')
conflicts=("tox")
provides=("tox")
backup=('etc/tox-bootstrapd.conf')
install=$pkgname.install
source=(
	# "${_pkgname}-v${pkgver}.tar.gz::https://github.com/TokTok/${_pkgname}/archive/v${pkgver}.tar.gz"
	"${_pkgname}-v${pkgver}.tar.gz::https://github.com/TokTok/${_pkgname}/releases/download/v${pkgver}/${_pkgname}-${pkgver}.tar.gz"
	"${_pkgname}-v${pkgver}.tar.gz.asc::https://github.com/TokTok/${_pkgname}/releases/download/v${pkgver}/${_pkgname}-${pkgver}.tar.gz.asc"
	# "${_pkgname}-v${pkgver}.tar.lz::https://github.com/TokTok/${_pkgname}/releases/download/v${pkgver}/${_pkgname}-v${pkgver}.tar.lz"
	# "${_pkgname}-v${pkgver}.tar.lz.asc::https://github.com/TokTok/${_pkgname}/releases/download/v${pkgver}/${_pkgname}-v${pkgver}.tar.lz.asc"
	# "pr504.patch::https://github.com/TokTok/c-toxcore/commit/d4414ffa3acf9e7ab5158e6c7a69c115ccb1a308.patch"
        'toxcore.conf')
sha512sums=('428fee2d811d0b6d5d005f082aa06f95765794b1a8bc77ec4411bb9ec9085b99675535b88db50f5ad7313850a0bb3c54c4e2e8d8864cea7c0c7d81be9879b157'
            'SKIP'
            'aa1dcfbdf9b613f5d89e238ff5d01e0ea150ad3162792acb806f51ce07fd9ade1270b310b1285a828dcdf578549b95a89fd9bd198fb205c83f5a5be2c969ea63')
validpgpkeys=(
'15D3B9A6B3951DF9854FCA93E786548AE0A0B56B'  # RobinLindén<mail+gitlab@ robinlinden.eu>
'B7008FF12C079BF6E6EA19D1601A604B7E605776'  # Robin Lindén <mail@ robinlinden.eu>
# GPG key fingerprints taken from https://github.com/qTox/qTox/blob/$_gitver/README.md
'DA262CC93C0E1E525AD21C8596775D454B8EBF44'  # sudden6 <sudden6@ gmx.at>
'BA7883E22F9D35945BA3376053137C3033F09008'  # Zetok Zalbavar <zetok@ openmailbox.org>
'1157616BBD860C539926F8139591A163FF9BE04C'  # - antis81
'31039166FA902CA50D05D6085AF9F2E29107C727'  # - Diadlo
'C7A2552D0B250F983827742C133203A3AC399151'  # - initramfs
'2880C860D95C909D3DA45C687E086DD661263264'  # - tux3
)

prepare() {
  cd $_pkgname-$pkgver
  sed -i "/Rpath/d;/RPATH/d" CMakeLists.txt
}

build() {
  cd $_pkgname-$pkgver
  # autoreconf -if
  # ./configure \
  #  --prefix=/usr \
  #  --enable-daemon \
  #  --disable-ntox \
  #  --enable-tests
  cmake -DCMAKE_INSTALL_PREFIX=/usr \
        -DDHT_BOOTSTRAP=on \
        -DBOOTSTRAP_DAEMON=on \
        -DBUILD_NTOX=off
  make
}

check() {
  cd $_pkgname-$pkgver
  # make check
  # make test # # test fail on i686 
}

package() {
  cd $_pkgname-$pkgver
  make DESTDIR="$pkgdir" install
  install -Dm644 "$srcdir/toxcore.conf" "$pkgdir/usr/lib/sysusers.d/toxcore.conf"
  install -Dm644 ./other/bootstrap_daemon/tox-bootstrapd.conf "$pkgdir/etc/tox-bootstrapd.conf"
}
It worked like a charm. :D Thanks for an in-depth reply!
And I had to
$makepkg -C --skippgpcheck
as a workaround for validpgpkeys=(...) .

Powered by Obarun