pidgin/pidgin

Make our windows builds usable from meson.
release-2.x.y
7 months ago, Gary Kramlich
2ff89178eb3d
Parents 5407cbf3c5dd
Children 9cc9fac6dd3c
Make our windows builds usable from meson.

This creates our pkg-config files on windows as well as fixes an include in
pidgin.h which can cause some issues.

This isn't usable as is, as you need a machine-file and a pkg-config wrapper
to make this all work, but that will be updated in the win32-dev.7z file thats
on data.imfreedom.org.

Testing Done:
Compiled guifications2 (which now uses meson) on windows and verified it works.

Reviewed at https://reviews.imfreedom.org/r/615/
--- a/libpurple/Makefile.mingw Sun Apr 11 03:27:57 2021 -0500
+++ b/libpurple/Makefile.mingw Mon Apr 19 20:41:12 2021 -0500
@@ -118,8 +118,11 @@
win32/win32dep.c
RC_SRC = win32/libpurplerc.rc
+OBJECTS = $(C_SRC:%.c=%.o) $(RC_SRC:%.rc=%.o)
-OBJECTS = $(C_SRC:%.c=%.o) $(RC_SRC:%.rc=%.o)
+PC_SRC = data/purple.pc.in data/purple-uninstalled.pc.in \
+ data/purple-2.pc.in data/purple-2-uninstalled.pc.in
+PC_FILES = $(PC_SRC:%.pc.in=%.pc)
##
## LIBRARIES
@@ -141,7 +144,7 @@
##
.PHONY: all install install_shallow clean
-all: $(TARGET).dll
+all: $(TARGET).dll $(PC_FILES)
$(MAKE) -C $(PURPLE_PROTOS_TOP) -f $(MINGW_MAKEFILE)
$(MAKE) -C $(PURPLE_PLUGINS_TOP) -f $(MINGW_MAKEFILE)
@@ -172,6 +175,8 @@
clean:
rm -f $(OBJECTS) $(RC_SRC) $(PURPLE_VERSION_H) $(PURPLE_PURPLE_H)
rm -f $(TARGET).dll $(TARGET).dll.a $(TARGET).def
+ rm -f data/pidgin.pc data/pidgin-uninstalled.pc
+ rm -f data/pidgin-2.pc data/pidgin-2-uninstalled.pc
$(MAKE) -C $(PURPLE_PROTOS_TOP) -f $(MINGW_MAKEFILE) clean
$(MAKE) -C $(PURPLE_PLUGINS_TOP) -f $(MINGW_MAKEFILE) clean
--- a/libpurple/data/purple-2-uninstalled.pc.in Sun Apr 11 03:27:57 2021 -0500
+++ b/libpurple/data/purple-2-uninstalled.pc.in Mon Apr 19 20:41:12 2021 -0500
@@ -6,9 +6,6 @@
datadir=@datadir@
sysconfdir=@sysconfdir@
-abs_srcdir=@abs_srcdir@
-abs_builddir=@abs_builddir@
-
abs_top_srcdir=@abs_top_srcdir@
abs_top_builddir=@abs_top_builddir@
@@ -18,5 +15,5 @@
Description: libpurple is a GLib-based instant messenger library.
Version: @VERSION@
Requires: glib-2.0
-Cflags: -I${abs_top_srcdir} -I${abs_top_builddir}
-Libs: ${abs_builddir}/libpurple.la
+Cflags: -I${abs_top_srcdir} -I${abs_top_srcdir}/libpurple -I${abs_top_builddir} -I${abs_top_builddir}/libpurple
+Libs: -L${abs_top_builddir}/libpurple -lpurple
--- a/libpurple/data/purple-uninstalled.pc.in Sun Apr 11 03:27:57 2021 -0500
+++ b/libpurple/data/purple-uninstalled.pc.in Mon Apr 19 20:41:12 2021 -0500
@@ -6,8 +6,8 @@
datadir=@datadir@
sysconfdir=@sysconfdir@
-abs_srcdir=@abs_srcdir@
-abs_builddir=@abs_builddir@
+abs_top_srcdir=@abs_top_srcdir@
+abs_top_builddir=@abs_top_builddir@
plugindir=${libdir}/purple-@PURPLE_MAJOR_VERSION@
@@ -15,5 +15,5 @@
Description: libpurple is a GLib-based instant messenger library.
Version: @VERSION@
Requires: glib-2.0
-Cflags: -I${abs_srcdir} -I${abs_builddir}
-Libs: ${abs_builddir}/libpurple.la
+Cflags: -I${abs_top_srcdir} -I${abs_top_srcdir}/libpurple -I${abs_top_builddir} -I${abs_top_builddir}/libpurple
+Libs: -L${abs_top_builddir}/libpurple -lpurple
--- a/libpurple/win32/global.mak Sun Apr 11 03:27:57 2021 -0500
+++ b/libpurple/win32/global.mak Mon Apr 19 20:41:12 2021 -0500
@@ -8,6 +8,10 @@
#include optional $(PIDGIN_TREE_TOP)/local.mak to allow overriding of any definitions
-include $(PIDGIN_TREE_TOP)/local.mak
+ABS_TOP_SRCDIR := $(shell realpath $(PIDGIN_TREE_TOP))
+# in case we ever do separate build directories
+ABS_TOP_BUILDDIR := $(ABS_TOP_SRCDIR)
+
# Locations of our various dependencies
WIN32_DEV_TOP ?= $(PIDGIN_TREE_TOP)/../win32-dev
GTKSPELL_TOP ?= $(WIN32_DEV_TOP)/gtkspell-2.0.16
@@ -74,6 +78,8 @@
cat $(PIDGIN_TREE_TOP)/VERSION \
)
PURPLE_VERSION := $(PIDGIN_VERSION)
+PURPLE_MAJOR_VERSION := $(firstword $(subst ., ,$(PURPLE_VERSION)))
+
ifdef EXTRAVERSION
DISPLAY_VERSION := $(PIDGIN_VERSION)-$(EXTRAVERSION)
else
--- a/libpurple/win32/rules.mak Sun Apr 11 03:27:57 2021 -0500
+++ b/libpurple/win32/rules.mak Mon Apr 19 20:41:12 2021 -0500
@@ -9,5 +9,20 @@
%.o: %.rc
$(WINDRES) -I$(PURPLE_TOP) -i $< -o $@
+%.pc: %.pc.in
+ sed -e 's|@prefix@|/usr/local|g' \
+ -e 's|@exec_prefix@|$${prefix}|g' \
+ -e 's|@libdir@|$${exec_prefix}/lib|g' \
+ -e 's|@includedir@|$${prefix}/include|g' \
+ -e 's|@datarootdir@|$${prefix}/share|g' \
+ -e 's|@datadir@|$${datarootdir}|g' \
+ -e 's|@sysconfdir@|$${prefix}/etc|g' \
+ -e 's|@VERSION@|$(PIDGIN_VERSION)|g' \
+ -e 's|@PURPLE_MAJOR_VERSION@|$(PURPLE_MAJOR_VERSION)|g' \
+ -e 's|@GSTREAMER_VER@|0.10|g' \
+ -e 's|@abs_top_srcdir@|$(ABS_TOP_SRCDIR)|g' \
+ -e 's|@abs_top_builddir@|$(ABS_TOP_BUILDDIR)|g' \
+ $< > $@
+
%.desktop: %.desktop.in $(wildcard $(PIDGIN_TREE_TOP)/po/*.po)
LC_ALL=C $(PERL) $(INTLTOOL_MERGE) -d -u -c $(PIDGIN_TREE_TOP)/po/.intltool-merge-cache $(PIDGIN_TREE_TOP)/po $< $@
--- a/pidgin/Makefile.mingw Sun Apr 11 03:27:57 2021 -0500
+++ b/pidgin/Makefile.mingw Mon Apr 19 20:41:12 2021 -0500
@@ -109,6 +109,10 @@
EXE_C_SRC = win32/winpidgin.c
EXE_OBJECTS = $(EXE_C_SRC:%.c=%.o) $(EXE_RC_SRC:%.rc=%.o)
+PC_SRC = data/pidgin.pc.in data/pidgin-uninstalled.pc.in \
+ data/pidgin-2.pc.in data/pidgin-2-uninstalled.pc.in
+PC_FILES = $(PC_SRC:%.pc.in=%.pc)
+
##
## LIBRARIES
##
@@ -136,7 +140,7 @@
##
.PHONY: all install install_shallow clean
-all: $(EXE_TARGET).exe $(PIDGIN_TARGET).dll
+all: $(EXE_TARGET).exe $(PIDGIN_TARGET).dll $(PC_FILES)
$(MAKE) -C $(PIDGIN_PLUGINS_TOP) -f $(MINGW_MAKEFILE)
win32/pidgin_exe_rc.rc: win32/pidgin_exe_rc.rc.in $(PIDGIN_TREE_TOP)/VERSION
@@ -172,5 +176,7 @@
rm -f $(PIDGIN_OBJECTS) $(PIDGIN_RC_SRC) $(EXE_OBJECTS) $(EXE_RC_SRC)
rm -f $(PIDGIN_TARGET).dll $(PIDGIN_TARGET).dll.a $(PIDGIN_TARGET).def
rm -f $(EXE_TARGET).exe
+ rm -f data/pidgin.pc data/pidgin-uninstalled.pc
+ rm -f data/pidgin-2.pc data/pidgin-2-uninstalled.pc
include $(PIDGIN_COMMON_TARGETS)
--- a/pidgin/data/pidgin-2-uninstalled.pc.in Sun Apr 11 03:27:57 2021 -0500
+++ b/pidgin/data/pidgin-2-uninstalled.pc.in Mon Apr 19 20:41:12 2021 -0500
@@ -6,9 +6,6 @@
datadir=@datadir@
sysconfdir=@sysconfdir@
-abs_srcdir=@abs_srcdir@
-abs_builddir=@abs_builddir@
-
abs_top_srcdir=@abs_top_srcdir@
abs_top_builddir=@abs_top_builddir@
@@ -18,4 +15,5 @@
Description: Pidgin is a GTK2-based instant messenger application.
Version: @VERSION@
Requires: gtk+-2.0 purple
-Cflags: -I${abs_top_srcdir}
+Cflags: -I${abs_top_srcdir} -I${abs_top_srcdir}/pidgin -I${abs_top_builddir} -I${abs_top_builddir}/pidgin
+Libs: -L${abs_top_builddir}/pidgin -lpidgin
--- a/pidgin/data/pidgin-uninstalled.pc.in Sun Apr 11 03:27:57 2021 -0500
+++ b/pidgin/data/pidgin-uninstalled.pc.in Mon Apr 19 20:41:12 2021 -0500
@@ -6,8 +6,8 @@
datadir=@datadir@
sysconfdir=@sysconfdir@
-abs_srcdir=@abs_srcdir@
-abs_builddir=@abs_builddir@
+abs_top_srcdir=@abs_top_srcdir@
+abs_top_builddir=@abs_top_builddir@
plugindir=${libdir}/pidgin
@@ -15,4 +15,5 @@
Description: Pidgin is a GTK2-based instant messenger application.
Version: @VERSION@
Requires: gtk+-2.0 purple
-Cflags: -I${abs_srcdir}
+Cflags: -I${abs_top_srcdir} -I${abs_top_srcdir}/pidgin -I${abs_top_builddir} -I${abs_top_builddir}/pidgin
+Libs: -L${abs_top_builddir}/pidgin -lpidgin
--- a/pidgin/pidgin.h Sun Apr 11 03:27:57 2021 -0500
+++ b/pidgin/pidgin.h Mon Apr 19 20:41:12 2021 -0500
@@ -34,7 +34,7 @@
#endif
#ifdef _WIN32
-# include "gtkwin32dep.h"
+# include "win32/gtkwin32dep.h"
#endif
/**