summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: abad54776ad648ba702304afb6d78769751bd7b7 (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
pkgname=ntfs3-dkms-git
pkgver=6.4.r0.gac9a786
pkgrel=1
epoch=1
pkgdesc="NTFS3 is fully functional NTFS Read-Write driver. The driver works with NTFS versions up to 3.1."
arch=('any')
url="https://github.com/Paragon-Software-Group/linux-ntfs3"
license=('GPL2')
depends=('dkms')
makedepends=('git')
provides=('NTFS3-MODULE' 'ntfs3')
conflicts=('ntfs3')
options=('!strip' '!emptydirs')

source=(
    "dkms.conf"
    "Makefile.patch"
)

sha256sums=(
    '5117515294c7457bff12738ba26ad6a3527e92273e0e51d5bf6038269273b5e0'
    'fd4cf0e2dc160efecc55d4ea99667669b870599e4e81be435ec2201381b7e2ac'
)

_ver="6.4"
_since="1683491675"

# The whole kernel history is very huge, so downloading it is a pain.
# Also commits count is insane and we don't want to see all that in pkgver.
# Here is a tricky workaround.
# Make a shallow clone since the specified timestamp.

pkgver() {
    cd "repo"

    local rev sha
    rev=$(("$(git rev-list --count HEAD)" - 1))
    sha="$(git rev-parse HEAD)"

    echo "${_ver}.r${rev}.g${sha:0:7}"
}

prepare() {
    if [ ! -d "repo" ]; then
        git clone --shallow-since="${_since}" --filter=tree:0 --no-checkout --single-branch "${url}" "repo"
    fi

    cd "repo"
    git fetch -f
    git sparse-checkout set --no-cone "/fs/ntfs3"
    git reset --hard FETCH_HEAD

    cd "fs/ntfs3"
    patch -i "${srcdir}/Makefile.patch"
}

package() {
    local dest="${pkgdir}/usr/src/ntfs3-${_ver}"
    install -Dm644 -t "${dest}" "${source[0]}"
    cp -rpT "repo/fs/ntfs3" "${dest}"
}