summaryrefslogtreecommitdiff
path: root/packages/media-gfx/wings/wings-2.1.7.exheres-0
blob: 1ab6278e6a295d2fa31dbe9a899e03433371164d (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
# Copyright 2015 Marvin Schmidt <marv@exherbo.org>
# Distributed under the terms of the GNU General Public License v2

require github [ user=dgud tag=v${PV} ] \
    freedesktop-desktop \
    gtk-icon-cache

SUMMARY="Wings 3D is an advanced subdivision modeler that is both powerful and easy to use"
HOMEPAGE+=" http://www.wings3d.com"

LICENCES="BSD-3"
SLOT="0"
PLATFORMS="~amd64"
MYOPTIONS="
    ( providers: graphicsmagick imagemagick ) [[
        number-selected = at-least-one
    ]]
"

DEPENDENCIES="
    build:
        providers:graphicsmagick? ( media-gfx/GraphicsMagick[imagemagick] )
        providers:imagemagick? ( media-gfx/ImageMagick )
    build+run:
        dev-erlang/erlang-cl
        dev-erlang/esdl[>=1.0.1]
        dev-lang/erlang[>=20.2][wxwidgets(-)]
        media-libs/SDL:0
"

src_prepare() {
    default

    # fix includes
    edo sed \
        -e '/include_lib/s|"wings/|"../|' \
        -i $(edo find . -name '*'.erl)

    # build flags
    edo sed \
        -e 's|-O3||g' \
        -e 's|-Werror||g' \
        -e 's|CFLAGS = |CFLAGS += |g' \
        -i $(edo find . -name Makefile)

    # fix version string
    edo sed \
        -e "s:v1.2.x.y.WINGS:${PV}:g" \
        -i WINGS-VERSION-GEN

    # create desktop icon
    edo convert win32/${PN}.ico win32/${PN}.png
}

src_compile() {
    ERL_PATH=$(/usr/bin/erl -noshell -eval 'io:format("~s", [code:lib_dir(esdl)]), halt().')

    emake ESDL_PATH=${ERL_PATH} unix
}

src_install() {
    WINGS_PATH=/usr/$(exhost --target)/lib/erlang/lib/${PNV}

    insinto ${WINGS_PATH}
    for subdir in ebin textures shaders ; do
        doins -r ${subdir}
    done

    insinto ${WINGS_PATH}/plugins/default
    doins -r plugins/*

    insinto ${WINGS_PATH}/ebin
    doins intl_tools/tools.beam

    newbin "${FILES}"/wings.sh wings

    insinto /usr/share/icons/hicolor/256x256/apps
    newins win32/${PN}-3.png ${PN}.png

    insinto /usr/share/applications
    hereins ${PN}.desktop <<EOF
[Desktop Entry]
Name=Wings 3D
Version=1.1
Exec=${PN}
Comment=A Polygon Modeler
Icon=${PN}
Type=Application
Terminal=false
StartupNotify=true
Categories=Graphics;3DGraphics;
EOF

    emagicdocs
}

pkg_postinst() {
    freedesktop-desktop_pkg_postinst
    gtk-icon-cache_pkg_postinst
}

pkg_postrm() {
    freedesktop-desktop_pkg_postrm
    gtk-icon-cache_pkg_postrm
}