Apply meson build 70/268070/15
authorSeungbae Shin <seungbae.shin@samsung.com>
Wed, 15 Dec 2021 14:55:32 +0000 (23:55 +0900)
committerSeungbae Shin <seungbae.shin@samsung.com>
Thu, 30 Dec 2021 07:39:20 +0000 (16:39 +0900)
Change-Id: Ic4a66d67dd67ad7b74aacc7b0b27b7d9eb537836

meson.build
meson_options.txt
packaging/pulseaudio.spec
src/daemon/meson.build
src/meson.build
src/modules/meson.build
src/pulsecore/meson.build
src/utils/meson.build

index 66b0b82..6fffdfc 100644 (file)
@@ -61,7 +61,9 @@ includedir = join_paths(prefix, get_option('includedir'))
 libdir = join_paths(prefix, get_option('libdir'))
 libexecdir = join_paths(prefix, get_option('libexecdir'))
 mandir = join_paths(prefix, get_option('mandir'))
-datadir = join_paths(prefix, get_option('datadir'))
+#datadir = join_paths(prefix, get_option('datadir'))
+#FIXME: meson.build:1:0: ERROR: The value of the 'datadir' option is '/hal/share' which must be a subdir of the prefix '/usr'.
+datadir = get_option('hal-datadir')
 localedir = join_paths(prefix, get_option('localedir'))
 localstatedir = join_paths(prefix, get_option('localstatedir'))
 sysconfdir = join_paths(prefix, get_option('sysconfdir'))
@@ -70,7 +72,8 @@ alsadatadir = join_paths(datadir, 'pulseaudio', 'alsa-mixer')
 
 pkgconfigdir = join_paths(libdir, 'pkgconfig')
 pulselibexecdir = join_paths(libexecdir, 'pulse')
-pulsesysconfdir = join_paths(sysconfdir, 'pulse')
+#pulsesysconfdir = join_paths(sysconfdir, 'pulse')
+pulsesysconfdir = join_paths(get_option('hal-sysconfdir'), 'pulse')
 
 modlibexecdir = get_option('modlibexecdir')
 if modlibexecdir == ''
@@ -88,6 +91,7 @@ if pulsedsp_location == ''
 endif
 
 systemduserunitdir = get_option('systemduserunitdir')
+systemdsystemunitdir = get_option('systemdsystemunitdir')
 # the default value is set below
 
 udevrulesdir = get_option('udevrulesdir')
@@ -508,6 +512,76 @@ else
   database_dep = dependency('', required: false)
 endif
 
+# TIZEN BUILD OPTION
+vconf_dep = dependency('vconf')
+if vconf_dep.found()
+  cdata.set('HAVE_VCONF', 1)
+endif
+
+dlog_dep = dependency('dlog', required : get_option('dlog'))
+if dlog_dep.found()
+  cdata.set('TIZEN_DLOG', 1)
+endif
+
+if get_option('buffer-attribute')
+  cdata.set('TIZEN_BUFFER_ATTR', 1)
+endif
+
+if get_option('udev-usb-only')
+  cdata.set('TIZEN_UDEV_USB_ONLY', 1)
+endif
+
+if get_option('pcm-dump')
+  cdata.set('TIZEN_PCM_DUMP', 1)
+endif
+
+if get_option('udev-usb-only')
+  cdata.set('TIZEN_UDEV_USB_ONLY', 1)
+endif
+
+if get_option('pa-ready')
+  cdata.set('TIZEN_PA_READY', 1)
+endif
+
+if get_option('pa-simple-extensions')
+  cdata.set('TIZEN_PA_SIMPLE_EXT', 1)
+endif
+
+if get_option('empty-pop')
+  cdata.set('TIZEN_EMPTY_POP', 1)
+endif
+
+if get_option('volume-ramp')
+  cdata.set('TIZEN_VOLUME_RAMP', 1)
+endif
+
+if get_option('individual-volume-ratio')
+  cdata.set('TIZEN_INDIVIDUAL_VOLUME_RATIO', 1)
+endif
+
+if get_option('filter-group')
+  cdata.set('TIZEN_FILTER_GROUP', 1)
+endif
+
+if get_option('prelink')
+  cdata.set('TIZEN_TV_PROD_PRELINK', 1)
+endif
+
+if get_option('lwipc')
+  cdata.set('TIZEN_TV_PROD_LWIPC', 1)
+endif
+
+enable_security = false
+cynara_client_dep = dependency('cynara-client', required : get_option('security'))
+cynara_creds_socket_dep = dependency('cynara-creds-socket', required : get_option('security'))
+cynara_session_dep = dependency('cynara-session', required : get_option('security'))
+if cynara_client_dep.found() and cynara_creds_socket_dep.found() and cynara_session_dep.found()
+  cdata.set('TIZEN_SECURITY', 1)
+  enable_security = true
+endif
+
+# TIZEN BUILD OPTION end
+
 if get_option('ipv6')
   cdata.set('HAVE_IPV6', 1)
 endif
