diff options
Diffstat (limited to 'media-libs/svgalib')
16 files changed, 952 insertions, 0 deletions
diff --git a/media-libs/svgalib/Manifest b/media-libs/svgalib/Manifest new file mode 100644 index 000000000000..acf371777eb6 --- /dev/null +++ b/media-libs/svgalib/Manifest @@ -0,0 +1,18 @@ +AUX svgalib-1.9.19-pic.patch 487 SHA256 cbce8a1067b6618300de8b1934dd72a28130eba6953938434333dab3b29c8358 SHA512 313488478d487ce4e3e5cda64c2cba2b65dae12c768f0ec91da6365d5c0b939061f5ab489c7d19e2d8579534653da990c2e7e5a2e2f58ca4bd0b28076d22657e WHIRLPOOL 665eb68ab94748328efd4a08d408d9fa8a286df76d7d7e2db501b9ecf815fe1e19e15f1b5c184809d813fa4a30cc704d43ab0f08f98a55dcf1cc7c985dfc0900 +AUX svgalib-1.9.25-build.patch 2163 SHA256 f2d5033376e02f4424a7d6252dd442eb2f6b6a3834244d8830248b7c651da361 SHA512 87cb6458bb427d2e73bc275d6e77987919587dec1b2f52944191087e628aaa4eba46148bf8cd2f89f5c51a5c9f5433f3262d378173ed16e894fd962d8bada4e5 WHIRLPOOL 73422218cd8ca16f1fb9d1fa1b5efda1a7885f1593460f02a923f4f3afe1ff512b87cf91905c8d11562e494926ba208d60c2d294cbcbd357cf6fe55b9397fc48 +AUX svgalib-1.9.25-fix_buffer.patch 302 SHA256 9956316596b51dd189d82940289e07be60391260382585e0fcfd8e3f6ee432c9 SHA512 e238a5e05db06623abe04a6058345a4c4b91953c73ef02c3b4bd0b4606f9a57f2b20ef18aa2a91c50465bd3c048ba2ffd4792d62dcfadd94320afffa826641f1 WHIRLPOOL 2e5e761ca8010e3f259287f0d58634f63e6d5528e949fc4bd18828312e6d538664c51bde5b09e184fad16d51a69255f746c23e22ec88deaad652d948d3f980ca +AUX svgalib-1.9.25-glibc210.patch 3842 SHA256 d8ac6b82406e9d85fbd7ce3f35ee94a3bb77b729352d62f51d51931c46a2a434 SHA512 43813c240eaff58d993c0ed839bee0d5d73515e4954e7793536a981d149c882808ea79187b0bfe8511afcde78fd31b6e9ad94aaf20d28c8e96577d5f0e530d96 WHIRLPOOL 633cc0b0978067f6cdb9e60f56b1de2d061c83f02e94a8ea107f45bfd1c0b4b768320b50c48f4235f6979639145fc88268e60a5911e0fb268aa4b2cd67b4698c +AUX svgalib-1.9.25-linux_2.6.28.patch 1672 SHA256 79e3b78faadc7fc4a0f965e8ce7564c0a391293105a5bcd88ce44a77543af512 SHA512 ba3fcfb870768bc5d7e2d7acfe0381d6602b2e42d40e1d8b37246a60343e6e2f0b251c2a5fb32467773b565f4a0f38fdd5cba7c51fdf7fd36b0e5b988fcf2416 WHIRLPOOL d7ce90c9102b2a818461e25230b0d39f947e827e32184122378dbf8fd4cc92b872fdd6f67f883765e18f303237c9fbcf7c4c158649943e21c4594affcea72492 +AUX svgalib-1.9.25-linux_2.6.36-r1.patch 1244 SHA256 d7420b0b236f967b2588bb542fa8f802c02a623124078a03022410b926630b25 SHA512 0a14679ee0029931e54387ff413aee43a01b107c277ff1fde52b1fb862d5ca56571028a527118b6f6c05a9485c00890b0eab35df4537e394bb4cc81e771e9ae0 WHIRLPOOL ceb5385c559d44de75f15e627295253bb64593a8a86c6f7a31366ae610563cc90b88f9aba392953ec43486c50710dbf5bb09366d7106c180750f10224d3626e7 +AUX svgalib-1.9.25-linux_2.6.patch 9547 SHA256 553b4c81a87a9c584377cae2795849b5237ca07e6bf0bef5ffc00ebb0b9a1160 SHA512 b2a1105735398f7f1f452612947a66c85bc0eca5c1e7f0d56f154d980dbfcf23bea2d5038145e6e004afb7658d7d3ab2de655a408da7c6853d8fdc817f775191 WHIRLPOOL 0ee822c679b4677c173fb7528807d61f0ea0c9b4595fad224273601527ebe68fbbd550988020b308d0ad70d82f98cd7010521a2451f71a2294fde53ecb7d56c7 +AUX svgalib-1.9.25-linux_3.4.patch 1125 SHA256 8ce6db9fe60ac28a29765d2108ef6cb3d6cedea13bfecf0e3da424b3913fc8b0 SHA512 35e035cfbe65823d8e5836653a058eb78bf3483c62a05dcad5a2aac3ac1ad47f63a7994c140d5b526bdf2e6edcfc5916452009cec056f73db664c0ffd3ba5857 WHIRLPOOL caaca99d95bda632c060f4f85b3086bc754b19c818e27e39de704d6ea1839cb2611143476e9bbc9159e339f7b4b388dedad0c92d4c04d9732601d552e9ab05a2 +AUX svgalib-1.9.25-linux_3.9.patch 1045 SHA256 553c8b1e2c40612ebc789fe62223ca9256cf2d9b0752ebda88d29f038d18eda3 SHA512 ce3529558b249351f0dbe915fcf940e9b478e60fc444d0727996eaa269f567d6a44707285b7c9a836c5a2309c217361620b6e655ec4331c6b25bd87e445cedeb WHIRLPOOL dff605de74dd24b54e3fb316259879988d0914ee0f3c8b2db3bdef3574cdca47aa9b56723ce8de5c4890efad51b219406eb72e36515353ea140815c7530bc72b +AUX svgalib-1.9.25-missing_include.patch 1157 SHA256 78fd351b98d0a148052e94dcd674f354e34f46b70b58da0534d54e3064703945 SHA512 e0bc82f1c27f7d6003be8ce4e96005605dad73ff22086ceb0861d60931776ecaf86f4bca15b0f4a6e5f5ab5b5ec50d8fa305f53bb090f122ea38d88569834b8b WHIRLPOOL a6e4ac24acaca2b27d6f04e2ba875bcfe16584d2027a8db44029c2e57f3cd3f3ae1e52bdebfd7805b75501f2a9b87857e9404425d0641f7377549f90db8ce312 +AUX svgalib-1.9.25-vga_reset.patch 747 SHA256 dd89edb6a63e07f42c31db5844166261808d01d4d4271922e06854a6973c248d SHA512 9baf930a3da15340f3f6823bcb45242bdf6b53d60d4ea2e9ef81af42e748838d40b2d5973821005decd3d44375508838fe852c89d1b704e57b790c042907ba94 WHIRLPOOL 1f9df2862ee5f98e517f1aef68ccaad5d9c4393f119092e37625d926a910ac06db15569a083d8c3c9955f04b3bc700f47a74c2c9c07eb668fdb624b120fd5824 +AUX svgalib.udev.rules.d.2 44 SHA256 08973143b979ff88ff49701d7173cb6fb9661ea9c8f3911efc031435b648cc96 SHA512 41336ddd1fc2a033c684dee1a442ee20ed58fdd1395346913502e4b0c5f798ad0e4cffe69de3dcdfa993dc8b480910c422d38e0483eacfea8f8ad24c41060c82 WHIRLPOOL 04badca6a832a7178b592d4b7a78649e43c52f22525263f268b623f1e64a6d68f8680ed709943cbc0944716f7169a25be60ea21f128499fb16e37a897aa45c6e +DIST svgalib-1.9.25.tar.gz 987084 SHA256 2ad5da713a6bd69622c483de4e4f448ed2b82f7b954db43dc477d5b6b12d8602 SHA512 697e417e6fb4fc3c41f47945a87bd0252f33b565ac1b20d98f984168c6b3ac0f04887e929fbf912ef7bb7b0a3b0a1763cc7cf3e316b62235cc926ca4b1ed96f7 WHIRLPOOL 7956941849ff5d3516681736b224246c11345c6982f074fb58f1145c9c24b9a539334a47d6596bd0c524c0b9d09e0ee713cec0e6d531be9f981c7556cf7615e1 +EBUILD svgalib-1.9.25-r4.ebuild 4043 SHA256 71b323a117cedb3ec070a1ad4b64e27052cbdaa8cc053cbf79189ccf9b410b12 SHA512 b96d007f1dff3d8f3f55a6f10d7f64ba10277e2cb6edf02120ac52fef8afa0c44440d94c05a850d0b1845a66f5cb945b27dd19ea3b69b474dfc502a06bc2de20 WHIRLPOOL 3395ae099117b0afbec423aa144626144679c7f7b9125bce44b821fc5027e937cf229f1f96da1814e1fb1528bd0f0778ceb0d2327f86059835be78215e6644a8 +EBUILD svgalib-1.9.25-r5.ebuild 3565 SHA256 b220fab1bfb3c99c96e39fabb38b891e86c5fccc34999483be9eab1597c12940 SHA512 c693257317b3b4e480bfb5e92f4b2201cfed6338ed8677e1d95922a41fca297ceb28e0fc49ac825486cf25efedcdef71060ca3749cb8ebfafb53d7b7493c4abc WHIRLPOOL d806b5ea816e93f429b8832b3eb88cb989627035dc1542d759d8848ba68e7cc3ae7ae17d261206bb8703fbf70bcd27761e287dcff80e8566437d50030a198300 +MISC ChangeLog 4724 SHA256 ca1539c1c22e64c63978ba75a458a43f0e864c2576aece4c91d749a3e1143e87 SHA512 66adee73f144644b8650b8875af40d654d43228c6561b0c56d11805417532b521339b3fd735e22dc9da7e7d1cb252461a8fea9ecb4b6ced1b0d4c06e556dd34f WHIRLPOOL 123fcc35b6ba4a7a64c222aa2dc78fe798997da3e89ac78b6497908326b56f7cd787ac39c0ccc2cff90f276c1ab7ff6ea0ceb2c3556057642452491b2adc59ef +MISC ChangeLog-2015 17639 SHA256 4d03e09ae1a14e697e78b2cb556c646249fd8337c87a7377438ce79a077dfc71 SHA512 d34ded43e66fd5b605ebe626b2d6fee34e780cad02cacea99b989a0918e24f18cf51239d3e3ab7220a47b80514c003d8b93f49e10aa9ccfece8afb46ac45007b WHIRLPOOL db85d2dbc1f6e722ff3f1d5e03512ce271a10a61151ba9e2836861b1c20ff33c9b5ec3e716cb6c185a82ef1e774f3d3445fedf0d22e1a5ceaeed42f3ade0f341 +MISC metadata.xml 325 SHA256 52f2dc7db439ff17275fcd586aeaf3983ba26670196df60f685eec879018b31b SHA512 7d2874207eaab21b41da8bd8b9afb5cda10351e3c88fe09ae1856664115b3c86d13362a82695a016911390e5ff6762a86409b437a3d76b077e01ac0ff6662d5d WHIRLPOOL c1b861d93662111590c4e72179e26bd61a14a85e2c5f4096acf785480146a8c22afa8abb823352accad4bb1b5b1eb5fdcb74ba833e49d11bd51728ec23143e2d diff --git a/media-libs/svgalib/files/svgalib-1.9.19-pic.patch b/media-libs/svgalib/files/svgalib-1.9.19-pic.patch new file mode 100644 index 000000000000..b068886cc1d1 --- /dev/null +++ b/media-libs/svgalib/files/svgalib-1.9.19-pic.patch @@ -0,0 +1,17 @@ +the -fPIC flag does work for lrmi + +http://bugs.gentoo.org/51698 + +--- svgalib-1.9.19/src/Makefile.jj 2004-09-09 09:08:24.369399280 -0700 ++++ svgalib-1.9.19/src/Makefile 2004-09-09 09:08:32.340187536 -0700 +@@ -462,8 +462,8 @@ + $(CC) $(CFLAGS) $(VGA_DEFINES) -c -o $@ $< + + #lrmi must NOT be compiled as -fPIC +-lrmi.o: lrmi.c +- $(CC) $(CFLAGS:-fPIC=) -c -o $@ $< ++#lrmi.o: lrmi.c ++# $(CC) $(CFLAGS:-fPIC=) -c -o $@ $< + + $(RAMDAC): %.o: %.c + $(CC) $(CFLAGS) $(RAMDAC_DEFINES) -c -o $@ $< diff --git a/media-libs/svgalib/files/svgalib-1.9.25-build.patch b/media-libs/svgalib/files/svgalib-1.9.25-build.patch new file mode 100644 index 000000000000..946b5303663d --- /dev/null +++ b/media-libs/svgalib/files/svgalib-1.9.25-build.patch @@ -0,0 +1,73 @@ +fix up build + +dont strip the binary as portage will take care of it + +--- svgalib-1.9.25/Makefile.cfg ++++ svgalib-1.9.25/Makefile.cfg +@@ -44,7 +44,7 @@ CONFDIR = $(SRCDIR)/src/config + # Common prefix for installation directories. + # NOTE: This directory must exist when you start the install. + TOPDIR= +-prefix = $(TOPDIR)/usr/local ++prefix = $(TOPDIR)/usr + exec_prefix = $(prefix) + + # Directory where the shared stubs and static library will be installed. +@@ -313,14 +313,13 @@ + WARN = -Wall -Wstrict-prototypes + INCLUDES = -I$(srcdir)/include -I. + CFLAGS = $(WARN) $(DLLFLAGS) $(INCLUDES) $(OPTIMIZE) $(DEFINES) +-LDFLAGS = -s + + # additional flags for shared lib. + DLLFLAGS = -fPIC -DPIC + + # Utilites used. + AR = ar +-INSTALL_PROGRAM = install -sm755 ++INSTALL_PROGRAM = install -m755 + INSTALL_SCRIPT = install -m755 + INSTALL_SHLIB = install -m755 + INSTALL_DATA = install -m644 +--- svgalib-1.9.25/Makefile ++++ svgalib-1.9.25/Makefile +@@ -99,8 +99,6 @@ + (cd $(sharedlibdir); \ + ln -sf $$foo `echo $$foo | sed 's/\.so\..*/.so/'` ); \ + done +- @./fixldsoconf +- -ldconfig + + installstaticlib: static + @echo Installing static libraries in $(libdir). +--- svgalib-1.9.25/gl/Makefile ++++ svgalib-1.9.25/gl/Makefile +@@ -29,7 +29,7 @@ all: libvgagl.a + .PHONY: all clean dep + + libvgagl.so.$(VERSION): $(MODULES) +- $(CC) -s -shared -Wl,-soname,libvgagl.so.$(MAJOR_VER) -o libvgagl.so.$(VERSION) \ ++ $(CC) -shared -Wl,-soname,libvgagl.so.$(MAJOR_VER) -o libvgagl.so.$(VERSION) \ + $(MODULES) + + libvgagl.a: $(MODULES) +--- svgalib-1.9.25/threeDKit/Makefile ++++ svgalib-1.9.25/threeDKit/Makefile +@@ -58,7 +58,6 @@ + $(sharedlibdir)/lib3dkit.so.$(VERSION): lib3dkit.so.$(VERSION) + $(INSTALL_SHLIB) $< $(sharedlibdir)/$< + (cd $(sharedlibdir); ln -sf lib3dkit.so.$(VERSION) `echo lib3dkit.so.$(VERSION) | sed 's/\.so\..*/.so/'` ) +- -ldconfig + + install: $(sharedlibdir)/lib3dkit.so.$(VERSION) installheaders + +--- svgalib-1.9.25/src/Makefile ++++ svgalib-1.9.25/src/Makefile +@@ -453,7 +453,6 @@ + + $(sharedlibdir)/libvga.so.$(VERSION): libvga.so.$(VERSION) + $(INSTALL_SHLIB) $< $(sharedlibdir)/$< +- -ldconfig + + install: $(sharedlibdir)/libvga.so.$(VERSION) + diff --git a/media-libs/svgalib/files/svgalib-1.9.25-fix_buffer.patch b/media-libs/svgalib/files/svgalib-1.9.25-fix_buffer.patch new file mode 100644 index 000000000000..da7c1c21c646 --- /dev/null +++ b/media-libs/svgalib/files/svgalib-1.9.25-fix_buffer.patch @@ -0,0 +1,11 @@ +--- svgalib-1.9.25/src/vgamodesel.c~ ++++ svgalib-1.9.25/src/vgamodesel.c +@@ -35,7 +35,7 @@ int __svgalib_name2number(char *m) + int vga_getmodenumber(char *m) + { + int i; +- char s[3]; ++ char s[8]; + + __svgalib_getchipset(); /* Do initialisation first */ + i = __svgalib_name2number(m); diff --git a/media-libs/svgalib/files/svgalib-1.9.25-glibc210.patch b/media-libs/svgalib/files/svgalib-1.9.25-glibc210.patch new file mode 100644 index 000000000000..ed80935e955a --- /dev/null +++ b/media-libs/svgalib/files/svgalib-1.9.25-glibc210.patch @@ -0,0 +1,109 @@ +diff -Naur svgalib-1.9.25/utils/gtf/gtfcalc.c svgalib-1.9.25.new/utils/gtf/gtfcalc.c +--- svgalib-1.9.25/utils/gtf/gtfcalc.c 2005-07-10 15:33:16.000000000 -0400 ++++ svgalib-1.9.25.new/utils/gtf/gtfcalc.c 2009-07-09 15:39:08.743610103 -0400 +@@ -64,7 +64,9 @@ + + /*-------------------------- Implementation -------------------------------*/ + +-static double round(double v) ++static double svg_round(double v); ++ ++double svg_round(double v) + { + return floor(v + 0.5); + } +@@ -84,9 +86,9 @@ + ****************************************************************************/ + { + c->margin = GC.margin; +- c->cellGran = round(GC.cellGran); +- c->minPorch = round(GC.minPorch); +- c->vSyncRqd = round(GC.vSyncRqd); ++ c->cellGran = svg_round(GC.cellGran); ++ c->minPorch = svg_round(GC.minPorch); ++ c->vSyncRqd = svg_round(GC.vSyncRqd); + c->hSync = GC.hSync; + c->minVSyncBP = GC.minVSyncBP; + if (GC.k == 0) +@@ -140,13 +142,13 @@ + vFreq = hFreq = dotClock = freq; + + /* Round pixels to character cell granularity */ +- hPixels = round(hPixels / c.cellGran) * c.cellGran; ++ hPixels = svg_round(hPixels / c.cellGran) * c.cellGran; + + /* For interlaced mode halve the vertical parameters, and double + * the required field refresh rate. + */ + if (wantInterlace) { +- vLines = round(vLines / 2); ++ vLines = svg_round(vLines / 2); + vFieldRate = vFreq * 2; + dotClock = dotClock * 2; + interlace = 0.5; +@@ -158,8 +160,8 @@ + + /* Determine the lines for margins */ + if (wantMargins) { +- topMarginLines = round(c.margin / 100 * vLines); +- botMarginLines = round(c.margin / 100 * vLines); ++ topMarginLines = svg_round(c.margin / 100 * vLines); ++ botMarginLines = svg_round(c.margin / 100 * vLines); + } + else { + topMarginLines = 0; +@@ -173,11 +175,11 @@ + (vLines + (2*topMarginLines) + c.minPorch + interlace) * 1000000; + + /* Find the number of lines in vSync + back porch */ +- vSyncBP = round(c.minVSyncBP / hPeriodEst); ++ vSyncBP = svg_round(c.minVSyncBP / hPeriodEst); + } + else if (type == GTF_lockHF) { + /* Find the number of lines in vSync + back porch */ +- vSyncBP = round((c.minVSyncBP * hFreq) / 1000); ++ vSyncBP = svg_round((c.minVSyncBP * hFreq) / 1000); + } + + /* Find the number of lines in the V back porch alone */ +@@ -205,8 +207,8 @@ + + /* Find the number of pixels in the left and right margins */ + if (wantMargins) { +- leftMarginPixels = round(hPixels * c.margin) / (100 * c.cellGran); +- rightMarginPixels = round(hPixels * c.margin) / (100 * c.cellGran); ++ leftMarginPixels = svg_round(hPixels * c.margin) / (100 * c.cellGran); ++ rightMarginPixels = svg_round(hPixels * c.margin) / (100 * c.cellGran); + } + else { + leftMarginPixels = 0; +@@ -235,17 +237,17 @@ + } + + /* Find the number of pixels in blanking time */ +- hBlankPixels = round((hTotalActivePixels * idealDutyCycle) / ++ hBlankPixels = svg_round((hTotalActivePixels * idealDutyCycle) / + ((100 - idealDutyCycle) * 2 * c.cellGran)) * (2 * c.cellGran); + + /* Find the total number of pixels */ + hTotalPixels = hTotalActivePixels + hBlankPixels; + + /* Find the horizontal back porch */ +- hBackPorch = round((hBlankPixels / 2) / c.cellGran) * c.cellGran; ++ hBackPorch = svg_round((hBlankPixels / 2) / c.cellGran) * c.cellGran; + + /* Find the horizontal sync width */ +- hSyncWidth = round(((c.hSync/100) * hTotalPixels) / c.cellGran) * c.cellGran; ++ hSyncWidth = svg_round(((c.hSync/100) * hTotalPixels) / c.cellGran) * c.cellGran; + + /* Find the horizontal sync + back porch */ + hSyncBP = hBackPorch + hSyncWidth; +@@ -258,7 +260,7 @@ + hPeriod = 1000 / hFreq; + + /* Find the number of lines in vSync + back porch */ +- vSyncBP = round((c.minVSyncBP * hFreq) / 1000); ++ vSyncBP = svg_round((c.minVSyncBP * hFreq) / 1000); + + /* Find the number of lines in the V back porch alone */ + vBackPorch = vSyncBP - c.vSyncRqd; diff --git a/media-libs/svgalib/files/svgalib-1.9.25-linux_2.6.28.patch b/media-libs/svgalib/files/svgalib-1.9.25-linux_2.6.28.patch new file mode 100644 index 000000000000..7742110da429 --- /dev/null +++ b/media-libs/svgalib/files/svgalib-1.9.25-linux_2.6.28.patch @@ -0,0 +1,30 @@ +--- svgalib-1.9.25-original/kernel/svgalib_helper/kernel26compat.h 2008-12-26 15:52:24.000000000 +0100 ++++ svgalib-1.9.25/kernel/svgalib_helper/kernel26compat.h 2008-12-26 16:48:46.000000000 +0100 +@@ -128,7 +128,7 @@ + MKDEV(SVGALIB_HELPER_MAJOR, _minor), \ + _name); + /* 2.6.27 changed device_create to device_create_drvdata */ +-#else ++#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28) + # define SLH_SYSFS_ADD_CONTROL \ + device_create_drvdata(svgalib_helper_class, NULL, \ + MKDEV(SVGALIB_HELPER_MAJOR, 0), \ +@@ -139,6 +139,18 @@ + &sh_pci_devs[_minor]->dev->dev, \ + MKDEV(SVGALIB_HELPER_MAJOR, _minor), \ + "%s%d", _name, _minor); ++/* 2.6.28 changed device_create_drvdata back to device_create */ ++#else ++# define SLH_SYSFS_ADD_CONTROL \ ++ device_create(svgalib_helper_class, NULL, \ ++ MKDEV(SVGALIB_HELPER_MAJOR, 0), NULL, \ ++ "%s%d", "svga", 0); ++ ++# define SLH_SYSFS_ADD_DEVICE(_name, _minor) \ ++ device_create(svgalib_helper_class, \ ++ &sh_pci_devs[_minor]->dev->dev, \ ++ MKDEV(SVGALIB_HELPER_MAJOR, _minor), NULL, \ ++ "%s%d", _name, _minor); + #endif + + # define SLH_SYSFS_REMOVE_DEVICE(i) \ diff --git a/media-libs/svgalib/files/svgalib-1.9.25-linux_2.6.36-r1.patch b/media-libs/svgalib/files/svgalib-1.9.25-linux_2.6.36-r1.patch new file mode 100644 index 000000000000..dbc0338cbfb5 --- /dev/null +++ b/media-libs/svgalib/files/svgalib-1.9.25-linux_2.6.36-r1.patch @@ -0,0 +1,32 @@ +--- svgalib-1.9.25.orig/kernel/svgalib_helper/main.c ++++ svgalib-1.9.25/kernel/svgalib_helper/main.c +@@ -162,10 +162,16 @@ static void task_startad(void *data) { + get_user(pciv.address, &user_pciv->address); \ + get_user(pciv.val, &user_pciv->val); + #define PUT_PCIV \ +- put_user(pciv.val, &user_pciv->val); ++ put_user(pciv.val, &user_pciv->val); ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36) + static int svgalib_helper_ioctl( struct inode *inode, struct file *filp, + unsigned int cmd, unsigned long arg) { ++#else ++static long svgalib_helper_ioctl(struct file *filp, ++ unsigned int cmd, unsigned long arg) { ++ struct inode *inode=filp->f_dentry->d_inode; ++#endif + + io_t iov, *user_iov=(io_t *)arg; + pcic_t pciv, *user_pciv=(pcic_t *)arg; + int minor = my_minor(inode->i_rdev); +@@ -595,7 +601,11 @@ struct file_operations svgalib_helper_fo + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,0) + .owner = THIS_MODULE, + #endif ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36) + .ioctl = svgalib_helper_ioctl, ++#else ++ .unlocked_ioctl = svgalib_helper_ioctl, ++#endif + .mmap = svgalib_helper_mmap, + .open = svgalib_helper_open, + .release = svgalib_helper_release, diff --git a/media-libs/svgalib/files/svgalib-1.9.25-linux_2.6.patch b/media-libs/svgalib/files/svgalib-1.9.25-linux_2.6.patch new file mode 100644 index 000000000000..20ab1fe1ed16 --- /dev/null +++ b/media-libs/svgalib/files/svgalib-1.9.25-linux_2.6.patch @@ -0,0 +1,289 @@ + - get rid of warning when linux/device.h doesnt exist + - touch up the Makefile to let the ebuild handle the module details + - fix support with io remap stuff in newer kernels + - dont include headers that dont exist in 2.4.x kernels + - use module_param() for 2.6.x and MODULE_PARM() for all others + - dont declare all_devices as static since it is exported + - dont include <linux/config.h> as the build system does it for us + - in lrmi, map old flag names to new names for versions >= 2.6.26 + +--- svgalib/kernel/svgalib_helper/Makefile ++++ svgalib/kernel/svgalib_helper/Makefile +@@ -25,7 +25,7 @@ + endif + + +-CLASS_SIMPLE := $(shell grep class_simple_create $(KDIR)/include/linux/device.h) ++CLASS_SIMPLE := $(shell grep -s class_simple_create $(KDIR)/include/linux/device.h) + + ifneq ($(CLASS_SIMPLE),) + CLASS_CFLAGS = -DCLASS_SIMPLE=1 +--- svgalib/kernel/svgalib_helper/Makefile.alt ++++ svgalib/kernel/svgalib_helper/Makefile.alt +@@ -37,7 +37,7 @@ + CFLAGS += -DSVGALIB_HELPER_MAJOR=$(SVGALIB_HELPER_MAJOR) + + ifeq (1,$(findstring 1,$(MODVER))) +- CFLAGS += -DMODVERSIONS -include $(INCLUDEDIR)/linux/modversions.h ++ CFLAGS += -DMODVERSIONS -DCONFIG_MODVERSIONS=1 + endif + + TARGET = svgalib_helper +@@ -50,7 +50,8 @@ + endif + endif + +-all: .depend $(OBJS) ++modules: $(OBJS) ++all: .depend modules + + $(TARGET).o: $(SRC:.c=.o) + $(LD) -r $^ -o $@ +@@ -61,8 +62,8 @@ + install: device modules_install + + modules_install: $(OBJS) +- mkdir -p /lib/modules/$(VER)/kernel/misc +- install -m 0644 -c $(OBJS) /lib/modules/$(VER)/kernel/misc ++ mkdir -p $(TOPDIR)/lib/modules/$(VER)/kernel/misc ++ install -m 0644 -c $(OBJS) $(TOPDIR)/lib/modules/$(VER)/kernel/misc + + device: + rm -f /dev/svgalib_helper* /dev/svga_helper* /dev/svga /dev/svga? +--- svgalib/kernel/svgalib_helper/kernel26compat.h ++++ svgalib/kernel/svgalib_helper/kernel26compat.h +@@ -10,7 +10,7 @@ + # define PCI_GET_CLASS pci_find_class + # define PCI_GET_DEVICE pci_find_device + +-# if defined (PG_chainlock) ++# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,3) + # define my_io_remap_page_range(vma, start, ofs, len, prot) \ + io_remap_page_range(vma,start,ofs,len,prot) + # else +@@ -70,6 +70,7 @@ + + /* These are also not present in 2.6 kernels ... */ + #if (!defined _LINUX_DEVFS_FS_KERNEL_H) || (defined KERNEL_2_6) ++#include <linux/fs.h> + static inline int devfs_register_chrdev (unsigned int major, const char *name, + struct file_operations *fops) + { +@@ -77,7 +78,12 @@ + } + static inline int devfs_unregister_chrdev (unsigned int major,const char *name) + { +- return unregister_chrdev (major, name); ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) ++ return unregister_chrdev (major, name); ++#else ++ unregister_chrdev (major, name); ++ return 0; ++#endif + } + #endif + +@@ -99,7 +105,8 @@ + class_device_create(svgalib_helper_class, \ + MKDEV(SVGALIB_HELPER_MAJOR, _minor), \ + &sh_pci_devs[_minor]->dev->dev, _name); +-#else /* 2.6.15 changed class_device_create */ ++/* 2.6.15 changed class_device_create */ ++#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26) + # define SLH_SYSFS_ADD_CONTROL \ + class_device_create(svgalib_helper_class, NULL, \ + MKDEV(SVGALIB_HELPER_MAJOR, 0), \ +@@ -109,7 +116,30 @@ + class_device_create(svgalib_helper_class, NULL, \ + MKDEV(SVGALIB_HELPER_MAJOR, _minor), \ + &sh_pci_devs[_minor]->dev->dev, _name); +-#endif /* 2.6.15 */ ++/* 2.6.26 changed class_device_create to device_create */ ++#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27) ++# define SLH_SYSFS_ADD_CONTROL \ ++ device_create(svgalib_helper_class, NULL, \ ++ MKDEV(SVGALIB_HELPER_MAJOR, 0), \ ++ "svga"); ++ ++# define SLH_SYSFS_ADD_DEVICE(_name, _minor) \ ++ device_create(svgalib_helper_class, &sh_pci_devs[_minor]->dev->dev, \ ++ MKDEV(SVGALIB_HELPER_MAJOR, _minor), \ ++ _name); ++/* 2.6.27 changed device_create to device_create_drvdata */ ++#else ++# define SLH_SYSFS_ADD_CONTROL \ ++ device_create_drvdata(svgalib_helper_class, NULL, \ ++ MKDEV(SVGALIB_HELPER_MAJOR, 0), \ ++ "%s%d", "svga", 0); ++ ++# define SLH_SYSFS_ADD_DEVICE(_name, _minor) \ ++ device_create_drvdata(svgalib_helper_class, \ ++ &sh_pci_devs[_minor]->dev->dev, \ ++ MKDEV(SVGALIB_HELPER_MAJOR, _minor), \ ++ "%s%d", _name, _minor); ++#endif + + # define SLH_SYSFS_REMOVE_DEVICE(i) \ + class_destroy(svgalib_helper_class); +@@ -161,3 +191,7 @@ + #ifndef PCI_VENDOR_ID_RENDITION + #define PCI_VENDOR_ID_RENDITION 0x1163 + #endif ++ ++#ifndef IRQF_SHARED ++# define IRQF_SHARED SA_SHIRQ ++#endif +--- svgalib/kernel/svgalib_helper/main.c ++++ svgalib/kernel/svgalib_helper/main.c +@@ -1,5 +1,3 @@ +-#include <linux/config.h> +- + #if defined (CONFIG_MODVERSIONS) && !defined (MODVERSIONS) + # define MODVERSIONS + #endif +@@ -17,15 +15,22 @@ + #include <linux/ioport.h> + #include <linux/interrupt.h> + #include <linux/pci.h> ++#include <linux/version.h> ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18) + #include <linux/devfs_fs_kernel.h> ++#endif + #include <linux/mm.h> ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) + #include <linux/thread_info.h> ++#endif + #include <linux/smp.h> + #include <linux/smp_lock.h> + + #include <linux/sched.h> + #include <linux/wait.h> ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) + #include <linux/syscalls.h> ++#endif + + #define __KERNEL_SYSCALLS__ + #include <linux/unistd.h> +@@ -50,7 +55,7 @@ + #include "displaystart.h" + + int debug=0; +-static int all_devices=0; ++int all_devices=0; + int num_devices=0; + + static char *sdev_id="svgalib_helper"; +@@ -98,7 +103,11 @@ + static volatile int vsync=0; + static wait_queue_head_t vsync_wait; + +-static irqreturn_t vsync_interrupt(int irq, void *dev_id, struct pt_regs *regs) ++static irqreturn_t vsync_interrupt(int irq, void *dev_id ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) ++, struct pt_regs *regs ++#endif ++) + { + struct sh_pci_device *dev = (struct sh_pci_device *)dev_id; + +@@ -355,7 +364,7 @@ + vsync=1; + i=0; + while(irqs[i]!=-1) +- request_irq(irqs[i++], vsync_interrupt, SA_SHIRQ, "svgalib_helper", sdev_id); ++ request_irq(irqs[i++], vsync_interrupt, IRQF_SHARED, "svgalib_helper", sdev_id); + vga_enable_vsync((void *)sdev_id); + wait_event_interruptible(vsync_wait, !vsync); + i=0; +@@ -443,7 +452,7 @@ + int i=sh_pci_devs[minor]->dev->irq; + sh_pci_devs[minor]->opencount++; + if(sh_pci_devs[minor]->opencount==1 && i!=0 && i!=-1 && i!=255) +- request_irq(i, vsync_interrupt, SA_SHIRQ, "svgalib_helper", sh_pci_devs[minor]); ++ request_irq(i, vsync_interrupt, IRQF_SHARED, "svgalib_helper", sh_pci_devs[minor]); + } + + #ifndef KERNEL_2_6 +@@ -763,10 +772,15 @@ + + } + ++#ifdef KERNEL_2_6 ++module_param(debug, int, 0); ++module_param(all_devices, int, 0); ++#else + MODULE_PARM(debug, "i"); +-MODULE_PARM_DESC(debug, "Debug output level."); +- + MODULE_PARM(all_devices, "i"); ++#endif ++ ++MODULE_PARM_DESC(debug, "Debug output level."); + MODULE_PARM_DESC(all_devices, "Give access to all PCI devices, regardless of class."); + + +--- svgalib/src/lrmi.6.c ++++ svgalib/src/lrmi.6.c +@@ -169,6 +169,13 @@ + } + } + ++#ifndef TF_MASK ++#define TF_MASK X86_EFLAGS_TF ++#define IF_MASK X86_EFLAGS_IF ++#define IOPL_MASK X86_EFLAGS_IOPL ++#define VIF_MASK X86_EFLAGS_VIF ++#define VIP_MASK X86_EFLAGS_VIP ++#endif + + #define DEFAULT_VM86_FLAGS (IF_MASK | IOPL_MASK) + #define DEFAULT_STACK_SIZE 0x1000 +--- svgalib/src/lrmi.9.c ++++ svgalib/src/lrmi.9.c +@@ -206,6 +206,13 @@ + + + #if defined(__linux__) ++#ifndef TF_MASK ++#define TF_MASK X86_EFLAGS_TF ++#define IF_MASK X86_EFLAGS_IF ++#define IOPL_MASK X86_EFLAGS_IOPL ++#define VIF_MASK X86_EFLAGS_VIF ++#define VIP_MASK X86_EFLAGS_VIP ++#endif + #define DEFAULT_VM86_FLAGS (IF_MASK | IOPL_MASK) + #elif defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) + #define DEFAULT_VM86_FLAGS (PSL_I | PSL_IOPL) +--- svgalib/lrmi-0.6m/lrmi.c ++++ svgalib/lrmi-0.6m/lrmi.c +@@ -170,6 +170,14 @@ + } + + ++#ifndef TF_MASK ++#define TF_MASK X86_EFLAGS_TF ++#define IF_MASK X86_EFLAGS_IF ++#define IOPL_MASK X86_EFLAGS_IOPL ++#define VIF_MASK X86_EFLAGS_VIF ++#define VIP_MASK X86_EFLAGS_VIP ++#endif ++ + #define DEFAULT_VM86_FLAGS (IF_MASK | IOPL_MASK) + #define DEFAULT_STACK_SIZE 0x1000 + #define RETURN_TO_32_INT 255 +--- svgalib/lrmi-0.9/lrmi.c ++++ svgalib/lrmi-0.9/lrmi.c +@@ -203,6 +203,13 @@ + + + #if defined(__linux__) ++#ifndef TF_MASK ++#define TF_MASK X86_EFLAGS_TF ++#define IF_MASK X86_EFLAGS_IF ++#define IOPL_MASK X86_EFLAGS_IOPL ++#define VIF_MASK X86_EFLAGS_VIF ++#define VIP_MASK X86_EFLAGS_VIP ++#endif + #define DEFAULT_VM86_FLAGS (IF_MASK | IOPL_MASK) + #elif defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) + #define DEFAULT_VM86_FLAGS (PSL_I | PSL_IOPL) diff --git a/media-libs/svgalib/files/svgalib-1.9.25-linux_3.4.patch b/media-libs/svgalib/files/svgalib-1.9.25-linux_3.4.patch new file mode 100644 index 000000000000..5e2d1e527cbb --- /dev/null +++ b/media-libs/svgalib/files/svgalib-1.9.25-linux_3.4.patch @@ -0,0 +1,29 @@ +diff -Naur svgalib-1.9.25/kernel/svgalib_helper/main.c svgalib-1.9.25_new/kernel/svgalib_helper/main.c
+--- svgalib-1.9.25/kernel/svgalib_helper/main.c 2006-01-12 18:17:53.000000000 +0000
++++ svgalib-1.9.25_new/kernel/svgalib_helper/main.c 2012-06-25 15:02:11.000000000 +0100
+@@ -33,7 +33,9 @@
+
+ #include <asm/processor.h>
+ #include <asm/uaccess.h>
+-#include <asm/system.h> /* cli(), *_flags */
++#if LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)
++ #include <asm/system.h> /* cli(), *_flags */
++#endif
+ #include <asm/segment.h> /* memcpy and such */
+ #include <asm/io.h>
+ #include <asm/pgtable.h>
+diff -Naur svgalib-1.9.25/kernel/svgalib_helper/Makefile svgalib-1.9.25_new/kernel/svgalib_helper/Makefile
+--- svgalib-1.9.25/kernel/svgalib_helper/Makefile 2006-05-20 13:31:04.000000000 +0100
++++ svgalib-1.9.25_new/kernel/svgalib_helper/Makefile 2012-06-25 13:39:38.000000000 +0100
+@@ -11,9 +11,11 @@
+ PWD := $(shell pwd)
+ TARGET := svgalib_helper
+
++ ifneq ($(TOPDIR),)
+ ifeq ($(PATCHLEVEL),4)
+ include $(TOPDIR)/Rules.make
+ endif
++ endif
+
+ else
+
\ No newline at end of file diff --git a/media-libs/svgalib/files/svgalib-1.9.25-linux_3.9.patch b/media-libs/svgalib/files/svgalib-1.9.25-linux_3.9.patch new file mode 100644 index 000000000000..be10e394707a --- /dev/null +++ b/media-libs/svgalib/files/svgalib-1.9.25-linux_3.9.patch @@ -0,0 +1,27 @@ +--- svgalib-1.9.25/kernel/svgalib_helper/main.c.orig 2016-02-22 11:10:25.000000000 +0300 ++++ svgalib-1.9.25/kernel/svgalib_helper/main.c 2016-02-22 11:17:16.223529679 +0300 +@@ -170,8 +170,12 @@ + #else + static int svgalib_helper_ioctl(struct file *filp, + unsigned int cmd, unsigned long arg) { ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0) ++ struct inode *inode=file_inode(filp); ++#else + struct inode *inode=filp->f_dentry->d_inode; + #endif ++#endif + + io_t iov, *user_iov=(io_t *)arg; + pcic_t pciv, *user_pciv=(pcic_t *)arg; +@@ -586,7 +590,11 @@ + static int svgalib_helper_mmap(struct file *filp, struct vm_area_struct *vma) { + unsigned long start=vma->vm_start; + unsigned long end=vma->vm_end; ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0) ++ unsigned long minor = my_minor(file_inode(filp)->i_rdev); ++#else + unsigned long minor = my_minor(filp->f_dentry->d_inode->i_rdev); ++#endif + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,0) + unsigned long ofs=vma->vm_pgoff*PAGE_SIZE; + #else diff --git a/media-libs/svgalib/files/svgalib-1.9.25-missing_include.patch b/media-libs/svgalib/files/svgalib-1.9.25-missing_include.patch new file mode 100644 index 000000000000..5f6f5a2c3aa7 --- /dev/null +++ b/media-libs/svgalib/files/svgalib-1.9.25-missing_include.patch @@ -0,0 +1,33 @@ +diff -Naur svgalib-1.9.25.orig/demos/bg_test.c svgalib-1.9.25/demos/bg_test.c +--- svgalib-1.9.25.orig/demos/bg_test.c 2005-07-16 23:59:22.000000000 +0400 ++++ svgalib-1.9.25/demos/bg_test.c 2012-06-09 20:28:24.698448313 +0400 +@@ -9,6 +9,7 @@ + #include <stdio.h> + #include <stdlib.h> + #include <unistd.h> ++#include <string.h> + #include <strings.h> + #include <vga.h> + #include <vgagl.h> +diff -Naur svgalib-1.9.25.orig/demos/eventtest.c svgalib-1.9.25/demos/eventtest.c +--- svgalib-1.9.25.orig/demos/eventtest.c 2012-06-09 20:26:47.000000000 +0400 ++++ svgalib-1.9.25/demos/eventtest.c 2012-06-09 20:26:53.464932538 +0400 +@@ -5,6 +5,7 @@ + #include <unistd.h> + #include <sys/time.h> + #include <sys/types.h> ++#include <time.h> + #include <vga.h> + #include <vgagl.h> + #include <vgamouse.h> +diff -Naur svgalib-1.9.25.orig/demos/vgatweak.c svgalib-1.9.25/demos/vgatweak.c +--- svgalib-1.9.25.orig/demos/vgatweak.c 2000-08-06 14:20:02.000000000 +0400 ++++ svgalib-1.9.25/demos/vgatweak.c 2012-06-09 20:29:51.108801463 +0400 +@@ -4,6 +4,7 @@ + + #include <stdio.h> + #include <unistd.h> /* for usleep( long ) */ ++#include <stdlib.h> + #include <string.h> + #include "vga.h" + diff --git a/media-libs/svgalib/files/svgalib-1.9.25-vga_reset.patch b/media-libs/svgalib/files/svgalib-1.9.25-vga_reset.patch new file mode 100644 index 000000000000..a367363f044a --- /dev/null +++ b/media-libs/svgalib/files/svgalib-1.9.25-vga_reset.patch @@ -0,0 +1,14 @@ +--- svgalib-1.9.21/Makefile.makefiles 2005-03-18 14:49:10.000000000 +0100 ++++ svgalib-1.9.21/Makefile 2005-07-08 21:16:12.000000000 +0200 +@@ -152,8 +126,10 @@ + @echo "savetextmode: Script that saves textmode information used by 'textmode'." + @$(INSTALL_SCRIPT) utils/savetextmode $(bindir) + ifeq ($(LRMI),lrmi) +- @echo "mode3: Restore textmode by setting VESA mode 3." ++ @echo "mode3: Restore textmode by setting VESA mode 3." + @$(INSTALL_PROGRAM) lrmi-0.6m/mode3 $(bindir) ++ @echo "vga_reset: Restore textmode by resetting graphic board." ++ @cp lrmi-0.6m/vga_reset $(bindir) + endif + @echo "Installing keymap utilities in $(bindir):" + @echo "svgakeymap: Perl script that generates scancode conversion maps." diff --git a/media-libs/svgalib/files/svgalib.udev.rules.d.2 b/media-libs/svgalib/files/svgalib.udev.rules.d.2 new file mode 100644 index 000000000000..368a3219a134 --- /dev/null +++ b/media-libs/svgalib/files/svgalib.udev.rules.d.2 @@ -0,0 +1 @@ +KERNEL=="svga*", MODE="0660", GROUP="video" diff --git a/media-libs/svgalib/metadata.xml b/media-libs/svgalib/metadata.xml new file mode 100644 index 000000000000..bf137b46a821 --- /dev/null +++ b/media-libs/svgalib/metadata.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> +<maintainer type="person"> + <email>bircoph@gentoo.org</email> + <name>Andrew Savchenko</name> +</maintainer> +<use> + <flag name="kernel-helper">Build the helper kernel module</flag> +</use> +</pkgmetadata> diff --git a/media-libs/svgalib/svgalib-1.9.25-r4.ebuild b/media-libs/svgalib/svgalib-1.9.25-r4.ebuild new file mode 100644 index 000000000000..3896ddd8506a --- /dev/null +++ b/media-libs/svgalib/svgalib-1.9.25-r4.ebuild @@ -0,0 +1,129 @@ +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI="4" + +inherit eutils flag-o-matic toolchain-funcs linux-mod + +DESCRIPTION="A library for running svga graphics on the console" +HOMEPAGE="http://www.svgalib.org/" +SRC_URI="http://www.arava.co.il/matan/${PN}/${P}.tar.gz" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="-* x86" +IUSE="build +kernel-helper" + +DEPEND="" +RDEPEND="" + +MODULE_NAMES="svgalib_helper(misc:${S}/kernel/svgalib_helper)" +BUILD_TARGETS="default" + +pkg_setup() { + linux-mod_pkg_setup + BUILD_PARAMS="KDIR=${KV_OUT_DIR}" +} + +src_prepare() { + epatch "${FILESDIR}"/${PN}-1.9.25-linux_2.6.patch + epatch "${FILESDIR}"/${PN}-1.9.19-pic.patch #51698 + epatch "${FILESDIR}"/${PN}-1.9.25-build.patch + epatch "${FILESDIR}"/${PN}-1.9.25-linux_2.6.28.patch + epatch "${FILESDIR}"/${PN}-1.9.25-glibc210.patch #274305 + epatch "${FILESDIR}"/${PN}-1.9.25-linux_2.6.36-r1.patch + epatch "${FILESDIR}"/${PN}-1.9.25-fix_buffer.patch + epatch "${FILESDIR}"/${PN}-1.9.25-vga_reset.patch + epatch "${FILESDIR}"/${PN}-1.9.25-missing_include.patch + epatch "${FILESDIR}"/${PN}-1.9.25-linux_3.4.patch + epatch "${FILESDIR}"/${PN}-1.9.25-linux_3.9.patch #557052 + sed -i -e '/linux\/smp_lock.h/d' kernel/svgalib_helper/main.c || die +} + +src_compile() { + use kernel-helper || export NO_HELPER=y + + export CC=$(tc-getCC) + + # First build static + emake OPTIMIZE="${CFLAGS}" static || die "Failed to build static libraries!" + # Then build shared ... + emake OPTIMIZE="${CFLAGS}" shared || die "Failed to build shared libraries!" + # Missing in some cases ... + ln -s libvga.so.${PV} sharedlib/libvga.so + # Build lrmi and tools ... + emake OPTIMIZE="${CFLAGS}" LDFLAGS+=" -L../sharedlib" \ + textutils lrmi utils \ + || die "Failed to build libraries and utils!" + # Build the gl stuff tpp + emake OPTIMIZE="${CFLAGS}" -C gl || die "Failed to build gl!" + emake OPTIMIZE="${CFLAGS}" -C gl libvgagl.so.${PV} \ + || die "Failed to build libvgagl.so.${PV}!" + # Missing in some cases ... + ln -s libvgagl.so.${PV} sharedlib/libvgagl.so + emake OPTIMIZE="${CFLAGS}" -C src libvga.so.${PV} \ + || die "Failed to build libvga.so.${PV}!" + cp -pPR src/libvga.so.${PV} sharedlib/ + # Build threeDKit ... + emake OPTIMIZE="${CFLAGS}" LDFLAGS+=" -L../sharedlib" \ + -C threeDKit lib3dkit.a || die "Failed to build threeDKit!" + # Build demo's ... + emake OPTIMIZE="${CFLAGS} -I../gl" LDFLAGS+=" -L../sharedlib" \ + demoprogs || die "Failed to build demoprogs!" + + ! use build && use kernel-helper && linux-mod_src_compile +} + +src_install() { + local x= + + dodir /etc/svgalib /usr/{include,lib,bin,share/man} + + emake \ + TOPDIR="${D}" OPTIMIZE="${CFLAGS}" INSTALLMODULE="" \ + install || die "Failed to install svgalib!" + ! use build && use kernel-helper && linux-mod_src_install + + insinto /usr/include + doins gl/vgagl.h + dolib.a staticlib/libvga.a || die "dolib.a libvga" + dolib.a gl/libvgagl.a || die "dolib.a libvgagl" + dolib.a threeDKit/lib3dkit.a + dolib.so gl/libvgagl.so.${PV} || die "dolib.so libvgagl.so" + local abiver=$(sed -n '/^MAJOR_VER.*=/{s:.*=[ ]*::;p}' Makefile.cfg) + for x in lib3dkit libvga libvgagl ; do + dosym ${x}.so.${PV} /usr/lib/${x}.so + dosym ${x}.so.${PV} /usr/lib/${x}.so.${abiver} + done + + insinto /usr/include + doins src/vga.h gl/vgagl.h src/mouse/vgamouse.h src/joystick/vgajoystick.h + doins src/keyboard/vgakeyboard.h kernel/svgalib_helper/svgalib_helper.h + + insinto /lib/udev/rules.d + newins "${FILESDIR}"/svgalib.udev.rules.d.2 30-svgalib.rules + + exeinto /usr/lib/svgalib/demos + for x in "${S}"/demos/* ; do + [[ -x ${x} ]] && doexe ${x} + done + + cd "${S}"/threeDKit + exeinto /usr/lib/svgalib/threeDKit + local THREED_PROGS="plane wrapdemo" + doexe ${THREED_PROGS} + + cd "${S}" + dodoc 0-README + cd "${S}"/doc + dodoc CHANGES DESIGN TODO + docinto txt + dodoc Driver-programming-HOWTO add_driver svgalib.lsm \ + README.{joystick,keymap,multi-monitor,patching,vesa} + # avoid installation of a broken symlink + newdoc ../lrmi-0.6m/README README.lrmi +} + +pkg_postinst() { + ! use build && use kernel-helper && linux-mod_pkg_postinst +} diff --git a/media-libs/svgalib/svgalib-1.9.25-r5.ebuild b/media-libs/svgalib/svgalib-1.9.25-r5.ebuild new file mode 100644 index 000000000000..db04ae0a17d0 --- /dev/null +++ b/media-libs/svgalib/svgalib-1.9.25-r5.ebuild @@ -0,0 +1,129 @@ +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI="6" + +inherit flag-o-matic linux-mod toolchain-funcs + +DESCRIPTION="A library for running svga graphics on the console" +HOMEPAGE="http://www.svgalib.org/" +SRC_URI="http://www.arava.co.il/matan/${PN}/${P}.tar.gz" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="-* ~x86" +IUSE="build +kernel-helper" + +MODULE_NAMES="svgalib_helper(misc:${S}/kernel/svgalib_helper)" +BUILD_TARGETS="default" + +PATCHES=( + "${FILESDIR}"/${PN}-1.9.25-linux_2.6.patch + "${FILESDIR}"/${PN}-1.9.19-pic.patch + "${FILESDIR}"/${PN}-1.9.25-build.patch + "${FILESDIR}"/${PN}-1.9.25-linux_2.6.28.patch + "${FILESDIR}"/${PN}-1.9.25-glibc210.patch + "${FILESDIR}"/${PN}-1.9.25-linux_2.6.36-r1.patch + "${FILESDIR}"/${PN}-1.9.25-fix_buffer.patch + "${FILESDIR}"/${PN}-1.9.25-vga_reset.patch + "${FILESDIR}"/${PN}-1.9.25-missing_include.patch + "${FILESDIR}"/${PN}-1.9.25-linux_3.4.patch + "${FILESDIR}"/${PN}-1.9.25-linux_3.9.patch +) + +pkg_setup() { + linux-mod_pkg_setup + BUILD_PARAMS="KDIR=${KV_OUT_DIR}" +} + +src_prepare() { + default + sed -i -e '/linux\/smp_lock.h/d' kernel/svgalib_helper/main.c || die +} + +src_compile() { + use kernel-helper || export NO_HELPER=y + + export CC=$(tc-getCC) + # C89 extern inlines are needed, see #576260 + append-cflags -fgnu89-inline + + # First build static + emake OPTIMIZE="${CFLAGS}" static + # Then build shared ... + emake OPTIMIZE="${CFLAGS}" shared + # Missing in some cases ... + ln -s libvga.so.${PV} sharedlib/libvga.so + # Build lrmi and tools ... + emake OPTIMIZE="${CFLAGS}" LDFLAGS+=" -L../sharedlib" \ + textutils lrmi utils + # Build the gl stuff tpp + emake OPTIMIZE="${CFLAGS}" -C gl + emake OPTIMIZE="${CFLAGS}" -C gl libvgagl.so.${PV} + # Missing in some cases ... + ln -s libvgagl.so.${PV} sharedlib/libvgagl.so + emake OPTIMIZE="${CFLAGS}" -C src libvga.so.${PV} + cp -pPR src/libvga.so.${PV} sharedlib/ + # Build threeDKit ... + emake OPTIMIZE="${CFLAGS}" LDFLAGS+=" -L../sharedlib" \ + -C threeDKit lib3dkit.a + # Build demo's ... + emake OPTIMIZE="${CFLAGS} -I../gl" LDFLAGS+=" -L../sharedlib" \ + demoprogs + + ! use build && use kernel-helper && linux-mod_src_compile +} + +src_install() { + local x + + dodir /etc/svgalib /usr/{include,lib,bin,share/man} + + emake \ + TOPDIR="${D}" OPTIMIZE="${CFLAGS}" INSTALLMODULE="" \ + install + ! use build && use kernel-helper && linux-mod_src_install + + insinto /usr/include + doins gl/vgagl.h + dolib.a staticlib/libvga.a + dolib.a gl/libvgagl.a + dolib.a threeDKit/lib3dkit.a + dolib.so gl/libvgagl.so.${PV} + local abiver=$(sed -n '/^MAJOR_VER.*=/{s:.*=[ ]*::;p}' Makefile.cfg) + for x in lib3dkit libvga libvgagl ; do + dosym ${x}.so.${PV} /usr/lib/${x}.so + dosym ${x}.so.${PV} /usr/lib/${x}.so.${abiver} + done + + insinto /usr/include + doins src/vga.h gl/vgagl.h src/mouse/vgamouse.h src/joystick/vgajoystick.h + doins src/keyboard/vgakeyboard.h kernel/svgalib_helper/svgalib_helper.h + + insinto /lib/udev/rules.d + newins "${FILESDIR}"/svgalib.udev.rules.d.2 30-svgalib.rules + + exeinto /usr/lib/svgalib/demos + for x in "${S}"/demos/* ; do + [[ -x ${x} ]] && doexe ${x} + done + + cd "${S}"/threeDKit + exeinto /usr/lib/svgalib/threeDKit + local THREED_PROGS="plane wrapdemo" + doexe ${THREED_PROGS} + + cd "${S}" + dodoc 0-README + cd "${S}"/doc + dodoc CHANGES DESIGN TODO + docinto txt + dodoc Driver-programming-HOWTO add_driver svgalib.lsm \ + README.{joystick,keymap,multi-monitor,patching,vesa} + # avoid installation of a broken symlink + newdoc ../lrmi-0.6m/README README.lrmi +} + +pkg_postinst() { + ! use build && use kernel-helper && linux-mod_pkg_postinst +} |