From 84b7e7d18a1d3f115a13b759affe4fff4aba3934 Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 2 Dec 2021 10:08:38 -0500 Subject: [PATCH] Some smaller unix changes (#5543) 1. RPM file has correct %files% section. Addresses #5542 2. XDG_DOCUMENTS_DIR used to resolve documents dir if set --- scripts/installer_linux/make_rpm.sh | 11 +++++++---- src/common/SurgeStorage.cpp | 9 +++++++-- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/scripts/installer_linux/make_rpm.sh b/scripts/installer_linux/make_rpm.sh index 7dbd7f54ec4..5dd48748fac 100755 --- a/scripts/installer_linux/make_rpm.sh +++ b/scripts/installer_linux/make_rpm.sh @@ -127,10 +127,13 @@ find %{buildroot}%{_libdir}/vst3/ -type f -iname "*.so" -exec chmod 0644 {} + %files -%{_bindir} -%{_libdir}/vst3/ -%{_libdir}/lv2/ -%{_datarootdir}/surge-xt/ +"%{_bindir}/Surge XT" +"%{_bindir}/Surge XT Effects" +"%{_libdir}/vst3/Surge XT.vst3/*" +"%{_libdir}/lv2/Surge XT.lv2/*" +"%{_libdir}/vst3/Surge XT Effects.vst3/*" +"%{_libdir}/lv2/Surge XT Effects.lv2/*" +"%{_datarootdir}/surge-xt/*" %changelog diff --git a/src/common/SurgeStorage.cpp b/src/common/SurgeStorage.cpp index 21e5c6c72e7..eec5188f6c4 100644 --- a/src/common/SurgeStorage.cpp +++ b/src/common/SurgeStorage.cpp @@ -309,8 +309,13 @@ SurgeStorage::SurgeStorage(std::string suppliedDataPath) : otherscene_clients(0) ** Compensating for whether your distro makes you a ~/Documents or not */ - // FIXME: This "if" chain makes no sense. It's only here as a 1:1 mapping from the old code. - if (auto documentsSurge = homePath / "Documents/Surge XT"; fs::is_directory(documentsSurge)) + if (auto xdgdd = getenv("XDG_DOCUMENTS_DIR")) + { + auto xdgpath = fs::path{xdgdd} / "Surge XT"; + userDataPath = std::move(xdgpath); + } + else if (auto documentsSurge = homePath / "Documents/Surge XT"; + fs::is_directory(documentsSurge)) { userDataPath = std::move(documentsSurge); }