diff --git a/gnu/packages/education.scm b/gnu/packages/education.scm index 15518896ed..a636db5e22 100644 --- a/gnu/packages/education.scm +++ b/gnu/packages/education.scm @@ -12,6 +12,7 @@ ;;; Copyright © 2021 Nicolò Balzarotti ;;; Copyright © 2022 Luis Felipe López Acevedo ;;; Copyright © 2023 Maxim Cournoyer +;;; Copyright © 2024 Luis Higino ;;; ;;; This file is part of GNU Guix. ;;; @@ -49,6 +50,7 @@ (define-module (gnu packages education) #:use-module (gnu packages golang) #:use-module (gnu packages golang-build) #:use-module (gnu packages golang-check) + #:use-module (gnu packages golang-web) #:use-module (gnu packages golang-xyz) #:use-module (gnu packages gtk) #:use-module (gnu packages gstreamer) @@ -90,6 +92,71 @@ (define-module (gnu packages education) #:use-module (guix build-system trivial) #:use-module (srfi srfi-1)) +(define-public cf-tool + (package + (name "cf-tool") + (version "1.0.0") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/xalanq/cf-tool") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "0ad2mljjg4pr8jjk9i1asnld16xi1wdfnh25drngm3c590cmrnfj")) + (patches (search-patches "cf-tool-add-languages.patch")) + (modules '((guix build utils))) + ;; Remove assets and vendorized dependencies from checkout + (snippet '(begin + (delete-file-recursively "assets") + (delete-file-recursively "vendor"))))) + (build-system go-build-system) + (arguments + (list + #:go go-1.18 + #:install-source? #f + #:import-path "github.com/xalanq/cf-tool" + #:phases + #~(modify-phases %standard-phases + (add-after 'install 'add-alternate-name + (lambda* _ + (let ((bin (string-append #$output "/bin"))) + (symlink (string-append bin "/cf-tool") + (string-append bin "/cf")))))))) + (native-inputs + (list go-github-com-docopt-docopt-go + go-github-com-fatih-color + go-github-com-k0kubun-go-ansi + go-github-com-mitchellh-go-homedir + go-github-com-olekukonko-tablewriter + go-github-com-puerkitobio-goquery + go-github-com-sergi-go-diff + go-github-com-shirou-gopsutil + go-github-com-skratchdot-open-golang + go-golang-org-x-crypto + go-golang-org-x-term)) + (home-page "https://github.com/xalanq/cf-tool") + (synopsis + "Command-line interface tool for @url{https://codeforces.com, Codeforces}") + (description + "Codeforces Tool is a command-line interface tool for +@url{https://codeforces.com,Codeforces}. Its features include: +@itemize +@item support Contests, Gym, Groups and acmsguru +@item support all programming languages in Codeforces +@item submit codes +@item watch submissions' status dynamically +@item fetch problems' samples +@item compile and test locally +@item clone all codes of someone +@item generate codes from the specified template (including timestamp, author, etc.) +@item list problems' stats of one contest +@item use default web browser to open problems' pages, standings' page, etc. +@item setup a network proxy and setup a mirror host +@end itemize") + (license license:expat))) + (define-public gcompris (package (name "gcompris") diff --git a/gnu/packages/patches/cf-tool-add-languages.patch b/gnu/packages/patches/cf-tool-add-languages.patch new file mode 100644 index 0000000000..a5dc0c8cfa --- /dev/null +++ b/gnu/packages/patches/cf-tool-add-languages.patch @@ -0,0 +1,22 @@ +Add newer language options. + +diff --git a/client/langs.go b/tmp/langs.go +index b09c69f..0695958 100644 +--- a/client/langs.go ++++ b/tmp/langs.go +@@ -9,6 +9,7 @@ var Langs = map[string]string{ + "42": "GNU G++11 5.1.0", + "50": "GNU G++14 6.4.0", + "54": "GNU G++17 7.3.0", ++ "89": "GNU G++20 13.2 (64 bit, winlibs)", + "2": "Microsoft Visual C++ 2010", + "59": "Microsoft Visual C++ 2017", + "9": "C# Mono 5.18", +@@ -60,6 +61,7 @@ var LangsExt = map[string]string{ + "GNU C++11": "cpp", + "GNU C++14": "cpp", + "GNU C++17": "cpp", ++ "GNU G++20": "cpp", + "MS C++": "cpp", + "MS C++ 2017": "cpp", + "Mono C#": "cs",