diff --git a/libs/spice/Makefile b/libs/spice/Makefile index 888c2cfbd..55d08d6b8 100644 --- a/libs/spice/Makefile +++ b/libs/spice/Makefile @@ -9,20 +9,22 @@ include $(TOPDIR)/rules.mk PKG_NAME:=spice PKG_VERSION:=0.14.3 -PKG_RELEASE:=2 +PKG_RELEASE:=3 + PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=https://www.spice-space.org/download/releases/spice-server PKG_HASH:=551d4be4a07667cf0543f3c895beb6da8a93ef5a9829f2ae47817be5e616a114 + +PKG_MAINTAINER:=Yousong Zhou PKG_LICENSE:=LGPL-2.1-only PKG_LICENSE_FILES:=COPYING -PKG_INSTALL:=1 -PKG_MAINTAINER:=Yousong Zhou -PKG_FIXUP:=autoreconf -PKG_BUILD_DEPENDS+=spice-protocol +PKG_INSTALL:=1 +PKG_BUILD_DEPENDS:=spice-protocol include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/nls.mk +include ../../devel/meson/meson.mk define Package/libspice-server SECTION:=libs @@ -32,30 +34,46 @@ define Package/libspice-server DEPENDS:=+glib2 +libjpeg +libopenssl +pixman +zlib endef -define Package/libspice-server/install - $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_INSTALL_DIR)/usr/lib/libspice-server.so* $(1)/usr/lib -endef +# audio codec +MESON_ARGS += \ + -Dcelt051=disabled \ + -Dopus=disabled \ + +MESON_ARGS += \ + -Dgstreamer=no \ + -Dlz4=false \ + -Dsasl=false \ + -Dsmartcard=disabled \ + -Dalignment-checks=false \ + -Dextra-checks=false \ + -Dstatistics=false \ + -Dmanual=false \ + -Dinstrumentation=no \ + +MESON_ARGS += \ + -Dspice-common:alignment-checks=false \ + -Dspice-common:extra-checks=false \ + -Dspice-common:celt051=disabled \ + -Dspice-common:opus=disabled \ + -Dspice-common:instrumentation=no \ + -Dspice-common:smartcard=disabled \ + -Dspice-common:python-checks=false \ + -Dspice-common:manual=false \ + -Dspice-common:generate-code=none \ + -Dspice-common:tests=false \ define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include/spice-server + $(CP) $(PKG_INSTALL_DIR)/usr/include/spice-server/*.h $(1)/usr/include/spice-server $(INSTALL_DIR) $(1)/usr/lib - $(INSTALL_DIR) $(1)/usr/include - $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include - $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libspice-server.* $(1)/usr/lib + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/spice-server.pc $(1)/usr/lib/pkgconfig endef -# audio codec -CONFIGURE_ARGS += \ - --disable-opus \ - --disable-celt051 \ - -CONFIGURE_ARGS += \ - --disable-lz4 \ - --disable-manual \ - --disable-gstreamer \ - --disable-smartcard \ - --disable-statistics \ - --without-sasl \ - --disable-silent-rules \ +define Package/libspice-server/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libspice-server.so* $(1)/usr/lib +endef $(eval $(call BuildPackage,libspice-server)) diff --git a/libs/spice/patches/0001-build-skip-tests.patch b/libs/spice/patches/0001-build-skip-tests.patch deleted file mode 100644 index d79c33772..000000000 --- a/libs/spice/patches/0001-build-skip-tests.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 9380ff5a8849ea5a772958b5dcfc5462182f1597 Mon Sep 17 00:00:00 2001 -From: Yousong Zhou -Date: Fri, 20 Mar 2020 17:06:31 +0800 -Subject: [PATCH] build: skip tests - -Tests build can fail for arc700 for the following causes - - - Missing -stack-protector-all argument when building test progs - - Missing linker flag -lgmodule-2.0 -lffi - -Signed-off-by: Yousong Zhou ---- - server/Makefile.am | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/server/Makefile.am b/server/Makefile.am -index 2d148c14..5b927a1b 100644 ---- a/server/Makefile.am -+++ b/server/Makefile.am -@@ -1,5 +1,5 @@ - NULL = --SUBDIRS = . tests -+SUBDIRS = . - - check-valgrind: - $(MAKE) -C tests check-valgrind diff --git a/libs/spice/patches/0002-build-tools-fix-build-failure.patch b/libs/spice/patches/0002-build-tools-fix-build-failure.patch deleted file mode 100644 index 2a1237233..000000000 --- a/libs/spice/patches/0002-build-tools-fix-build-failure.patch +++ /dev/null @@ -1,24 +0,0 @@ -From d37fe6af97a45f0567c47932fd5c66d451fcb128 Mon Sep 17 00:00:00 2001 -From: Yousong Zhou -Date: Fri, 20 Mar 2020 17:07:03 +0800 -Subject: [PATCH] build: tools: fix build failure - -Tools build can fail because -stack-protector-all is missing - -Signed-off-by: Yousong Zhou ---- - tools/Makefile.am | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/tools/Makefile.am b/tools/Makefile.am -index 702fcdd1..7dc70c4e 100644 ---- a/tools/Makefile.am -+++ b/tools/Makefile.am -@@ -8,6 +8,7 @@ AM_CPPFLAGS = \ - - AM_LDFLAGS = \ - $(LIBRT) \ -+ $(WARN_LDFLAGS) \ - $(NULL) - - if !OS_WIN32 diff --git a/libs/spice/patches/010-librt-libm.patch b/libs/spice/patches/010-librt-libm.patch new file mode 100644 index 000000000..69f64913b --- /dev/null +++ b/libs/spice/patches/010-librt-libm.patch @@ -0,0 +1,28 @@ +From 26bbb85c150f882c05399e4c574208b8b1242082 Mon Sep 17 00:00:00 2001 +From: James Le Cuirot +Date: Tue, 7 Apr 2020 19:32:15 +0100 +Subject: [PATCH] build: Fix librt and libm dependencies in Meson + +They need to be requested without the lib prefix, otherwise a +generated pkg-config file ends up with absolute paths instead of -l +flags. + +Signed-off-by: James Le Cuirot +Acked-by: Frediano Ziglio +--- + meson.build | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/meson.build b/meson.build +index 1685c077..f9090a82 100644 +--- a/meson.build ++++ b/meson.build +@@ -102,7 +102,7 @@ foreach dep : ['libjpeg', 'zlib'] + endforeach + + if host_machine.system() != 'windows' +- foreach dep : ['librt', 'libm'] ++ foreach dep : ['rt', 'm'] + spice_server_deps += compiler.find_library(dep) + endforeach + else diff --git a/libs/spice/patches/020-no-code-generation.patch b/libs/spice/patches/020-no-code-generation.patch new file mode 100644 index 000000000..ec4cd62fa --- /dev/null +++ b/libs/spice/patches/020-no-code-generation.patch @@ -0,0 +1,155 @@ +From 713a3e09fbd5948823ac0c396249537329b878e4 Mon Sep 17 00:00:00 2001 +From: Frediano Ziglio +Date: Thu, 12 Mar 2020 03:45:54 +0000 +Subject: [PATCH] build: Allow to build disabling code generation + +Reduce dependencies if used by agents which do not need +marshallers/demarshallers code. + +Signed-off-by: Frediano Ziglio +--- + common/meson.build | 28 +++++++++++++++------------- + meson.build | 24 +++++++++++++----------- + meson_options.txt | 2 +- + tests/meson.build | 34 ++++++++++++++++++---------------- + 4 files changed, 47 insertions(+), 41 deletions(-) + +diff --git a/common/meson.build b/common/meson.build +index 7356cc0..14bf242 100644 +--- a/subprojects/spice-common/common/meson.build ++++ b/subprojects/spice-common/common/meson.build +@@ -67,19 +67,21 @@ spice_common_dep = declare_dependency(link_with : spice_common_lib, + + + # client_demarshallers +-codegen_cmd = [python, spice_codegen] +-codegen_args = ['--generate-demarshallers', +- '--client', +- '--include', 'common/messages.h', +- '--generated-declaration-file', '@OUTPUT1@', +- '@INPUT@', '@OUTPUT0@'] +- +-client_demarshallers = custom_target('client_demarshallers', +- input : [spice_proto], +- output : ['generated_client_demarshallers.c', 'generated_messages.h'], +- install : false, +- command : [codegen_cmd, codegen_args], +- depend_files : [spice_codegen_files, 'messages.h']) ++if spice_common_generate_client_code or spice_common_generate_server_code ++ codegen_cmd = [python, spice_codegen] ++ codegen_args = ['--generate-demarshallers', ++ '--client', ++ '--include', 'common/messages.h', ++ '--generated-declaration-file', '@OUTPUT1@', ++ '@INPUT@', '@OUTPUT0@'] ++ ++ client_demarshallers = custom_target('client_demarshallers', ++ input : [spice_proto], ++ output : ['generated_client_demarshallers.c', 'generated_messages.h'], ++ install : false, ++ command : [codegen_cmd, codegen_args], ++ depend_files : [spice_codegen_files, 'messages.h']) ++endif + + # + # libspice-common-client +diff --git a/meson.build b/meson.build +index 41a9419..b60a9fe 100644 +--- a/subprojects/spice-common/meson.build ++++ b/subprojects/spice-common/meson.build +@@ -119,17 +119,19 @@ foreach dep, version : optional_deps + endforeach + + # Python +-py_module = import('python') +-python = py_module.find_installation() +- +-if get_option('python-checks') +- foreach module : ['six', 'pyparsing'] +- message('Checking for python module @0@'.format(module)) +- cmd = run_command(python, '-m', module) +- if cmd.returncode() != 0 +- error('Python module @0@ not found'.format(module)) +- endif +- endforeach ++if spice_common_generate_client_code or spice_common_generate_server_code ++ py_module = import('python') ++ python = py_module.find_installation() ++ ++ if get_option('python-checks') ++ foreach module : ['six', 'pyparsing'] ++ message('Checking for python module @0@'.format(module)) ++ cmd = run_command(python, '-m', module) ++ if cmd.returncode() != 0 ++ error('Python module @0@ not found'.format(module)) ++ endif ++ endforeach ++ endif + endif + + # smartcard check +diff --git a/meson_options.txt b/meson_options.txt +index d30858f..d93d74b 100644 +--- a/subprojects/spice-common/meson_options.txt ++++ b/subprojects/spice-common/meson_options.txt +@@ -39,7 +39,7 @@ option('manual', + + option('generate-code', + type : 'combo', +- choices : ['all', 'server', 'client'], ++ choices : ['all', 'server', 'client', 'none'], + description : 'Which code should be built') + + option('tests', +diff --git a/tests/meson.build b/tests/meson.build +index d315056..1ad5bc5 100644 +--- a/subprojects/spice-common/tests/meson.build ++++ b/subprojects/spice-common/tests/meson.build +@@ -20,26 +20,28 @@ endforeach + # + # test_marshallers + # +-test_proto = files('test-marshallers.proto') ++if spice_common_generate_client_code or spice_common_generate_server_code ++ test_proto = files('test-marshallers.proto') + +-test_marshallers_sources = ['test-marshallers.c', 'test-marshallers.h'] ++ test_marshallers_sources = ['test-marshallers.c', 'test-marshallers.h'] + +-targets = [ +- ['test_marshallers', test_proto, 'generated_test_marshallers.c', ['--generate-marshallers', '--server', '--include', 'test-marshallers.h', '@INPUT@', '@OUTPUT@']], +- ['test_marshallers_h', test_proto, 'generated_test_marshallers.h', ['--generate-marshallers', '--server', '--include', 'test-marshallers.h', '-H', '@INPUT@', '@OUTPUT@']], +- ['test_demarshallers', test_proto, 'generated_test_demarshallers.c', ['--generate-demarshallers', '--client', '--include', 'test-marshallers.h', '@INPUT@', '@OUTPUT@']], +- ['test_enums_h', test_proto, 'generated_test_enums.h', ['-e', '@INPUT@', '@OUTPUT@']], +-] ++ targets = [ ++ ['test_marshallers', test_proto, 'generated_test_marshallers.c', ['--generate-marshallers', '--server', '--include', 'test-marshallers.h', '@INPUT@', '@OUTPUT@']], ++ ['test_marshallers_h', test_proto, 'generated_test_marshallers.h', ['--generate-marshallers', '--server', '--include', 'test-marshallers.h', '-H', '@INPUT@', '@OUTPUT@']], ++ ['test_demarshallers', test_proto, 'generated_test_demarshallers.c', ['--generate-demarshallers', '--client', '--include', 'test-marshallers.h', '@INPUT@', '@OUTPUT@']], ++ ['test_enums_h', test_proto, 'generated_test_enums.h', ['-e', '@INPUT@', '@OUTPUT@']], ++ ] + +-foreach t : targets +- cmd = [python, spice_codegen] + t[3] +- test_marshallers_sources += custom_target(t[0], input: t[1], output : t[2], command: cmd, depend_files : spice_codegen_files) +-endforeach ++ foreach t : targets ++ cmd = [python, spice_codegen] + t[3] ++ test_marshallers_sources += custom_target(t[0], input: t[1], output : t[2], command: cmd, depend_files : spice_codegen_files) ++ endforeach + +-test('test_marshallers', +- executable('test_marshallers', test_marshallers_sources, +- dependencies : spice_common_dep, +- install : false)) ++ test('test_marshallers', ++ executable('test_marshallers', test_marshallers_sources, ++ dependencies : spice_common_dep, ++ install : false)) ++endif + + # + # test_quic +-- +GitLab + diff --git a/libs/spice/patches/030-include-generated-code.patch b/libs/spice/patches/030-include-generated-code.patch new file mode 100644 index 000000000..a6caf2707 --- /dev/null +++ b/libs/spice/patches/030-include-generated-code.patch @@ -0,0 +1,36 @@ +From 0ce9cecd0912f78b75600f3f428bdd943bf9622b Mon Sep 17 00:00:00 2001 +From: Rosen Penev +Date: Fri, 9 Oct 2020 04:19:01 -0700 +Subject: [PATCH] don't regenerate [de]marshallers + +The release tarballs already include these files. + +Signed-off-by: Rosen Penev +--- + subprojects/spice-common/common/meson.build | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + +diff --git a/subprojects/spice-common/common/meson.build b/subprojects/spice-common/common/meson.build +index 7356cc0..5796989 100644 +--- a/subprojects/spice-common/common/meson.build ++++ b/subprojects/spice-common/common/meson.build +@@ -180,6 +180,19 @@ if spice_common_generate_server_code + endif + endforeach + ++ spice_common_server_lib = static_library('spice-common-server', spice_common_server_sources, ++ install : false, ++ dependencies : spice_common_dep) ++ ++ spice_common_server_dep = declare_dependency(sources : spice_common_server_dep_sources, ++ link_with : spice_common_server_lib, ++ dependencies : spice_common_dep) ++else ++ spice_common_server_sources = ['generated_server_marshallers.c', 'generated_server_marshallers.h'] ++ spice_common_server_sources += ['generated_server_demarshallers.c'] ++ spice_common_server_dep_sources = ['generated_server_marshallers.c', 'generated_server_marshallers.h'] ++ spice_common_server_dep_sources += ['generated_server_demarshallers.c'] ++ + spice_common_server_lib = static_library('spice-common-server', spice_common_server_sources, + install : false, + dependencies : spice_common_dep) diff --git a/libs/spice/patches/040-only-server.patch b/libs/spice/patches/040-only-server.patch new file mode 100644 index 000000000..dd2076fe4 --- /dev/null +++ b/libs/spice/patches/040-only-server.patch @@ -0,0 +1,19 @@ +--- a/meson.build ++++ b/meson.build +@@ -192,8 +192,6 @@ add_project_arguments(compiler.get_supported_arguments(spice_server_global_cflag + # Subdirectories + # + subdir('server') +-subdir('tools') +-subdir('docs') + + # + # write config.h +--- a/server/meson.build ++++ b/server/meson.build +@@ -186,5 +186,3 @@ spice_server_libs = both_libraries('spice-server', spice_server_sources, + + spice_server_shared_lib = spice_server_libs.get_shared_lib() + spice_server_static_lib = spice_server_libs.get_static_lib() +- +-subdir('tests') diff --git a/libs/spice/patches/050-no-mkenums.patch b/libs/spice/patches/050-no-mkenums.patch new file mode 100644 index 000000000..23cd486d2 --- /dev/null +++ b/libs/spice/patches/050-no-mkenums.patch @@ -0,0 +1,29 @@ +From 60f49745eb80eb84ff293cfadf8092b66b6a088c Mon Sep 17 00:00:00 2001 +From: Rosen Penev +Date: Fri, 9 Oct 2020 04:22:31 -0700 +Subject: [PATCH] don't regenerate enums files + +The release tarballs already include these files. + +Signed-off-by: Rosen Penev +--- + server/meson.build | 6 +----- + 1 file changed, 1 insertion(+), 5 deletions(-) + +diff --git a/server/meson.build b/server/meson.build +index b2eb410..b79b8d9 100644 +--- a/server/meson.build ++++ b/server/meson.build +@@ -36,11 +36,7 @@ spice_server_headers = [ + + install_headers(spice_server_headers, subdir : 'spice-server') + +-# generate enums +-gnome = import('gnome') +-spice_server_enums = gnome.mkenums_simple('spice-server-enums', +- sources : 'spice-server.h', +- symbol_prefix : 'SPICE') ++spice_server_enums = ['spice-server-enums.c', 'spice-server-enums.h'] + + spice_server_sources = [ + spice_server_headers,