From patchwork Fri Feb 3 14:41:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Josselin Poiret X-Patchwork-Id: 46653 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 2F9B827BBEB; Fri, 3 Feb 2023 14:42:25 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FROM_SUSPICIOUS_NTLD,MAILING_LIST_MULTI,PDS_OTHER_BAD_TLD, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 46C1927BBE9 for ; Fri, 3 Feb 2023 14:42:23 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pNxGS-0005Xz-3C; Fri, 03 Feb 2023 09:42:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pNxGM-0005WF-CN for guix-patches@gnu.org; Fri, 03 Feb 2023 09:42:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pNxGL-0001FL-RR for guix-patches@gnu.org; Fri, 03 Feb 2023 09:42:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pNxGL-0001Lr-Mj for guix-patches@gnu.org; Fri, 03 Feb 2023 09:42:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#61207] [PATCH v2] gnu: Add opentaxsolver. Resent-From: Josselin Poiret Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 03 Feb 2023 14:42:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61207 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Josselin Poiret , Skylar Hill , 61207@debbugs.gnu.org Received: via spool by 61207-submit@debbugs.gnu.org id=B61207.16754353055172 (code B ref 61207); Fri, 03 Feb 2023 14:42:01 +0000 Received: (at 61207) by debbugs.gnu.org; 3 Feb 2023 14:41:45 +0000 Received: from localhost ([127.0.0.1]:36952 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pNxG3-0001LL-EM for submit@debbugs.gnu.org; Fri, 03 Feb 2023 09:41:45 -0500 Received: from jpoiret.xyz ([206.189.101.64]:48340) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pNxFx-0001L9-O5 for 61207@debbugs.gnu.org; Fri, 03 Feb 2023 09:41:41 -0500 Received: from authenticated-user (jpoiret.xyz [206.189.101.64]) by jpoiret.xyz (Postfix) with ESMTPA id 93825184BF2; Fri, 3 Feb 2023 14:41:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jpoiret.xyz; s=dkim; t=1675435296; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZEOpcJRKCJY1p9yy0w8OOavqEHUnPFCvJe7AWWXEPTo=; b=iS27FE+aGBLJI1Vhj8ZnaETH5yOEG+tw5H/nqhzrqpKihAGhedukFm8Cnd0xfUHr+clQUW NQJ4JeuLnaoit5Ug+5MAQbJTCuWp6pyedCHTIyLAh+QUCMU/HYVkNzlEnL8t7mnfJs3sJJ B6GjcjNT0LqAmTooi7mW/DdUkXLsuLa6OrPIAyYRfYaAjCZ3JCXhLraEavVy9sY0k7zaZd 2dtisHrzyIZbi61a3942yTH9Dmn2rDdrwH+fBR70f7ijwylOY21zizWxyzLjsuKi87ONRE YbUpg2xG8D1BZPpq8VgGN1PwSQZFyhSt6W9Zb17o1qWCyjWREur975E3U7I0gA== Date: Fri, 3 Feb 2023 15:41:27 +0100 Message-Id: In-Reply-To: <87edr6x169.fsf@jpoiret.xyz> References: <87edr6x169.fsf@jpoiret.xyz> MIME-Version: 1.0 Authentication-Results: jpoiret.xyz; auth=pass smtp.auth=jpoiret@jpoiret.xyz smtp.mailfrom=dev@jpoiret.xyz X-Spamd-Bar: --- X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Josselin Poiret X-ACL-Warn: , Josselin Poiret via Guix-patches X-Patchwork-Original-From: Josselin Poiret via Guix-patches via From: Josselin Poiret Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches From: Skylar Hill --- gnu/packages/finance.scm | 71 +++++++++++++++++++ .../opentaxsolver-file-browser-fix.patch | 58 +++++++++++++++ 2 files changed, 129 insertions(+) create mode 100644 gnu/packages/patches/opentaxsolver-file-browser-fix.patch base-commit: c19cd9f9470a8d60f8c1f8e0ff26b9cdb0e083ad diff --git a/gnu/packages/finance.scm b/gnu/packages/finance.scm index c9c8e9b823..a2795c41f9 100644 --- a/gnu/packages/finance.scm +++ b/gnu/packages/finance.scm @@ -33,6 +33,7 @@ ;;; Copyright © 2022 Collin J. Doering ;;; Copyright © 2022 Justin Veilleux ;;; Copyright © 2023 Frank Pursel +;;; Copyright © 2023 Skylar Hill ;;; ;;; This file is part of GNU Guix. ;;; @@ -2271,3 +2272,73 @@ (define-public p2pool Monero node and what it mines, but you get frequent payouts like on a regular pool.") (license license:gpl3))) + +(define-public opentaxsolver + ;; The OTS version is formatted like tax-year_version. So, at time of + ;; writing, the version is 2022_20.00. Each part of this is used in + ;; different places in the source uri, so it's convenient to have them + ;; separately like this. + (let ((tax-year "2022") + (ots-version "20.00")) + (package + (name "opentaxsolver") + (version (string-append tax-year "_" ots-version)) + (source (origin + (method url-fetch) + (uri (string-append "mirror://sourceforge/opentaxsolver/OTS_" + tax-year + "/v" + ots-version + "_linux/OpenTaxSolver" + version + "_linux64.tgz")) + (sha256 + (base32 + "06k0a72bmwdmr71dvrp8b4vl8vilnggsh92hrp7wjdgcjj9m074w")) + (patches (search-patches + "opentaxsolver-file-browser-fix.patch")))) + (build-system glib-or-gtk-build-system) + (arguments + (list #:phases #~(modify-phases %standard-phases + (delete 'configure) + ;; OTS does provide a shellscript that does exactly + ;; this, but we need to do it ourselves to specify + ;; the correct compiler and to delete the GUI + ;; binaries. + (replace 'build + (lambda _ + (delete-file "Run_taxsolve_GUI") + (delete-file-recursively "bin") + (mkdir "bin") + (chdir "src/Gui_gtk") + (invoke "make" + (string-append "CC=" + #$(cc-for-target))) + (chdir "..") + (invoke "make" + (string-append "CC=" + #$(cc-for-target))))) + (delete 'check) + ;; OTS doesn't provide a `make install` target, + ;; because it assumes it'll be run from the + ;; tarball. So, we do it ourselves, making sure to + ;; replicate the directory structure of the tarball. + (replace 'install + (lambda _ + (copy-recursively "../bin" + (string-append #$output "/bin")) + (copy-recursively "../tax_form_files" + (string-append #$output + "/tax_form_files")) + (copy-recursively "formdata" + (string-append #$output + "/src/formdata"))))))) + (inputs (list gtk+-2)) + (native-inputs (list pkg-config)) + (synopsis "Yearly tax preparation tool") + (description + "OpenTaxSolver is a free, safe, and secure program for calculating tax form entries for federal and state personal income taxes. It automatically fills out and prints your forms for mailing. + +Invoke with @code{ots_gui2} rather than the usual @code{Run_taxsolve_GUI}.") + (home-page "https://opentaxsolver.sourceforge.net/") + (license license:gpl2+)))) diff --git a/gnu/packages/patches/opentaxsolver-file-browser-fix.patch b/gnu/packages/patches/opentaxsolver-file-browser-fix.patch new file mode 100644 index 0000000000..0e6be74f85 --- /dev/null +++ b/gnu/packages/patches/opentaxsolver-file-browser-fix.patch @@ -0,0 +1,58 @@ +From 96fda11a53a89c6647031f2c05ef12f1a9df6a08 Mon Sep 17 00:00:00 2001 +From: Skylar Hill +Date: Tue, 31 Jan 2023 21:02:18 -0600 +Subject: [PATCH] Change default directory in file browser + +--- + src/Gui_gtk/ots_gui2.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/src/Gui_gtk/ots_gui2.c b/src/Gui_gtk/ots_gui2.c +index ff3366b..1247933 100644 +--- a/src/Gui_gtk/ots_gui2.c ++++ b/src/Gui_gtk/ots_gui2.c +@@ -82,6 +82,7 @@ char ots_release_package[]="20.00"; + #include + #include + #include ++#include + #include + // #include "backcompat.c" + #include "gtk_utils.c" /* Include the graphics library. */ +@@ -109,6 +110,7 @@ char toolpath[MaxFname]="", *start_cmd; + int pending_compute=0, supported_pdf_form=1; + int filingstatus_mfj=1; + int round_to_whole_nums=0; ++char *working_dir[MaxFname+512]; + + void pick_file( GtkWidget *wdg, void *data ); /* Prototype */ + void consume_leading_trailing_whitespace( char *line ); +@@ -2364,7 +2366,7 @@ void save_taxfile( GtkWidget *wdg, void *data ) + if (cpt != 0) + strcpy( cpt, "_xxxx.txt" ); + // printf("OTS_save_taxfile: dir='%s', wc='%s', fname='%s'\n", directory_dat, wildcards_fb, filename_fb ); +- Browse_Files( "File to Save As:", 2048, directory_dat, wildcards_fb, filename_fb, Save_Tax_File ); ++ Browse_Files( "File to Save As:", 2048, working_dir, wildcards_fb, filename_fb, Save_Tax_File ); + } + + +@@ -3878,7 +3880,7 @@ void pick_file( GtkWidget *wdg, void *data ) + strcpy( wildcards_fb, ".txt" ); + strcpy( filename_fb, "" ); + // printf("OTS_pick_file: dir='%s', wc='%s', fname='%s'\n", directory_dat, wildcards_fb, filename_fb ); +- Browse_Files( "Select File", 2048, directory_dat, wildcards_fb, filename_fb, receive_filename ); ++ Browse_Files( "Select File", 2048, working_dir, wildcards_fb, filename_fb, receive_filename ); + } + + +@@ -4019,6 +4021,7 @@ int main(int argc, char *argv[] ) + invocation_path[k] = '\0'; + // printf("Invocation path = '%s'\n", invocation_path); + set_ots_path(); ++ getcwd(working_dir, MaxFname+512); + + /* Decode any command-line arguments. */ + argn = 1; k=1; +-- +2.38.1 +