summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: c056b08c510eef5660cb0174562f9115dfa9f2cd (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
# Maintainer: Luis Martinez <luis dot martinez at disroot dot org>
# Contributor: Davide Depau <davide@depau.eu>
# Contributor: Jonathan Shreckengost <jonathanshrek@gmail.com>

pkgbase=liblnk-git
pkgname=(liblnk-git liblnk-tools-git python-liblnk-git)
pkgver=20260525.r1.g6579a99
pkgrel=1
pkgdesc="Library and tools to access the Windows Shortcut File (LNK) format"
arch=(x86_64)
license=(LGPL-3.0-or-later)
url="https://github.com/libyal/liblnk"
depends=(glibc)
makedepends=(git python automake autoconf libtool pkgconf python-build python-installer python-wheel python-setuptools)
source=("$pkgname::git+$url?signed"
        "libbfio::git+${url/liblnk/libbfio}"
        "libcdata::git+${url/liblnk/libcdata}"
        "libcerror::git+${url/liblnk/libcerror}"
        "libcfile::git+${url/liblnk/libcfile}"
        "libclocale::git+${url/liblnk/libclocale}"
        "libcnotify::git+${url/liblnk/libcnotify}"
        "libcpath::git+${url/liblnk/libcpath}"
        "libcsplit::git+${url/liblnk/libcsplit}"
        "libcthreads::git+${url/liblnk/libcthreads}"
        "libfdatetime::git+${url/liblnk/libfdatetime}"
        "libfguid::git+${url/liblnk/libfguid}"
        "libfole::git+${url/liblnk/libfole}"
        "libfwps::git+${url/liblnk/libfwps}"
        "libfwsi::git+${url/liblnk/libfwsi}"
        "libuna::git+${url/liblnk/libuna}")
sha256sums=('SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP')
validpgpkeys=(0ED9020DA90D3F6E70BD3945D9625E5D7AD0177E)

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

prepare() {
    cd "$pkgbase"
    ## use the local git repos
    sed -i "s#\${GIT_URL}#${srcdir}/\${LOCAL_LIB}#" synclibs.sh
    ./synclibs.sh
    ./autogen.sh
}

build() {
    cd "$srcdir/$pkgname"

    ./configure --prefix=/usr \
      --sysconfdir=/etc \
      --localstatedir=/var \
      --runstatedir=/run \
      --sbindir=/usr/bin \
      --libexecdir=/usr/lib \
      --enable-python

    make
    mkdir -p "$srcdir/package"
    make DESTDIR="$srcdir/package" install
    python -m build --wheel --no-isolation
}

package_liblnk-git() {
    provides=(liblnk liblnk.so)
    conflicts=(liblnk)

    cd "$srcdir/package"
    cp -a --parents \
        usr/lib \
        usr/include \
        usr/share/man/man3 \
        "$pkgdir"
    rm -rf "$pkgdir/usr/lib/python"*
}

package_liblnk-tools-git() {
    pkgdesc="Command line tools for liblnk"
    provides=(liblnk-tools)
    conflicts=(liblnk-tools)
    depends=(liblnk-git)

    cd "$srcdir/package"
    cp -a --parents usr/bin usr/share/man/man1 "$pkgdir"
}

package_python-liblnk-git() {
    pkgdesc="Python3 bindings for liblnk"
    provides=(python-liblnk pylnk)
    conflicts=(python-liblnk)
    depends=(python liblnk-git)

    cd "$pkgbase"
    python -m installer --destdir="$pkgdir" dist/*.whl
}