summaryrefslogtreecommitdiff
path: root/veracrypt/debian/patches
diff options
context:
space:
mode:
Diffstat (limited to 'veracrypt/debian/patches')
-rw-r--r--veracrypt/debian/patches/001-indicator-support.patch194
-rw-r--r--veracrypt/debian/patches/001-user-guide-location.diff22
-rw-r--r--veracrypt/debian/patches/002-build-flags.diff33
-rw-r--r--veracrypt/debian/patches/004-fixup-install.diff52
-rw-r--r--veracrypt/debian/patches/series4
5 files changed, 195 insertions, 110 deletions
diff --git a/veracrypt/debian/patches/001-indicator-support.patch b/veracrypt/debian/patches/001-indicator-support.patch
new file mode 100644
index 0000000..54414c7
--- /dev/null
+++ b/veracrypt/debian/patches/001-indicator-support.patch
@@ -0,0 +1,194 @@
+From: Stefan Sundin <stefan@stefansundin.com>, Unit 193 <unit193@ubuntu.com>
+Date: Fri, 06 July 2017
+Subject: Add support for Ubuntu and Ayatana application indicators.
+
+This patch adds compile-time support for application indicators.
+
+Forwarded: no
+
+Signed-off-by: Unit 193 <unit193@ubuntu.com>
+
+Index: veracrypt/src/Main/Forms/MainFrame.cpp
+===================================================================
+--- veracrypt.orig/src/Main/Forms/MainFrame.cpp
++++ veracrypt/src/Main/Forms/MainFrame.cpp
+@@ -46,6 +46,9 @@ namespace VeraCrypt
+ DEFINE_EVENT_TYPE(wxEVT_COMMAND_SHOW_WARNING)
+
+ MainFrame::MainFrame (wxWindow* parent) : MainFrameBase (parent),
++#ifdef HAVE_INDICATORS
++ indicator (NULL),
++#endif
+ ListItemRightClickEventPending (false),
+ SelectedItemIndex (-1),
+ SelectedSlotNumber (0),
+@@ -1557,6 +1560,32 @@ namespace VeraCrypt
+ }
+ }
+
++#ifdef HAVE_INDICATORS
++ void MainFrame::SetBusy (bool busy)
++ {
++ gtk_widget_set_sensitive(indicator_item_mountfavorites, !busy);
++ gtk_widget_set_sensitive(indicator_item_dismountall, !busy);
++ gtk_widget_set_sensitive(indicator_item_prefs, !busy);
++ gtk_widget_set_sensitive(indicator_item_exit, !busy /*&& CanExit()*/);
++ }
++
++ static void IndicatorOnShowHideMenuItemSelected (GtkWidget *widget, MainFrame *self) { Gui->SetBackgroundMode (!Gui->IsInBackgroundMode()); }
++ static void IndicatorOnMountAllFavoritesMenuItemSelected (GtkWidget *widget, MainFrame *self) { self->SetBusy(true); self->MountAllFavorites (); self->SetBusy(false); }
++ static void IndicatorOnDismountAllMenuItemSelected (GtkWidget *widget, MainFrame *self) { self->SetBusy(true); Gui->DismountAllVolumes(); self->SetBusy(false); }
++ static void IndicatorOnPreferencesMenuItemSelected (GtkWidget *widget, MainFrame *self) {
++ self->SetBusy(true);
++ PreferencesDialog dialog (self);
++ dialog.ShowModal();
++ self->SetBusy(false);
++ }
++ static void IndicatorOnExitMenuItemSelected (GtkWidget *widget, MainFrame *self) {
++ self->SetBusy(true);
++ if (Core->GetMountedVolumes().empty() || Gui->AskYesNo (LangString ["CONFIRM_EXIT"], false, true))
++ self->Close (true);
++ self->SetBusy(false);
++ }
++
++#endif
+ void MainFrame::ShowTaskBarIcon (bool show)
+ {
+ if (!show && mTaskBarIcon->IsIconInstalled())
+@@ -1566,8 +1595,47 @@ namespace VeraCrypt
+ else if (show && !mTaskBarIcon->IsIconInstalled())
+ {
+ #ifndef TC_MACOSX
++#ifndef HAVE_INDICATORS
+ mTaskBarIcon->SetIcon (Resources::GetVeraCryptIcon(), L"VeraCrypt");
+ #endif
++#endif
++#ifdef HAVE_INDICATORS
++ if (indicator == NULL) {
++ indicator = app_indicator_new ("veracrypt", "veracrypt", APP_INDICATOR_CATEGORY_APPLICATION_STATUS);
++ app_indicator_set_status (indicator, APP_INDICATOR_STATUS_ACTIVE);
++
++ GtkWidget *menu = gtk_menu_new();
++
++ indicator_item_showhide = gtk_menu_item_new_with_label (LangString[Gui->IsInBackgroundMode() ? "SHOW_TC" : "HIDE_TC"].mb_str());
++ gtk_menu_shell_append (GTK_MENU_SHELL (menu), indicator_item_showhide);
++ g_signal_connect (indicator_item_showhide, "activate", G_CALLBACK (IndicatorOnShowHideMenuItemSelected), this);
++
++ gtk_menu_shell_append (GTK_MENU_SHELL (menu), gtk_separator_menu_item_new());
++
++ indicator_item_mountfavorites = gtk_menu_item_new_with_label ("Mount All Favorite Volumes");
++ gtk_menu_shell_append (GTK_MENU_SHELL (menu), indicator_item_mountfavorites);
++ g_signal_connect (indicator_item_mountfavorites, "activate", G_CALLBACK (IndicatorOnMountAllFavoritesMenuItemSelected), this);
++
++ indicator_item_dismountall = gtk_menu_item_new_with_label ("Dismount All Mounted Volumes");
++ gtk_menu_shell_append (GTK_MENU_SHELL (menu), indicator_item_dismountall);
++ g_signal_connect (indicator_item_dismountall, "activate", G_CALLBACK (IndicatorOnDismountAllMenuItemSelected), this);
++
++ gtk_menu_shell_append (GTK_MENU_SHELL (menu), gtk_separator_menu_item_new());
++
++ indicator_item_prefs = gtk_menu_item_new_with_label ("Preferences...");
++ gtk_menu_shell_append (GTK_MENU_SHELL (menu), indicator_item_prefs);
++ g_signal_connect (indicator_item_prefs, "activate", G_CALLBACK (IndicatorOnPreferencesMenuItemSelected), this);
++
++ gtk_menu_shell_append (GTK_MENU_SHELL (menu), gtk_separator_menu_item_new());
++
++ indicator_item_exit = gtk_menu_item_new_with_label ("Exit");
++ gtk_menu_shell_append (GTK_MENU_SHELL (menu), indicator_item_exit);
++ g_signal_connect (indicator_item_exit, "activate", G_CALLBACK (IndicatorOnExitMenuItemSelected), this);
++
++ gtk_widget_show_all (menu);
++ app_indicator_set_menu (indicator, GTK_MENU (menu));
++ }
++#endif
+ }
+ }
+
+Index: veracrypt/src/Main/Forms/MainFrame.h
+===================================================================
+--- veracrypt.orig/src/Main/Forms/MainFrame.h
++++ veracrypt/src/Main/Forms/MainFrame.h
+@@ -13,6 +13,16 @@
+ #ifndef TC_HEADER_Main_Forms_MainFrame
+ #define TC_HEADER_Main_Forms_MainFrame
+
++#ifdef HAVE_INDICATORS
++#define GSocket GlibGSocket
++#ifdef UBUNTU_INDICATOR
++#include <libappindicator/app-indicator.h>
++#elif AYATANA_INDICATOR
++#include <libayatana-appindicator/app-indicator.h>
++#endif
++#undef GSocket
++#endif
++
+ #include "Forms.h"
+ #include "ChangePasswordDialog.h"
+ #ifdef TC_MACOSX
+@@ -38,6 +48,18 @@ namespace VeraCrypt
+ static FilePath GetShowRequestFifoPath () { return Application::GetConfigFilePath (L".show-request-queue", true); }
+ #endif
+
++ void MountAllFavorites ();
++
++#ifdef HAVE_INDICATORS
++ AppIndicator *indicator;
++ GtkWidget *indicator_item_showhide;
++ GtkWidget *indicator_item_mountfavorites;
++ GtkWidget *indicator_item_dismountall;
++ GtkWidget *indicator_item_prefs;
++ GtkWidget *indicator_item_exit;
++ void SetBusy (bool busy);
++
++#endif
+ protected:
+ enum
+ {
+@@ -71,7 +93,6 @@ namespace VeraCrypt
+ void LoadFavoriteVolumes ();
+ void LoadPreferences ();
+ void MountAllDevices ();
+- void MountAllFavorites ();
+ void MountVolume ();
+ void OnAboutMenuItemSelected (wxCommandEvent& event);
+ void OnQuit(wxCommandEvent& event) { Close(true); }
+Index: veracrypt/src/Main/GraphicUserInterface.cpp
+===================================================================
+--- veracrypt.orig/src/Main/GraphicUserInterface.cpp
++++ veracrypt/src/Main/GraphicUserInterface.cpp
+@@ -1754,6 +1754,10 @@ namespace VeraCrypt
+ }
+
+ BackgroundMode = state;
++
++#ifdef HAVE_INDICATORS
++ gtk_menu_item_set_label ((GtkMenuItem*) ((MainFrame*) mMainFrame)->indicator_item_showhide, LangString[Gui->IsInBackgroundMode() ? "SHOW_TC" : "HIDE_TC"].mb_str());
++#endif
+ }
+
+ void GraphicUserInterface::SetListCtrlColumnWidths (wxListCtrl *listCtrl, list <int> columnWidthPermilles, bool hasVerticalScrollbar) const
+Index: veracrypt/src/Makefile
+===================================================================
+--- veracrypt.orig/src/Makefile
++++ veracrypt/src/Makefile
+@@ -58,6 +58,21 @@ export WXCONFIG_CFLAGS :=
+ export WXCONFIG_CXXFLAGS :=
+ WX_ROOT ?= ..
+
++ifneq (,$(findstring gtk3,$(shell $(WX_CONFIG) --selected-config)))
++ INDICATOR_LIBRARY=appindicator3-0.1
++else
++ INDICATOR_LIBRARY=appindicator-0.1
++endif
++
++ifeq ($(shell pkg-config --exists $(INDICATOR_LIBRARY) && echo $$?),0)
++ export C_CXX_FLAGS += -DHAVE_INDICATORS -DUBUNTU_INDICATOR
++ export LIBS += $(shell pkg-config --libs $(INDICATOR_LIBRARY))
++ C_CXX_FLAGS += $(shell pkg-config --cflags $(INDICATOR_LIBRARY))
++else ifeq ($(shell pkg-config --exists ayatana-$(INDICATOR_LIBRARY) && echo $$?),0)
++ export C_CXX_FLAGS += -DHAVE_INDICATORS -DAYATANA_INDICATOR
++ export LIBS += $(shell pkg-config --libs ayatana-$(INDICATOR_LIBRARY))
++ C_CXX_FLAGS += $(shell pkg-config --cflags ayatana-$(INDICATOR_LIBRARY))
++endif
+
+ export TC_BUILD_CONFIG := Release
+
diff --git a/veracrypt/debian/patches/001-user-guide-location.diff b/veracrypt/debian/patches/001-user-guide-location.diff
deleted file mode 100644
index e7bddf2..0000000
--- a/veracrypt/debian/patches/001-user-guide-location.diff
+++ /dev/null
@@ -1,22 +0,0 @@
-From: Francis Russell <francis@unchartedbackwaters.co.uk>
-Date: Mon, 14 Jan 2013 11:44
-Subject: Move manual
-
-The user manual is installed in /usr/share/doc/veracrypt as opposed to
-/usr/share/veracrypt/doc.
-
-Forwarded: no
-
-Index: veracrypt/src/Main/GraphicUserInterface.cpp
-===================================================================
---- a/src/Main/GraphicUserInterface.cpp 2017-06-29 17:10:39.000000000 -0400
-+++ b/src/Main/GraphicUserInterface.cpp 2017-06-30 16:30:20.842509262 -0400
-@@ -1309,7 +1309,7 @@
- #elif defined (TC_MACOSX)
- htmlPath += L"/../Resources/doc/HTML/";
- #elif defined (TC_UNIX)
-- htmlPath = L"/usr/share/veracrypt/doc/HTML/";
-+ htmlPath = L"/usr/share/doc/veracrypt/HTML/";
- #else
- localFile = false;
- #endif
diff --git a/veracrypt/debian/patches/002-build-flags.diff b/veracrypt/debian/patches/002-build-flags.diff
deleted file mode 100644
index da0bdc6..0000000
--- a/veracrypt/debian/patches/002-build-flags.diff
+++ /dev/null
@@ -1,33 +0,0 @@
-From: Stefan Sundin <stefan@stefansundin.com>
-Date: Fri, 12 Sept 2013
-Subject: Add build flags
-
-Forwarded: no
-
-Index: veracrypt/src/Makefile
-===================================================================
---- veracrypt.orig/src/Makefile
-+++ veracrypt/src/Makefile
-@@ -57,6 +57,10 @@ export WXCONFIG_CFLAGS :=
- export WXCONFIG_CXXFLAGS :=
- WX_ROOT ?= ..
-
-+CPPFLAGS+=$(shell dpkg-buildflags --get CPPFLAGS)
-+CFLAGS+=$(shell dpkg-buildflags --get CFLAGS) $(CPPFLAGS) -Wno-sequence-point
-+CXXFLAGS+=$(shell dpkg-buildflags --get CXXFLAGS) $(CPPFLAGS) -Wno-narrowing
-+LFLAGS+=$(shell dpkg-buildflags --get LDFLAGS)
-
- export TC_BUILD_CONFIG := Release
-
-diff -Naur 1.24-Update3/src/Build/Include/Makefile.inc 1.24-Update3.debian/src/Build/Include/Makefile.inc
---- 1.24-Update3/src/Build/Include/Makefile.inc 2019-12-22 10:35:56.000000000 -0500
-+++ 1.24-Update3.debian/src/Build/Include/Makefile.inc 2020-01-21 21:16:00.628555627 -0500
-@@ -14,7 +14,7 @@
-
- clean:
- @echo Cleaning $(NAME)
-- rm -f $(APPNAME) $(NAME).a $(OBJS) $(OBJSEX) $(OBJSNOOPT) $(OBJS:.o=.d) $(OBJSEX:.oo=.d) $(OBJSNOOPT:.o0=.d) *.gch
-+ rm -f $(APPNAME) $(NAME).a $(OBJS) $(OBJSNOOPT) $(OBJS:.o=.d) $(OBJSEX:.oo=.d) $(OBJSNOOPT:.o0=.d) *.gch $(RESOURCES) SystemPrecompiled.d
-
- %.o: %.c
- @echo Compiling $(<F)
diff --git a/veracrypt/debian/patches/004-fixup-install.diff b/veracrypt/debian/patches/004-fixup-install.diff
deleted file mode 100644
index 8257d10..0000000
--- a/veracrypt/debian/patches/004-fixup-install.diff
+++ /dev/null
@@ -1,52 +0,0 @@
-Description: Fixup the install target so it's usable.
- - Use a path that works from the top src dir.
- - Inverse 'doc' and 'veracrypt' in /usr/share/veracrypt/doc/
- - Don't install the uninstall script nor extra License.txt file.
- - Use our own veracrypt.desktop file.
-Author: Unit 193 <unit193@ubuntu.com>
-
-Origin: vendor
-Forwarded: no
-Last-Update: 2017-07-10
-
---- veracrypt-1.21.orig/src/Main/Main.make
-+++ veracrypt-1.21/src/Main/Main.make
-@@ -236,25 +236,25 @@ endif
-
- ifeq "$(PLATFORM)" "Linux"
- prepare: $(APPNAME)
-- rm -fr $(PWD)/Setup/Linux/usr
-- mkdir -p $(PWD)/Setup/Linux/usr/bin
-- mkdir -p $(PWD)/Setup/Linux/usr/share/$(APPNAME)/doc/HTML
-- cp $(PWD)/Main/$(APPNAME) $(PWD)/Setup/Linux/usr/bin/$(APPNAME)
-- cp $(PWD)/Setup/Linux/$(APPNAME)-uninstall.sh $(PWD)/Setup/Linux/usr/bin/$(APPNAME)-uninstall.sh
-- chmod +x $(PWD)/Setup/Linux/usr/bin/$(APPNAME)-uninstall.sh
-- cp $(PWD)/License.txt $(PWD)/Setup/Linux/usr/share/$(APPNAME)/doc/License.txt
-- cp $(PWD)/../doc/html/* "$(PWD)/Setup/Linux/usr/share/$(APPNAME)/doc/HTML"
-+ rm -fr $(CURDIR)/../Setup/Linux/usr
-+ mkdir -p $(CURDIR)/../Setup/Linux/usr/bin
-+ mkdir -p $(CURDIR)/../Setup/Linux/usr/share/doc/$(APPNAME)/HTML
-+ cp $(CURDIR)/$(APPNAME) $(CURDIR)/../Setup/Linux/usr/bin/$(APPNAME)
-+# cp $(CURDIR)/../Setup/Linux/$(APPNAME)-uninstall.sh $(CURDIR)/../Setup/Linux/usr/bin/$(APPNAME)-uninstall.sh
-+# chmod +x $(CURDIR)/../Setup/Linux/usr/bin/$(APPNAME)-uninstall.sh
-+# cp $(CURDIR)/../License.txt $(CURDIR)/../Setup/Linux/usr/share/doc/$(APPNAME)/License.txt
-+ cp $(CURDIR)/../../doc/html/* "$(CURDIR)/../Setup/Linux/usr/share/doc/$(APPNAME)/HTML"
-
- ifndef TC_NO_GUI
-- mkdir -p $(PWD)/Setup/Linux/usr/share/applications
-- mkdir -p $(PWD)/Setup/Linux/usr/share/pixmaps
-- cp $(PWD)/Resources/Icons/VeraCrypt-256x256.xpm $(PWD)/Setup/Linux/usr/share/pixmaps/$(APPNAME).xpm
-- cp $(PWD)/Setup/Linux/$(APPNAME).desktop $(PWD)/Setup/Linux/usr/share/applications/$(APPNAME).desktop
-+# mkdir -p $(CURDIR)/../Setup/Linux/usr/share/applications
-+ mkdir -p $(CURDIR)/../Setup/Linux/usr/share/pixmaps
-+ cp $(CURDIR)/../Resources/Icons/VeraCrypt-256x256.xpm $(CURDIR)/../Setup/Linux/usr/share/pixmaps/$(APPNAME).xpm
-+# cp $(CURDIR)/../Setup/Linux/$(APPNAME).desktop $(CURDIR)/../Setup/Linux/usr/share/applications/$(APPNAME).desktop
- endif
-
-
- install: prepare
-- cp -R $(CURDIR)/Setup/Linux/usr $(DESTDIR)/.
-+ cp -R $(CURDIR)/../Setup/Linux/usr $(DESTDIR)/
-
- ifeq "$(TC_BUILD_CONFIG)" "Release"
- package: prepare
diff --git a/veracrypt/debian/patches/series b/veracrypt/debian/patches/series
index 7e9c1bf..b3dc56a 100644
--- a/veracrypt/debian/patches/series
+++ b/veracrypt/debian/patches/series
@@ -1,4 +1,2 @@
-#001-user-guide-location.diff
-002-build-flags.diff
-#004-fixup-install.diff
+001-indicator-support.patch
vc_devuan.patch
bgstack15