From 653c964a39511dad9a8b8613ba9bdf9e1d9f4104 Mon Sep 17 00:00:00 2001 From: perqin Date: Tue, 16 Oct 2018 00:36:44 +0800 Subject: [PATCH 01/14] Update to 3.3176 --- .SRCINFO | 30 ++++++ .gitignore | 4 + LICENSE | 3 + PKGBUILD | 51 ++++++++++ subl | 2 + sublime-imfix.c | 263 ++++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 353 insertions(+) create mode 100644 .SRCINFO create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 PKGBUILD create mode 100755 subl create mode 100644 sublime-imfix.c diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 0000000..65b65fd --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,30 @@ +pkgbase = sublime-text-3-imfix + pkgdesc = Sophisticated text editor for code, markup and prose - Stable build with input method support for CJK users + pkgver = 3.3176 + pkgrel = 1 + url = https://www.sublimetext.com/3 + arch = x86_64 + license = custom + depends = libpng + depends = gtk2 + provides = sublime-text + provides = sublime-text-dev + provides = sublime-text-nightly + provides = sublime-text-dev-imfix + provides = sublime-text-dev-imfix2 + conflicts = sublime-text + conflicts = sublime-text-dev + conflicts = sublime-text-nightly + conflicts = sublime-text-dev-imfix + conflicts = sublime-text-dev-imfix2 + source = https://download.sublimetext.com/sublime_text_3_build_3176_x64.tar.bz2 + source = sublime-imfix.c + source = subl + source = LICENSE + sha256sums = 74f17c1aec4ddec9d4d4c39f5aec0414a4755d407a05efa571e8892e0b9cf732 + sha256sums = 05c08fc144151713e25ebb528c2a86ef5aaf3afa3e20b79302faefdbb7158f12 + sha256sums = 00ab76aff168a0dcccec861610985e3695da10e6f95ce1fa399f5747b4d5af5b + sha256sums = 8e4c48469bf3f35d0c0904e770c4e307d4965a8931e839c01c5765498a19cf01 + +pkgname = sublime-text-3-imfix + diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2f39e2f --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +/*.tar.bz2 +/*.pkg.tar.xz +/pkg +/src diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..3e2f842 --- /dev/null +++ b/LICENSE @@ -0,0 +1,3 @@ +Sublime Text may be downloaded and evaluated for free, however a license must be purchased for continued use. +Licenses are per-user, rather than per-machine, so you can enjoy Sublime Text on as many computers and operating systems as you wish with your license. +For more information, please visit https://www.sublimetext.com/buy diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 0000000..07a8654 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,51 @@ +# Maintainer: perqin + +pkgname=sublime-text-3-imfix +pkgver=3.3176 +pkgrel=1 +pkgdesc='Sophisticated text editor for code, markup and prose - Stable build with input method support for CJK users' +arch=('x86_64') +url='https://www.sublimetext.com/3' +license=('custom') +depends=('libpng' 'gtk2') +conflicts=('sublime-text' 'sublime-text-dev' 'sublime-text-nightly' 'sublime-text-dev-imfix' 'sublime-text-dev-imfix2') +provides=('sublime-text' 'sublime-text-dev' 'sublime-text-nightly' 'sublime-text-dev-imfix' 'sublime-text-dev-imfix2') +source=( + "https://download.sublimetext.com/sublime_text_3_build_${pkgver:2}_x64.tar.bz2" + 'sublime-imfix.c' + 'subl' + 'LICENSE' +) +sha256sums=( + '74f17c1aec4ddec9d4d4c39f5aec0414a4755d407a05efa571e8892e0b9cf732' + '05c08fc144151713e25ebb528c2a86ef5aaf3afa3e20b79302faefdbb7158f12' + '00ab76aff168a0dcccec861610985e3695da10e6f95ce1fa399f5747b4d5af5b' + '8e4c48469bf3f35d0c0904e770c4e307d4965a8931e839c01c5765498a19cf01' +) + +build() { + # Build imfix library + gcc -shared -o libsublime-imfix.so sublime-imfix.c `pkg-config --libs --cflags gtk+-2.0` -fPIC +} + +package() { + cd "${srcdir}" + # Install sublime text 3 + install -dm755 "${pkgdir}/opt" + cp --preserve=mode -r "sublime_text_3" "${pkgdir}/opt/sublime_text_3" + # Install imfix library + install -Dm755 libsublime-imfix.so ${pkgdir}/opt/sublime_text_3/libsublime-imfix.so + # Install icons + for res in 128x128 16x16 256x256 32x32 48x48; do + install -dm755 "${pkgdir}/usr/share/icons/hicolor/${res}/apps" + ln -s "/opt/sublime_text_3/Icon/${res}/sublime-text.png" "${pkgdir}/usr/share/icons/hicolor/${res}/apps/sublime-text.png" + done + # Install desktop entry and executable + install -dm755 "${pkgdir}/usr/share/applications" + install -Dm644 "sublime_text_3/sublime_text.desktop" "${pkgdir}/usr/share/applications/sublime_text.desktop" + sed -i 's#/opt/sublime_text/sublime_text#subl#g' "${pkgdir}/usr/share/applications/sublime_text.desktop" + install -Dm755 subl "${pkgdir}/usr/bin/subl" + # Install license file + install -d "${pkgdir}/usr/share/licenses/${pkgname}" + install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" +} diff --git a/subl b/subl new file mode 100755 index 0000000..ff9bf52 --- /dev/null +++ b/subl @@ -0,0 +1,2 @@ +#!/bin/bash +LD_PRELOAD=/opt/sublime_text_3/libsublime-imfix.so /opt/sublime_text_3/sublime_text "$@" \ No newline at end of file diff --git a/sublime-imfix.c b/sublime-imfix.c new file mode 100644 index 0000000..9a90f1f --- /dev/null +++ b/sublime-imfix.c @@ -0,0 +1,263 @@ +/* +sublime-imfix.c +Use LD_PRELOAD to interpose some function to fix sublime input method support for linux. +By Cjacker Huang +By whitequark@whitequark.org + +How to compile: +gcc -shared -o libsublime-imfix.so sublime_imfix.c `pkg-config --libs --cflags gtk+-2.0` -fPIC +How to use: +LD_PRELOAD=./libsublime-imfix.so sublime_text + +Changes: +2014 06-09 +1, Fix cursor position update for sublime text 3. +2, Combine the codes from whitequark(fix for xim immodule) and add cursor update support for XIM immodule. +*/ + +/*for RTLD_NEXT*/ +#define _GNU_SOURCE + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef VERBOSE +#define DEBUG(fmt, ...) do { \ + FILE* err = fopen("/tmp/libsublime-immethod-fix.log", "a"); \ + if (err) { \ + fprintf(err, fmt, __VA_ARGS__); \ + fclose(err); \ + } \ + } while(0) +#else +#define DEBUG(fmt, ...) +#endif + + +typedef GdkSegment GdkRegionBox; + +struct _GdkRegion +{ + long size; + long numRects; + GdkRegionBox *rects; + GdkRegionBox extents; +}; + +GtkIMContext *local_context; + + +//this func is interposed to support cursor position update. +void +gdk_region_get_clipbox (const GdkRegion *region, + GdkRectangle *rectangle) +{ + g_return_if_fail (region != NULL); + g_return_if_fail (rectangle != NULL); + + rectangle->x = region->extents.x1; + rectangle->y = region->extents.y1; + rectangle->width = region->extents.x2 - region->extents.x1; + rectangle->height = region->extents.y2 - region->extents.y1; + GdkRectangle rect; + rect.x = rectangle->x; + rect.y = rectangle->y; + rect.width = 0; + rect.height = rectangle->height; + //The caret width is 2 in sublime text 2 + //And is 1 in sublime text 3. + //Maybe sometimes we will make a mistake, but for most of the time, it should be the caret. + if((rectangle->width == 2 || rectangle->width == 1) && GTK_IS_IM_CONTEXT(local_context)) { + gtk_im_context_set_cursor_location(local_context, rectangle); + } +} + +//this is needed, for example, if you input something in file dialog and return back the edit area +//context will lost, so here we set it again. +static GdkFilterReturn event_filter (GdkXEvent *xevent, GdkEvent *event, gpointer im_context) +{ + XEvent *xev = (XEvent *)xevent; + if(xev->type == KeyRelease && GTK_IS_IM_CONTEXT(im_context)) { + GdkWindow * win = g_object_get_data(G_OBJECT(im_context),"window"); + if(GDK_IS_WINDOW(win)) + gtk_im_context_set_client_window(im_context, win); + } + return GDK_FILTER_CONTINUE; +} + +void gtk_im_context_set_client_window (GtkIMContext *context, + GdkWindow *window) +{ + GtkIMContextClass *klass; + g_return_if_fail (GTK_IS_IM_CONTEXT (context)); + klass = GTK_IM_CONTEXT_GET_CLASS (context); + if (klass->set_client_window) + klass->set_client_window (context, window); + + //below is our interposed codes to save the context to local_context. + if(!GDK_IS_WINDOW (window)) + return; + g_object_set_data(G_OBJECT(context),"window",window); + int width = gdk_window_get_width(window); + int height = gdk_window_get_height(window); + if(width != 0 && height !=0) { + gtk_im_context_focus_in(context); + local_context = context; + } + //only add this event_filter when using 'fcitx' immodule. + //for xim immodule, this function is as same as original from gtk2. + const gchar * immodule = g_getenv("GTK_IM_MODULE"); + if(immodule && !strcmp(immodule, "fcitx")) { + gdk_window_add_filter (window, event_filter, context); + } +} + + +/*below codes is from whitequark, fix for xim immodule*/ + +/* See gtkimcontextxim.c */ +GType gtk_type_im_context_xim = 0; + +#define GTK_TYPE_IM_CONTEXT_XIM (gtk_type_im_context_xim) +#define GTK_IM_CONTEXT_XIM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_IM_CONTEXT_XIM, GtkIMContextXIM)) +#define GTK_IM_CONTEXT_XIM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_IM_CONTEXT_XIM, GtkIMContextXIMClass)) +#define GTK_IS_IM_CONTEXT_XIM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_IM_CONTEXT_XIM)) +#define GTK_IS_IM_CONTEXT_XIM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_IM_CONTEXT_XIM)) +#define GTK_IM_CONTEXT_XIM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_IM_CONTEXT_XIM, GtkIMContextXIMClass)) + +typedef struct _GtkIMContextXIM GtkIMContextXIM; +typedef struct _GtkIMContextXIMClass GtkIMContextXIMClass; + +struct _GtkIMContextXIMClass +{ + GtkIMContextClass parent_class; +}; + +typedef struct _StatusWindow StatusWindow; +typedef struct _GtkXIMInfo GtkXIMInfo; + +struct _GtkIMContextXIM +{ + GtkIMContext object; + + GtkXIMInfo *im_info; + + gchar *locale; + gchar *mb_charset; + + GdkWindow *client_window; + GtkWidget *client_widget; + + /* The status window for this input context; we claim the +* * status window when we are focused and have created an XIC +* */ + StatusWindow *status_window; + + gint preedit_size; + gint preedit_length; + gunichar *preedit_chars; + XIMFeedback *feedbacks; + + gint preedit_cursor; + + XIMCallback preedit_start_callback; + XIMCallback preedit_done_callback; + XIMCallback preedit_draw_callback; + XIMCallback preedit_caret_callback; + + XIMCallback status_start_callback; + XIMCallback status_done_callback; + XIMCallback status_draw_callback; + + XIMCallback string_conversion_callback; + + XIC ic; + + guint filter_key_release : 1; + guint use_preedit : 1; + guint finalizing : 1; + guint in_toplevel : 1; + guint has_focus : 1; +}; + +static GClassInitFunc orig_gtk_im_context_xim_class_init; +static GType (*orig_g_type_module_register_type)(GTypeModule *, + GType, const gchar *, + const GTypeInfo *, GTypeFlags); +static gboolean (*orig_gtk_im_context_xim_filter_keypress)(GtkIMContext *context, + GdkEventKey *event); + +static gboolean +hook_gtk_im_context_xim_filter_keypress(GtkIMContext *context, GdkEventKey *event) { + GtkIMContextXIM *im_context_xim = GTK_IM_CONTEXT_XIM(context); + if (!im_context_xim->client_window) { + DEBUG("im_context_xim == %p\n", im_context_xim); + DEBUG("event->window == %p\n", event->window); + + gtk_im_context_set_client_window(context, event->window); + } + + return orig_gtk_im_context_xim_filter_keypress(context, event); +} + +static void +hook_gtk_im_context_xim_class_init (GtkIMContextXIMClass *class) { + orig_gtk_im_context_xim_class_init(class, NULL); /* wat? */ + + GtkIMContextClass *im_context_class = GTK_IM_CONTEXT_CLASS (class); + + assert(!orig_gtk_im_context_xim_filter_keypress); + orig_gtk_im_context_xim_filter_keypress = im_context_class->filter_keypress; + im_context_class->filter_keypress = hook_gtk_im_context_xim_filter_keypress; + DEBUG("orig_gtk_im_context_xim_filter_keypress: %p\n", + orig_gtk_im_context_xim_filter_keypress); +} + +GType +g_type_module_register_type (GTypeModule *module, + GType parent_type, + const gchar *type_name, + const GTypeInfo *type_info, + GTypeFlags flags) { + if (!orig_g_type_module_register_type) { + orig_g_type_module_register_type = dlsym(RTLD_NEXT, "g_type_module_register_type"); + assert(orig_g_type_module_register_type); + } + + if (type_name && !strcmp(type_name, "GtkIMContextXIM")) { + assert(!orig_gtk_im_context_xim_class_init); + orig_gtk_im_context_xim_class_init = type_info->class_init; + + assert(sizeof(GtkIMContextXIM) == type_info->instance_size); + + const GTypeInfo hook_im_context_xim_info = + { + type_info->class_size, + type_info->base_init, + type_info->base_finalize, + (GClassInitFunc) hook_gtk_im_context_xim_class_init, + type_info->class_finalize, + type_info->class_data, + type_info->instance_size, + type_info->n_preallocs, + type_info->instance_init, + }; + + DEBUG("orig_gtk_im_context_xim_class_init: %p\n", orig_gtk_im_context_xim_class_init); + + gtk_type_im_context_xim = + orig_g_type_module_register_type(module, parent_type, type_name, + &hook_im_context_xim_info, flags); + + return gtk_type_im_context_xim; + } + + return orig_g_type_module_register_type(module, parent_type, type_name, type_info, flags); +} From de7ff47d183a09eefc7ccad4f179850409d8a336 Mon Sep 17 00:00:00 2001 From: perqin Date: Sun, 17 Mar 2019 12:07:01 +0800 Subject: [PATCH 02/14] Update to 3.3200 --- PKGBUILD | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PKGBUILD b/PKGBUILD index 07a8654..c4a32a5 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,7 +1,7 @@ # Maintainer: perqin pkgname=sublime-text-3-imfix -pkgver=3.3176 +pkgver=3.3200 pkgrel=1 pkgdesc='Sophisticated text editor for code, markup and prose - Stable build with input method support for CJK users' arch=('x86_64') @@ -17,7 +17,7 @@ source=( 'LICENSE' ) sha256sums=( - '74f17c1aec4ddec9d4d4c39f5aec0414a4755d407a05efa571e8892e0b9cf732' + 'b9d5297c65bd14a8ba3394e74dbd9a5013b3fed5a5a2f8f5120d2cec40614fbd' '05c08fc144151713e25ebb528c2a86ef5aaf3afa3e20b79302faefdbb7158f12' '00ab76aff168a0dcccec861610985e3695da10e6f95ce1fa399f5747b4d5af5b' '8e4c48469bf3f35d0c0904e770c4e307d4965a8931e839c01c5765498a19cf01' From ac6aae16c65a88086520e3be61724f3ed783a4ea Mon Sep 17 00:00:00 2001 From: perqin Date: Sun, 17 Mar 2019 12:09:15 +0800 Subject: [PATCH 03/14] Update to 3.3200 (Fix .SRCINFO) --- .SRCINFO | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.SRCINFO b/.SRCINFO index 65b65fd..0500a44 100644 --- a/.SRCINFO +++ b/.SRCINFO @@ -1,6 +1,6 @@ pkgbase = sublime-text-3-imfix pkgdesc = Sophisticated text editor for code, markup and prose - Stable build with input method support for CJK users - pkgver = 3.3176 + pkgver = 3.3200 pkgrel = 1 url = https://www.sublimetext.com/3 arch = x86_64 @@ -17,11 +17,11 @@ pkgbase = sublime-text-3-imfix conflicts = sublime-text-nightly conflicts = sublime-text-dev-imfix conflicts = sublime-text-dev-imfix2 - source = https://download.sublimetext.com/sublime_text_3_build_3176_x64.tar.bz2 + source = https://download.sublimetext.com/sublime_text_3_build_3200_x64.tar.bz2 source = sublime-imfix.c source = subl source = LICENSE - sha256sums = 74f17c1aec4ddec9d4d4c39f5aec0414a4755d407a05efa571e8892e0b9cf732 + sha256sums = b9d5297c65bd14a8ba3394e74dbd9a5013b3fed5a5a2f8f5120d2cec40614fbd sha256sums = 05c08fc144151713e25ebb528c2a86ef5aaf3afa3e20b79302faefdbb7158f12 sha256sums = 00ab76aff168a0dcccec861610985e3695da10e6f95ce1fa399f5747b4d5af5b sha256sums = 8e4c48469bf3f35d0c0904e770c4e307d4965a8931e839c01c5765498a19cf01 From e1914b9809f464d2ad133009c7cd14da4ab618c2 Mon Sep 17 00:00:00 2001 From: perqin Date: Mon, 18 Mar 2019 00:31:11 +0800 Subject: [PATCH 04/14] Remove unnecessary imfix --- .SRCINFO | 6 +- PKGBUILD | 16 +-- subl | 2 - sublime-imfix.c | 263 ------------------------------------------------ 4 files changed, 4 insertions(+), 283 deletions(-) delete mode 100755 subl delete mode 100644 sublime-imfix.c diff --git a/.SRCINFO b/.SRCINFO index 0500a44..94025cd 100644 --- a/.SRCINFO +++ b/.SRCINFO @@ -1,7 +1,7 @@ pkgbase = sublime-text-3-imfix pkgdesc = Sophisticated text editor for code, markup and prose - Stable build with input method support for CJK users pkgver = 3.3200 - pkgrel = 1 + pkgrel = 2 url = https://www.sublimetext.com/3 arch = x86_64 license = custom @@ -18,12 +18,8 @@ pkgbase = sublime-text-3-imfix conflicts = sublime-text-dev-imfix conflicts = sublime-text-dev-imfix2 source = https://download.sublimetext.com/sublime_text_3_build_3200_x64.tar.bz2 - source = sublime-imfix.c - source = subl source = LICENSE sha256sums = b9d5297c65bd14a8ba3394e74dbd9a5013b3fed5a5a2f8f5120d2cec40614fbd - sha256sums = 05c08fc144151713e25ebb528c2a86ef5aaf3afa3e20b79302faefdbb7158f12 - sha256sums = 00ab76aff168a0dcccec861610985e3695da10e6f95ce1fa399f5747b4d5af5b sha256sums = 8e4c48469bf3f35d0c0904e770c4e307d4965a8931e839c01c5765498a19cf01 pkgname = sublime-text-3-imfix diff --git a/PKGBUILD b/PKGBUILD index c4a32a5..2afb904 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -2,7 +2,7 @@ pkgname=sublime-text-3-imfix pkgver=3.3200 -pkgrel=1 +pkgrel=2 pkgdesc='Sophisticated text editor for code, markup and prose - Stable build with input method support for CJK users' arch=('x86_64') url='https://www.sublimetext.com/3' @@ -12,29 +12,18 @@ conflicts=('sublime-text' 'sublime-text-dev' 'sublime-text-nightly' 'sublime-tex provides=('sublime-text' 'sublime-text-dev' 'sublime-text-nightly' 'sublime-text-dev-imfix' 'sublime-text-dev-imfix2') source=( "https://download.sublimetext.com/sublime_text_3_build_${pkgver:2}_x64.tar.bz2" - 'sublime-imfix.c' - 'subl' 'LICENSE' ) sha256sums=( 'b9d5297c65bd14a8ba3394e74dbd9a5013b3fed5a5a2f8f5120d2cec40614fbd' - '05c08fc144151713e25ebb528c2a86ef5aaf3afa3e20b79302faefdbb7158f12' - '00ab76aff168a0dcccec861610985e3695da10e6f95ce1fa399f5747b4d5af5b' '8e4c48469bf3f35d0c0904e770c4e307d4965a8931e839c01c5765498a19cf01' ) -build() { - # Build imfix library - gcc -shared -o libsublime-imfix.so sublime-imfix.c `pkg-config --libs --cflags gtk+-2.0` -fPIC -} - package() { cd "${srcdir}" # Install sublime text 3 install -dm755 "${pkgdir}/opt" cp --preserve=mode -r "sublime_text_3" "${pkgdir}/opt/sublime_text_3" - # Install imfix library - install -Dm755 libsublime-imfix.so ${pkgdir}/opt/sublime_text_3/libsublime-imfix.so # Install icons for res in 128x128 16x16 256x256 32x32 48x48; do install -dm755 "${pkgdir}/usr/share/icons/hicolor/${res}/apps" @@ -44,7 +33,8 @@ package() { install -dm755 "${pkgdir}/usr/share/applications" install -Dm644 "sublime_text_3/sublime_text.desktop" "${pkgdir}/usr/share/applications/sublime_text.desktop" sed -i 's#/opt/sublime_text/sublime_text#subl#g' "${pkgdir}/usr/share/applications/sublime_text.desktop" - install -Dm755 subl "${pkgdir}/usr/bin/subl" + install -dm755 "${pkgdir}/usr/bin" + ln -s "/opt/sublime_text_3/sublime_text" "${pkgdir}/usr/bin/subl" # Install license file install -d "${pkgdir}/usr/share/licenses/${pkgname}" install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" diff --git a/subl b/subl deleted file mode 100755 index ff9bf52..0000000 --- a/subl +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -LD_PRELOAD=/opt/sublime_text_3/libsublime-imfix.so /opt/sublime_text_3/sublime_text "$@" \ No newline at end of file diff --git a/sublime-imfix.c b/sublime-imfix.c deleted file mode 100644 index 9a90f1f..0000000 --- a/sublime-imfix.c +++ /dev/null @@ -1,263 +0,0 @@ -/* -sublime-imfix.c -Use LD_PRELOAD to interpose some function to fix sublime input method support for linux. -By Cjacker Huang -By whitequark@whitequark.org - -How to compile: -gcc -shared -o libsublime-imfix.so sublime_imfix.c `pkg-config --libs --cflags gtk+-2.0` -fPIC -How to use: -LD_PRELOAD=./libsublime-imfix.so sublime_text - -Changes: -2014 06-09 -1, Fix cursor position update for sublime text 3. -2, Combine the codes from whitequark(fix for xim immodule) and add cursor update support for XIM immodule. -*/ - -/*for RTLD_NEXT*/ -#define _GNU_SOURCE - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef VERBOSE -#define DEBUG(fmt, ...) do { \ - FILE* err = fopen("/tmp/libsublime-immethod-fix.log", "a"); \ - if (err) { \ - fprintf(err, fmt, __VA_ARGS__); \ - fclose(err); \ - } \ - } while(0) -#else -#define DEBUG(fmt, ...) -#endif - - -typedef GdkSegment GdkRegionBox; - -struct _GdkRegion -{ - long size; - long numRects; - GdkRegionBox *rects; - GdkRegionBox extents; -}; - -GtkIMContext *local_context; - - -//this func is interposed to support cursor position update. -void -gdk_region_get_clipbox (const GdkRegion *region, - GdkRectangle *rectangle) -{ - g_return_if_fail (region != NULL); - g_return_if_fail (rectangle != NULL); - - rectangle->x = region->extents.x1; - rectangle->y = region->extents.y1; - rectangle->width = region->extents.x2 - region->extents.x1; - rectangle->height = region->extents.y2 - region->extents.y1; - GdkRectangle rect; - rect.x = rectangle->x; - rect.y = rectangle->y; - rect.width = 0; - rect.height = rectangle->height; - //The caret width is 2 in sublime text 2 - //And is 1 in sublime text 3. - //Maybe sometimes we will make a mistake, but for most of the time, it should be the caret. - if((rectangle->width == 2 || rectangle->width == 1) && GTK_IS_IM_CONTEXT(local_context)) { - gtk_im_context_set_cursor_location(local_context, rectangle); - } -} - -//this is needed, for example, if you input something in file dialog and return back the edit area -//context will lost, so here we set it again. -static GdkFilterReturn event_filter (GdkXEvent *xevent, GdkEvent *event, gpointer im_context) -{ - XEvent *xev = (XEvent *)xevent; - if(xev->type == KeyRelease && GTK_IS_IM_CONTEXT(im_context)) { - GdkWindow * win = g_object_get_data(G_OBJECT(im_context),"window"); - if(GDK_IS_WINDOW(win)) - gtk_im_context_set_client_window(im_context, win); - } - return GDK_FILTER_CONTINUE; -} - -void gtk_im_context_set_client_window (GtkIMContext *context, - GdkWindow *window) -{ - GtkIMContextClass *klass; - g_return_if_fail (GTK_IS_IM_CONTEXT (context)); - klass = GTK_IM_CONTEXT_GET_CLASS (context); - if (klass->set_client_window) - klass->set_client_window (context, window); - - //below is our interposed codes to save the context to local_context. - if(!GDK_IS_WINDOW (window)) - return; - g_object_set_data(G_OBJECT(context),"window",window); - int width = gdk_window_get_width(window); - int height = gdk_window_get_height(window); - if(width != 0 && height !=0) { - gtk_im_context_focus_in(context); - local_context = context; - } - //only add this event_filter when using 'fcitx' immodule. - //for xim immodule, this function is as same as original from gtk2. - const gchar * immodule = g_getenv("GTK_IM_MODULE"); - if(immodule && !strcmp(immodule, "fcitx")) { - gdk_window_add_filter (window, event_filter, context); - } -} - - -/*below codes is from whitequark, fix for xim immodule*/ - -/* See gtkimcontextxim.c */ -GType gtk_type_im_context_xim = 0; - -#define GTK_TYPE_IM_CONTEXT_XIM (gtk_type_im_context_xim) -#define GTK_IM_CONTEXT_XIM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_IM_CONTEXT_XIM, GtkIMContextXIM)) -#define GTK_IM_CONTEXT_XIM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_IM_CONTEXT_XIM, GtkIMContextXIMClass)) -#define GTK_IS_IM_CONTEXT_XIM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_IM_CONTEXT_XIM)) -#define GTK_IS_IM_CONTEXT_XIM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_IM_CONTEXT_XIM)) -#define GTK_IM_CONTEXT_XIM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_IM_CONTEXT_XIM, GtkIMContextXIMClass)) - -typedef struct _GtkIMContextXIM GtkIMContextXIM; -typedef struct _GtkIMContextXIMClass GtkIMContextXIMClass; - -struct _GtkIMContextXIMClass -{ - GtkIMContextClass parent_class; -}; - -typedef struct _StatusWindow StatusWindow; -typedef struct _GtkXIMInfo GtkXIMInfo; - -struct _GtkIMContextXIM -{ - GtkIMContext object; - - GtkXIMInfo *im_info; - - gchar *locale; - gchar *mb_charset; - - GdkWindow *client_window; - GtkWidget *client_widget; - - /* The status window for this input context; we claim the -* * status window when we are focused and have created an XIC -* */ - StatusWindow *status_window; - - gint preedit_size; - gint preedit_length; - gunichar *preedit_chars; - XIMFeedback *feedbacks; - - gint preedit_cursor; - - XIMCallback preedit_start_callback; - XIMCallback preedit_done_callback; - XIMCallback preedit_draw_callback; - XIMCallback preedit_caret_callback; - - XIMCallback status_start_callback; - XIMCallback status_done_callback; - XIMCallback status_draw_callback; - - XIMCallback string_conversion_callback; - - XIC ic; - - guint filter_key_release : 1; - guint use_preedit : 1; - guint finalizing : 1; - guint in_toplevel : 1; - guint has_focus : 1; -}; - -static GClassInitFunc orig_gtk_im_context_xim_class_init; -static GType (*orig_g_type_module_register_type)(GTypeModule *, - GType, const gchar *, - const GTypeInfo *, GTypeFlags); -static gboolean (*orig_gtk_im_context_xim_filter_keypress)(GtkIMContext *context, - GdkEventKey *event); - -static gboolean -hook_gtk_im_context_xim_filter_keypress(GtkIMContext *context, GdkEventKey *event) { - GtkIMContextXIM *im_context_xim = GTK_IM_CONTEXT_XIM(context); - if (!im_context_xim->client_window) { - DEBUG("im_context_xim == %p\n", im_context_xim); - DEBUG("event->window == %p\n", event->window); - - gtk_im_context_set_client_window(context, event->window); - } - - return orig_gtk_im_context_xim_filter_keypress(context, event); -} - -static void -hook_gtk_im_context_xim_class_init (GtkIMContextXIMClass *class) { - orig_gtk_im_context_xim_class_init(class, NULL); /* wat? */ - - GtkIMContextClass *im_context_class = GTK_IM_CONTEXT_CLASS (class); - - assert(!orig_gtk_im_context_xim_filter_keypress); - orig_gtk_im_context_xim_filter_keypress = im_context_class->filter_keypress; - im_context_class->filter_keypress = hook_gtk_im_context_xim_filter_keypress; - DEBUG("orig_gtk_im_context_xim_filter_keypress: %p\n", - orig_gtk_im_context_xim_filter_keypress); -} - -GType -g_type_module_register_type (GTypeModule *module, - GType parent_type, - const gchar *type_name, - const GTypeInfo *type_info, - GTypeFlags flags) { - if (!orig_g_type_module_register_type) { - orig_g_type_module_register_type = dlsym(RTLD_NEXT, "g_type_module_register_type"); - assert(orig_g_type_module_register_type); - } - - if (type_name && !strcmp(type_name, "GtkIMContextXIM")) { - assert(!orig_gtk_im_context_xim_class_init); - orig_gtk_im_context_xim_class_init = type_info->class_init; - - assert(sizeof(GtkIMContextXIM) == type_info->instance_size); - - const GTypeInfo hook_im_context_xim_info = - { - type_info->class_size, - type_info->base_init, - type_info->base_finalize, - (GClassInitFunc) hook_gtk_im_context_xim_class_init, - type_info->class_finalize, - type_info->class_data, - type_info->instance_size, - type_info->n_preallocs, - type_info->instance_init, - }; - - DEBUG("orig_gtk_im_context_xim_class_init: %p\n", orig_gtk_im_context_xim_class_init); - - gtk_type_im_context_xim = - orig_g_type_module_register_type(module, parent_type, type_name, - &hook_im_context_xim_info, flags); - - return gtk_type_im_context_xim; - } - - return orig_g_type_module_register_type(module, parent_type, type_name, type_info, flags); -} From ccbdc5859ea9defa2e8c56f57e5454fd330c267d Mon Sep 17 00:00:00 2001 From: perqin Date: Tue, 9 Apr 2019 22:56:00 +0800 Subject: [PATCH 05/14] Update to 3.3207 --- .SRCINFO | 8 ++++---- PKGBUILD | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.SRCINFO b/.SRCINFO index 94025cd..fd24a30 100644 --- a/.SRCINFO +++ b/.SRCINFO @@ -1,7 +1,7 @@ pkgbase = sublime-text-3-imfix pkgdesc = Sophisticated text editor for code, markup and prose - Stable build with input method support for CJK users - pkgver = 3.3200 - pkgrel = 2 + pkgver = 3.3207 + pkgrel = 1 url = https://www.sublimetext.com/3 arch = x86_64 license = custom @@ -17,9 +17,9 @@ pkgbase = sublime-text-3-imfix conflicts = sublime-text-nightly conflicts = sublime-text-dev-imfix conflicts = sublime-text-dev-imfix2 - source = https://download.sublimetext.com/sublime_text_3_build_3200_x64.tar.bz2 + source = https://download.sublimetext.com/sublime_text_3_build_3207_x64.tar.bz2 source = LICENSE - sha256sums = b9d5297c65bd14a8ba3394e74dbd9a5013b3fed5a5a2f8f5120d2cec40614fbd + sha256sums = acb64f1de024a0f004888096afa101051e48d96c7a3e7fe96e11312d524938c4 sha256sums = 8e4c48469bf3f35d0c0904e770c4e307d4965a8931e839c01c5765498a19cf01 pkgname = sublime-text-3-imfix diff --git a/PKGBUILD b/PKGBUILD index 2afb904..f262881 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,8 +1,8 @@ # Maintainer: perqin pkgname=sublime-text-3-imfix -pkgver=3.3200 -pkgrel=2 +pkgver=3.3207 +pkgrel=1 pkgdesc='Sophisticated text editor for code, markup and prose - Stable build with input method support for CJK users' arch=('x86_64') url='https://www.sublimetext.com/3' @@ -15,7 +15,7 @@ source=( 'LICENSE' ) sha256sums=( - 'b9d5297c65bd14a8ba3394e74dbd9a5013b3fed5a5a2f8f5120d2cec40614fbd' + 'acb64f1de024a0f004888096afa101051e48d96c7a3e7fe96e11312d524938c4' '8e4c48469bf3f35d0c0904e770c4e307d4965a8931e839c01c5765498a19cf01' ) From 5afd86ac7fee6a6e1b3d92dd5829298ec9319248 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Marcos?= Date: Wed, 13 Nov 2019 11:32:43 -0300 Subject: [PATCH 06/14] Updating version to 3211 and changing maintainer --- PKGBUILD | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PKGBUILD b/PKGBUILD index f262881..92b610b 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,7 +1,7 @@ -# Maintainer: perqin +# Maintainer: marcospb19 pkgname=sublime-text-3-imfix -pkgver=3.3207 +pkgver=3.3211 pkgrel=1 pkgdesc='Sophisticated text editor for code, markup and prose - Stable build with input method support for CJK users' arch=('x86_64') From 46c432f447f0db9848a17cad2990f1bb4ae995ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Marcos?= Date: Wed, 13 Nov 2019 11:46:08 -0300 Subject: [PATCH 07/14] Fixing last commit --- .SRCINFO | 6 +++--- PKGBUILD | 8 +++----- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.SRCINFO b/.SRCINFO index fd24a30..1185994 100644 --- a/.SRCINFO +++ b/.SRCINFO @@ -1,6 +1,6 @@ pkgbase = sublime-text-3-imfix pkgdesc = Sophisticated text editor for code, markup and prose - Stable build with input method support for CJK users - pkgver = 3.3207 + pkgver = 3.3211 pkgrel = 1 url = https://www.sublimetext.com/3 arch = x86_64 @@ -17,9 +17,9 @@ pkgbase = sublime-text-3-imfix conflicts = sublime-text-nightly conflicts = sublime-text-dev-imfix conflicts = sublime-text-dev-imfix2 - source = https://download.sublimetext.com/sublime_text_3_build_3207_x64.tar.bz2 + source = https://download.sublimetext.com/sublime_text_3_build_3211_x64.tar.bz2 source = LICENSE - sha256sums = acb64f1de024a0f004888096afa101051e48d96c7a3e7fe96e11312d524938c4 + sha256sums = 0b3c8ca5e6df376c3c24a4b9ac2e3b391333f73b229bc6e87d0b4a5f636d74ee sha256sums = 8e4c48469bf3f35d0c0904e770c4e307d4965a8931e839c01c5765498a19cf01 pkgname = sublime-text-3-imfix diff --git a/PKGBUILD b/PKGBUILD index 92b610b..67cab9d 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -2,7 +2,7 @@ pkgname=sublime-text-3-imfix pkgver=3.3211 -pkgrel=1 +pkgrel=2 pkgdesc='Sophisticated text editor for code, markup and prose - Stable build with input method support for CJK users' arch=('x86_64') url='https://www.sublimetext.com/3' @@ -14,10 +14,8 @@ source=( "https://download.sublimetext.com/sublime_text_3_build_${pkgver:2}_x64.tar.bz2" 'LICENSE' ) -sha256sums=( - 'acb64f1de024a0f004888096afa101051e48d96c7a3e7fe96e11312d524938c4' - '8e4c48469bf3f35d0c0904e770c4e307d4965a8931e839c01c5765498a19cf01' -) +sha256sums=('0b3c8ca5e6df376c3c24a4b9ac2e3b391333f73b229bc6e87d0b4a5f636d74ee' + '8e4c48469bf3f35d0c0904e770c4e307d4965a8931e839c01c5765498a19cf01') package() { cd "${srcdir}" From 65321dcaa8885506f14a8fc96e4c78e4430b9e8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Marcos?= Date: Wed, 13 Nov 2019 12:13:38 -0300 Subject: [PATCH 08/14] Changed package description size --- .SRCINFO | 4 ++-- PKGBUILD | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.SRCINFO b/.SRCINFO index 1185994..cc11883 100644 --- a/.SRCINFO +++ b/.SRCINFO @@ -1,7 +1,7 @@ pkgbase = sublime-text-3-imfix - pkgdesc = Sophisticated text editor for code, markup and prose - Stable build with input method support for CJK users + pkgdesc = Sophisticated text editor for code, html and prose - Stable build with support for CJK pkgver = 3.3211 - pkgrel = 1 + pkgrel = 2 url = https://www.sublimetext.com/3 arch = x86_64 license = custom diff --git a/PKGBUILD b/PKGBUILD index 67cab9d..ec77952 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -3,7 +3,7 @@ pkgname=sublime-text-3-imfix pkgver=3.3211 pkgrel=2 -pkgdesc='Sophisticated text editor for code, markup and prose - Stable build with input method support for CJK users' +pkgdesc="Sophisticated text editor for code, html and prose - Stable build with support for CJK" arch=('x86_64') url='https://www.sublimetext.com/3' license=('custom') @@ -19,20 +19,24 @@ sha256sums=('0b3c8ca5e6df376c3c24a4b9ac2e3b391333f73b229bc6e87d0b4a5f636d74ee' package() { cd "${srcdir}" + # Install sublime text 3 install -dm755 "${pkgdir}/opt" cp --preserve=mode -r "sublime_text_3" "${pkgdir}/opt/sublime_text_3" + # Install icons for res in 128x128 16x16 256x256 32x32 48x48; do install -dm755 "${pkgdir}/usr/share/icons/hicolor/${res}/apps" ln -s "/opt/sublime_text_3/Icon/${res}/sublime-text.png" "${pkgdir}/usr/share/icons/hicolor/${res}/apps/sublime-text.png" done + # Install desktop entry and executable install -dm755 "${pkgdir}/usr/share/applications" install -Dm644 "sublime_text_3/sublime_text.desktop" "${pkgdir}/usr/share/applications/sublime_text.desktop" sed -i 's#/opt/sublime_text/sublime_text#subl#g' "${pkgdir}/usr/share/applications/sublime_text.desktop" install -dm755 "${pkgdir}/usr/bin" ln -s "/opt/sublime_text_3/sublime_text" "${pkgdir}/usr/bin/subl" + # Install license file install -d "${pkgdir}/usr/share/licenses/${pkgname}" install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" From 490414b64a122c3c87a434f9341879deba1b34bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20M=2E=20Bezerra?= Date: Sun, 13 Sep 2020 10:49:21 -0300 Subject: [PATCH 09/14] Renamed package to `sublime-text-3` --- .SRCINFO | 24 +++++++++++------------- LICENSE | 14 ++++++++++++-- PKGBUILD | 22 ++++++++++++++++------ 3 files changed, 39 insertions(+), 21 deletions(-) diff --git a/.SRCINFO b/.SRCINFO index cc11883..c7e4295 100644 --- a/.SRCINFO +++ b/.SRCINFO @@ -1,26 +1,24 @@ -pkgbase = sublime-text-3-imfix - pkgdesc = Sophisticated text editor for code, html and prose - Stable build with support for CJK +pkgbase = sublime-text-3 + pkgdesc = Sophisticated text editor for code, html and prose - stable build pkgver = 3.3211 - pkgrel = 2 + pkgrel = 1 url = https://www.sublimetext.com/3 arch = x86_64 license = custom depends = libpng depends = gtk2 provides = sublime-text - provides = sublime-text-dev - provides = sublime-text-nightly - provides = sublime-text-dev-imfix - provides = sublime-text-dev-imfix2 - conflicts = sublime-text - conflicts = sublime-text-dev + provides = sublime + conflicts = sublime-text-4-dev + conflicts = sublime-text-3-imfix + conflicts = sublime-text-imfix conflicts = sublime-text-nightly - conflicts = sublime-text-dev-imfix - conflicts = sublime-text-dev-imfix2 + conflicts = sublime-text-dev + conflicts = sublime-text2 source = https://download.sublimetext.com/sublime_text_3_build_3211_x64.tar.bz2 source = LICENSE sha256sums = 0b3c8ca5e6df376c3c24a4b9ac2e3b391333f73b229bc6e87d0b4a5f636d74ee - sha256sums = 8e4c48469bf3f35d0c0904e770c4e307d4965a8931e839c01c5765498a19cf01 + sha256sums = 339dbd1b6ae3e699809afcdd6c690299e6fa0d385aa2ef658a52d336a3f8107f -pkgname = sublime-text-3-imfix +pkgname = sublime-text-3 diff --git a/LICENSE b/LICENSE index 3e2f842..981842a 100644 --- a/LICENSE +++ b/LICENSE @@ -1,3 +1,13 @@ -Sublime Text may be downloaded and evaluated for free, however a license must be purchased for continued use. -Licenses are per-user, rather than per-machine, so you can enjoy Sublime Text on as many computers and operating systems as you wish with your license. +Maintainer note: +Sublime Text is free to use, if you want access to the newer builds, with the package +`sublime-text-4-dev` or `sublime-text-dev`, you'll need a paid license. + +Buying a license also supports the development of the editor. + +--- + +Sublime Text may be downloaded and evaluated for free, however a license must be purchased for +continued use. Licenses are per-user, rather than per-machine, so you can enjoy Sublime Text on as +many computers and operating systems as you wish with your license. + For more information, please visit https://www.sublimetext.com/buy diff --git a/PKGBUILD b/PKGBUILD index ec77952..411ba05 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,21 +1,31 @@ # Maintainer: marcospb19 -pkgname=sublime-text-3-imfix +pkgname=sublime-text-3 pkgver=3.3211 -pkgrel=2 -pkgdesc="Sophisticated text editor for code, html and prose - Stable build with support for CJK" +pkgrel=1 +pkgdesc="Sophisticated text editor for code, html and prose - stable build" arch=('x86_64') url='https://www.sublimetext.com/3' license=('custom') depends=('libpng' 'gtk2') -conflicts=('sublime-text' 'sublime-text-dev' 'sublime-text-nightly' 'sublime-text-dev-imfix' 'sublime-text-dev-imfix2') -provides=('sublime-text' 'sublime-text-dev' 'sublime-text-nightly' 'sublime-text-dev-imfix' 'sublime-text-dev-imfix2') + +replaces=('sublime-text-3-imfix') + +conflicts=('sublime-text-4-dev' + 'sublime-text-3-imfix' + 'sublime-text-imfix' + 'sublime-text-nightly' + 'sublime-text-dev' + 'sublime-text2') + +provides=('sublime-text' 'sublime') + source=( "https://download.sublimetext.com/sublime_text_3_build_${pkgver:2}_x64.tar.bz2" 'LICENSE' ) sha256sums=('0b3c8ca5e6df376c3c24a4b9ac2e3b391333f73b229bc6e87d0b4a5f636d74ee' - '8e4c48469bf3f35d0c0904e770c4e307d4965a8931e839c01c5765498a19cf01') + '339dbd1b6ae3e699809afcdd6c690299e6fa0d385aa2ef658a52d336a3f8107f') package() { cd "${srcdir}" From 43b10975f352ea4425d2d3b5e83066e635806259 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20M=2E=20Bezerra?= Date: Sun, 18 Jul 2021 21:45:58 -0300 Subject: [PATCH 10/14] Removing "sublime" from "provides" --- .SRCINFO | 4 ++-- PKGBUILD | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.SRCINFO b/.SRCINFO index c7e4295..addfb1f 100644 --- a/.SRCINFO +++ b/.SRCINFO @@ -8,17 +8,17 @@ pkgbase = sublime-text-3 depends = libpng depends = gtk2 provides = sublime-text - provides = sublime conflicts = sublime-text-4-dev + conflicts = sublime-text-4 conflicts = sublime-text-3-imfix conflicts = sublime-text-imfix conflicts = sublime-text-nightly conflicts = sublime-text-dev conflicts = sublime-text2 + replaces = sublime-text-3-imfix source = https://download.sublimetext.com/sublime_text_3_build_3211_x64.tar.bz2 source = LICENSE sha256sums = 0b3c8ca5e6df376c3c24a4b9ac2e3b391333f73b229bc6e87d0b4a5f636d74ee sha256sums = 339dbd1b6ae3e699809afcdd6c690299e6fa0d385aa2ef658a52d336a3f8107f pkgname = sublime-text-3 - diff --git a/PKGBUILD b/PKGBUILD index 411ba05..a3c3ca6 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -12,13 +12,14 @@ depends=('libpng' 'gtk2') replaces=('sublime-text-3-imfix') conflicts=('sublime-text-4-dev' + 'sublime-text-4' 'sublime-text-3-imfix' 'sublime-text-imfix' 'sublime-text-nightly' 'sublime-text-dev' 'sublime-text2') -provides=('sublime-text' 'sublime') +provides=('sublime-text') source=( "https://download.sublimetext.com/sublime_text_3_build_${pkgver:2}_x64.tar.bz2" From 16cbab618fabe0d4ac6900e0ef362bce01976d73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20H=C3=BCsers?= Date: Tue, 15 Nov 2022 17:16:35 +0100 Subject: [PATCH 11/14] upgpkg: sublime-text-3 3.3211-2 Allow installation next to sublime-text --- sublime-text-3/.SRCINFO | 14 ++------ sublime-text-3/.gitignore | 4 --- sublime-text-3/LICENSE | 13 -------- sublime-text-3/PKGBUILD | 48 ++++++++++----------------- sublime-text-3/sublime-text-3.install | 18 ++++++++++ 5 files changed, 38 insertions(+), 59 deletions(-) delete mode 100644 sublime-text-3/.gitignore delete mode 100644 sublime-text-3/LICENSE create mode 100644 sublime-text-3/sublime-text-3.install diff --git a/sublime-text-3/.SRCINFO b/sublime-text-3/.SRCINFO index addfb1f..be124a1 100644 --- a/sublime-text-3/.SRCINFO +++ b/sublime-text-3/.SRCINFO @@ -1,24 +1,14 @@ pkgbase = sublime-text-3 pkgdesc = Sophisticated text editor for code, html and prose - stable build pkgver = 3.3211 - pkgrel = 1 + pkgrel = 2 url = https://www.sublimetext.com/3 + install = sublime-text-3.install arch = x86_64 license = custom depends = libpng depends = gtk2 - provides = sublime-text - conflicts = sublime-text-4-dev - conflicts = sublime-text-4 - conflicts = sublime-text-3-imfix - conflicts = sublime-text-imfix - conflicts = sublime-text-nightly - conflicts = sublime-text-dev - conflicts = sublime-text2 - replaces = sublime-text-3-imfix source = https://download.sublimetext.com/sublime_text_3_build_3211_x64.tar.bz2 - source = LICENSE sha256sums = 0b3c8ca5e6df376c3c24a4b9ac2e3b391333f73b229bc6e87d0b4a5f636d74ee - sha256sums = 339dbd1b6ae3e699809afcdd6c690299e6fa0d385aa2ef658a52d336a3f8107f pkgname = sublime-text-3 diff --git a/sublime-text-3/.gitignore b/sublime-text-3/.gitignore deleted file mode 100644 index 2f39e2f..0000000 --- a/sublime-text-3/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -/*.tar.bz2 -/*.pkg.tar.xz -/pkg -/src diff --git a/sublime-text-3/LICENSE b/sublime-text-3/LICENSE deleted file mode 100644 index 981842a..0000000 --- a/sublime-text-3/LICENSE +++ /dev/null @@ -1,13 +0,0 @@ -Maintainer note: -Sublime Text is free to use, if you want access to the newer builds, with the package -`sublime-text-4-dev` or `sublime-text-dev`, you'll need a paid license. - -Buying a license also supports the development of the editor. - ---- - -Sublime Text may be downloaded and evaluated for free, however a license must be purchased for -continued use. Licenses are per-user, rather than per-machine, so you can enjoy Sublime Text on as -many computers and operating systems as you wish with your license. - -For more information, please visit https://www.sublimetext.com/buy diff --git a/sublime-text-3/PKGBUILD b/sublime-text-3/PKGBUILD index a3c3ca6..28dad93 100644 --- a/sublime-text-3/PKGBUILD +++ b/sublime-text-3/PKGBUILD @@ -1,36 +1,26 @@ -# Maintainer: marcospb19 +# Maintainer: Manuel Hüsers +# Contributor: marcospb19 pkgname=sublime-text-3 pkgver=3.3211 -pkgrel=1 +pkgrel=2 pkgdesc="Sophisticated text editor for code, html and prose - stable build" arch=('x86_64') url='https://www.sublimetext.com/3' license=('custom') depends=('libpng' 'gtk2') - -replaces=('sublime-text-3-imfix') - -conflicts=('sublime-text-4-dev' - 'sublime-text-4' - 'sublime-text-3-imfix' - 'sublime-text-imfix' - 'sublime-text-nightly' - 'sublime-text-dev' - 'sublime-text2') - -provides=('sublime-text') - -source=( - "https://download.sublimetext.com/sublime_text_3_build_${pkgver:2}_x64.tar.bz2" - 'LICENSE' -) -sha256sums=('0b3c8ca5e6df376c3c24a4b9ac2e3b391333f73b229bc6e87d0b4a5f636d74ee' - '339dbd1b6ae3e699809afcdd6c690299e6fa0d385aa2ef658a52d336a3f8107f') +install="${pkgname}.install" +source=("https://download.sublimetext.com/sublime_text_3_build_${pkgver:2}_x64.tar.bz2") +sha256sums=('0b3c8ca5e6df376c3c24a4b9ac2e3b391333f73b229bc6e87d0b4a5f636d74ee') package() { cd "${srcdir}" + # Adjust naming + sed -i 's#/opt/sublime_text/sublime_text#/opt/sublime_text_3/sublime_text#g' "sublime_text_3/sublime_text.desktop" + sed -i 's#Sublime Text#Sublime Text 3#g' "sublime_text_3/sublime_text.desktop" + sed -i 's#sublime-text#sublime-text-3#g' "sublime_text_3/sublime_text.desktop" + # Install sublime text 3 install -dm755 "${pkgdir}/opt" cp --preserve=mode -r "sublime_text_3" "${pkgdir}/opt/sublime_text_3" @@ -38,17 +28,15 @@ package() { # Install icons for res in 128x128 16x16 256x256 32x32 48x48; do install -dm755 "${pkgdir}/usr/share/icons/hicolor/${res}/apps" - ln -s "/opt/sublime_text_3/Icon/${res}/sublime-text.png" "${pkgdir}/usr/share/icons/hicolor/${res}/apps/sublime-text.png" + ln -s "/opt/sublime_text_3/Icon/${res}/sublime-text.png" "${pkgdir}/usr/share/icons/hicolor/${res}/apps/sublime-text-3.png" done # Install desktop entry and executable - install -dm755 "${pkgdir}/usr/share/applications" - install -Dm644 "sublime_text_3/sublime_text.desktop" "${pkgdir}/usr/share/applications/sublime_text.desktop" - sed -i 's#/opt/sublime_text/sublime_text#subl#g' "${pkgdir}/usr/share/applications/sublime_text.desktop" - install -dm755 "${pkgdir}/usr/bin" - ln -s "/opt/sublime_text_3/sublime_text" "${pkgdir}/usr/bin/subl" + sed -i 's#/opt/sublime_text_3/sublime_text#/usr/bin/subl3#g' "sublime_text_3/sublime_text.desktop" - # Install license file - install -d "${pkgdir}/usr/share/licenses/${pkgname}" - install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" + install -dm755 "${pkgdir}/usr/share/applications" + install -Dm644 "sublime_text_3/sublime_text.desktop" "${pkgdir}/usr/share/applications/sublime_text_3.desktop" + + install -dm755 "${pkgdir}/usr/bin" + ln -s "/opt/sublime_text_3/sublime_text" "${pkgdir}/usr/bin/subl3" } diff --git a/sublime-text-3/sublime-text-3.install b/sublime-text-3/sublime-text-3.install new file mode 100644 index 0000000..83f0138 --- /dev/null +++ b/sublime-text-3/sublime-text-3.install @@ -0,0 +1,18 @@ +post_install() { + cat << _EOF + + ==> sublime-text-3 install note: + ------------------------------------------------------------------------------ + Since this is the last version of Sublime Text 3, you might want to disable + in-application reminders about new Sublime Text versions (reportedly only + works as a licensed user). + + Add the following setting to your User Preferences file: + "update_check": false + +_EOF +} + +post_upgrade() { + post_install +} From 651f681329555e70c7cb753325dbb5b8729702c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20H=C3=BCsers?= Date: Tue, 15 Nov 2022 17:21:20 +0100 Subject: [PATCH 12/14] upgpkg: sublime-text-4 4.4143-2 Update formatting Use included desktop file Remove obsolete optdepends --- sublime-text-4/.SRCINFO | 5 +---- sublime-text-4/PKGBUILD | 17 ++++++++--------- sublime-text-4/sublime_text.desktop | 24 ------------------------ 3 files changed, 9 insertions(+), 37 deletions(-) delete mode 100644 sublime-text-4/sublime_text.desktop diff --git a/sublime-text-4/.SRCINFO b/sublime-text-4/.SRCINFO index 1d04289..dad6b7d 100644 --- a/sublime-text-4/.SRCINFO +++ b/sublime-text-4/.SRCINFO @@ -1,18 +1,15 @@ pkgbase = sublime-text-4 pkgdesc = Sophisticated text editor for code, html and prose - stable build pkgver = 4.4143 - pkgrel = 1 + pkgrel = 2 url = https://www.sublimetext.com/download arch = x86_64 arch = aarch64 license = custom depends = libpng depends = gtk3 - optdepends = gksu: sudo-save support provides = sublime-text conflicts = sublime-text - source = sublime_text.desktop - sha256sums = e991aac5207655dadf69c6f74c194c80009fb9767d7710337f586908969aa9cf source_x86_64 = https://download.sublimetext.com/sublime_text_build_4143_x64.tar.xz sha256sums_x86_64 = 7de862c38d19367414117110328dded754ac709fed54c8cc5cb0737c894c073c source_aarch64 = https://download.sublimetext.com/sublime_text_build_4143_arm64.tar.xz diff --git a/sublime-text-4/PKGBUILD b/sublime-text-4/PKGBUILD index 68df7ae..1f76103 100644 --- a/sublime-text-4/PKGBUILD +++ b/sublime-text-4/PKGBUILD @@ -2,21 +2,18 @@ pkgname=sublime-text-4 pkgver=4.4143 -pkgrel=1 -pkgdesc="Sophisticated text editor for code, html and prose - stable build" +pkgrel=2 +pkgdesc='Sophisticated text editor for code, html and prose - stable build' arch=('x86_64' 'aarch64') -url="https://www.sublimetext.com/download" +url='https://www.sublimetext.com/download' license=('custom') depends=('libpng' 'gtk3') -optdepends=('gksu: sudo-save support') conflicts=('sublime-text') provides=('sublime-text') -source=('sublime_text.desktop') source_x86_64=("https://download.sublimetext.com/sublime_text_build_${pkgver:2}_x64.tar.xz") source_aarch64=("https://download.sublimetext.com/sublime_text_build_${pkgver:2}_arm64.tar.xz") -sha256sums=('e991aac5207655dadf69c6f74c194c80009fb9767d7710337f586908969aa9cf') sha256sums_x86_64=('7de862c38d19367414117110328dded754ac709fed54c8cc5cb0737c894c073c') sha256sums_aarch64=('e33a4d1d51073bdf2f1dc5936ea9b096b078f87230a10a23790beaee702a4a93') @@ -24,16 +21,18 @@ package() { cd "${srcdir}" install -dm755 "${pkgdir}/opt" - cp --preserve=mode -r "sublime_text" "${pkgdir}/opt/sublime_text" + cp --preserve=mode -r 'sublime_text' "${pkgdir}/opt/sublime_text" for res in 128x128 16x16 256x256 32x32 48x48; do install -dm755 "${pkgdir}/usr/share/icons/hicolor/${res}/apps" ln -s "/opt/sublime_text/Icon/${res}/sublime-text.png" "${pkgdir}/usr/share/icons/hicolor/${res}/apps/sublime-text.png" done + sed -i 's#/opt/sublime_text/sublime_text#/usr/bin/subl#g' 'sublime_text/sublime_text.desktop' + install -dm755 "${pkgdir}/usr/share/applications" - install -Dm644 "sublime_text.desktop" "${pkgdir}/usr/share/applications/sublime_text.desktop" + install -Dm644 'sublime_text/sublime_text.desktop' "${pkgdir}/usr/share/applications/sublime_text.desktop" install -dm755 "${pkgdir}/usr/bin" - ln -s "/opt/sublime_text/sublime_text" "${pkgdir}/usr/bin/subl" + ln -s '/opt/sublime_text/sublime_text' "${pkgdir}/usr/bin/subl" } diff --git a/sublime-text-4/sublime_text.desktop b/sublime-text-4/sublime_text.desktop deleted file mode 100644 index f678850..0000000 --- a/sublime-text-4/sublime_text.desktop +++ /dev/null @@ -1,24 +0,0 @@ -[Desktop Entry] -Version=1.0 -Type=Application -Name=Sublime Text -GenericName=Text Editor -Comment=Sophisticated text editor for code, markup and prose -Exec=subl %F -Terminal=false -MimeType=text/plain; -Icon=sublime-text -Categories=TextEditor;Development; -StartupNotify=true -StartupWMClass=subl -Actions=Window;Document; - -[Desktop Action Window] -Name=New Window -Exec=subl -n -OnlyShowIn=Unity; - -[Desktop Action Document] -Name=New File -Exec=subl --command new_file -OnlyShowIn=Unity; From 6c6a3546ab86c49f7b18d84e7a3fed0d73f2bd0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20H=C3=BCsers?= Date: Tue, 15 Nov 2022 17:24:05 +0100 Subject: [PATCH 13/14] upgpkg: sublime-text-dev 4.4141-2 Update formatting Use included desktop file Remove obsolete optdepends --- sublime-text-dev/.SRCINFO | 5 +---- sublime-text-dev/PKGBUILD | 17 ++++++++--------- sublime-text-dev/sublime_text.desktop | 24 ------------------------ 3 files changed, 9 insertions(+), 37 deletions(-) delete mode 100644 sublime-text-dev/sublime_text.desktop diff --git a/sublime-text-dev/.SRCINFO b/sublime-text-dev/.SRCINFO index 9c11952..14ff8a3 100644 --- a/sublime-text-dev/.SRCINFO +++ b/sublime-text-dev/.SRCINFO @@ -1,7 +1,7 @@ pkgbase = sublime-text-dev pkgdesc = Sophisticated text editor for code, html and prose - dev build pkgver = 4.4141 - pkgrel = 1 + pkgrel = 2 url = https://www.sublimetext.com/dev install = sublime-text-dev.install arch = x86_64 @@ -9,11 +9,8 @@ pkgbase = sublime-text-dev license = custom depends = libpng depends = gtk3 - optdepends = gksu: sudo-save support provides = sublime-text conflicts = sublime-text - source = sublime_text.desktop - sha256sums = e991aac5207655dadf69c6f74c194c80009fb9767d7710337f586908969aa9cf source_x86_64 = https://download.sublimetext.com/sublime_text_build_4141_x64.tar.xz sha256sums_x86_64 = 785a3dbf8852ae9d60579e9a755c8507db0e02939794a36f5415b4c1b1581b88 source_aarch64 = https://download.sublimetext.com/sublime_text_build_4141_arm64.tar.xz diff --git a/sublime-text-dev/PKGBUILD b/sublime-text-dev/PKGBUILD index 8c645a7..7e38d31 100644 --- a/sublime-text-dev/PKGBUILD +++ b/sublime-text-dev/PKGBUILD @@ -4,22 +4,19 @@ pkgname=sublime-text-dev pkgver=4.4141 -pkgrel=1 -pkgdesc="Sophisticated text editor for code, html and prose - dev build" +pkgrel=2 +pkgdesc='Sophisticated text editor for code, html and prose - dev build' arch=('x86_64' 'aarch64') -url="https://www.sublimetext.com/dev" +url='https://www.sublimetext.com/dev' license=('custom') depends=('libpng' 'gtk3') -optdepends=('gksu: sudo-save support') conflicts=('sublime-text') provides=('sublime-text') install=${pkgname}.install -source=('sublime_text.desktop') source_x86_64=("https://download.sublimetext.com/sublime_text_build_${pkgver:2}_x64.tar.xz") source_aarch64=("https://download.sublimetext.com/sublime_text_build_${pkgver:2}_arm64.tar.xz") -sha256sums=('e991aac5207655dadf69c6f74c194c80009fb9767d7710337f586908969aa9cf') sha256sums_x86_64=('785a3dbf8852ae9d60579e9a755c8507db0e02939794a36f5415b4c1b1581b88') sha256sums_aarch64=('326c12a6dbd21f9d3bf97f464fc182e2dcd917311f4f6a4a73efd0bb949b3243') @@ -27,16 +24,18 @@ package() { cd "${srcdir}" install -dm755 "${pkgdir}/opt" - cp --preserve=mode -r "sublime_text" "${pkgdir}/opt/sublime_text" + cp --preserve=mode -r 'sublime_text' "${pkgdir}/opt/sublime_text" for res in 128x128 16x16 256x256 32x32 48x48; do install -dm755 "${pkgdir}/usr/share/icons/hicolor/${res}/apps" ln -s "/opt/sublime_text/Icon/${res}/sublime-text.png" "${pkgdir}/usr/share/icons/hicolor/${res}/apps/sublime-text.png" done + sed -i 's#/opt/sublime_text/sublime_text#/usr/bin/subl#g' 'sublime_text/sublime_text.desktop' + install -dm755 "${pkgdir}/usr/share/applications" - install -Dm644 "sublime_text.desktop" "${pkgdir}/usr/share/applications/sublime_text.desktop" + install -Dm644 'sublime_text/sublime_text.desktop' "${pkgdir}/usr/share/applications/sublime_text.desktop" install -dm755 "${pkgdir}/usr/bin" - ln -s "/opt/sublime_text/sublime_text" "${pkgdir}/usr/bin/subl" + ln -s '/opt/sublime_text/sublime_text' "${pkgdir}/usr/bin/subl" } diff --git a/sublime-text-dev/sublime_text.desktop b/sublime-text-dev/sublime_text.desktop deleted file mode 100644 index f678850..0000000 --- a/sublime-text-dev/sublime_text.desktop +++ /dev/null @@ -1,24 +0,0 @@ -[Desktop Entry] -Version=1.0 -Type=Application -Name=Sublime Text -GenericName=Text Editor -Comment=Sophisticated text editor for code, markup and prose -Exec=subl %F -Terminal=false -MimeType=text/plain; -Icon=sublime-text -Categories=TextEditor;Development; -StartupNotify=true -StartupWMClass=subl -Actions=Window;Document; - -[Desktop Action Window] -Name=New Window -Exec=subl -n -OnlyShowIn=Unity; - -[Desktop Action Document] -Name=New File -Exec=subl --command new_file -OnlyShowIn=Unity; From 95be8e0fc11b7308a875e3175b5054ac8645676a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20H=C3=BCsers?= Date: Tue, 15 Nov 2022 17:25:15 +0100 Subject: [PATCH 14/14] upgpkg: firefox-syncstorage 0.13.0-1 upstream release --- firefox-syncstorage/.SRCINFO | 6 +++--- firefox-syncstorage/PKGBUILD | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/firefox-syncstorage/.SRCINFO b/firefox-syncstorage/.SRCINFO index aa7be2c..a2814d4 100644 --- a/firefox-syncstorage/.SRCINFO +++ b/firefox-syncstorage/.SRCINFO @@ -1,6 +1,6 @@ pkgbase = firefox-syncstorage pkgdesc = Sync storage server with built-in token server for running a self-hosted firefox sync server - pkgver = 0.12.5 + pkgver = 0.13.0 pkgrel = 1 url = https://github.com/mozilla-services/syncstorage-rs install = firefox-syncstorage.install @@ -20,9 +20,9 @@ pkgbase = firefox-syncstorage depends = python-tokenlib optdepends = mysql: for use with a local database server backup = etc/firefox-syncstorage.toml - source = https://github.com/mozilla-services/syncstorage-rs/archive/0.12.5.tar.gz + source = https://github.com/mozilla-services/syncstorage-rs/archive/0.13.0.tar.gz source = firefox-syncstorage.service - sha256sums = e9904c3571789f5ba29645a69def5f7550ebd544d51c3af5a4b5a2c1b1b72135 + sha256sums = 62c9922f3fc8067da511780fbdd7e41a55d18ec0790827ec253a17fcc60022a7 sha256sums = 609e057cd835ea54b06b32b98e210cd946255f652e7754c9160fd7c94379a83d pkgname = firefox-syncstorage diff --git a/firefox-syncstorage/PKGBUILD b/firefox-syncstorage/PKGBUILD index 28f7d08..d2d68c0 100644 --- a/firefox-syncstorage/PKGBUILD +++ b/firefox-syncstorage/PKGBUILD @@ -5,7 +5,7 @@ pkgname=firefox-syncstorage _pkgname=syncstorage-rs -pkgver=0.12.5 +pkgver=0.13.0 pkgrel=1 pkgdesc='Sync storage server with built-in token server for running a self-hosted firefox sync server' arch=('i686' 'x86_64' 'arm' 'armv6h' 'armv7h' 'aarch64') @@ -17,7 +17,7 @@ optdepends=('mysql: for use with a local database server') install="${pkgname}.install" source=("https://github.com/mozilla-services/${_pkgname}/archive/${pkgver}.tar.gz" "${pkgname}.service") -sha256sums=('e9904c3571789f5ba29645a69def5f7550ebd544d51c3af5a4b5a2c1b1b72135' +sha256sums=('62c9922f3fc8067da511780fbdd7e41a55d18ec0790827ec253a17fcc60022a7' '609e057cd835ea54b06b32b98e210cd946255f652e7754c9160fd7c94379a83d') backup=("etc/${pkgname}.toml") @@ -30,7 +30,7 @@ package() { cd "${_pkgname}-${pkgver}" # Installing manually - install -Dm 755 target/release/syncstorage "${pkgdir}"/usr/bin/"${pkgname}" + install -Dm 755 target/release/syncserver "${pkgdir}"/usr/bin/"${pkgname}" install -Dm 644 config/local.example.toml "${pkgdir}"/etc/"${pkgname}".toml install -Dm 644 "${srcdir}/${pkgname}".service "${pkgdir}"/usr/lib/systemd/system/"${pkgname}".service }