Commit d5271e4f authored by Vivien Kraus's avatar Vivien Kraus
Browse files

Generate a guix definition for the package

parent 048bed52
Pipeline #170413 passed with stages
in 34 minutes and 45 seconds
......@@ -66,6 +66,7 @@
/eu.planete_kraus.Tarot.json.in
/git-version-gen
/gitlog-to-changelog
/guix/gnu/packages/tarot.scm.in
/index.html
/install-sh
/lib
......
......@@ -46,6 +46,7 @@ include flatpak/Makefile.am
include model/Makefile.am
include git-check.am
include copyright/Makefile.am
include guix/Makefile.am
AM_CPPFLAGS += \
-DLOCALEDIR="\"$(localedir)\"" \
......
# tarot implements the rules of the tarot game
# Copyright (C) 2019 Vivien Kraus
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at
# your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
EXTRA_DIST += %reldir%/gen-manifest %reldir%/gnu/packages/tarot.scm.in
MAINTAINERCLEANFILES += $(srcdir)/%reldir%/gnu/packages/tarot.scm.in
$(srcdir)/%reldir%/gnu/packages/tarot.scm.in: $(srcdir)/%reldir%/gen-manifest .version
$(MKDIR_P) $(srcdir)/%reldir%/gnu/packages
$(AM_V_GEN) $(srcdir)/%reldir%/gen-manifest $(DIST_ARCHIVES) $(VERSION) > $(srcdir)/%reldir%/gnu/packages/tarot.scm.in-t
@mv $(srcdir)/%reldir%/gnu/packages/tarot.scm.in-t $(srcdir)/%reldir%/gnu/packages/tarot.scm.in
#!/bin/sh
# tarot implements the rules of the tarot game
# Copyright (C) 2019 Vivien Kraus
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at
# your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
URL="https://play-tarot.frama.io/tarot-releases/$1"
cat <<EOF
(define-module (gnu packages tarot)
#:use-module (guix packages)
#:use-module (guix download)
#:use-module (guix build-system gnu)
#:use-module (guix licenses)
#:use-module (gnu packages glib)
#:use-module (gnu packages gtk)
#:use-module (gnu packages pkg-config)
#:use-module (gnu packages nettle)
#:use-module (gnu packages xml)
#:use-module (rnrs bytevectors))
(define (hex data)
(define (to-number char)
(case char
((#\0) 0)
((#\1) 1)
((#\2) 2)
((#\3) 3)
((#\4) 4)
((#\5) 5)
((#\6) 6)
((#\7) 7)
((#\8) 8)
((#\9) 9)
((#\a) 10)
((#\b) 11)
((#\c) 12)
((#\d) 13)
((#\e) 14)
((#\f) 15)))
(define (get-bytes k)
(if (>= k (string-length data))
'()
(cons (+ (* 16 (to-number (string-ref data k)))
(to-number (string-ref data (+ k 1))))
(get-bytes (+ k 2)))))
(u8-list->bytevector (get-bytes 0)))
(define-public tarot
(package
(name "tarot")
(version "$2")
(source (origin
(method url-fetch)
(uri "$URL")
(sha256 (hex "GET_SHA256"))))
(build-system gnu-build-system)
(arguments '(#:configure-flags '("--enable-silent-rules")))
(inputs \`(("glib" ,glib)
("gtk+" ,gtk+)
("pkg-config" ,pkg-config)
("nettle" ,nettle)
("libxml2" ,libxml2)))
(synopsis "Play the multi-player game of Tarot against the AI")
(description "Tarot is a multi-player trick taking card game, when one strong player plays against three others. This package lets you play against the AI.")
(home-page "https://play-tarot.frama.io/tarot")
(license gpl3+)))
EOF
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment