diff --git a/mingw-w64-geany/0001-Fix-windres-invocation.patch b/mingw-w64-geany/0001-Fix-windres-invocation.patch new file mode 100644 index 0000000000..dd57129186 --- /dev/null +++ b/mingw-w64-geany/0001-Fix-windres-invocation.patch @@ -0,0 +1,37 @@ +From ada38bc30b61401ea36296e6f580cbed7b50b5ce Mon Sep 17 00:00:00 2001 +From: David Macek +Date: Thu, 19 Feb 2015 13:42:35 +0100 +Subject: [PATCH 1/4] Fix windres invocation + +--- + src/Makefile.in | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/src/Makefile.in b/src/Makefile.in +index c231cfc..528b580 100644 +--- a/src/Makefile.in ++++ b/src/Makefile.in +@@ -547,7 +547,7 @@ nodist_EXTRA_geany_SOURCES = dummy.cxx + @MINGW_TRUE@ -DG_LOG_DOMAIN=\""Geany"\" + + @MINGW_TRUE@geany_LDFLAGS = -mwindows -mms-bitfields +-@MINGW_TRUE@WINDRES = $(host_alias)-windres ++@MINGW_TRUE@WINDRES = windres + all: all-am + + .SUFFIXES: +@@ -968,7 +968,10 @@ uninstall-am: uninstall-binPROGRAMS uninstall-geany_includeHEADERS + + + @MINGW_TRUE@geany_private.res: +-@MINGW_TRUE@ $(WINDRES) -i ../geany_private.rc --input-format=rc -o geany_private.res -O coff; ++@MINGW_TRUE@ cp $(VPATH)/../geany_private.rc ./ ++@MINGW_TRUE@ cp $(VPATH)/../geany.exe.manifest ./ ++@MINGW_TRUE@ cp $(VPATH)/../icons/geany.ico ../icons/ ++@MINGW_TRUE@ $(WINDRES) -i geany_private.rc --input-format=rc -o geany_private.res -O coff; + + @MINGW_TRUE@clean-local: + @MINGW_TRUE@ rm -f geany_private.res +-- +2.3.0 + diff --git a/mingw-w64-geany/0002-Fix-plugin-compilation.patch b/mingw-w64-geany/0002-Fix-plugin-compilation.patch new file mode 100644 index 0000000000..f1ab6a2b8e --- /dev/null +++ b/mingw-w64-geany/0002-Fix-plugin-compilation.patch @@ -0,0 +1,25 @@ +From 7e6446a6c67f47d68317b071ad4767b9f24f2255 Mon Sep 17 00:00:00 2001 +From: David Macek +Date: Thu, 19 Feb 2015 13:44:06 +0100 +Subject: [PATCH 2/4] Fix plugin compilation + +--- + plugins/Makefile.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/plugins/Makefile.in b/plugins/Makefile.in +index 111f135..30ddf6e 100644 +--- a/plugins/Makefile.in ++++ b/plugins/Makefile.in +@@ -463,7 +463,7 @@ splitwindow_la_LDFLAGS = -module -avoid-version + + # build Geany for Windows on non-Windows systems (cross-compile) + # (this is a little hack'ish and surely can be improved) +-@MINGW_TRUE@@PLUGINS_TRUE@DLL_LD_FLAGS = -module -avoid-version ++@MINGW_TRUE@@PLUGINS_TRUE@DLL_LD_FLAGS = + @MINGW_TRUE@@PLUGINS_TRUE@MINGW_CFLAGS = \ + @MINGW_TRUE@@PLUGINS_TRUE@ -DGEANY_DATADIR=\"data\" \ + @MINGW_TRUE@@PLUGINS_TRUE@ -DHAVE_CONFIG_H \ +-- +2.3.0 + diff --git a/mingw-w64-geany/0003-Use-FHS.patch b/mingw-w64-geany/0003-Use-FHS.patch new file mode 100644 index 0000000000..4b62073694 --- /dev/null +++ b/mingw-w64-geany/0003-Use-FHS.patch @@ -0,0 +1,69 @@ +From 45bd465a64e456defcf37f429afe89edf103b4fa Mon Sep 17 00:00:00 2001 +From: David Macek +Date: Thu, 19 Feb 2015 13:52:42 +0100 +Subject: [PATCH 3/4] Use FHS + +--- + plugins/Makefile.in | 2 +- + src/Makefile.in | 2 +- + src/main.c | 4 ++-- + src/plugins.c | 2 +- + 4 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/plugins/Makefile.in b/plugins/Makefile.in +index 30ddf6e..73b54f1 100644 +--- a/plugins/Makefile.in ++++ b/plugins/Makefile.in +@@ -465,7 +465,7 @@ splitwindow_la_LDFLAGS = -module -avoid-version + # (this is a little hack'ish and surely can be improved) + @MINGW_TRUE@@PLUGINS_TRUE@DLL_LD_FLAGS = + @MINGW_TRUE@@PLUGINS_TRUE@MINGW_CFLAGS = \ +-@MINGW_TRUE@@PLUGINS_TRUE@ -DGEANY_DATADIR=\"data\" \ ++@MINGW_TRUE@@PLUGINS_TRUE@ -DGEANY_DATADIR=\"\" \ + @MINGW_TRUE@@PLUGINS_TRUE@ -DHAVE_CONFIG_H \ + @MINGW_TRUE@@PLUGINS_TRUE@ -DGTK \ + @MINGW_TRUE@@PLUGINS_TRUE@ -I$(top_srcdir) \ +diff --git a/src/Makefile.in b/src/Makefile.in +index 528b580..0638b0e 100644 +--- a/src/Makefile.in ++++ b/src/Makefile.in +@@ -537,7 +537,7 @@ nodist_EXTRA_geany_SOURCES = dummy.cxx + @MINGW_FALSE@ -DGTK \ + @MINGW_FALSE@ -DG_LOG_DOMAIN=\""Geany"\" + +-@MINGW_TRUE@AM_CFLAGS = -DGEANY_DATADIR=\"data\" \ ++@MINGW_TRUE@AM_CFLAGS = -DGEANY_DATADIR=\"\" \ + @MINGW_TRUE@ -DGEANY_DOCDIR=\"\" \ + @MINGW_TRUE@ -DGEANY_LIBDIR=\"\" \ + @MINGW_TRUE@ -DGEANY_LOCALEDIR=\"\" \ +diff --git a/src/main.c b/src/main.c +index 0d952bc..fc5ca18 100644 +--- a/src/main.c ++++ b/src/main.c +@@ -414,8 +414,8 @@ static void setup_paths(void) + * documentation and data files */ + gchar *install_dir = win32_get_installation_dir(); + +- data_dir = g_build_filename(install_dir, "data", NULL); /* e.g. C:\Program Files\geany\data */ +- doc_dir = g_build_filename(install_dir, "doc", NULL); ++ data_dir = g_build_filename(install_dir, "share", "geany", NULL); ++ doc_dir = g_build_filename(install_dir, "share", "doc", "geany", "html", NULL); + + g_free(install_dir); + #else +diff --git a/src/plugins.c b/src/plugins.c +index 08523d8..3f17f8c 100644 +--- a/src/plugins.c ++++ b/src/plugins.c +@@ -962,7 +962,7 @@ static gchar *get_plugin_path(void) + gchar *path; + gchar *install_dir = win32_get_installation_dir(); + +- path = g_build_filename(install_dir, "lib", NULL); ++ path = g_build_filename(install_dir, "lib", "geany", NULL); + g_free(install_dir); + + return path; +-- +2.3.0 + diff --git a/mingw-w64-geany/0004-Fix-genapi-invocation.patch b/mingw-w64-geany/0004-Fix-genapi-invocation.patch new file mode 100644 index 0000000000..2be70d4b27 --- /dev/null +++ b/mingw-w64-geany/0004-Fix-genapi-invocation.patch @@ -0,0 +1,41 @@ +From a3d840f370ed2e4478a3d6e865350003bc73e548 Mon Sep 17 00:00:00 2001 +From: David Macek +Date: Thu, 19 Feb 2015 23:16:44 +0100 +Subject: [PATCH 4/4] Fix genapi invocation + +--- + plugins/Makefile.in | 4 ++-- + plugins/genapi.py | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/plugins/Makefile.in b/plugins/Makefile.in +index 73b54f1..ef273e1 100644 +--- a/plugins/Makefile.in ++++ b/plugins/Makefile.in +@@ -958,8 +958,8 @@ uninstall-am: uninstall-pluginLTLIBRARIES \ + + + # systems without python should continue to build OK +-geanyfunctions.h: genapi.py ../src/plugins.c +- python genapi.py || true ++geanyfunctions.h: @srcdir@/genapi.py @srcdir@/../src/plugins.c ++ python2 @srcdir@/genapi.py @srcdir@/../src/plugins.c + + all: geanyfunctions.h + +diff --git a/plugins/genapi.py b/plugins/genapi.py +index 5c798f8..31d3fe3 100644 +--- a/plugins/genapi.py ++++ b/plugins/genapi.py +@@ -36,7 +36,7 @@ import sys + + def get_function_names(): + names = [] +- filep = open('../src/plugins.c') ++ filep = open(sys.argv[1]) + while 1: + line = filep.readline() + if line == "": +-- +2.3.0 + diff --git a/mingw-w64-geany/PKGBUILD b/mingw-w64-geany/PKGBUILD new file mode 100644 index 0000000000..79c2856954 --- /dev/null +++ b/mingw-w64-geany/PKGBUILD @@ -0,0 +1,77 @@ +# Contributor (MSYS2): David Macek +# Maintainer (Arch Linux): Alexander Rødseth +# Contributor (Arch Linux): Angel Velasquez +# Contributor (Arch Linux): Ionut Biru +# Contributor (Arch Linux): William Rea +# Contributor (Arch Linux): Allan McRae + +_realname=geany +pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}" +pkgver=1.24.1 +pkgrel=1 +pkgdesc='Fast and lightweight IDE (mingw-w64)' +arch=('any') +url='http://www.geany.org/' +license=('GPL') +depends=("${MINGW_PACKAGE_PREFIX}-gtk2" + "${MINGW_PACKAGE_PREFIX}-hicolor-icon-theme") +makedepends=('perlxml' + 'intltool' + "${MINGW_PACKAGE_PREFIX}-gcc") +install=geany-${CARCH}.install +optdepends=( + #'geany-plugins: various extra features' + #'vte: terminal support' + "${MINGW_PACKAGE_PREFIX}-python2") +source=("http://download.geany.org/${_realname}-${pkgver}.tar.bz2" + "0001-Fix-windres-invocation.patch" + "0002-Fix-plugin-compilation.patch" + "0003-Use-FHS.patch" + "0004-Fix-genapi-invocation.patch") +sha256sums=('7fb505d9b01fe6874890525f837644a6a38c23a372bb068c65ef3673108a8c33' + 'aacd1815833e03ba95853f7a8adf53d848cc68f41c5cddd47f2f1a8425590a81' + 'b96b810359e45bb9a263377bc2dcca0125833bf649153cd5da24d21ee94cfb42' + '8380b1cfa5f58233158c7e4f71d910399026df4bc3abf117087e050ecee323cf' + 'a21ff06e9022bb973f876d4edc003c23f3c244c3638281b58a2b141a6ba893b9') + +prepare() { + cd "${srcdir}/${_realname}-${pkgver}" + + # Python2 fix + sed -i '0,/on/s//on2/' data/templates/files/main.py + + # Syntax highlighting for PKGBUILD files + sed -i 's/Sh=/Sh=PKGBUILD;/' data/filetype_extensions.conf + + patch -p1 -i "${srcdir}/0001-Fix-windres-invocation.patch" + patch -p1 -i "${srcdir}/0002-Fix-plugin-compilation.patch" + patch -p1 -i "${srcdir}/0003-Use-FHS.patch" + patch -p1 -i "${srcdir}/0004-Fix-genapi-invocation.patch" +} + +build() { + mkdir -p "build-${MINGW_CHOST}" + cd "build-${MINGW_CHOST}" + + # libiberty + export LDFLAGS+=" -L${MINGW_PREFIX}/lib/binutils" + + # config.h + export PLUGIN_CFLAGS+=" -I$(pwd)" + + ../${_realname}-${pkgver}/configure \ + --host=${MINGW_CHOST} \ + --target=${MINGW_CHOST} \ + --build=${MINGW_CHOST} \ + --prefix=${MINGW_PREFIX} + make +} + +package() { + cd "build-${MINGW_CHOST}" + make DESTDIR="${pkgdir}" install + mkdir -p "${pkgdir}${MINGW_PREFIX}/lib/geany" + cp plugins/*.dll "${pkgdir}${MINGW_PREFIX}/lib/geany/" + rm -r "${pkgdir}${MINGW_PREFIX}/share/applications" + rm -r "${pkgdir}${MINGW_PREFIX}/share/icons/hicolor/index.theme" +} diff --git a/mingw-w64-geany/geany-i686.install b/mingw-w64-geany/geany-i686.install new file mode 100644 index 0000000000..da50a72875 --- /dev/null +++ b/mingw-w64-geany/geany-i686.install @@ -0,0 +1,11 @@ +post_install() { + mingw32/bin/gtk-update-icon-cache -q -t -f mingw32/share/icons/hicolor +} + +post_upgrade() { + post_install +} + +post_remove() { + post_install +} diff --git a/mingw-w64-geany/geany-x86_64.install b/mingw-w64-geany/geany-x86_64.install new file mode 100644 index 0000000000..4a2bb1bb75 --- /dev/null +++ b/mingw-w64-geany/geany-x86_64.install @@ -0,0 +1,11 @@ +post_install() { + mingw64/bin/gtk-update-icon-cache -q -t -f mingw64/share/icons/hicolor +} + +post_upgrade() { + post_install +} + +post_remove() { + post_install +}