summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: f0643ec863819e98d710faac4be3fe78ee53bb92 (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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# Maintainer: Caleb Maclennan <caleb@alerque.com>
# Contributor: George Rawlinson <grawlinson@archlinux.org>
# Contributor: Andy Weidenbaum <archbaum@gmail.com>
# Contributor: Vlad M. <vlad@archlinux.net>
# Contributor: Mario Rodas
# Contributor: Oozyslug <oozyslug at gmail dot com>
# Contributor: koral <koral at mailoo dot org>

pkgbase=nix-git
pkgname=(nix-git nix-docs-git)
_pkgname=${pkgbase%-git}
pkgver=2.2.r10010.g50cb14f
pkgrel=1
pkgdesc='A purely functional package manager'
arch=(x86_64 i686)
url="https://nixos.org/$_pkgname"
license=(LGPL2)
makedepends=(autoconf-archive
             aws-crt-cpp
             aws-sdk-cpp
             boost
             brotli
             bzip2
             curl
             editline
             gc
             git
             graphviz
             gtest
             jq
             libcpuid
             libgit2
             libseccomp
             libsodium
             lowdown
             mdbook
             mdbook-linkcheck
             nix-busybox
             nlohmann-json
             openssl
             rapidcheck
             sqlite)
source=("$_pkgname::git+https://github.com/NixOS/nix.git"
        nix.conf
        sysusers.conf
        tmpfiles.conf
        user.environment.conf
        user.tmpfiles.conf)
sha256sums=('SKIP'
            'cf3c7a3a24ac0f553b6fd8ba6adb8f1375d8675911af12c4db94918a799f688e'
            'cf6caa02e0b5224332c5945ba6fa08b1517802898290e6c2eb96046cad9598d8'
            'f078cb60bdd549e9cb3b9af3dfacd33e1b7f16a7e7c02904f50f08bfc8c0d952'
            'e45e45394a119a4ef2046a4a39403dda2df2af820c2d116763031c4689fc5717'
            'c353524861487ef7f7e862bdaaa70e2a3a29e08d2ee31947ebf9e01237c5c50d')

prepare() {
	cd "$_pkgname"
	sed -i "s:\$(bindir):src/nix:g" doc/manual/local.mk
	autoreconf -vfi
}

pkgver() {
	cd "$_pkgname"
	git describe --long --tags --abbrev=7 HEAD |
		sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
	cd "$_pkgname"
	CXXFLAGS='-D_GLIBCXX_USE_CXX11_ABI=0' \
	./configure \
		--prefix=/usr \
		--libexecdir="/usr/lib/$_pkgname" \
		--sysconfdir=/etc \
		--localstatedir=/nix/var \
		--with-sandbox-shell=/usr/lib/nix/busybox \
		--enable-static=rapidcheck \
		--enable-gc \
		--enable-lto
	make
}

package_nix-git() {
	depends=(aws-crt-cpp
	         aws-sdk-cpp
	         boost-libs
	         brotli
	         curl
	         editline
	         gc
	         gcc-libs
	         glibc
	         libarchive
	         libcpuid
	         libseccomp
	         libsodium
	         lowdown
	         nix-busybox
	         openssl
	         sqlite)
	provides=("$_pkgname=$pkgver")
	conflicts=("$_pkgname")
	backup=("etc/$_pkgname/$_pkgname.conf")
	install="$_pkgname.install"
	install -vDm644 tmpfiles.conf "$pkgdir/usr/lib/tmpfiles.d/$_pkgname-daemon.conf"
	install -vDm644 sysusers.conf "$pkgdir/usr/lib/sysusers.d/$_pkgname-daemon.conf"
	install -vDm644 user.tmpfiles.conf "$pkgdir/usr/share/user-tmpfiles.d/$_pkgname-daemon.conf"
	install -vDm644 user.environment.conf "$pkgdir/usr/lib/environment.d/$_pkgname-daemon.conf"
	install -vDm644 nix.conf -t "$pkgdir/etc/$_pkgname"
	cd "$_pkgname"
	make DESTDIR="$pkgdir" install
	rm -rf \
		"$pkgdir/etc/init" \
		"$pkgdir/etc/profile.d/nix.sh" \
		"$pkgdir/etc/profile.d/nix.fish"
	mv "$pkgdir/usr/share/doc" nix-docs
	install -Dm0644 -t "$pkgdir/usr/share/licenses/$pkgname/" COPYING
}

package_nix-docs-git() {
	pkgdesc+=" (documentation)"
	cd "$_pkgname"
	install -vd "$pkgdir/usr/share/doc"
	mv nix-docs/nix "$pkgdir/usr/share/doc"
}