summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: c5bc748a3713e659567c490afc777742d7d0316b (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
# Maintainer: Dan Beste <dan.ray.beste@gmail.com>

# Previous maintainers:
# Maintainer : André Fettouhi <a.fettouhi@gmail.com>
# Contributor: mirandir <mirandir[at)orange(dot]com>

# TODO
#   1. Get the game working.
#       The game is currently unplayable. The launcher will boot, however the
#       game crashes when attempting to launch the game. I don't have too much
#       time to look into this _yet_, but some stracing may go a long way...

pkgname=gog-the-witcher-2-assassins-of-kings
pkgver=2.2.0.8
pkgrel=1
pkgdesc='Enjoy a captivating story, dynamic combat system and beautiful graphics in the second installment in the RPG saga about the Witcher, Geralt of Rivia.'
arch=(
    'i686'
    'x86_64'
)
depends_x86_64=(
    'freetype2'
    'gtk2'
    'sdl2'
    'sdl2_image'
)
depends_i686=(
    'lib32-freetype2'
    'lib32-gtk2'
    'lib32-sdl2'
    'lib32-sdl2_image'
)
url='http://thewitcher.com/en/witcher2'
license=(
    'custom'
)
groups=(
    'games'
    'gog'
)
source=(
    "gog://${pkgname//-/_}_enhanced_edition_${pkgver}.sh"
    "${pkgname}"
    "${pkgname}.desktop"
)
DLAGENTS=(
    "gog::/usr/bin/echo %u Download the GOG file to $PWD or set up a gog:// DLAGENT."
)
noextract=(
    "gog_the_witcher_2_assassins_of_kings_enhanced_edition_${pkgver}.sh"
)
sha256sums=(
    '6d6f519db92fe38219b9bb62a6d2dfff0a93e5c24f73cf69ba7d05071361f586'
    '32fd021d75ad3ed9e55e97b34d5ee08c2bde469028ddee410f933290d2998731'
    '9f56e0b94fcd60a179a158dac27051c526f0f27b2ebe4224ca68d6ecafee7d47'
)

prepare() {
    cd "${srcdir}" || exit 1
    # "The ~20GB workaround"
    #
    # prepare() may need some changes upstream... Unzip extracts file.sh fine.
    # Due to some "garbage" (shell script) at the beginning of file.sh, unzip
    # will exit with a reutn code of 1, causing prepare() to fail.
    #
    #The "sane" solution is to repackage file.sh into a "fixed" zip file:
    zip -FFv "../${source[0]}" --out "${pkgname}.zip"
    # Then unzip the result:
    unzip "${pkgname}.zip"
    # Then cleanup after ourselves:
    rm "${pkgname}.zip"
    # Fun...
}

package() { 
    cd "${srcdir}"

    # Install game
    install -d "${pkgdir}/opt/${pkgname}/"
    install -d "${pkgdir}/opt/${pkgname}/support"
    install -d "${pkgdir}/usr/bin/"
    cp -r "data/noarch/game/" "${pkgdir}/opt/${pkgname}/"


    find "${pkgdir}/opt/${pkgname}" -type d -exec chmod 755 {} \;
    install -Dm755 "data/noarch/start.sh"               \
        "${pkgdir}/opt/${pkgname}/"
    install -Dm755 data/noarch/support/*.{sh,shlib} -t  \
        "${pkgdir}/opt/${pkgname}/support"

    # Desktop integration
    install -Dm 644 "data/noarch/support/icon.png" \
        "${pkgdir}/usr/share/pixmaps/${pkgname}.png"
    install -Dm644 "data/noarch/docs/End User License Agreement.txt" \
        "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
    install -Dm 644 "${srcdir}/${pkgname}.desktop" \
        "${pkgdir}/usr/share/applications/${pkgname}.desktop"
    install -Dm755 "${srcdir}/${pkgname}" \
        "${pkgdir}/usr/bin/${pkgname}"
}