--- /dev/null
+Author: Ole Streicher <olebole@debian.org>
+Description: Use loadct in cgloadct if no file is specified.
+ GDL does not shipt with a color table "colors1.tbl", so in the case
+ that no file name is specified, fall back to loadct instead of trying to
+ load this file.
+--- a/cgloadct.pro
++++ b/cgloadct.pro
+@@ -86,8 +86,8 @@
+ ; If this keyword is set to a named variable, the color table is returned as an \r
+ ; [NCOLORS,3] array and no colors are loaded in the display.\r
+ ; filename: in, optional, type='string'\r
+-; The name of a color table file to open. By default colors1.tbl in the IDL \r
+-; resource directory.\r
++; The name of a color table file to open. By default the gdl standard
++;color table\r
+ ; get_names: out, optional, type='string'\r
+ ; If set to a named variable, the names of the color tables are returned\r
+ ; and no colors are loaded in the display. Note that RGB_TABLE cannot be\r
+@@ -192,9 +192,8 @@
+ Catch, /CANCEL\r
+ Help, LAST_MESSAGE=1, OUTPUT=traceback\r
+ Help, Calls=callStack\r
+- callingRoutine = (StrSplit(StrCompress(callStack[1])," ", /Extract))[0]\r
+- Print,''\r
+- Print, 'Traceback Report from ' + StrUpCase(callingRoutine) + ':'\r
++ Print,''+callStack\r
++ Print, 'Traceback Report from:'\r
+ Print, ''\r
+ FOR j=0,N_Elements(traceback)-1 DO Print, " " + traceback[j]\r
+ void = Dialog_Message(traceback[0], /Error, TITLE='Trapped Error')\r
+@@ -236,11 +235,9 @@
+ IF N_Elements(clip) EQ 0 THEN clip = [0,255]\r
+ IF N_Elements(clip) EQ 1 THEN clip = [clip, 255]\r
+ clip = 0 > clip < 255\r
+- IF N_Elements(file) EQ 0 THEN file = Filepath('colors1.tbl', SUBDIRECTORY=['resource', 'colors'])\r
+- \r
+ ; Try to locate the brewer file. \r
+ IF Keyword_Set(brewer) THEN BEGIN\r
+- brewerfilepath = Filepath( ROOT_DIR=cgSourceDir(), 'fsc_brewer.tbl')\r
++ brewerfilepath = Filepath( ROOT_DIR='/usr/share/gnudatalanguage/coyote', 'fsc_brewer.tbl')\r
+ brewerFile = File_Search(brewerfilepath, Count=count)\r
+ IF count EQ 0 THEN BEGIN\r
+ Message, 'Cannot find the Brewer color table file "fsc_brewer.tbl."' + $\r
+@@ -257,6 +254,14 @@
+ IF N_Elements(ncolors) EQ 0 THEN ncolors = !D.TABLE_SIZE - bottom\r
+ reverse = KEYWORD_SET(reverse)\r
+ \r
++ IF N_Elements(file) EQ 0 THEN BEGIN
++ loadct, table, get_names=get_names, ncolors=ncolors, bottom=bottom, $
++ silent=silent, rgb_table=ltable
++ len = N_Elements(ltable)/3
++ r = ltable[0:len-1]
++ g = ltable[len:2*len-1]
++ b = ltable[2*len:3*len-1]
++ ENDIF ELSE BEGIN
+ ; Open and read the color table files.\r
+ OPENR, lun, file, /GET_LUN\r
+ ntables = 0B\r
+@@ -284,6 +289,7 @@
+ \r
+ ; Close the file.\r
+ FREE_LUN, lun\r
++ ENDELSE
+ \r
+ ; Clip the colors.\r
+ r = r[clip[0]:clip[1]]\r
+--- a/xcolors.pro
++++ b/xcolors.pro
+@@ -838,7 +838,7 @@
+ END\r
+ \r
+ 'BREWER': BEGIN\r
+- info.file = cgFindPathTo('fsc_brewer.tbl')\r
++ info.file = '/usr/share/gnudatalanguage/fsc_brewer.tbl'\r
+ info.brewer = 1\r
+ END\r
+ ENDCASE\r
--- /dev/null
+Author: Ole Streicher <olebole@debian.org>
+Description: Various small patches to fix things under GDL
+--- a/convert_to_type.pro
++++ b/convert_to_type.pro
+@@ -122,7 +122,7 @@
+ (type EQ 8): Message, 'Unable to convert input to STRUCTURE data type.'\r
+ (type EQ 10): Message, 'Unable to convert input to POINTER data type.'\r
+ (type EQ 11): Message, 'Unable to convert input to OBJECT data type.'\r
+- (type GT 15): Message, 'Unable to convert undefined data type: ', StrTrim(theType) + '.'\r
++ (type GT 15): Message, 'Unable to convert undefined data type: ' + StrTrim(theType) + '.'\r
+ ELSE:\r
+ ENDCASE\r
+ ENDELSE\r
--- /dev/null
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+
+DESCRIPTION="GDL library from D. Fannings IDL courses"
+HOMEPAGE="http://www.idlcoyote.com/"
+SRC_URI="http://www.idlcoyote.com/programs/zip_files/coyoteprograms.zip -> ${P}.zip"
+
+LICENSE="BSD GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+DEPEND="app-arch/unzip"
+RDEPEND="dev-lang/gdl"
+
+S="${WORKDIR}/coyote"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-cgloadct.patch"
+ "${FILESDIR}/${PN}-gdl-fixes.patch"
+)
+
+src_install() {
+ dodoc README.txt
+ newdoc public/README.txt README-public.txt
+ rm README.txt public/README.txt || die
+ insinto /usr/share/gnudatalanguage/coyote
+ doins -r *
+}