@@ -586,6 +660,9 @@ systemd_dep = dependency('systemd', required : get_option('systemd'))
 if systemd_dep.found() and systemduserunitdir == ''
   systemduserunitdir = systemd_dep.get_pkgconfig_variable('systemduserunitdir')
 endif
+if systemd_dep.found() and systemdsystemunitdir == ''
+  systemdsystemunitdir = systemd_dep.get_pkgconfig_variable('systemdsystemunitdir')
+endif
 
 x11_dep = dependency('x11-xcb', required : get_option('x11'))
 if x11_dep.found()
@@ -598,8 +675,11 @@ endif
 
 # Module dependencies
 
-if cc.has_header('sys/soundcard.h')
+# OSS support : import from 15.0
+if cc.has_header('sys/soundcard.h', required: get_option('oss-output'))
+  # OSS output via daemon module-detect
   cdata.set('HAVE_OSS_OUTPUT', 1)
+  # OSS wrapper
   cdata.set('HAVE_OSS_WRAPPER', 1)
   cdata.set('PULSEDSP_LOCATION', pulsedsp_location)
 endif
@@ -643,7 +723,7 @@ if lirc_dep.found()
   cdata.set('HAVE_LIRC', 1)
 endif
 
-openssl_dep = dependency('openssl', version : '>= 0.9', required : get_option('openssl'))
+openssl_dep = dependency('openssl1.1', version : '>= 0.9', required : get_option('openssl'))
 if openssl_dep.found()
   cdata.set('HAVE_OPENSSL', 1)
 endif
@@ -704,10 +784,12 @@ pc_cdata.set('PA_MAJORMINOR', pa_version_major_minor)
 # get_configtool_variable() work with it, so we have no way to get this flag right,
 # unless we do all the work ourselves. See current work in glib, also meson #553.
 pc_cdata.set('PTHREAD_LIBS', '-pthread')
+pc_cdata.set('PA_DEFAULT_CONFIG_DIR', cdata.get_unquoted('PA_DEFAULT_CONFIG_DIR'))
 
 pc_files = [
   'libpulse.pc',
   'libpulse-simple.pc',
+  'pulsecore.pc',
 ]
 
 if glib_dep.found()
@@ -826,6 +908,20 @@ summary = [
 #  'Enable per-user EsounD socket: @0@'.format(${ENABLE_PER_USER_ESOUND_SOCKET}),
 #  'Force preopen:                 @0@'.format(${FORCE_PREOPEN}),
 #  'Preopened modules:             @0@'.format(${PREOPEN_MODS}),
+  '',
+  'Tizen options:',
+  '  dlog:                        @0@'.format(dlog_dep.found()),
+  '  buffer-attribute:            @0@'.format(get_option('buffer-attribute')),
+  '  pcm-dump:                    @0@'.format(get_option('pcm-dump')),
+  '  security:                    @0@'.format(enable_security),
+  '  udev-usb-only:               @0@'.format(get_option('udev-usb-only')),
+  '  pa-ready:                    @0@'.format(get_option('pa-ready')),
+  '  pa-simple-extensions:        @0@'.format(get_option('pa-simple-extensions')),
+  '  empty-pop:                   @0@'.format(get_option('empty-pop')),
+  '  volume-ramp:                 @0@'.format(get_option('volume-ramp')),
+  '  individual-volume-ratio:     @0@'.format(get_option('individual-volume-ratio')),
+  '  prelink (for TV):            @0@'.format(get_option('prelink')),
+  '  lwipc (for TV):              @0@'.format(get_option('lwipc')),
 ]
 
 message('\n    '.join(summary))
