Mercurial > vanilla
annotate multimedia/sfml/sfml.sh @ 1149:ee4b956157fe
kernel/linux-headers: rename from lib/linux-headers
author | David Demelier <markand@malikania.fr> |
---|---|
date | Wed, 25 Sep 2019 21:10:00 +0200 |
parents | af9e47ff06b8 |
children | 6710613b88b9 |
rev | line source |
---|---|
1117
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
1 #!/bin/sh |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
2 # |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
3 # Copyright (c) 2019 David Demelier <markand@malikania.fr> |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
4 # |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
5 # Permission to use, copy, modify, and/or distribute this software for any |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
6 # purpose with or without fee is hereby granted, provided that the above |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
7 # copyright notice and this permission notice appear in all copies. |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
8 # |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
9 # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
10 # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
11 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
12 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
13 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
14 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
15 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
16 # |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
17 |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
18 PKGNAME=sfml |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
19 PKGVERSION=2.5.1 |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
20 PKGREVISION=1 |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
21 PKGLICENSE="ZLIB" |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
22 PKGSUMMARY="Simple and Fast Multimedia Library" |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
23 PKGDOWNLOAD="https://www.sfml-dev.org/files/SFML-$PKGVERSION-sources.zip" |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
24 PKGDEPENDS="cmake:build unzip:build" |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
25 PKGOPTIONS="WINDOW GRAPHICS AUDIO NETWORK" |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
26 |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
27 : ${CC:=clang} |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
28 : ${CFLAGS:=-O2} |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
29 : ${CXX:=clang++} |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
30 : ${CXXFLAGS:=-O2} |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
31 : ${AUDIO:=yes} |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
32 : ${GRAPHICS:=yes} |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
33 : ${NETWORK:=yes} |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
34 : ${WINDOW:=yes} |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
35 |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
36 if [ "$AUDIO" = "yes" ]; then |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
37 PKGDEPENDS="flac libogg libvorbis openal-soft $PKGDEPENDS" |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
38 with_audio="-DSFML_BUILD_AUDIO=On" |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
39 else |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
40 with_audio="-DSFML_BUILD_AUDIO=Off" |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
41 fi |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
42 |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
43 # Both Window and Graphics component require mesa |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
44 if [ "$GRAPHICS" = "yes" ] || [ "$WINDOW" = "yes" ]; then |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
45 PKGDEPENDS="mesa libx11 libxrandr $PKGDEPENDS" |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
46 fi |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
47 |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
48 if [ "$GRAPHICS" = "yes" ]; then |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
49 PKGDEPENDS="freetype libjpeg-turbo libpng $PKGDEPENDS" |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
50 with_graphics="-DSFML_BUILD_GRAPHICS=On" |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
51 else |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
52 with_graphics="-DSFML_BUILD_GRAPHICS=Off" |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
53 fi |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
54 |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
55 if [ "$NETWORK" = "yes" ]; then |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
56 with_network="-DSFML_BUILD_NETWORK=On" |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
57 else |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
58 with_network="-DSFML_BUILD_NETWORK=Off" |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
59 fi |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
60 |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
61 if [ "$WINDOW" = "yes" ]; then |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
62 PKGDEPENDS="eudev $PKGDEPENDS" |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
63 with_window="-DSFML_BUILD_WINDOW=On" |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
64 else |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
65 with_window="-DSFML_BUILD_WINDOW=Off" |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
66 fi |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
67 |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
68 build() |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
69 { |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
70 rm -rf SFML-$PKGVERSION |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
71 unzip SFML-$PKGVERSION-sources.zip |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
72 cd SFML-$PKGVERSION |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
73 |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
74 mkdir build && cd build |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
75 cmake .. \ |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
76 -DBUILD_SHARED_LIBS=On \ |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
77 -DCMAKE_BUILD_TYPE=Release \ |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
78 -DCMAKE_CXX_COMPILER="$CXX" \ |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
79 -DCMAKE_CXX_FLAGS="$CXXFLAGS" \ |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
80 -DCMAKE_C_COMPILER="$CC" \ |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
81 -DCMAKE_C_FLAGS="$CFLAGS" \ |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
82 -DCMAKE_INSTALL_PREFIX= \ |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
83 -DSFML_USE_SYSTEM_DEPS=On \ |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
84 -DSFML_PKGCONFIG_INSTALL_PREFIX=/lib/pkgconfig \ |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
85 $with_audio \ |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
86 $with_graphics \ |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
87 $with_network \ |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
88 $with_window |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
89 make VERBOSE=1 |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
90 make install DESTDIR=$DESTDIR |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
91 cd .. |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
92 |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
93 cd .. |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
94 rm -rf SFML-$PKGVERSION |
af9e47ff06b8
graphics/sfml: initial import, closes #1602
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
95 } |