archrelease: copy trunk to community-x86_64
[ArchLinux/community.git] / fltk / repos / community-x86_64 / PKGBUILD
blobe85936e2dff0d025289b8b999a9d2fce91fd0066
1 # Maintainer: David Runge <dvzrv@archlinux.org>
3 pkgbase=fltk
4 pkgname=(fltk fltk-docs)
5 pkgver=1.3.8
6 pkgrel=2
7 pkgdesc="Graphical user interface toolkit for X"
8 arch=(x86_64)
9 license=(custom:FLTK)
10 url="https://www.fltk.org/"
11 makedepends=(
12   alsa-lib
13   cmake
14   doxygen
15   fontconfig
16   libglvnd
17   libjpeg-turbo
18   libpng
19   libx11
20   libxcursor
21   libxfixes
22   libxft
23   libxinerama
24   libxrender
25   mesa
27 source=(https://github.com/$pkgbase/$pkgbase/archive/release-$pkgver/$pkgbase-release-$pkgver.tar.gz)
28 sha512sums=('197848d3b80a65cca936daf4f0b74609f0fe8332a4cd11af53385fb2aa45ad698b1e239a48732b118cd3cb189bc531711b72fb2eeeb85be887dc6c5a558fa4b3')
29 b2sums=('d0a963a38b62ea8cf1d5fe57fab6664fc64083ff41f17847d737f71bfff08578c682deefb9847a9ab5b93210fce2afbfc2020bdfcde714947beac9b3f7c84358')
31 _pick() {
32   local p="$1" f d; shift
33   for f; do
34     d="$srcdir/$p/${f#$pkgdir/}"
35     mkdir -p "$(dirname "$d")"
36     mv "$f" "$d"
37     rmdir -p --ignore-fail-on-non-empty "$(dirname "$f")"
38   done
41 build() {
42   local cmake_options=(
43     -B build
44     -D CMAKE_INSTALL_PREFIX=/usr
45     -D CMAKE_BUILD_TYPE=None
46     -D FLTK_LIBDIR=/usr/lib
47     -D OPTION_BUILD_SHARED_LIBS=ON
48     -D OPTION_BUILD_HTML_DOCUMENTATION=ON
49     -D OPTION_INSTALL_HTML_DOCUMENTATION=ON
50     -S $pkgbase-release-$pkgver
51     -W no-dev
52   )
54   # fat-lto-objects is required for non-mangled .a files in fltk
55   CFLAGS+=" -ffat-lto-objects"
56   CXXFLAGS+=" -ffat-lto-objects"
58   cmake "${cmake_options[@]}"
59   cmake --build build --verbose
60   # build documentation explicitly as it is otherwise not generated/ installed
61   make VERBOSE=1 -C build/documentation html
64 check() {
65   ctest --test-dir build --output-on-failure
68 package_fltk() {
69   depends=(
70     gcc-libs
71     glibc
72     hicolor-icon-theme
73     fontconfig libfontconfig.so
74     libglvnd
75     libjpeg-turbo
76     libpng
77     libx11
78     libxcursor
79     libxext
80     libxfixes
81     libxft
82     libxinerama
83     libxrender
84     sh
85   )
86   provides=(
87     libfltk_images.so
88     libfltk_gl.so
89     libfltk_forms.so
90     libfltk.so
91   )
92   options=(
93     !docs
94     staticlibs
95   )
97   DESTDIR="$pkgdir" cmake --install build
98   install -vDm 644 $pkgbase-release-$pkgver/COPYING -t "$pkgdir/usr/share/licenses/$pkgname/"
100   # remove man pages of examples
101   rm -rvf "$pkgdir/usr/share/man/man6"
103   (
104     cd "$pkgdir"
105     _pick $pkgbase-docs usr/share/doc/$pkgname/html
106   )
109 package_fltk-docs() {
110   pkgdesc+=" - documentation"
112   mv -v $pkgname/* "$pkgdir"
113   install -vDm 644 $pkgbase-release-$pkgver/COPYING -t "$pkgdir/usr/share/licenses/$pkgname/"