aboutsummarylogtreecommitdiffstats
path: root/PKGBUILD
blob: b10dcd44c9549633ce17342a95ddca0350cdd8e1 (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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# Maintainer: Clive Wright <seawright27@gmail.com>
# Contributor: Yuuki Galaxy <galaxy001@gmail.com>
# Contributor: Alex Wiggins <alex.d.wiggins@gmail.com>
# Contributor: Damian Nowak <damian.nowak@atlashost.eu>
# Contributor: Julian Rother <julian@toksik.org>
# Contributor: Sebastian Schwarz <seschwar@gmail.com>
# Contributor: Kyle Keen <keenerd@gmail.com>
# Contributor: Florian Pritz <bluewind@xinu.at>
# Contributor: Paulo Matias <matiasΘarchlinux-br·org>
# Contributor: Daniel J Griffiths <ghost1227@archlinux.us>

pkgbase=oss-git
pkgname=oss-git
true && pkgname=(oss-git libflashsupport-oss-git)
pkgver=5693e1e
pkgrel=2
arch=(i686 x86_64 pentium4)
url="http://developer.opensound.com/"
license=(GPL2)
makedepends=(git)
source=(oss::git://git.code.sourceforge.net/p/opensound/git
        oss4_sys-libs_glibc-2.23_ossdetect_fix_git.patch
        galaxy.patch
        oss.service
        remove-hal.patch
        rm-init-scripts.patch
        soundon.patch
        kmod-link.patch
        kmod-link2.patch
        ossvermagic.patch
        osscore.patch
        extramodules.patch)
sha512sums=('SKIP'
            '5599f75ac2784aca7d0367e88705938d2680e7a0eb7ae7300080e3fc0ea0c9d3b183554a9e208ed8359f675028024e8de62baa5f8dbc79e9f3bd942db6aa6157'
            'SKIP'
            '355e1380432947c0e9caa21114b2c3debeb162fb5abcf845125ec281ce52b437ad1ee1db04d37e9b7a5ac79816c4dcbc21b4ed4cf8191f71218d99acd7bab70e'
            '6956e5e2e9323b568bb18e80bbee591b0e5ffd3d4612a50df09879941b2733c31d6b3178dc9a46c283bd1629f76b7ff5e2b54893a42a47f6379eaee4731fd9be'
            '64e6d9d8eb5320f737d3a0698a245da2b2d141b68cfb2f02e448144d1c610aa8b8a6c38b56fcca364d63171a49afe93161a00545cdb90086b5328997b3096690'
            'a8196aeea43499f4822bad6adc8c7f8721eb122045732ab34bb675182a1c4403c3f4a30ead85188fdaec77ee79a5097dd8de84782f8915db4061157474b5c7c6'
            'f73b837643c7b86c5ce3a2ff18a66b99166d16ac7d1ac3d419b203efd8d398d8c4b21c304d6fa1c038ebf180ca0620d6517be384b307bb66e84a15b0339800df'
            '6cefeca6921916d2fbf7c4efd354d3c0b7f7285c6d049912bd318f0b520698a2de2a974604a56a7b288636939773ef49f022962bb88f9e3b5ea442462a50de1b'
            '5db4bb6d636983485bc56aa7dd83347de848624d4ff160c1ec77d7d21d22154be61cad393af2d772f58bca47494d853dd5b286e4820440bd339cbb6edd50d1db'
            '0ca7b5ce6e63aadcfef763d105fa141260c2db002dd587200ada6d1c8c0abd4fdc2ca728b76d638181504faf58df3edbacb39cda2a988e1dd13facd962792c9e'
            '0742a9400d6b683e3813cf1b1a1fb7f07dff22b6d26d47ca4e3d6179bc099044661c33e2d445a3fef278187d8dab90aae3323b4693e63383e03b9b5213bbc4a5')


pkgver() {
  cd "oss"
  git describe --always | sed 's/-/./g'
}

prepare() {
  cd "oss"

  # OSS wants an empty build directory
  rm -rf build
  mkdir build

  # make OSS compile with current Linux kernel
  # - no longer required from build 2010
  # patch -p0 < "$srcdir/linux-3.14.0.patch"
  # - no longer required (from commit c110e9)
  # patch -p1 < "$srcdir/linux-4.0.patch"
  # - no longer required (from commit 5d996a)
  # patch -p0 < "$srcdir/linux-4.6.patch"
  # - no longer required (from commit 891ddd)
  # patch -p0 < "$srcdir/linux-4.8-usercopy.patch"
  # - no longer required (from commit 218878) 
  # patch -p1 < "$srcdir/galaxy.patch"
  # - no longer required (from commit 4d221f) 
  # patch -p1 < "$srcdir/ossvermagic.patch"
  patch -p1 < "$srcdir/osscore.patch"
  patch -p1 < "$srcdir/extramodules.patch"

  # make OSS compile with glibc >= 2.23
  # - no longer required (from commit 3e7a6c)
  # patch -p1 < "$srcdir/oss4_sys-libs_glibc-2.23_ossdetect_fix_git.patch"

  # make OSS compile with gcc-5
  # - no longer required (from commit b3dc64)
  # patch -p0 < "$srcdir/gcc-5.patch"

  # remove outdated stuff
  cd setup/Linux
  patch -p2 < "$srcdir/rm-init-scripts.patch"
  rm oss/etc/S89oss
  patch -p2 < "$srcdir/remove-hal.patch"
  rm oss/scripts/*oss_usb-create-device*
  patch -p1 < "$srcdir/soundon.patch"

  # include conf directory in package so that
  # it is deleted when package is uninstalled.
  sed -i 's/conf.tmpl/conf/' build.sh 
  sed -i 's/conf.tmpl/conf/' build_arm.sh
  # FS#35672
  # - no longer required (from commit 3e7a6c)
  # mv oss/build/{osscore.c,osscore_wrapper.c}
  # patch -p3 < "$srcdir/kmod-link2.patch"
  # patch -p2 < "$srcdir/kmod-link.patch"
  cd ../..
}

build() {
  export CFLAGS=""
  cd "$srcdir/oss/build"
  ../configure --config-midi=YES
  make build
  gcc $CFLAGS -shared -fPIC -Wall -Werror oss/lib/flashsupport.c \
      -o libflashsupport.so
}

package_libflashsupport-oss-git() {
  pkgdesc="Adobe flash plugin support lib (OSSv4)"
  conflicts=(libflashsupport libflashsupport-oss libflashsupport-oss-nonfree libflashsupport-pulse)
  depends=(oss)

  install -dm755 "$pkgdir/usr/lib"
  ln -s oss/lib/libflashsupport.so "$pkgdir/usr/lib/libflashsupport.so"
}

package_oss-git() {
  pkgdesc="Open Sound System UNIX audio architecture"
  depends=(linux-headers)
  optdepends=('gtk2: for graphical mixer (ossxmix)'
              'libogg: for Ogg Vorbis support in ossplay'
              'libvorbis: for Ogg Vorbis support in ossplay'
              'libflashsupport-oss: Adobe flash plugin support')
  provides=(oss)
  conflicts=(oss oss-nonfree libflashsupport-oss libflashsupport-oss-nonfree)
  backup=(usr/lib/oss/soundon.user)
  install=oss.install

  cd "oss/build"
  make DESTDIR="$pkgdir/" copy
  install -Dm755 libflashsupport.so \
      "$pkgdir/usr/lib/oss/lib/libflashsupport.so"
  cd "$pkgdir"

  # usr-move fixes
  mv usr/sbin/* usr/bin
  rmdir usr/sbin
  grep -IlrZ '\<s\?bin\>' . \
      | xargs -0 sed -i 's,\<\(usr/\)\?s\?bin\>,usr/bin,g' --
  grep -IlrZ '\<lib/modules\>' . \
      | xargs -0 sed -i 's,\<\(usr/\)\?lib/modules\>,usr/&,g' --

  # make OSS install its modules to /usr/lib/modules/$KERNEL/extramodules/oss
  grep -IlrZ '\<usr/lib/modules/[^/]\+/kernel/oss\>' . \
      | xargs -0 sed -i 's,\<usr/lib/modules/\([^/]\+\)/kernel/oss\>,usr/lib/modules/\1/extramodules/oss,g' --

  chmod -R a+rX .  # FS#13815
  install -Dm644 "$srcdir/oss.service" usr/lib/systemd/system/oss.service
}