forked from pool/libXbgi
Accepting request 174006 from home:jengelh:branches:devel:libraries:c_c++
OBS-URL: https://build.opensuse.org/request/show/174006 OBS-URL: https://build.opensuse.org/package/show/graphics/libXbgi?expand=0&rev=1
This commit is contained in:
commit
8447d88e65
23
.gitattributes
vendored
Normal file
23
.gitattributes
vendored
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
## Default LFS
|
||||||
|
*.7z filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.bsp filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.gem filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.gz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.jar filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.lz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.lzma filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.obscpio filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.oxt filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.pdf filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.png filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.rpm filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.tbz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.tbz2 filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.tgz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.ttf filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.txz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.whl filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.xz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.zip filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.zst filter=lfs diff=lfs merge=lfs -text
|
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
.osc
|
4
libXbgi.changes
Normal file
4
libXbgi.changes
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Apr 30 14:33:30 UTC 2013 - jengelh@inai.de
|
||||||
|
|
||||||
|
- Initial package (version 362) for build.opensuse.org
|
100
libXbgi.spec
Normal file
100
libXbgi.spec
Normal file
@ -0,0 +1,100 @@
|
|||||||
|
#
|
||||||
|
# spec file for package libXbgi
|
||||||
|
#
|
||||||
|
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||||
|
#
|
||||||
|
# All modifications and additions to the file contributed by third parties
|
||||||
|
# remain the property of their copyright owners, unless otherwise agreed
|
||||||
|
# upon. The license for this file, and modifications and additions to the
|
||||||
|
# file, is the same license as for the pristine package itself (unless the
|
||||||
|
# license for the pristine package is not an Open Source License, in which
|
||||||
|
# case the license is the MIT License). An "Open Source License" is a
|
||||||
|
# license that conforms to the Open Source Definition (Version 1.9)
|
||||||
|
# published by the Open Source Initiative.
|
||||||
|
|
||||||
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
|
Name: libXbgi
|
||||||
|
%define lname libXbgi0
|
||||||
|
Version: 362
|
||||||
|
Release: 0
|
||||||
|
Summary: BGI-compatible 2D graphics C library
|
||||||
|
License: MIT
|
||||||
|
Group: Development/Libraries/C and C++
|
||||||
|
Url: http://libXbgi.sf.net/
|
||||||
|
|
||||||
|
#Freecode-URL: http://freecode.com/projects/libxbgi/
|
||||||
|
Source: http://libxbgi.sf.net/xbgi-362.tar.gz
|
||||||
|
Patch1: xbgi-automake.diff
|
||||||
|
Patch2: xbgi-getpixel.diff
|
||||||
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||||
|
BuildRequires: autoconf
|
||||||
|
BuildRequires: automake
|
||||||
|
BuildRequires: libtool
|
||||||
|
BuildRequires: pkgconfig
|
||||||
|
BuildRequires: pkgconfig(x11)
|
||||||
|
|
||||||
|
%description
|
||||||
|
libXbgi is a Borland Graphics Interface (BGI) emulation library for
|
||||||
|
X11. This library strictly emulates most BGI functions, making it
|
||||||
|
possible to compile X11 versions of programs written for
|
||||||
|
Turbo/Borland C. RGB extensions and basic mouse support are also
|
||||||
|
implemented.
|
||||||
|
|
||||||
|
%package -n %lname
|
||||||
|
Summary: BGI-compatible 2D graphics C library
|
||||||
|
Group: System/Libraries
|
||||||
|
|
||||||
|
%description -n %lname
|
||||||
|
libXbgi is a Borland Graphics Interface (BGI) emulation library for
|
||||||
|
X11. This library strictly emulates most BGI functions, making it
|
||||||
|
possible to compile X11 versions of programs written for
|
||||||
|
Turbo/Borland C. RGB extensions and basic mouse support are also
|
||||||
|
implemented.
|
||||||
|
|
||||||
|
%package devel
|
||||||
|
Summary: Development files for the XBGI library
|
||||||
|
Group: Development/Libraries/C and C++
|
||||||
|
Requires: %lname = %version
|
||||||
|
Requires: libX11-devel, xorg-x11-proto-devel
|
||||||
|
|
||||||
|
%description devel
|
||||||
|
libXbgi is a Borland Graphics Interface (BGI) emulation library for
|
||||||
|
X11. This library strictly emulates most BGI functions, making it
|
||||||
|
possible to compile X11 versions of programs written for
|
||||||
|
Turbo/Borland C. RGB extensions and basic mouse support are also
|
||||||
|
implemented.
|
||||||
|
|
||||||
|
This package contains the development headers for the library found
|
||||||
|
in %lname.
|
||||||
|
|
||||||
|
%prep
|
||||||
|
%setup -qn xbgi
|
||||||
|
%patch -P 1 -P 2 -p1
|
||||||
|
|
||||||
|
%build
|
||||||
|
autoreconf -fiv
|
||||||
|
%configure --disable-static
|
||||||
|
make %{?_smp_mflags} V=1;
|
||||||
|
|
||||||
|
%install
|
||||||
|
make install DESTDIR="%buildroot";
|
||||||
|
rm -f "%buildroot/%_libdir"/*.la;
|
||||||
|
|
||||||
|
%post -n %lname -p /sbin/ldconfig
|
||||||
|
%postun -n %lname -p /sbin/ldconfig
|
||||||
|
|
||||||
|
%files -n %lname
|
||||||
|
%defattr(-,root,root)
|
||||||
|
%doc License.txt
|
||||||
|
%_libdir/libXbgi.so.0*
|
||||||
|
|
||||||
|
%files devel
|
||||||
|
%defattr(-,root,root)
|
||||||
|
%_includedir/graphics.h
|
||||||
|
%_libdir/libXbgi.so
|
||||||
|
%doc Using.txt
|
||||||
|
|
||||||
|
%changelog
|
3
xbgi-362.tar.gz
Normal file
3
xbgi-362.tar.gz
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:b1fc02a2902eae2d0acf9d1d5e5553738b629e89d493f13dab71326c1327f9b0
|
||||||
|
size 61974
|
103
xbgi-automake.diff
Normal file
103
xbgi-automake.diff
Normal file
@ -0,0 +1,103 @@
|
|||||||
|
From: Jan Engelhardt <jengelh@inai.de>
|
||||||
|
Date: 2013-04-30 16:20:06.862768841 +0200
|
||||||
|
|
||||||
|
build: use automake as build system
|
||||||
|
|
||||||
|
---
|
||||||
|
Makefile.am | 4 ++++
|
||||||
|
Using.txt | 2 +-
|
||||||
|
configure.ac | 9 +++++++++
|
||||||
|
m4/.gitignore | 2 ++
|
||||||
|
src/Makefile.am | 42 ++++++++++++++++++++++++++++++++++++++++++
|
||||||
|
5 files changed, 58 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
Index: xbgi/Makefile.am
|
||||||
|
===================================================================
|
||||||
|
--- /dev/null
|
||||||
|
+++ xbgi/Makefile.am
|
||||||
|
@@ -0,0 +1,4 @@
|
||||||
|
+# -*- Makefile -*-
|
||||||
|
+
|
||||||
|
+ACLOCAL_AMFLAGS = -I m4
|
||||||
|
+SUBDIRS = src
|
||||||
|
Index: xbgi/Using.txt
|
||||||
|
===================================================================
|
||||||
|
--- xbgi.orig/Using.txt
|
||||||
|
+++ xbgi/Using.txt
|
||||||
|
@@ -11,7 +11,7 @@ Nearly all programs can be compiled with
|
||||||
|
|
||||||
|
To compile a program against libXbgi:
|
||||||
|
|
||||||
|
- gcc -o program program.c /usr/lib/libXbgi.a -lX11 -lm
|
||||||
|
+ gcc -o program program.c -lXbgi
|
||||||
|
|
||||||
|
Most old programs that use the original BGI library should compile
|
||||||
|
with no modification. For instance,
|
||||||
|
Index: xbgi/configure.ac
|
||||||
|
===================================================================
|
||||||
|
--- /dev/null
|
||||||
|
+++ xbgi/configure.ac
|
||||||
|
@@ -0,0 +1,9 @@
|
||||||
|
+AC_INIT([xbgi], [362])
|
||||||
|
+AC_CONFIG_AUX_DIR([build-aux])
|
||||||
|
+AC_CONFIG_MACRO_DIR([m4])
|
||||||
|
+AC_PROG_CC
|
||||||
|
+AM_INIT_AUTOMAKE([foreign subdir-objects tar-pax])
|
||||||
|
+LT_INIT
|
||||||
|
+PKG_CHECK_MODULES([x11], [x11])
|
||||||
|
+AC_CONFIG_FILES([Makefile src/Makefile])
|
||||||
|
+AC_OUTPUT
|
||||||
|
Index: xbgi/m4/.gitignore
|
||||||
|
===================================================================
|
||||||
|
--- /dev/null
|
||||||
|
+++ xbgi/m4/.gitignore
|
||||||
|
@@ -0,0 +1,2 @@
|
||||||
|
+/libtool.m4
|
||||||
|
+/lt*.m4
|
||||||
|
Index: xbgi/src/Makefile.am
|
||||||
|
===================================================================
|
||||||
|
--- /dev/null
|
||||||
|
+++ xbgi/src/Makefile.am
|
||||||
|
@@ -0,0 +1,42 @@
|
||||||
|
+# -*- Makefile -*-
|
||||||
|
+
|
||||||
|
+AM_CPPFLAGS = ${x11_CFLAGS}
|
||||||
|
+AM_CFLAGS = -Wall
|
||||||
|
+
|
||||||
|
+lib_LTLIBRARIES = libXbgi.la
|
||||||
|
+
|
||||||
|
+libXbgi_la_SOURCES = \
|
||||||
|
+ _graphfreemem.c _graphgetmem.c arc.c bar.c bar3d.c circle.c\
|
||||||
|
+ cleardevice.c clearviewport.c closegraph.c detectgraph.c drawpoly.c\
|
||||||
|
+ ellipse.c fillellipse.c fillpoly.c floodfill.c\
|
||||||
|
+ getarccoords.c getaspectratio.c getbkcolor.c getch.c getcolor.c\
|
||||||
|
+ getdate.c getdefaultpalette.c getdrivername.c getfillpattern.c\
|
||||||
|
+ getfillsettings.c getgraphmode.c getimage.c getlinesettings.c\
|
||||||
|
+ getmaxcolor.c getmaxmode.c getmaxx.c getmaxy.c getmodename.c\
|
||||||
|
+ getmoderange.c getpalette.c getpalettesize.c getpixel.c\
|
||||||
|
+ gettextsettings.c getviewsettings.c getx.c gety.c graphdefaults.c\
|
||||||
|
+ grapherrormsg.c graphresult.c imagesize.c initgraph.c\
|
||||||
|
+ installuserdriver.c installuserfont.c kbhit.c line.c linerel.c lineto.c\
|
||||||
|
+ moverel.c moveto.c outtext.c outtextxy.c pieslice.c putimage.c\
|
||||||
|
+ putpixel.c rectangle.c registerbgidriver.c registerbgifont.c\
|
||||||
|
+ restorecrtmode.c rotated.c sector.c setactivepage.c setallpalette.c\
|
||||||
|
+ setaspectratio.c setbkcolor.c setcolor.c setfillpattern.c\
|
||||||
|
+ setfillstyle.c setgraphbufsize.c setgraphmode.c setlinestyle.c\
|
||||||
|
+ setpalette.c setrgbpalette.c settextjustify.c settextstyle.c\
|
||||||
|
+ setusercharsize.c setviewport.c setvisualpage.c setwritemode.c\
|
||||||
|
+ textheight.c textwidth.c delay.c\
|
||||||
|
+ COLOR.c getmaxheight.c getmaxwidth.c getmouseclick.c\
|
||||||
|
+ initwindow.c mouseclick.c mousex.c mousey.c _putpixel.c\
|
||||||
|
+ IS_BGI_COLOR.c IS_RGB_COLOR.c setrgbcolor.c setbkrgbcolor.c\
|
||||||
|
+ getevent.c converttorgb.c
|
||||||
|
+libXbgi_la_LDFLAGS = -Wl,-z,defs
|
||||||
|
+libXbgi_la_LIBADD = -lm ${x11_LIBS}
|
||||||
|
+
|
||||||
|
+EXTRA_DIST = xkbhit.c
|
||||||
|
+
|
||||||
|
+include_HEADERS = graphics.h
|
||||||
|
+
|
||||||
|
+noinst_PROGRAMS = demo
|
||||||
|
+
|
||||||
|
+demo_SOURCES = demo.c
|
||||||
|
+demo_LDADD = libXbgi.la
|
30
xbgi-getpixel.diff
Normal file
30
xbgi-getpixel.diff
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
From: Jan Engelhardt <jengelh@inai.de>
|
||||||
|
Date: 2013-04-30 16:29:33.540380817 +0200
|
||||||
|
|
||||||
|
gcc:
|
||||||
|
getpixel.c: In function 'getpixel':
|
||||||
|
getpixel.c:29:1: warning: control reaches end of non-void function [-Wreturn-type]
|
||||||
|
|
||||||
|
rpmlint:
|
||||||
|
I: Program returns random data in a function
|
||||||
|
E: libXbgi no-return-in-nonvoid-function getpixel.c:29
|
||||||
|
|
||||||
|
If the color is not in the palette, the function will return trash.
|
||||||
|
Any value would be ok, but consistently give 0 to quiesce gcc.
|
||||||
|
|
||||||
|
---
|
||||||
|
src/getpixel.c | 1 +
|
||||||
|
1 file changed, 1 insertion(+)
|
||||||
|
|
||||||
|
Index: xbgi/src/getpixel.c
|
||||||
|
===================================================================
|
||||||
|
--- xbgi.orig/src/getpixel.c
|
||||||
|
+++ xbgi/src/getpixel.c
|
||||||
|
@@ -26,6 +26,7 @@ unsigned int getpixel(int x, int y)
|
||||||
|
for (col = 0; col < MAXCOLORS + 1; col++)
|
||||||
|
if (vga_palette[col].pixel_value == pixel)
|
||||||
|
return (col);
|
||||||
|
+ return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user