Accepting request 288657 from electronics

1

OBS-URL: https://build.opensuse.org/request/show/288657
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/gerbv?expand=0&rev=7
This commit is contained in:
Dominique Leuenberger 2015-03-05 14:40:10 +00:00 committed by Git OBS Bridge
commit c1de94f19f
3 changed files with 181 additions and 3 deletions

View File

@ -0,0 +1,163 @@
diff -ur gerbv-2.6.1/src/callbacks.c gerbv-2.6.1.mod/src/callbacks.c
--- a/src/callbacks.c 2013-07-22 21:09:16.000000000 +0200
+++ b/src/callbacks.c 2015-03-01 02:41:55.775350761 +0100
@@ -89,13 +89,6 @@
#define SAVE_AS_PROJECT 1
#define OPEN_PROJECT 2
-/**Global variable to keep track of what's happening on the screen.
- Declared extern in gerbv_screen.h
- */
-extern gerbv_screen_t screen;
-extern gerbv_render_info_t screenRenderInfo;
-
-
/* These are the names of the valid apertures. These
* values are used in several places in this file.
* Please keep this in sync with the gerbv_aperture_type_t
diff -ur gerbv-2.6.1/src/exportimage.c gerbv-2.6.1.mod/src/exportimage.c
--- a/src/exportimage.c 2013-07-22 21:09:16.000000000 +0200
+++ b/src/exportimage.c 2015-03-01 02:43:23.249446752 +0100
@@ -28,19 +28,14 @@
\ingroup libgerbv
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
+#include "gerbv.h"
+#include "common.h"
#include <math.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <png.h>
-#include "gerbv.h"
+#include "render.h"
#include "draw.h"
#include <cairo.h>
@@ -48,8 +43,6 @@
#include <cairo-ps.h>
#include <cairo-svg.h>
-extern gerbv_render_info_t screenRenderInfo;
-
void exportimage_render_to_surface_and_destroy (gerbv_project_t *gerbvProject,
cairo_surface_t *cSurface, gerbv_render_info_t *renderInfo, gchar const* filename) {
cairo_t *cairoTarget = cairo_create (cSurface);
diff -ur gerbv-2.6.1/src/interface.c gerbv-2.6.1.mod/src/interface.c
--- a/src/interface.c 2013-07-22 21:09:16.000000000 +0200
+++ b/src/interface.c 2015-03-01 02:43:32.812566655 +0100
@@ -52,7 +52,6 @@
#include "gerbv_icon.h"
#include "icons.h"
-extern gerbv_render_info_t screenRenderInfo;
#define WIN_TITLE N_("Gerbv -- gEDA's Gerber Viewer")
diff -ur gerbv-2.6.1/src/main.c gerbv-2.6.1.mod/src/main.c
--- a/src/main.c 2013-07-22 21:09:16.000000000 +0200
+++ b/src/main.c 2015-03-01 02:43:50.698790955 +0100
@@ -160,7 +160,7 @@
const char *opt_options = "VadhB:D:O:W:b:f:r:m:l:o:p:t:T:w:x:";
/**Global state variable to keep track of what's happening on the screen.
- Declared extern in gerbv_screen.h
+ Declared extern in main.h
*/
gerbv_project_t *mainProject;
gerbv_screen_t screen;
diff -ur gerbv-2.6.1/src/render.c gerbv-2.6.1.mod/src/render.c
--- a/src/render.c 2013-07-22 21:09:16.000000000 +0200
+++ b/src/render.c 2015-03-01 02:44:39.142398742 +0100
@@ -69,17 +69,7 @@
#define dprintf if(DEBUG) printf
-/**Global variable to keep track of what's happening on the screen.
- Declared extern in gerbv_screen.h
- */
-extern gerbv_screen_t screen;
-
-extern gerbv_render_info_t screenRenderInfo;
-
-/*
-static void
-render_layer_to_cairo_target_without_transforming(cairo_t *cr, gerbv_fileinfo_t *fileInfo, gerbv_render_info_t *renderInfo );
-*/
+gerbv_render_info_t screenRenderInfo;
gboolean
render_check_scale_factor_limits (void) {
diff -ur gerbv-2.6.1/src/render.h gerbv-2.6.1.mod/src/render.h
--- a/src/render.h 2013-07-22 21:09:16.000000000 +0200
+++ b/src/render.h 2015-03-01 02:45:20.823922017 +0100
@@ -71,8 +71,4 @@
render_fill_selection_buffer_from_mouse_drag (gint corner1X, gint corner1Y,
gint corner2X, gint corner2Y, gint activeFileIndex, gboolean eraseOldSelection);
-gerbv_render_info_t screenRenderInfo;
-
-
-
-
+extern gerbv_render_info_t screenRenderInfo;
diff --git a/src/pick-and-place.c b/src/pick-and-place.c
index ab50337..23d1cd1 100644
--- a/src/pick-and-place.c
+++ b/src/pick-and-place.c
@@ -56,7 +56,6 @@
#include "gerbv.h"
#include "gerber.h"
-#include "main.h"
#ifdef RENDER_USING_GDK
#include "draw-gdk.h"
#else
@@ -161,36 +160,22 @@ pick_and_place_reset_bounding_box (gerbv_net_t *net) {
}
//! Parses a string representing float number with a unit, default is mil
-static double
-pick_and_place_get_float_unit(char *str)
+static double
+pick_and_place_get_float_unit(const char *str)
{
double x = 0.0;
char unit[41];
- extern gerbv_screen_t screen;
/* float, optional space, optional unit mm,cm,in,mil */
sscanf(str, "%lf %40s", &x, unit);
if(strstr(unit,"in")) {
;
- } else if(strstr(unit, "mil")) {
- x /= 1000;
} else if(strstr(unit, "cm")) {
x /= 2.54;
} else if(strstr(unit, "mm")) {
x /= 25.4;
- } else { /* default to GUI units */
- switch (screen.unit) {
- case GERBV_INS:
- break;
- case GERBV_MILS:
- x /= 1000;
- break;
- case GERBV_MMS:
- x /= 25.4;
- break;
- default:
- assert(screen.unit);
- }
+ } else { /* default to mils */
+ x /= 1000;
}
return x;

View File

@ -1,3 +1,16 @@
-------------------------------------------------------------------
Tue Mar 3 12:49:46 UTC 2015 - dev@stellardeath.org
- Backport commits 55e4460 and dd8f9fa from upstream that cures
the problem of an undefined symbol "screen" when using gerbv as
a library
* gerbv-2.6.1-undefined-symbols.patch
-------------------------------------------------------------------
Tue Mar 3 11:46:11 UTC 2015 - dmitry_r@opensuse.org
- Fix desktop menu categories
-------------------------------------------------------------------
Tue Oct 7 21:24:37 UTC 2014 - dmitry_r@opensuse.org

View File

@ -1,7 +1,7 @@
#
# spec file for package gerbv
#
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -32,6 +32,7 @@ Patch1: gerbv-no-build-time.patch
Patch2: gerbv-2.6.1-no-translation.patch
# PATCH-FIX-UPSTREAM gerbv-fix-install-sh-call.patch -- Fix calling install-sh not from build dir for automake 1.14
Patch3: gerbv-fix-install-sh-call.patch
Patch4: gerbv-2.6.1-undefined-symbols.patch
BuildRequires: autoconf
BuildRequires: gtk2-devel
BuildRequires: libpng-devel
@ -75,6 +76,7 @@ that use gerbv library.
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%build
./autogen.sh
@ -87,8 +89,8 @@ export LDFLAGS="$LDFLAGS -ldl"
make %{?_smp_mflags}
%install
%makeinstall
%suse_update_desktop_file %{name} Education Science Electronics
%make_install
%suse_update_desktop_file -r %{name} Education Engineering
find %{buildroot}%{_libdir} -name '*.la' -type f -delete -print
%post -n %{libname}%{somajor} -p /sbin/ldconfig