index 7668773..01b5cf7 100644 (file)
@@ -1,3 +1,48 @@
+option('dlog',
+       type : 'boolean', value : true,
+       description : 'dlog')
+option('buffer-attribute',
+       type : 'boolean', value : true,
+       description : 'buffer attribute')
+option('pcm-dump',
+       type : 'boolean', value : false,
+       description : 'pcm dump')
+option('security',
+       type : 'boolean', value : true,
+       description : 'security')
+option('udev-usb-only',
+       type : 'boolean', value : true,
+       description : 'udev usb only')
+option('pa-ready',
+       type : 'boolean', value : true,
+       description : 'pa ready')
+option('pa-simple-extensions',
+       type : 'boolean', value : true,
+       description : 'pa simple extensions')
+option('empty-pop',
+       type : 'boolean', value : true,
+       description : 'empty pop')
+option('volume-ramp',
+       type : 'boolean', value : true,
+       description : 'volume ramp')
+option('individual-volume-ratio',
+       type : 'boolean', value : true,
+       description : 'individual volume ratio')
+option('filter-group',
+       type : 'boolean', value : true,
+       description : 'filter group')
+option('prelink',
+       type : 'boolean', value : false,
+       description : 'prelink')
+option('lwipc',
+       type : 'boolean', value : false,
+       description : 'lwipc')
+option('hal-datadir',
+       type : 'string',
+       description : 'Directory for HAL data files')
+option('hal-sysconfdir',
+       type : 'string',
+       description : 'Directory for HAL sysconf files')
 option('gcov',
        type : 'boolean', value : false,
        description : 'Enable optional gcov coverage analysis')
