diff --git a/src/tle-update.c b/src/tle-update.c index 3ebfc2a9e..652eda28e 100644 --- a/src/tle-update.c +++ b/src/tle-update.c @@ -23,7 +23,6 @@ You should have received a copy of the GNU General Public License along with this program; if not, visit http://www.fsf.org/ */ -#include #include #include #include @@ -32,6 +31,11 @@ #ifdef HAVE_CONFIG_H #include #endif +#ifdef WIN32 +#include "win32-fetch.h" +#else +#include +#endif #include "compat.h" #include "gpredict-utils.h" @@ -42,8 +46,10 @@ /* private function prototypes */ +#ifndef WIN32 static size_t my_write_func(void *ptr, size_t size, size_t nmemb, FILE * stream); +#endif static gint read_fresh_tle(const gchar * dir, const gchar * fnam, GHashTable * data); static gboolean is_tle_file(const gchar * dir, const gchar * fnam); @@ -473,8 +479,12 @@ void tle_update_from_network(gboolean silent, gchar *curfile; gchar *locfile; gchar *userconfdir; +#ifdef WIN32 + int res; +#else CURL *curl; CURLcode res; +#endif gdouble fraction, start = 0; FILE *outfile; GDir *dir; @@ -518,6 +528,7 @@ void tle_update_from_network(gboolean silent, if (!silent && (progress != NULL)) start = gtk_progress_bar_get_fraction(GTK_PROGRESS_BAR(progress)); +#ifndef WIN32 /* initialise curl */ curl = curl_easy_init(); if (proxy != NULL) @@ -525,13 +536,16 @@ void tle_update_from_network(gboolean silent, curl_easy_setopt(curl, CURLOPT_USERAGENT, "gpredict/curl"); curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, 10); +#endif /* get files */ for (i = 0; i < numfiles; i++) { /* set URL */ curfile = g_strdup(files[i]); +#ifndef WIN32 curl_easy_setopt(curl, CURLOPT_URL, curfile); +#endif /* set activity message */ if (!silent && (label1 != NULL)) @@ -556,6 +570,22 @@ void tle_update_from_network(gboolean silent, outfile = g_fopen(locfile, "wb"); if (outfile != NULL) { +#ifdef WIN32 + res = win32_fetch(curfile, outfile, proxy, "gpredict/win32"); + if (res != 0) + { + sat_log_log(SAT_LOG_LEVEL_ERROR, + _("%s: Error fetching %s (%x)"), + __func__, curfile, res); + } + else + { + sat_log_log(SAT_LOG_LEVEL_INFO, + _("%s: Successfully fetched %s"), + __func__, curfile); + success++; + } +#else curl_easy_setopt(curl, CURLOPT_WRITEDATA, outfile); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, my_write_func); @@ -575,6 +605,7 @@ void tle_update_from_network(gboolean silent, __func__, curfile); success++; } +#endif fclose(outfile); } else @@ -604,7 +635,9 @@ void tle_update_from_network(gboolean silent, g_free(locfile); } +#ifndef WIN32 curl_easy_cleanup(curl); +#endif /* continue update if we have fetched at least one file */ if (success > 0) @@ -665,6 +698,7 @@ void tle_update_from_network(gboolean silent, g_mutex_unlock(&tle_in_progress); } +#ifndef WIN32 /** * Write TLE data block to file. * @@ -683,6 +717,7 @@ static size_t my_write_func(void *ptr, size_t size, size_t nmemb, /*** FIXME: TBC whether this works in wintendo */ return fwrite(ptr, size, nmemb, stream); } +#endif /** * Check whether file is TLE file. diff --git a/src/trsp-update.c b/src/trsp-update.c index 368bd317d..117332b67 100644 --- a/src/trsp-update.c +++ b/src/trsp-update.c @@ -29,7 +29,6 @@ * Downloads Frequency list from SATNOGS db and exports json transponder * information into satellite files identified by catalog id */ -#include #include #include #include @@ -39,14 +38,20 @@ #include "compat.h" #include "trsp-update.h" #include "gpredict-utils.h" -#include "nxjson/nxjson.h" #include "sat-cfg.h" #include "sat-log.h" +#include "nxjson/nxjson.h" #ifdef HAVE_CONFIG_H #include #endif +#ifdef WIN32 +#include "win32-fetch.h" +#else +#include +#endif + /* TRSP auto update frequency. */ typedef enum { TRSP_AUTO_UPDATE_NEVER = 0, /* No auto-update, just warn after one week. */ @@ -89,9 +94,11 @@ typedef struct { guint numtrsp; /* Number of transponders. */ } new_trsp_t; +#ifndef WIN32 /* private function prototypes */ static size_t my_write_func(void *ptr, size_t size, size_t nmemb, FILE * stream); +#endif //int getMODElist_intoHashMap(); @@ -387,8 +394,12 @@ void modes_update_from_network() gchar *file_url; gchar *locfile; gchar *userconfdir; +#ifdef WIN32 + int res; +#else CURL *curl; CURLcode res; +#endif FILE *outfile; guint success = 0; /* no. of successfull downloads */ @@ -396,6 +407,7 @@ void modes_update_from_network() proxy = sat_cfg_get_str(SAT_CFG_STR_TRSP_PROXY); modes_file = sat_cfg_get_str(SAT_CFG_STR_TRSP_MODE_FILE); +#ifndef WIN32 /* initialise curl */ curl = curl_easy_init(); if (proxy != NULL) @@ -403,14 +415,17 @@ void modes_update_from_network() curl_easy_setopt(curl, CURLOPT_USERAGENT, "gpredict/curl"); curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, 10); +#endif /* get files */ /* set URL */ file_url = g_strconcat(server, modes_file, NULL); +#ifndef WIN32 curl_easy_setopt(curl, CURLOPT_URL, file_url); sat_log_log(SAT_LOG_LEVEL_INFO, _("%s: Ready to fetch modes list from %s"), __func__, file_url); +#endif /* create local cache file */ userconfdir = get_user_conf_dir(); @@ -422,6 +437,20 @@ void modes_update_from_network() outfile = g_fopen(locfile, "wb"); if (outfile != NULL) { +#ifdef WIN32 + res = win32_fetch(file_url, outfile, proxy, "gpredict/win32"); + if (res != 0) + { + sat_log_log(SAT_LOG_LEVEL_ERROR, _("%s: Error fetching %s (%x)"), + __func__, file_url, res); + } + else + { + sat_log_log(SAT_LOG_LEVEL_INFO, _("%s: Successfully fetched %s"), + __func__, file_url); + success++; + } +#else curl_easy_setopt(curl, CURLOPT_WRITEDATA, outfile); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, my_write_func); @@ -439,6 +468,7 @@ void modes_update_from_network() __func__, file_url); success++; } +#endif fclose(outfile); } @@ -455,7 +485,9 @@ void modes_update_from_network() g_free(proxy); g_free(modes_file); +#ifndef WIN32 curl_easy_cleanup(curl); +#endif /* continue update if we have fetched at least one file */ if (success > 0) @@ -495,8 +527,12 @@ void trsp_update_from_network(gboolean silent, gchar *file_url; gchar *locfile_trsp; gchar *userconfdir; +#ifdef WIN32 + int res; +#else CURL *curl; CURLcode res; +#endif gdouble fraction; FILE *outfile; gchar *cache; @@ -524,6 +560,7 @@ void trsp_update_from_network(gboolean silent, proxy = sat_cfg_get_str(SAT_CFG_STR_TRSP_PROXY); freq_file = sat_cfg_get_str(SAT_CFG_STR_TRSP_FREQ_FILE); +#ifndef WIN32 /* initialise curl */ curl = curl_easy_init(); if (proxy != NULL) @@ -531,14 +568,17 @@ void trsp_update_from_network(gboolean silent, curl_easy_setopt(curl, CURLOPT_USERAGENT, "gpredict/curl"); curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, 10); +#endif /* get files */ /* set URL */ file_url = g_strconcat(server, freq_file, NULL); +#ifndef WIN32 curl_easy_setopt(curl, CURLOPT_URL, file_url); sat_log_log(SAT_LOG_LEVEL_INFO, _("%s: Ready to fetch transponder list from %s"), __func__, file_url); +#endif /* set activity message */ if (!silent && (label1 != NULL)) @@ -566,6 +606,20 @@ void trsp_update_from_network(gboolean silent, outfile = g_fopen(locfile_trsp, "wb"); if (outfile != NULL) { +#ifdef WIN32 + res = win32_fetch(file_url, outfile, proxy, "gpredict/win32"); + if (res != 0) + { + sat_log_log(SAT_LOG_LEVEL_ERROR, _("%s: Error fetching %s (%x)"), + __func__, file_url, res); + } + else + { + sat_log_log(SAT_LOG_LEVEL_INFO, _("%s: Successfully fetched %s"), + __func__, file_url); + success++; + } +#else curl_easy_setopt(curl, CURLOPT_WRITEDATA, outfile); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, my_write_func); @@ -583,6 +637,7 @@ void trsp_update_from_network(gboolean silent, __func__, file_url); success++; } +#endif fclose(outfile); } @@ -614,7 +669,9 @@ void trsp_update_from_network(gboolean silent, g_free(freq_file); g_free(proxy); +#ifndef WIN32 curl_easy_cleanup(curl); +#endif /* continue update if we have fetched at least one file */ if (success > 0) @@ -637,6 +694,7 @@ void trsp_update_from_network(gboolean silent, g_mutex_unlock(&trsp_in_progress); } +#ifndef WIN32 /** * Write TRSP data block to file. * @@ -655,6 +713,7 @@ static size_t my_write_func(void *ptr, size_t size, size_t nmemb, /*** FIXME: TBC whether this works in wintendo */ return fwrite(ptr, size, nmemb, stream); } +#endif const gchar *freq_to_str2[TRSP_AUTO_UPDATE_NUM] = { N_("Never"), diff --git a/win32/Makefile b/win32/Makefile index a4fc9fb94..845c8843c 100644 --- a/win32/Makefile +++ b/win32/Makefile @@ -1,45 +1,53 @@ # Makefile for cross-compiling gpredict for win32 on Linux, # using mingw compiler +# configure pkg-config, version from git include config.mk +# version string in C code +VERSION_SHORT = $(GITMAJ).$(GITMIN).$(GITBLD) +VERSION_LONG = $(GITMAJ).$(GITMIN).0.$(GITBLD) + +# cross-compiler prefix +MGW_PREFIX=i686-w64-mingw32- + # directories topsrc = .. -glibdir = c:/mingw/include/glib-2.0 -gcincdir = c:/mingw/include/goocanvas-1.0/ -gcsrcdir = $(topsrc)/goocanvas-0.15/src - gpreddir = $(topsrc)/src sgpsdpdir = $(gpreddir)/sgpsdp +nxjsondir = $(gpreddir)/nxjson # tools -CC = $(MGW_PREFIX)gcc -Wall -O2 -mms-bitfields -DWIN32 -Wl,-subsystem,windows +CC = $(MGW_PREFIX)gcc -Wall -O2 -mms-bitfields -DWIN32 -m32 AS = $(MGW_PREFIX)as DLLWRAP = $(MGW_PREFIX)dllwrap DLLWRAP_FLAGS = --as=$(AS) --export-all --driver-name $(CC) -s RC = $(MGW_PREFIX)windres -RCFLAGS = --define __WIN32__ --define __WIN95__ --define MSRC \ - --define __GNUWIN32__ +# NB: .rc file create various version formats from the numbers +RCFLAGS = --define __WIN32__ --define __WIN95__ --define MSRC --define __GNUWIN32__ \ + --define VERMAJ=$(GITMAJ) --define VERMIN=$(GITMIN) --define VERBLD=$(GITBLD) # libraries -GTKLIBS := $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) pkg-config --libs gtk+-win32-2.0) +GTKLIBS := $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) pkg-config --libs gtk+-3.0) GLIBLIB := $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) pkg-config --libs glib-2.0 gthread-2.0) -GUI_LIBS = $(GTKLIBS) $(GLIBLIB) -lgoocanvas libsgpsdp.lib -lcurldll -lwinmm -lws2_32 +GOOLIBS := $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) pkg-config --libs goocanvas) +GUI_LIBS = $(GTKLIBS) $(GLIBLIB) $(GOOLIBS) libsgpsdp.lib -lwinmm -lwininet -lws2_32 LIBS = -lm # flags/defines -CFLAGS = -DHAVE_CONFIG_H -DHAVE_LIBCURL -DPACKAGE_LOCALE_DIR=\"/\" \ - -I. -I.. -I$(glibdir) -I$(gpreddir) -I$(gcincdir) -I$(gcsrcdir) -I$(CROSSDIR)/include -GTK_CFLAGS := $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) pkg-config --cflags gtk+-win32-2.0) +GTK_CFLAGS := $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) pkg-config --cflags gtk+-3.0) +GOO_CFLAGS := $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) pkg-config --cflags goocanvas) +CFLAGS = -DVERSION_SHORT=$(VERSION_SHORT) -DHAVE_CONFIG_H -DPACKAGE_LOCALE_DIR=\"/\" -I. -I.. -I$(gpreddir) $(GOO_CFLAGS) # source paths -vpath %.c $(gcsrcdir) vpath %.c $(sgpsdpdir) vpath %.c $(gpreddir) vpath %.h $(gpreddir) vpath %.h $(sgpsdpdir) -vpath %.h $(gcsrcdir) +vpath %.c $(nxjsondir) +vpath %.h $(nxjsondir) vpath %.rc $(topsrc)/win32 +vpath %.c . #### End of system configuration section. #### @@ -53,6 +61,10 @@ SGPSDPSRC = \ SGPSDPOBJ = $(SGPSDPSRC:.c=.o) +NXJSONSRC = \ + nxjson.c + +NXJSONOBJ = $(NXJSONSRC:.c=.o) GOOCANVSRC = \ goocanvasatk.c \ @@ -84,11 +96,10 @@ GPREDICTSRC = \ compat.c \ first-time.c \ gpredict-help.c \ - gpredict-url-hook.c \ gpredict-utils.c \ gtk-azel-plot.c \ - gtk-event-list.c \ - gtk-event-list-popup.c \ + gtk-event-list.c \ + gtk-event-list-popup.c \ gtk-freq-knob.c \ gtk-polar-plot.c \ gtk-polar-view.c \ @@ -99,7 +110,6 @@ GPREDICTSRC = \ gtk-sat-data.c \ gtk-sat-list.c \ gtk-sat-list-popup.c \ - gtk-sat-list-col-sel.c \ gtk-sat-map.c \ gtk-sat-map-ground-track.c \ gtk-sat-map-popup.c \ @@ -130,7 +140,6 @@ GPREDICTSRC = \ radio-conf.c \ rotor-conf.c \ sat-cfg.c \ - sat-debugger.c \ sat-info.c \ sat-log.c \ sat-log-browser.c \ @@ -141,7 +150,6 @@ GPREDICTSRC = \ sat-pref-debug.c \ sat-pref-formats.c \ sat-pref-general.c \ - sat-pref-help.c \ sat-pref-interfaces.c \ sat-pref-layout.c \ sat-pref-list-view.c \ @@ -168,10 +176,12 @@ GPREDICTSRC = \ tle-tools.c \ tle-update.c \ trsp-conf.c \ + trsp-update.c \ + win32-fetch.c GPREDICTOBJ = $(GPREDICTSRC:.c=.o) -OBJS = $(SGPSDPOBJ) $(GPREDICTOBJ) +OBJS = $(SGPSDPOBJ) $(NXJSONOBJ) $(GPREDICTOBJ) %.o: %.c $(CC) -c $(CFLAGS) $(GTK_CFLAGS) $< @@ -180,16 +190,37 @@ OBJS = $(SGPSDPOBJ) $(GPREDICTOBJ) # targets begin -all: libsgpsdp.dll gpredict.exe +all: libsgpsdp.dll gpredict.exe gpredict-con.exe + +dist: gpredict-$(GITMAJ).$(GITMIN).$(GITBLD).zip +gpredict-$(GITMAJ).$(GITMIN).$(GITBLD).zip: all + mkdir -p gpredict/share/gpredict + cp -p libsgpsdp.dll gpredict.exe gpredict-con.exe $(BINDEPS) gpredict + cp -rp ../data gpredict/share/gpredict + cp -rp ../pixmaps gpredict/share/gpredict + cp -rp ../po gpredict/share/gpredict + mkdir -p gpredict/$(LOADERS) + cp -p loaders.cache gpredict/$(LOADERS) + cp -rp $(GTKETC) gpredict + mkdir -p gpredict/share/glib-2.0 + cp -rp $(SCHEMAS) gpredict/share/glib-2.0 + zip -r $@ gpredict + rm -rf gpredict # Use -mconsole to always open a console window when gpredicxt is started -# Use -mwindows for no copnsole -gpredict.exe: $(OBJS) gpredict_res.o - $(CC) -mconsole -mthreads -o $@ $^ $(CFLAGS) $(GTK_CFLAGS) $(LIBS) $(GUI_LIBS) -lmingwex -s +# Use -mwindows for no console +gpredict.exe: TARGET:=-mwindows +gpredict-con.exe: TARGET:=-mconsole -gpredict_res.o: gpredict.rc - $(RC) $(RCFLAGS) $< $@ +gpredict.exe gpredict-con.exe: $(OBJS) gpredict_res.o + $(CC) $(TARGET) -mthreads -o $@ $^ $(CFLAGS) $(GTK_CFLAGS) $(LIBS) $(GUI_LIBS) -lmingwex -s + +gpredict_res.o: gpredict.rc gpredict.exp.manifest + $(RC) $(RCFLAGS) gpredict.rc $@ + +gpredict.exp.manifest: gpredict.exe.manifest + sed -e 's/VERSION_STRL/$(VERSION_LONG)/' < $< > $@ libgoocanvas.dll: $(GOOCANVOBJ) $(CC) -shared $(CFLAGS) $(GTK_CFLAGS) $(GOOCANVOBJ) $(GTKLIBS) -lm -lmingwex \ @@ -200,7 +231,6 @@ libsgpsdp.dll: $(SGPSDPOBJ) -Wl,--enable-auto-image-base -Wl,--out-implib,libsgpsdp.lib -o libsgpsdp.dll clean: - rm -f *.o *.d *.def *.a *.lib *.dll *.exe - - + rm -f *.o *.d *.def *.a *.lib *.dll *.exe *.exp.manifest *.zip + rm -rf gpredict diff --git a/win32/README b/win32/README new file mode 100644 index 000000000..d7184f1f4 --- /dev/null +++ b/win32/README @@ -0,0 +1,16 @@ +### Win32 build notes ### + +# Phil Ashby, Dec 2017 + +Check config.mk for dependant packages. I recommend use of inline sed +to fix up pkg-config file prefix settings once unpacked, then fix up and +copy in gtk+-3.0.pc and gdk.pc if required. + +Compile tested on Debian 9 (stretch) using standard mingw-w64 toolchain. + +To build a deployable ZIP archive, use 'make dist', which packages all +binary DLLs from dependant packages along with gpredict[-con].exe into +a versioned ZIP. + +Good luck! +Phlash. diff --git a/win32/build-config.h b/win32/build-config.h index b62fd1fec..4408fe853 100644 --- a/win32/build-config.h +++ b/win32/build-config.h @@ -86,7 +86,13 @@ #undef STDC_HEADERS /* Version number of package */ -#define VERSION "1.3.99" +#ifdef VERSION_SHORT +#define stringify_(x) #x +#define str_(x) stringify_(x) +#define VERSION str_(VERSION_SHORT) +#else +#define VERSION "1.9.xx" +#endif #define GETTEXT_PACKAGE "gpredict" diff --git a/win32/config.mk b/win32/config.mk index 2bd806b54..d47e02bfd 100644 --- a/win32/config.mk +++ b/win32/config.mk @@ -1,16 +1,38 @@ -# Configuration variables governing the build of grig for win32 +# Configuration variables governing the build of gpredict for win32 -# directory containing the cross tools -CROSSDIR = /mingw +# pkgconfig path, assumes goocanvas-2.0.2 and gtk+-3.10.4 win32 packages +# unpacked and paths adjusted (pkg-config files) at the same folder level +# as gpredict. Downloads used: +# +# http://ftp.gnome.org/pub/GNOME/binaries/win32/goocanvas/2.0/ +# download both: goocanvas-2.0.2-win32.zip, goocanvas-dev-2.0.2-win32.zip +# +# http://win32builder.gnome.org/gtk+-bundle_3.10.4-20131202_win32.zip +# NB: I had to create new .pc files for both gtk+-3.0.pc and gdk.pc +# (thanks GNOME for missing crucial bits out of builds). My versions +# are in this folder, and will need unpack paths inserting. -# prefix for mingw tools (e.g. i586-mingw32msvc-gcc) -#MGW_PREFIX = i586-mingw32msvc- +PKG_CONFIG_PATH = $(abspath ../../goocanvas-2.0.2/lib/pkgconfig):$(abspath ../../gtk+-3.10.4/lib/pkgconfig) -# mingw include dir -MGW_INC = $(CROSSDIR)/include +# binary dependencies to be deployed with gpredict.exe +BINDEPS = \ + $(wildcard ../../goocanvas-2.0.2/bin/*.dll) \ + $(wildcard ../../gtk+-3.10.4/bin/*.dll) \ + ../../gtk+-3.10.4/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.dll -# msgfmt command for producing win32 messages file +# where to put the loaders.cache file +LOADERS = lib/gdk-pixbuf-2.0/2.10.0 +# other miscellaneous folders to deploy with the binary +GTKETC = ../../gtk+-3.10.4/etc +SCHEMAS = ../../gtk+-3.10.4/share/glib-2.0/schemas -# pkgconfig path -PKG_CONFIG_PATH = $(CROSSDIR)/lib/pkgconfig +# Autoversioning from nearest git tag, assumes v. tag format. + +GITVER := $(shell git describe) +GITSEP := $(subst -, ,$(GITVER)) +GITTAG := $(word 1,$(GITSEP)) +GITBLD := $(word 2,$(GITSEP)) +GITCOM := $(word 3,$(GITSEP)) +GITMAJ := $(subst v,,$(word 1,$(subst ., ,$(GITTAG)))) +GITMIN := $(word 2,$(subst ., ,$(GITTAG))) diff --git a/win32/gdk.pc b/win32/gdk.pc new file mode 100644 index 000000000..ff6cc62ba --- /dev/null +++ b/win32/gdk.pc @@ -0,0 +1,11 @@ +prefix=/gtk+-3.10.4 +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include + +Name: Gdk +Description: Graphics Drawing Kit +Version: 3.10.4 +Requires: +Libs: -L${libdir} -lgdk-3 +Cflags: -I${includedir}/gdk-3 diff --git a/win32/gpredict.exe.manifest b/win32/gpredict.exe.manifest index 15b114e62..af08ea3ba 100644 --- a/win32/gpredict.exe.manifest +++ b/win32/gpredict.exe.manifest @@ -1,6 +1,6 @@ - + Gpredict: Real-time satellite tracking and orbit prediction program diff --git a/win32/gpredict.rc b/win32/gpredict.rc index 090843849..b942ed4e3 100644 --- a/win32/gpredict.rc +++ b/win32/gpredict.rc @@ -3,12 +3,27 @@ #include #include "resource.h" +#if defined(VERMAJ) && defined(VERMIN) && defined(VERBLD) +// awesome, we have version info +#else +// fake it! +#define VERMAJ 1 +#define VERMIN 9 +#define VERBLD 0 +#endif + +#define stringify_(x) #x +#define str_(x) stringify_(x) +#define VERSION_RSRC VERMAJ,VERMIN,0,VERBLD +#define VERSION_STRS str_(VERMAJ) "." str_(VERMIN) "." str_(VERBLD) +#define VERSION_STRL str_(VERMAJ) "." str_(VERMIN) ".0." str_(VERBLD) + A ICON "icons/gpredict-icon.ico" LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL 1 VERSIONINFO - FILEVERSION 1,3,99,0 - PRODUCTVERSION 1,3,99,0 + FILEVERSION VERSION_RSRC + PRODUCTVERSION VERSION_RSRC FILEOS VOS__WINDOWS32 FILETYPE VFT_APP FILESUBTYPE VFT2_UNKNOWN @@ -21,11 +36,11 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL { VALUE "CompanyName", "Alexandru Csete, OZ9AEC" VALUE "FileDescription", "Gpredict: Real-time satellite tracking and orbit prediction program" - VALUE "FileVersion", "1.3.99.0" + VALUE "FileVersion", VERSION_STRL VALUE "InternalName", "GPredict" - VALUE "LegalCopyright", "Copyright (C) 2001-2013 Alexandru Csete, OZ9AEC" + VALUE "LegalCopyright", "Copyright (C) 2001-2017 Alexandru Csete, OZ9AEC" VALUE "ProductName", "GPredict" - VALUE "ProductVersion", "1.3.99" + VALUE "ProductVersion", VERSION_STRS } } BLOCK "VarFileInfo" @@ -35,4 +50,4 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL } LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL -2 RT_MANIFEST "gpredict.exe.manifest" +2 RT_MANIFEST "gpredict.exp.manifest" diff --git a/win32/gtk+-3.0.pc b/win32/gtk+-3.0.pc new file mode 100644 index 000000000..0162690af --- /dev/null +++ b/win32/gtk+-3.0.pc @@ -0,0 +1,13 @@ +prefix=/gtk+-3.10.4 +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include + +gtk_binary_version=3.0.0 + +Name: GTK+ +Description: GTK+ Graphical UI Library +Version: 3.10.4 +Requires: atk cairo cairo-gobject gdk gdk-pixbuf-2.0 gio-2.0 pangocairo +Libs: -L${libdir} -lgtk-3 +Cflags: -I${includedir}/gtk-3.0 diff --git a/win32/loaders.cache b/win32/loaders.cache new file mode 100644 index 000000000..80c0b05b2 --- /dev/null +++ b/win32/loaders.cache @@ -0,0 +1,14 @@ +# GdkPixbuf Image Loader Modules file +# Automatically generated file, do not edit +# Created by gdk-pixbuf-query-loaders.exe from gdk-pixbuf-2.30.1 +# +# LoaderDir = Z:\srv\win32builder\fixed_3104\build\win32/lib/gdk-pixbuf-2.0/2.10.0/loaders +# +"libpixbufloader-svg.dll" +"svg" 2 "gdk-pixbuf" "Scalable Vector Graphics" "LGPL" +"image/svg+xml" "image/svg" "image/svg-xml" "image/vnd.adobe.svg+xml" "text/xml-svg" "image/svg+xml-compressed" "" +"svg" "svgz" "svg.gz" "" +" +#include +#include +#include "win32-fetch.h" + +#define BUFLEN 8192 + +int win32_fetch(char *url, FILE *file, char *proxy, char *ua) +{ + HINTERNET hInt, hUrl; + char buf[BUFLEN]; + DWORD nRead; + + if (proxy != NULL) + hInt = InternetOpen(ua, INTERNET_OPEN_TYPE_PROXY, proxy, "", 0); + else + hInt = InternetOpen(ua, INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0); + if (NULL == hInt) + return 0x80000000 | (int)GetLastError(); + + hUrl = InternetOpenUrl(hInt, url, NULL, 0, INTERNET_FLAG_RELOAD, 0); + if (NULL == hUrl) + { + InternetCloseHandle(hInt); + return 0x40000000 | (int)GetLastError(); + } + + while (InternetReadFile(hUrl, buf, BUFLEN, &nRead)) + { + if (nRead > 0) + fwrite(buf, nRead, 1, file); + else + break; + } + InternetCloseHandle(hUrl); + InternetCloseHandle(hInt); + return 0; +} + diff --git a/win32/win32-fetch.h b/win32/win32-fetch.h new file mode 100644 index 000000000..2e8d5ea30 --- /dev/null +++ b/win32/win32-fetch.h @@ -0,0 +1,28 @@ +/* + Gpredict: Real-time satellite tracking and orbit prediction program + + Copyright (C) 2001-2017 Alexandru Csete, OZ9AEC. + Copyright (C) 2017 Phil Ashby, 2E0IPX. + + Comments, questions and bugreports should be submitted via + http://sourceforge.net/projects/gpredict/ + More details can be found at the project home page: + + http://gpredict.oz9aec.net/ + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, visit http://www.fsf.org/ +*/ + +extern int win32_fetch(char *url, FILE *file, char *proxy, char *ua); +