Skip to content

Commit

Permalink
Some smaller unix changes (#5543)
Browse files Browse the repository at this point in the history
1. RPM file has correct %files% section. Addresses #5542
2. XDG_DOCUMENTS_DIR used to resolve documents dir if set
  • Loading branch information
baconpaul authored Dec 2, 2021
1 parent 2f2509e commit 84b7e7d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
11 changes: 7 additions & 4 deletions scripts/installer_linux/make_rpm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 7 additions & 2 deletions src/common/SurgeStorage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 84b7e7d

Please sign in to comment.