From patchwork Wed Feb 1 04:44:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Skylar Hill X-Patchwork-Id: 46563 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 583E927BBED; Wed, 1 Feb 2023 14:01:14 +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=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, URIBL_BLOCKED autolearn=ham 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 5804D27BBE9 for ; Wed, 1 Feb 2023 14:01:11 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pNDfR-0001rd-UI; Wed, 01 Feb 2023 09:00:54 -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 1pN9Aw-0006pe-IM for guix-patches@gnu.org; Wed, 01 Feb 2023 04:13:06 -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 1pN9At-00013l-8f for guix-patches@gnu.org; Wed, 01 Feb 2023 04:13:06 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pN9As-0005YB-2i for guix-patches@gnu.org; Wed, 01 Feb 2023 04:13:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#61207] [PATCH] gnu: Add opentaxsolver. Resent-From: Skylar Hill Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 01 Feb 2023 09:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 61207 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 61207@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.167524278121329 (code B ref -1); Wed, 01 Feb 2023 09:13:01 +0000 Received: (at submit) by debbugs.gnu.org; 1 Feb 2023 09:13:01 +0000 Received: from localhost ([127.0.0.1]:56441 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pN9An-0005Xr-T6 for submit@debbugs.gnu.org; Wed, 01 Feb 2023 04:13:01 -0500 Received: from lists.gnu.org ([209.51.188.17]:58154) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pN4zQ-0003Dg-Qk for submit@debbugs.gnu.org; Tue, 31 Jan 2023 23:44:58 -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 1pN4zQ-00019A-8z for guix-patches@gnu.org; Tue, 31 Jan 2023 23:44:56 -0500 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pN4zN-00063b-Fc for guix-patches@gnu.org; Tue, 31 Jan 2023 23:44:55 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 88D8124049F for ; Wed, 1 Feb 2023 05:44:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1675226686; bh=03Zp8IqrlryC0aaQjd+t9IP8p2jtdCFtYMJI6RCHw6A=; h=From:To:Subject:Date:From; b=WAykqXvABVLfLJBZ3/cBM5aiHoiCJJBoe9lJXCiCMzJ4xGEguXSOqpyz5NIEdI/wo ECO+1hmHG8Im2vt2aYw30Qr+g4WJ0HGT4WLQzVOCVS5YCM9/Qatn0oIKq7k1Cv+7fs ZCoQ+OKlHuFvi2kqgkqa9a9pLlHScVgXB05Ydj8tVeNERgTnkGFBIUabvfsJbGTedQ EKIn6rmySDLJhza2Q+k1cWbr/uPN9z1Ry9oifeuhVTAdm5inZKI1PeMk2CMASFKoP2 Jaa2XhsnXI2UO3JmAymXK9SoyUgXzSXY2C03mlhaNxHx1wGlpXqj3ZrAtczR3azA1r NdEOA4j1FlyeA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4P68Tn2TqGz9rxB for ; Wed, 1 Feb 2023 05:44:45 +0100 (CET) From: Skylar Hill Date: Wed, 01 Feb 2023 04:44:24 +0000 Message-ID: <87v8kmyoyf.fsf@posteo.net> MIME-Version: 1.0 Received-SPF: pass client-ip=185.67.36.65; envelope-from=stellarskylark@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Wed, 01 Feb 2023 04:12:57 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Mailman-Approved-At: Wed, 01 Feb 2023 09:00:35 -0500 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 Hello, everyone, With tax season coming up in the US, I wanted to use OpenTaxSolver to prepare my tax return. However, it wasn't packaged on Guix! OTS assumes it'll be run directly from an unpacked tarball, so a patch is also included to fix some of the issues that causes (namely that an unmodified build will try to save files to the store instead of the user's home directory). This is my first time trying to package something for Guix, so if there are any glaring issues or mistakes here, please let me know! Skylar Hill From ec431fbcc49c8bb57ea6c11bb3fb4f5a93aa1a10 Mon Sep 17 00:00:00 2001 From: Skylar Hill Date: Tue, 31 Jan 2023 22:30:25 -0600 Subject: [PATCH] gnu: Add opentaxsolver. * gnu/packages/opentaxsolver.scm (opentaxsolver): New variable. --- gnu/packages/opentaxsolver.scm | 94 +++++++++++++++++++ .../opentaxsolver-file-browser-fix.patch | 58 ++++++++++++ 2 files changed, 152 insertions(+) create mode 100644 gnu/packages/opentaxsolver.scm create mode 100644 gnu/packages/patches/opentaxsolver-file-browser-fix.patch diff --git a/gnu/packages/opentaxsolver.scm b/gnu/packages/opentaxsolver.scm new file mode 100644 index 0000000000..85ba40a2ea --- /dev/null +++ b/gnu/packages/opentaxsolver.scm @@ -0,0 +1,94 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2023 Skylar Hill +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix 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. +;;; +;;; GNU Guix 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 GNU Guix. If not, see . + +(define-module (gnu packages opentaxsolver) + #:use-module (gnu packages) + #:use-module (guix packages) + #:use-module (guix download) + #:use-module (guix build-system glib-or-gtk) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (gnu packages gcc) + #:use-module (gnu packages gtk) + #:use-module (gnu packages pkg-config)) + +;; The version number seems to consist of two separate parts, a typical +;; version number (ots-version) and a tax year. At time of writing, the +;; version is 2022_20.00. Both parts are used separately in the tarball uri, +;; it is convenient to define both as separate variables. + +(define tax-year "2022") +(define ots-version "20.00") + +(define-public opentaxsolver + (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 + '(#:phases (modify-phases %standard-phases + (delete 'configure) + (replace 'build + (lambda _ + ;; The provided Build_taxsolve_packages.sh would do this, but + ;; then we can't configure CC=gcc in the make calls, which + ;; errors. Also, the provided `make clean` doesn't delete the + ;; GUI. + (delete-file "Run_taxsolve_GUI") + (delete-file-recursively "bin") + (mkdir "bin") + (chdir "src/Gui_gtk") + (invoke "make" "CC=gcc") + (chdir "..") + (invoke "make" "CC=gcc"))) + (delete 'check) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (bin (string-append out "/bin"))) + ;; OTS was designed to be run straight out of the unpacked + ;; tarball. Thus, the installation procedure is extremely + ;; cursed. Also note we don't use the provided + ;; Run_taxsolve_GUI because it's pointless in this context. + (copy-recursively "../bin" bin) + (copy-recursively "../tax_form_files" + (string-append out "/tax_form_files")) + (copy-recursively "formdata" + (string-append out "/src/formdata")))))))) + (inputs (list (specification->package "gtk+@2"))) + (native-inputs (list gcc 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 +