@@ -18,7 +63,7 @@ option('access_group',
         type : 'string', value : 'pulse-access',
         description : 'Group which is allowed access to a system-wide PulseAudio daemon (pulse-access)')
 option('database',
-        type : 'combo', value : 'tdb',
+        type : 'combo',
         choices : [ 'gdbm', 'tdb', 'simple' ],
         description : 'Database backend')
 option('legacy-database-entry-format',
@@ -51,6 +96,9 @@ option('modlibexecdir',
 option('systemduserunitdir',
        type : 'string',
        description : 'Directory for systemd user service files')
+option('systemdsystemunitdir',
+       type : 'string',
+       description : 'Directory for systemd system service files')
 option('udevrulesdir',
        type : 'string',
        description : 'Directory for udev rules (defaults to /lib/udev/rules.d)')
@@ -91,7 +139,7 @@ option('glib',
        type : 'feature', value : 'auto',
        description : 'Optional GLib 2 support')
 option('gsettings',
-       type : 'feature', value : 'auto',
+       type : 'feature',
        description : 'Optional GSettings support')
 option('gtk',
        type : 'feature', value : 'auto',
@@ -114,6 +162,9 @@ option('openssl',
 option('orc',
        type : 'feature', value : 'auto',
        description : 'Optimized Inner Loop Runtime Compiler')
+option('oss-output',
+       type : 'feature', value : 'auto',
+       description : 'Optional OSS output support')
 option('samplerate',
        type : 'feature', value : 'disabled',
        description : 'Optional libsamplerate support (DEPRECATED)')
index c9edbd6..2ad973d 100644 (file)
@@ -1,4 +1,5 @@
 %define udev_dir %{_prefix}/lib/udev
+%global _vpath_builddir build
 
 Name:             pulseaudio
 Summary:          Improved Linux sound server
@@ -13,6 +14,7 @@ BuildRequires:    libtool-ltdl-devel
 BuildRequires:    libtool
 BuildRequires:    intltool
 BuildRequires:    fdupes
+BuildRequires:    meson >= 0.50.0
 BuildRequires:    pkgconfig(speexdsp)
 BuildRequires:    pkgconfig(sndfile)
 BuildRequires:    pkgconfig(alsa)
@@ -184,57 +186,35 @@ export CFLAGS+=" -DTIZEN_TV_PROD "
 %endif
 
 export LD_AS_NEEDED=0
-NOCONFIGURE=yes ./bootstrap.sh
-%configure --prefix=%{_prefix} \
-        --datadir=%{_hal_datadir} \
-        --disable-static \
-        --enable-alsa \
-        --disable-ipv6 \
-        --disable-oss-output \
-        --disable-oss-wrapper \
-        --disable-esound \
-        --disable-per-user-esound-socket \
-        --disable-x11 \
-        --disable-hal-compat \
-        --disable-lirc \
-        --disable-avahi \
-        --disable-jack \
-        --without-fftw \
-        --disable-systemd-login \
-        --disable-gconf \
-        --disable-gsettings \
-        --with-udev-rules-dir=%{udev_dir}/rules.d \
-        --with-system-user=pulse \
-        --with-system-group=pulse \
-        --with-access-group=pulse-access \
-        --enable-dlog \
-        --enable-buffer-attr \
-        --disable-pcm-dump \
-        --enable-security \
-        --enable-udev-with-usb-only \
-        --enable-paready \
-        --enable-pa-simple-ext \
-        --enable-empty-pop \
-%{?asan: --disable-neon-opt } \
-        --enable-filter-group \
-        --enable-volume-ramp \
-        --enable-individual-volume-ratio \
-%if "%{tizen_profile_name}" == "tv"
-        --enable-prelink \
-        --enable-lwipc \
+
+mkdir -p %{_vpath_builddir}
+%meson --auto-feature=auto \
+    -Dhal-datadir=%{_hal_datadir} \
+    -Dhal-sysconfdir=%{_hal_sysconfdir} \
+    -Dtests=false \
+    -Ddatabase=simple \
+    -Dbluez5-native-headset=false \
+    -Dgsettings=disabled \
+    -Dhal-compat=false \
+    -Dipv6=false \
+ %if "%{tizen_profile_name}" == "tv"
+    -Dprelink=true \
+    -Dlwipc=true \
 %endif
-        hal_sysconfdir=%{_hal_sysconfdir}
+    -Doss-output=disabled \
+    -Dudevrulesdir=%{udev_dir}/rules.d
 
-%__make %{?_smp_mflags} V=0
+%meson_build
 
 %install
-%make_install
+%meson_install
 %find_lang %{name}
 
 rm -rf  %{buildroot}%{_sysconfdir}/xdg/autostart/pulseaudio-kde.desktop
 rm -rf  %{buildroot}%{_bindir}/start-pulseaudio-kde
 rm -rf  %{buildroot}%{_bindir}/start-pulseaudio-x11
-rm -rf %{buildroot}%{_libdir}/pulse-%{version}/modules/module-device-manager.so
+rm -rf  %{buildroot}%{_libdir}/pulse-%{version}/modules/module-device-manager.so
+rm -rf  %{buildroot}%{_libdir}/pulse-%{version}/modules/module-systemd-login.so
 mkdir -p %{buildroot}%{_includedir}/pulsecore/filter
 cp %{buildroot}%{_includedir}/pulsecore/lfe-filter.h %{buildroot}%{_includedir}/pulsecore/filter
 
index 9bc3bf1..5416dd7 100644 (file)
@@ -157,3 +157,16 @@ if systemd_dep.found()
     install_dir: systemduserunitdir,
   )
 endif
+
+if systemd_dep.found()
+  sd_system_service_conf = configuration_data()
+  sd_system_service_conf.set('PA_BINARY', cdata.get_unquoted('PA_BINARY'))
+
+  sd_system_service_file = configure_file(
+    input : 'systemd/system/pulseaudio.service.in',
+    output : 'pulseaudio.service',
+    configuration : sd_system_service_conf,
+    install : true,
+    install_dir : systemdsystemunitdir,
+  )
+endif
index c9b71a4..9f5d62f 100644 (file)
@@ -183,7 +183,7 @@ libpulsecommon = shared_library('pulsecommon-' + pa_version_major_minor,
   install_dir : privlibdir,
   dependencies : [
     libm_dep, thread_dep, dl_dep, shm_dep, iconv_dep, sndfile_dep, dbus_dep,
-    x11_dep, libsystemd_dep, glib_dep, gtk_dep, asyncns_dep
+    x11_dep, libsystemd_dep, glib_dep, gtk_dep, asyncns_dep, dlog_dep
   ],
   implicit_include_directories : false)
 
index 92d5871..fabc120 100644 (file)
@@ -56,9 +56,9 @@ all_modules = [
   [ 'module-switch-on-connect', 'module-switch-on-connect.c' ],
   [ 'module-switch-on-port-available', 'module-switch-on-port-available.c' ],
   [ 'module-tunnel-sink', 'module-tunnel.c', [], [], [x11_dep] ],
-  [ 'module-tunnel-sink-new', 'module-tunnel-sink-new.c' ],
+  [ 'module-tunnel-sink-new', 'module-tunnel-sink-new.c', [], [], [vconf_dep] ],
   [ 'module-tunnel-source', 'module-tunnel.c', [], [], [x11_dep] ],
-  [ 'module-tunnel-source-new', 'module-tunnel-source-new.c' ],
+  [ 'module-tunnel-source-new', 'module-tunnel-source-new.c', [], [], [vconf_dep] ],
   [ 'module-virtual-sink', 'module-virtual-sink.c' ],
   [ 'module-virtual-source', 'module-virtual-source.c' ],
   [ 'module-virtual-surround-sink', 'module-virtual-surround-sink.c' ],
@@ -74,7 +74,7 @@ if cc.has_header('linux/input.h')
   ]
 endif
 
-if cc.has_header('sys/soundcard.h')
+if cdata.has('HAVE_OSS_OUTPUT')
   subdir('oss')
   all_modules += [
     [ 'module-oss', 'oss/module-oss.c', [], [], [], liboss_util ],
index 19f6b9e..6a4c801 100644 (file)
@@ -132,6 +132,11 @@ if dbus_dep.found()
   ]
 endif
 
+if enable_security
+  libpulsecore_sources += ['cynara.c']
+  libpulsecore_headers += ['cynara.h']
+endif
+
 if samplerate_dep.found()
   libpulsecore_sources += ['resampler/libsamplerate.c']
 endif
@@ -198,11 +203,16 @@ libpulsecore = shared_library('pulsecore-' + pa_version_major_minor,
   install_rpath : privlibdir,
   install_dir : privlibdir,
   link_with : libpulsecore_simd_lib,
-  dependencies : [libm_dep, libpulsecommon_dep, libpulse_dep, ltdl_dep, shm_dep, sndfile_dep, database_dep, dbus_dep, libatomic_ops_dep, orc_dep, samplerate_dep, soxr_dep, speex_dep, x11_dep],
+  dependencies : [libm_dep, libpulsecommon_dep, libpulse_dep, ltdl_dep, shm_dep, sndfile_dep, database_dep, dbus_dep, libatomic_ops_dep, orc_dep, samplerate_dep, soxr_dep, speex_dep, x11_dep, cynara_client_dep, cynara_creds_socket_dep, cynara_session_dep],
   implicit_include_directories : false)
 
 libpulsecore_dep = declare_dependency(link_with: libpulsecore)
 
+install_data(
+  libpulsecore_headers,
+  install_dir : join_paths(includedir, 'pulsecore')
+)
+
 # Internal libraries for modules
 # TODO: understand 'c_args' and 'dependencies' better, maybe we can remove some
 
index d00e030..d902979 100644 (file)
@@ -82,7 +82,7 @@ if x11_dep.found()
   )
 endif
 
-if cc.has_header('sys/soundcard.h')
+if cdata.has('HAVE_OSS_WRAPPER')
   libpulsecommon_sources = [
     'padsp.c',
   ]