Merge pull request #143 from derivator/linux-fixes

Linux: enable building on x86 and prepare for packaging
This commit is contained in:
Stephan Sundermann committed 2015-03-01 03:15:32 +01:00
commit fb8dbb3a04
6 files changed
+28 -4

No files matched your search

+2
View File
@@ -75,6 +75,8 @@ namespace Vocaluxe.Base
#if INSTALLER #if INSTALLER
public static readonly string DataFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "Vocaluxe"); public static readonly string DataFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "Vocaluxe");
#elif LINUX
public static readonly string DataFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Vocaluxe");
#else #else
public static readonly string DataFolder = ProgramFolder; public static readonly string DataFolder = ProgramFolder;
#endif #endif
+20
View File
@@ -96,6 +96,23 @@ namespace Vocaluxe
return _IsProgramInstalled("Microsoft Visual C++ 2010"); return _IsProgramInstalled("Microsoft Visual C++ 2010");
} }
private static void _EnsureDataFolderExists()
{
if (!Directory.Exists(CSettings.DataFolder)) {
Directory.CreateDirectory(CSettings.DataFolder);
// copy default profiles to DataFolder instead of adding ProgramFolder to CConfig.ProfileFolders
// because we want to be able to edit them, but might not have permission to write to ProgramFolder
string profilePath = Path.Combine(CSettings.DataFolder, CSettings.FolderNameProfiles);
Directory.CreateDirectory(profilePath);
DirectoryInfo defaultProfileDir = new DirectoryInfo(Path.Combine(CSettings.ProgramFolder, CSettings.FolderNameProfiles));
FileInfo[] files = defaultProfileDir.GetFiles();
foreach (FileInfo file in files) {
string newPath = Path.Combine(profilePath, file.Name);
file.CopyTo(newPath, false);
}
}
}
public static bool CheckRequirements() public static bool CheckRequirements()
{ {
#if WIN #if WIN
@@ -135,6 +152,9 @@ namespace Vocaluxe
#endif #endif
path = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location) + Path.DirectorySeparatorChar + path; path = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location) + Path.DirectorySeparatorChar + path;
COSFunctions.AddEnvironmentPath(path); COSFunctions.AddEnvironmentPath(path);
#if LINUX
_EnsureDataFolderExists();
#endif
} }
} }
} }
+1 -1
View File
@@ -47,7 +47,7 @@ namespace Vocaluxe.Lib.Input
#endif #endif
#if LINUX #if LINUX
private const string _HIDApiDll = "libhidapi.so"; private const string _HIDApiDll = "libhidapi-libusb.so";
#endif #endif
#endif #endif
+1 -1
View File
@@ -176,7 +176,7 @@ namespace Vocaluxe.Lib.Video.Acinerella
#endif #endif
#if LINUX #if LINUX
private const string _AcDll = "x86/libacinerella.so"; private const string _AcDll = "libacinerella.so";
#endif #endif
#endif #endif
+2 -1
View File
@@ -85,11 +85,12 @@ namespace Vocaluxe
{ {
// Init Log // Init Log
CLog.Init(); CLog.Init();
CLog.StartBenchmark("Init Program");
if (!CProgrammHelper.CheckRequirements()) if (!CProgrammHelper.CheckRequirements())
return; return;
CProgrammHelper.Init(); CProgrammHelper.Init();
CLog.StartBenchmark("Init Program");
CMain.Init(); CMain.Init();
Application.DoEvents(); Application.DoEvents();
+2 -1
View File
@@ -1,9 +1,10 @@
ARCH?=$(shell uname -m | sed -e s/i.86/x86/ -e s/x86_64/x64/)
windowsLibs = Output/gstreamer-sharp.dll Output/glib-sharp.dll windowsLibs = Output/gstreamer-sharp.dll Output/glib-sharp.dll
all: all:
$(MAKE) -C PitchTracker $(MAKE) -C PitchTracker
$(MAKE) -C Vocaluxe/Lib/Video/Acinerella $(MAKE) -C Vocaluxe/Lib/Video/Acinerella
rm -f $(windowsLibs) rm -f $(windowsLibs)
xbuild /property:Platform=x64 /property:Configuration=ReleaseLinux xbuild /property:Platform=$(ARCH) /property:Configuration=ReleaseLinux
clean: clean:
xbuild /target:Clean xbuild /target:Clean