From 62753a4f396a2b88ac86377e55306f823859462c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sun, 16 Jan 2022 16:53:09 +0000 Subject: [PATCH] rhvoice: unstable-2018-02-10 -> 1.6.0 --- pkgs/applications/audio/rhvoice/default.nix | 54 ++++++++++++------- .../audio/rhvoice/honor_nix_environment.patch | 20 +++++-- 2 files changed, 50 insertions(+), 24 deletions(-) diff --git a/pkgs/applications/audio/rhvoice/default.nix b/pkgs/applications/audio/rhvoice/default.nix index ca51001dd62..f72b8404104 100644 --- a/pkgs/applications/audio/rhvoice/default.nix +++ b/pkgs/applications/audio/rhvoice/default.nix @@ -1,36 +1,50 @@ -{ stdenv, lib, pkg-config, fetchFromGitHub, sconsPackages -, glibmm, libpulseaudio, libao }: +{ lib +, stdenv +, fetchFromGitHub +, ensureNewerSourcesForZipFilesHook +, pkg-config +, scons +, glibmm +, libpulseaudio +, libao +, speechd +}: -let - version = "unstable-2018-02-10"; -in stdenv.mkDerivation { +stdenv.mkDerivation rec { pname = "rhvoice"; - inherit version; + version = "1.6.0"; src = fetchFromGitHub { - owner = "Olga-Yakovleva"; + owner = "RHVoice"; repo = "RHVoice"; - rev = "7a25a881b0465e47a12d8029b56f3b71a1d02312"; - sha256 = "1gkrlmv7msh9qlm0gkjqpl9gswghpclfdwszr1p85v8vk6m63v0b"; + rev = version; + fetchSubmodules = true; + hash = "sha256-5iq+St/fqGMeJu2XaiCmgzBpxqE9IQLnKlfZErd1fPs="; }; + patches = [ + # SConstruct patch + # Scons creates an independent environment that assumes standard POSIX paths. + # The patch is needed to push the nix environment. + # - PATH + # - PKG_CONFIG_PATH, to find available (sound) libraries + # - RPATH, to link to the newly built libraries + ./honor_nix_environment.patch + ]; + nativeBuildInputs = [ - sconsPackages.scons_3_1_2 pkg-config + ensureNewerSourcesForZipFilesHook + pkg-config + scons ]; buildInputs = [ - glibmm libpulseaudio libao + glibmm + libpulseaudio + libao + speechd ]; - # SConstruct patch - # Scons creates an independent environment that assumes standard POSIX paths. - # The patch is needed to push the nix environment. - # - PATH - # - PKG_CONFIG_PATH, to find available (sound) libraries - # - RPATH, to link to the newly built libraries - - patches = [ ./honor_nix_environment.patch ]; - meta = { description = "A free and open source speech synthesizer for Russian language and others"; homepage = "https://github.com/Olga-Yakovleva/RHVoice/wiki"; diff --git a/pkgs/applications/audio/rhvoice/honor_nix_environment.patch b/pkgs/applications/audio/rhvoice/honor_nix_environment.patch index ed180c92deb..1c0c9d3ee45 100644 --- a/pkgs/applications/audio/rhvoice/honor_nix_environment.patch +++ b/pkgs/applications/audio/rhvoice/honor_nix_environment.patch @@ -1,14 +1,26 @@ diff --git a/SConstruct b/SConstruct -index 2421399..ba39254 100644 +index b29168f..d507b95 100644 --- a/SConstruct +++ b/SConstruct -@@ -147,6 +147,9 @@ def create_base_env(vars): +@@ -93,6 +93,8 @@ def CheckWiX(context): + + def get_spd_module_dir(): + env = Environment() ++ env.PrependENVPath("PATH", os.environ["PATH"]) ++ env["ENV"]["PKG_CONFIG_PATH"]=os.environ["PKG_CONFIG_PATH"] + return env.ParseConfig("pkg-config speech-dispatcher --variable=modulebindir", passthru) + + def validate_spd_version(key,val,env): +@@ -202,9 +204,9 @@ def create_base_env(user_vars): env_args["package_name"]="RHVoice" env_args["CPPDEFINES"]=[("RHVOICE","1")] env=Environment(**env_args) +- if env["dev"]: +- env["prefix"]=os.path.abspath("local") +- env["RPATH"]=env.Dir("$libdir").abspath + env.PrependENVPath("PATH", os.environ["PATH"]) + env["ENV"]["PKG_CONFIG_PATH"]=os.environ["PKG_CONFIG_PATH"] -+ env["RPATH"]=env["libdir"] ++ env["RPATH"]=env.Dir("$libdir").abspath env["package_version"]=get_version(env["release"]) env.Append(CPPDEFINES=("PACKAGE",env.subst(r'\"$package_name\"'))) - env.Append(CPPDEFINES=("VERSION",env.subst(r'\"$package_version\"'))) + if env["PLATFORM"]=="win32":