diff options
author | Sebastian Pipping <sebastian@pipping.org> | 2014-09-07 20:49:55 +0200 |
---|---|---|
committer | Sebastian Pipping <sebastian@pipping.org> | 2014-09-07 21:16:57 +0200 |
commit | ddf10128b35257dd60639064b6e4d96c84904f94 (patch) | |
tree | 2394f31007235803d9d8d04ee26e1d1ef956bee8 /games-board | |
parent | games-board/hoichess: 0.12.1 (diff) | |
download | betagarden-ddf10128b35257dd60639064b6e4d96c84904f94.tar.gz betagarden-ddf10128b35257dd60639064b6e4d96c84904f94.tar.bz2 betagarden-ddf10128b35257dd60639064b6e4d96c84904f94.zip |
games-board/xiangqiboard: 0.1.3-rc
GHC patch by Sergei Trofimovich <slyfox@g.o>
Diffstat (limited to 'games-board')
5 files changed, 149 insertions, 0 deletions
diff --git a/games-board/xiangqiboard/Manifest b/games-board/xiangqiboard/Manifest new file mode 100644 index 0000000..ef13f1d --- /dev/null +++ b/games-board/xiangqiboard/Manifest @@ -0,0 +1 @@ +DIST xiangqiboard-0.1.3-rc.tar.gz 167644 SHA256 068f82c4f355e81022019e0dd2241989243017e14081859f6433928f39bf44af SHA512 ac8996273a3581a9737715aa4d1c1f38e452deef2b930766c4734c5d2dce44841a20bcfc50a953683ccdae2765c581e54867421bddae6e5a9363e1245c325f96 WHIRLPOOL 72cc4ec76927bd69ba3768e3ece5735cd2df324dad3ab6c7ade6c75f5dc0dc41eaca9731910638d98f12af38d69c36936a15cdbfd1cc75e92fb1debd0464f421 diff --git a/games-board/xiangqiboard/files/xiangqiboard-0.1.3-rc-modern-ghc.patch b/games-board/xiangqiboard/files/xiangqiboard-0.1.3-rc-modern-ghc.patch new file mode 100644 index 0000000..ae8e675 --- /dev/null +++ b/games-board/xiangqiboard/files/xiangqiboard-0.1.3-rc-modern-ghc.patch @@ -0,0 +1,68 @@ +diff --git a/Makefile b/Makefile +index f691934..c980d9e 100644 +--- a/Makefile ++++ b/Makefile +@@ -5,8 +5,12 @@ export datadir = $(datarootdir)/games/xiangqiboard + + VERSION = $(shell grep '^Version' ChangeLog | head -n 1 | awk '{ print $$2; }') + ++HC=ghc ++HC_PACKAGES=base cairo process directory filepath old-time gtk ++HCFLAGS=-hide-all-packages $(foreach p,$(HC_PACKAGES),-package=$(p)) ++ + xiangqiboard: ./src/xiangqiboard.hs +- ghc --make ./src/xiangqiboard.hs ++ $(HC) $(HCFLAGS) --make ./src/xiangqiboard.hs + + install: xiangqiboard + mkdir -p $(datadir) +diff --git a/src/xiangqiboard.hs b/src/xiangqiboard.hs +index 6faa257..d36ca21 100644 +--- a/src/xiangqiboard.hs ++++ b/src/xiangqiboard.hs +@@ -6,6 +6,8 @@ + module Main where + + import Graphics.UI.Gtk ++import Graphics.UI.Gtk.Gdk.GC (gcNew) ++import Graphics.UI.Gtk.Gdk.Events as GE + import Graphics.Rendering.Cairo + import System.IO + import System.Process +@@ -13,10 +15,10 @@ import System.Directory + import System.FilePath + import System.Time + import Control.Concurrent +-import Monad +-import List +-import Maybe +-import Char ++import Control.Monad ++import Data.List ++import Data.Maybe ++import Data.Char + import Data.IORef + + license = +@@ -457,7 +459,7 @@ main = do + checkmove + + onButtonPress canvas +- (\x -> if (eventButton x) == LeftButton ++ (\x -> if (GE.eventButton x) == LeftButton + then do let ty = eventY x + let tx = eventX x + (step, offX) <- getScale canvas +@@ -481,9 +483,9 @@ main = do + then do + parseMove movePart + else return () +- return (eventSent x) +- else return (eventSent x) +- else return (eventSent x)) ++ return (GE.eventSent x) ++ else return (GE.eventSent x) ++ else return (GE.eventSent x)) + + {- todo: explicitly handle engine commands in future versions, entry deactivated for now + onEntryActivate entry $ do diff --git a/games-board/xiangqiboard/files/xiangqiboard-0.1.3-rc-paths.patch b/games-board/xiangqiboard/files/xiangqiboard-0.1.3-rc-paths.patch new file mode 100644 index 0000000..061617f --- /dev/null +++ b/games-board/xiangqiboard/files/xiangqiboard-0.1.3-rc-paths.patch @@ -0,0 +1,34 @@ +From 39b4f3cfc76c083a8f163b49168cdb0c2ababd5b Mon Sep 17 00:00:00 2001 +From: Sebastian Pipping <sebastian@pipping.org> +Date: Sun, 7 Sep 2014 20:47:21 +0200 +Subject: [PATCH] Fix paths + +--- + src/xiangqiboard.hs | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/xiangqiboard.hs b/src/xiangqiboard.hs +index d36ca21..7c8e113 100644 +--- a/src/xiangqiboard.hs ++++ b/src/xiangqiboard.hs +@@ -794,7 +794,7 @@ getPiecePixbufferByChar :: Char -> IO Pixbuf + getPiecePixbufferByChar c = do + + Just relativeDir <- findExecutable "xiangqiboard" +- let dataDir = combine (takeDirectory relativeDir) "../share/games/xiangqiboard/" ++ let dataDir = "/usr/share/games/xiangqiboard/" + let filename = dataDir ++ [c] ++ ".svg" + + --pixbufNewFromFileAtSize filename 256 256 +@@ -938,7 +938,7 @@ openAboutDialog parentwindow license = do + openHelpContents :: IO () + openHelpContents = do + Just relativeDir <- findExecutable "xiangqiboard" +- let dataDir = combine (takeDirectory relativeDir) "../share/doc/xiangqiboard/" ++ let dataDir = "/usr/share/games/doc/xiangqiboard/" + let filename = "file://" ++ dataDir ++ "xiangqiboard.xml" + let commandString = "yelp " ++ filename ++ " > /dev/null" + handle <- runCommand commandString +-- +2.1.0 + diff --git a/games-board/xiangqiboard/metadata.xml b/games-board/xiangqiboard/metadata.xml new file mode 100644 index 0000000..16bcc9f --- /dev/null +++ b/games-board/xiangqiboard/metadata.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer> + <email>sping@gentoo.org</email> + <name>Sebastian Pipping</name> + </maintainer> +</pkgmetadata> diff --git a/games-board/xiangqiboard/xiangqiboard-0.1.3_rc.ebuild b/games-board/xiangqiboard/xiangqiboard-0.1.3_rc.ebuild new file mode 100644 index 0000000..59d3777 --- /dev/null +++ b/games-board/xiangqiboard/xiangqiboard-0.1.3_rc.ebuild @@ -0,0 +1,38 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI="5" + +inherit eutils + +MY_P=${PN}-${PV/_/-} +DESCRIPTION="Scalable Xiangqi GUI" +HOMEPAGE="http://xiangqiboard.blogspot.de/" +SRC_URI="http://ralph-glass.homepage.t-online.de/xiangqi/${MY_P}.tar.gz" + +LICENSE="GPL-2+" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="" + +SHARED_DEPEND="dev-haskell/gtk + dev-haskell/cairo" + +RDEPEND="${SHARED_DEPEND} + games-board/hoichess" +DEPEND="${SHARED_DEPEND} + dev-lang/ghc" + +S="${WORKDIR}"/${MY_P} + +src_prepare() { + epatch "${FILESDIR}"/${MY_P}-modern-ghc.patch + epatch "${FILESDIR}"/${MY_P}-paths.patch +} + +src_install() { + dodir /usr/games/bin || die + emake prefix="${D}/usr" install || die + mv "${D}"/usr/games/${PN} "${D}"/usr/games/bin/ || die +} |