GNU bug report logs - #61207
[PATCH] gnu: Add opentaxsolver.

Previous Next

Package: guix-patches;

Reported by: Skylar Hill <stellarskylark <at> posteo.net>

Date: Wed, 1 Feb 2023 09:13:01 UTC

Severity: normal

Tags: patch

Done: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 61207 in the body.
You can then email your comments to 61207 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#61207; Package guix-patches. (Wed, 01 Feb 2023 09:13:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Skylar Hill <stellarskylark <at> posteo.net>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Wed, 01 Feb 2023 09:13:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Skylar Hill <stellarskylark <at> posteo.net>
To: guix-patches <at> gnu.org
Subject: [PATCH] gnu: Add opentaxsolver.
Date: Wed, 01 Feb 2023 04:44:24 +0000
[Message part 1 (text/plain, inline)]
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

[0001-gnu-Add-opentaxsolver.patch (text/plain, inline)]
From ec431fbcc49c8bb57ea6c11bb3fb4f5a93aa1a10 Mon Sep 17 00:00:00 2001
From: Skylar Hill <stellarskylark <at> posteo.net>
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 <stellarskylark <at> posteo.net>
+;;;
+;;; 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 <http://www.gnu.org/licenses/>.
+
+(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 <stellarskylark <at> posteo.net>
+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 <string.h>
+ #include <stdlib.h>
+ #include <ctype.h>
++#include <unistd.h>
+ #include <sys/stat.h>
+ // #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
+
-- 
2.38.1


Information forwarded to guix-patches <at> gnu.org:
bug#61207; Package guix-patches. (Thu, 02 Feb 2023 18:32:01 GMT) Full text and rfc822 format available.

Message #8 received at 61207 <at> debbugs.gnu.org (full text, mbox):

From: Josselin Poiret <dev <at> jpoiret.xyz>
To: Skylar Hill <stellarskylark <at> posteo.net>, 61207 <at> debbugs.gnu.org
Subject: Re: [bug#61207] [PATCH] gnu: Add opentaxsolver.
Date: Thu, 02 Feb 2023 19:31:09 +0100
Hi Skylar,

Skylar Hill <stellarskylark <at> posteo.net> writes:

> 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!

Thanks for your work!  Adding a new package is a great first
contribution.  Here are some suggestions:

> Skylar Hill
>
> From ec431fbcc49c8bb57ea6c11bb3fb4f5a93aa1a10 Mon Sep 17 00:00:00 2001
> From: Skylar Hill <stellarskylark <at> posteo.net>
> 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

We don't usually create new files for specific packages.  I'd suggest
putting this definition into finance.scm.

>  create mode 100644 gnu/packages/patches/opentaxsolver-file-browser-fix.patch
> [...]
> +
> +;; 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

What I would do here instead would be to let-bind tax-year and
ots-version in the body of the define-public clause, so that it's only
defined there.

> +  (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")

Here, you shouldn't directly talk about gcc, since the compiler name
might be different when cross-compiling.  We have a procedure for that,
cc-for-target, an example use would be (invoke "make" (string-append
"CC=" ,(cc-for-target))), but you would need to replace the quote
'(#:phases ...) to a quasiquote `(#:phases ...). You should have a look
at quote and quasiquote in the Guile info manual, node "Expression
Syntax".

By the way, we now use g-expressions instead of s-expressions for
phases, but that might be too big of a commitment for a first
contribution.  Someone else can adjust that part after these changes.
You can still have a look in the Guix manual for the G-Expressions node
if you're so inclined.

> +                      (chdir "..")
> +                      (invoke "make" "CC=gcc")))

Ditto.

> +                  (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")))

You shouldn't use specification->package in package definitions, as
that's pretty costly (it needs to scan the whole package list for
it). You should instead make the package variable available itself by
using (#:use-module (gnu packages gtk)), and use the variable gtk+-2.

> +    (native-inputs (list gcc pkg-config))

There's no need to add gcc to the list of native-inputs, it is included
by most build systems, glib-or-gtk included.

> +    (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 <stellarskylark <at> posteo.net>
> +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 <string.h>
> + #include <stdlib.h>
> + #include <ctype.h>
> ++#include <unistd.h>
> + #include <sys/stat.h>
> + // #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
> +
> -- 
> 2.38.1
>

Best,
-- 
Josselin Poiret




Information forwarded to guix-patches <at> gnu.org:
bug#61207; Package guix-patches. (Fri, 03 Feb 2023 14:41:02 GMT) Full text and rfc822 format available.

Message #11 received at 61207 <at> debbugs.gnu.org (full text, mbox):

From: Josselin Poiret <dev <at> jpoiret.xyz>
To: Skylar Hill <stellarskylark <at> posteo.net>, 61207 <at> debbugs.gnu.org
Subject: Re: [bug#61207] [PATCH] gnu: Add opentaxsolver.
Date: Fri, 03 Feb 2023 15:40:14 +0100
Hi Skylar,

Skylar Hill <stellarskylark <at> posteo.net> writes:

> Thanks, Josselin! Here's an updated patch including the requested
> changes. I also took a crack at switching over to G-expressions -- let
> me know if I need to fix anything on that front to match best practices
> or fully take advantage of the construct.
>
> Skylar Hill
>
> [...]

Thanks for the quick changes, this looks really good, although you
forgot to reply to the bug email address! I've added it again and will
resend the patch, I've only removed one extra whitespace and rebased on
top of master (there is a new copyright line where you added yours). I
am no committer though so someone else will have to look at this, and
there might be an issue with the license, although I'm no expert: I see
some files with a GPLv2 header, another with a LGPLv2 header, some with
none.

Also, it's good practice to include the fact that it's the second
version of a patch by adding --reroll-count=2 (shortened -v 2) to git
format/send-patch, and also adding the base commit you're using using
--base=auto.

Best,
-- 
Josselin Poiret




Information forwarded to guix-patches <at> gnu.org:
bug#61207; Package guix-patches. (Fri, 03 Feb 2023 14:42:01 GMT) Full text and rfc822 format available.

Message #14 received at 61207 <at> debbugs.gnu.org (full text, mbox):

From: Josselin Poiret <dev <at> jpoiret.xyz>
To: Josselin Poiret <dev <at> jpoiret.xyz>, Skylar Hill <stellarskylark <at> posteo.net>,
 61207 <at> debbugs.gnu.org
Subject: [PATCH v2] gnu: Add opentaxsolver.
Date: Fri,  3 Feb 2023 15:41:27 +0100
From: Skylar Hill <stellarskylark <at> posteo.net>

---
 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

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 <collin <at> rekahsoft.ca>
 ;;; Copyright © 2022 Justin Veilleux <terramorpha <at> cock.li>
 ;;; Copyright © 2023 Frank Pursel <frank.pursel <at> gmail.com>
+;;; Copyright © 2023 Skylar Hill <stellarskylark <at> posteo.net>
 ;;;
 ;;; 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 <stellarskylark <at> posteo.net>
+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 <string.h>
+ #include <stdlib.h>
+ #include <ctype.h>
++#include <unistd.h>
+ #include <sys/stat.h>
+ // #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
+

base-commit: c19cd9f9470a8d60f8c1f8e0ff26b9cdb0e083ad
-- 
2.39.1





Information forwarded to guix-patches <at> gnu.org:
bug#61207; Package guix-patches. (Sat, 11 Feb 2023 22:08:02 GMT) Full text and rfc822 format available.

Message #17 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
To: Josselin Poiret via Guix-patches via <guix-patches <at> gnu.org>
Cc: Josselin Poiret <dev <at> jpoiret.xyz>, 61207 <at> debbugs.gnu.org,
 Skylar Hill <stellarskylark <at> posteo.net>
Subject: Re: [bug#61207] [PATCH v2] gnu: Add opentaxsolver.
Date: Sat, 11 Feb 2023 23:07:22 +0100
Hello,

Josselin Poiret via Guix-patches via <guix-patches <at> gnu.org> writes:

> From: Skylar Hill <stellarskylark <at> posteo.net>

Thanks to both of you.
>
> +      (source (origin
> +                (method url-fetch)
> +                (uri (string-append "mirror://sourceforge/opentaxsolver/OTS_"
> +                                    tax-year
> +                                    "/v"
> +                                    ots-version
> +                                    "_linux/OpenTaxSolver"
> +                                    version
> +                                    "_linux64.tgz"))

Formatting needs some love here.

> +                (sha256
> +                 (base32
> +                  "06k0a72bmwdmr71dvrp8b4vl8vilnggsh92hrp7wjdgcjj9m074w"))
> +                (patches (search-patches
> +                          "opentaxsolver-file-browser-fix.patch"))))

This file needs to be registered in gnu/local.mk file.

> +      (build-system glib-or-gtk-build-system)
> +      (arguments
> +       (list #:phases #~(modify-phases %standard-phases

  (list
   #:phases
   #~(...))

> +                          (delete 'check)

There are no tests. You need to use #:tests? keyword instead.

> +      (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.

I suggest to remove "free, safe, and secure".  Description needs to be
filled, too.

> +Invoke with @code{ots_gui2} rather than the usual
> @code{Run_taxsolve_GUI}.")

Note that it is possible to create a symlink to reintroduce Run_taxsolve_GUI.

> +      (license license:gpl2+))))

I agree with Josselin. Licensing is unclear. Many files do not have
a license, or are "user contributed" (under what terms?).

Would it be possible to clarify this with upstream?

Regards,
-- 
Nicolas Goaziou




Information forwarded to guix-patches <at> gnu.org:
bug#61207; Package guix-patches. (Sat, 11 Feb 2023 22:08:02 GMT) Full text and rfc822 format available.

Information forwarded to guix-patches <at> gnu.org:
bug#61207; Package guix-patches. (Mon, 13 Feb 2023 04:32:02 GMT) Full text and rfc822 format available.

Message #23 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Skylar Hill <stellarskylark <at> posteo.net>
To: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
Cc: Josselin Poiret <dev <at> jpoiret.xyz>, 61207 <at> debbugs.gnu.org,
 Josselin Poiret via Guix-patches via <guix-patches <at> gnu.org>
Subject: Re: [bug#61207] [PATCH v2] gnu: Add opentaxsolver.
Date: Mon, 13 Feb 2023 03:01:22 +0000
[Message part 1 (text/plain, inline)]
Thanks, y'all! I've attached a patch that addresses everything Nicolas
brought up. 

> I agree with Josselin. Licensing is unclear. Many files do not have
> a license, or are "user contributed" (under what terms?).
>
> Would it be possible to clarify this with upstream?

I got a hold of Aston Roberts <aston_roberts <at> yahoo.com>, the maintainer
for OTS, and asked him about the licensing for files without
headers. (The tax templates, in particular, seem to lack headers because
the custom markup doesn't appear to have comment syntax.) He answered:

> Yes, all files of OTS are released under GNU GPL license.
> Will review the file headers.

So it looks like all the files, even the ones without a clear license
header, are GPL.

Skylar

[v3-0001-gnu-Add-opentaxsolver.patch (text/plain, inline)]
From f5f2b8b4539d48b474b131ece87b65dbfd9b2532 Mon Sep 17 00:00:00 2001
From: Skylar Hill <stellarskylark <at> posteo.net>
Date: Sun, 12 Feb 2023 20:47:23 -0600
Subject: [PATCH v3] gnu: Add opentaxsolver

---
 gnu/local.mk                                  |  1 +
 gnu/packages/finance.scm                      | 71 +++++++++++++++++++
 .../opentaxsolver-file-browser-fix.patch      | 58 +++++++++++++++
 3 files changed, 130 insertions(+)
 create mode 100644 gnu/packages/patches/opentaxsolver-file-browser-fix.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index cdb99813d0..148bd6e908 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1616,6 +1616,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/opensles-add-license-file.patch			\
   %D%/packages/patches/openssl-1.1-c-rehash-in.patch		\
   %D%/packages/patches/openssl-3.0-c-rehash-in.patch		\
+  %D%/packages/patches/opentaxsolver-file-browser-fix.patch     \
   %D%/packages/patches/open-zwave-hidapi.patch			\
   %D%/packages/patches/orpheus-cast-errors-and-includes.patch	\
   %D%/packages/patches/osip-CVE-2017-7853.patch			\
diff --git a/gnu/packages/finance.scm b/gnu/packages/finance.scm
index c9c8e9b823..252f5e422c 100644
--- a/gnu/packages/finance.scm
+++ b/gnu/packages/finance.scm
@@ -33,6 +33,7 @@
 ;;; Copyright © 2022 Collin J. Doering <collin <at> rekahsoft.ca>
 ;;; Copyright © 2022 Justin Veilleux <terramorpha <at> cock.li>
 ;;; Copyright © 2023 Frank Pursel <frank.pursel <at> gmail.com>
+;;; Copyright © 2023 Skylar Hill <stellarskylark <at> posteo.net>
 ;;;
 ;;; 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)))))
+            ;; 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"))
+                (symlink (string-append #$output "/bin/ots_gui2")
+                         (string-append #$output "/bin/Run_taxsolve_GUI"))
+                (copy-recursively "../tax_form_files"
+                                  (string-append #$output
+                                                 "/tax_form_files"))
+                (copy-recursively "formdata"
+                                  (string-append #$output
+                                                 "/src/formdata")))))
+        #:tests? #f))
+      (inputs (list gtk+-2))
+      (native-inputs (list pkg-config))
+      (synopsis "Yearly tax preparation tool")
+      (description
+       "OpenTaxSolver is a program for calculating tax form entries for federal and
+state personal income taxes. It automatically fills out and prints your forms
+for mailing.")
+      (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 <stellarskylark <at> posteo.net>
+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 <string.h>
+ #include <stdlib.h>
+ #include <ctype.h>
++#include <unistd.h>
+ #include <sys/stat.h>
+ // #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
+
-- 
2.39.1


Information forwarded to guix-patches <at> gnu.org:
bug#61207; Package guix-patches. (Mon, 13 Feb 2023 04:32:03 GMT) Full text and rfc822 format available.

Message #26 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Skylar Hill <stellarskylark <at> posteo.net>
To: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
Cc: Josselin Poiret <dev <at> jpoiret.xyz>, 61207 <at> debbugs.gnu.org,
 Josselin Poiret via Guix-patches via <guix-patches <at> gnu.org>
Subject: Re: [bug#61207] [PATCH v3] gnu: Add opentaxsolver.
Date: Mon, 13 Feb 2023 03:16:49 +0000
[Message part 1 (text/plain, inline)]
Oops, my last email came back undeliverable to the bug tracker
address. Not sure why.

As a summary, just in case this one manages to get through, the new
patch addresses the issues Nicolas brought up, and I confirmed with
Aston Roberts, the OTS maintainer, that everything is released under
GPL. Here's the patch again, again just in case it gets through.

[v3-0001-gnu-Add-opentaxsolver.patch (text/plain, inline)]
From f5f2b8b4539d48b474b131ece87b65dbfd9b2532 Mon Sep 17 00:00:00 2001
From: Skylar Hill <stellarskylark <at> posteo.net>
Date: Sun, 12 Feb 2023 20:47:23 -0600
Subject: [PATCH v3] gnu: Add opentaxsolver

---
 gnu/local.mk                                  |  1 +
 gnu/packages/finance.scm                      | 71 +++++++++++++++++++
 .../opentaxsolver-file-browser-fix.patch      | 58 +++++++++++++++
 3 files changed, 130 insertions(+)
 create mode 100644 gnu/packages/patches/opentaxsolver-file-browser-fix.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index cdb99813d0..148bd6e908 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1616,6 +1616,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/opensles-add-license-file.patch			\
   %D%/packages/patches/openssl-1.1-c-rehash-in.patch		\
   %D%/packages/patches/openssl-3.0-c-rehash-in.patch		\
+  %D%/packages/patches/opentaxsolver-file-browser-fix.patch     \
   %D%/packages/patches/open-zwave-hidapi.patch			\
   %D%/packages/patches/orpheus-cast-errors-and-includes.patch	\
   %D%/packages/patches/osip-CVE-2017-7853.patch			\
diff --git a/gnu/packages/finance.scm b/gnu/packages/finance.scm
index c9c8e9b823..252f5e422c 100644
--- a/gnu/packages/finance.scm
+++ b/gnu/packages/finance.scm
@@ -33,6 +33,7 @@
 ;;; Copyright © 2022 Collin J. Doering <collin <at> rekahsoft.ca>
 ;;; Copyright © 2022 Justin Veilleux <terramorpha <at> cock.li>
 ;;; Copyright © 2023 Frank Pursel <frank.pursel <at> gmail.com>
+;;; Copyright © 2023 Skylar Hill <stellarskylark <at> posteo.net>
 ;;;
 ;;; 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)))))
+            ;; 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"))
+                (symlink (string-append #$output "/bin/ots_gui2")
+                         (string-append #$output "/bin/Run_taxsolve_GUI"))
+                (copy-recursively "../tax_form_files"
+                                  (string-append #$output
+                                                 "/tax_form_files"))
+                (copy-recursively "formdata"
+                                  (string-append #$output
+                                                 "/src/formdata")))))
+        #:tests? #f))
+      (inputs (list gtk+-2))
+      (native-inputs (list pkg-config))
+      (synopsis "Yearly tax preparation tool")
+      (description
+       "OpenTaxSolver is a program for calculating tax form entries for federal and
+state personal income taxes. It automatically fills out and prints your forms
+for mailing.")
+      (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 <stellarskylark <at> posteo.net>
+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 <string.h>
+ #include <stdlib.h>
+ #include <ctype.h>
++#include <unistd.h>
+ #include <sys/stat.h>
+ // #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
+
-- 
2.39.1


Information forwarded to guix-patches <at> gnu.org:
bug#61207; Package guix-patches. (Mon, 13 Feb 2023 04:32:03 GMT) Full text and rfc822 format available.

Message #29 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Skylar Hill <stellarskylark <at> posteo.net>
To: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
Cc: Josselin Poiret <dev <at> jpoiret.xyz>, 61207 <at> debbugs.gnu.org,
 Josselin Poiret via Guix-patches via <guix-patches <at> gnu.org>
Subject: Re: [bug#61207] [PATCH v2] gnu: Add opentaxsolver.
Date: Mon, 13 Feb 2023 03:26:19 +0000
Ahh okay had to disable the TLS guarantee on my Posteo account since
apparently debbugs doesn't provide a TLS connection, which is why it was
undeliverable. (Sorry for spamming you two but it should work this time.)

Here's my original message:

Thanks, y'all! I've attached a patch that addresses everything Nicolas
brought up. 

 I agree with Josselin. Licensing is unclear. Many files do not have
 a license, or are "user contributed" (under what terms?).

 Would it be possible to clarify this with upstream?

I got a hold of Aston Roberts <aston_roberts <at> yahoo.com>, the maintainer
for OTS, and asked him about the licensing for files without
headers. (The tax templates, in particular, seem to lack headers because
the custom markup doesn't appear to have comment syntax.) He answered:

 Yes, all files of OTS are released under GNU GPL license.
 Will review the file headers.

So it looks like all the files, even the ones without a clear license
header, are GPL.

Skylar

From f5f2b8b4539d48b474b131ece87b65dbfd9b2532 Mon Sep 17 00:00:00 2001
From: Skylar Hill <stellarskylark <at> posteo.net>
Date: Sun, 12 Feb 2023 20:47:23 -0600
Subject: [PATCH v3] gnu: Add opentaxsolver

---
 gnu/local.mk                                  |  1 +
 gnu/packages/finance.scm                      | 71 +++++++++++++++++++
 .../opentaxsolver-file-browser-fix.patch      | 58 +++++++++++++++
 3 files changed, 130 insertions(+)
 create mode 100644 gnu/packages/patches/opentaxsolver-file-browser-fix.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index cdb99813d0..148bd6e908 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1616,6 +1616,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/opensles-add-license-file.patch			\
   %D%/packages/patches/openssl-1.1-c-rehash-in.patch		\
   %D%/packages/patches/openssl-3.0-c-rehash-in.patch		\
+  %D%/packages/patches/opentaxsolver-file-browser-fix.patch     \
   %D%/packages/patches/open-zwave-hidapi.patch			\
   %D%/packages/patches/orpheus-cast-errors-and-includes.patch	\
   %D%/packages/patches/osip-CVE-2017-7853.patch			\
diff --git a/gnu/packages/finance.scm b/gnu/packages/finance.scm
index c9c8e9b823..252f5e422c 100644
--- a/gnu/packages/finance.scm
+++ b/gnu/packages/finance.scm
@@ -33,6 +33,7 @@
 ;;; Copyright © 2022 Collin J. Doering <collin <at> rekahsoft.ca>
 ;;; Copyright © 2022 Justin Veilleux <terramorpha <at> cock.li>
 ;;; Copyright © 2023 Frank Pursel <frank.pursel <at> gmail.com>
+;;; Copyright © 2023 Skylar Hill <stellarskylark <at> posteo.net>
 ;;;
 ;;; 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)))))
+            ;; 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"))
+                (symlink (string-append #$output "/bin/ots_gui2")
+                         (string-append #$output "/bin/Run_taxsolve_GUI"))
+                (copy-recursively "../tax_form_files"
+                                  (string-append #$output
+                                                 "/tax_form_files"))
+                (copy-recursively "formdata"
+                                  (string-append #$output
+                                                 "/src/formdata")))))
+        #:tests? #f))
+      (inputs (list gtk+-2))
+      (native-inputs (list pkg-config))
+      (synopsis "Yearly tax preparation tool")
+      (description
+       "OpenTaxSolver is a program for calculating tax form entries for federal and
+state personal income taxes. It automatically fills out and prints your forms
+for mailing.")
 +      (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 <stellarskylark <at> posteo.net>
+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 <string.h>
+ #include <stdlib.h>
+ #include <ctype.h>
++#include <unistd.h>
+ #include <sys/stat.h>
+ // #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
+




Information forwarded to guix-patches <at> gnu.org:
bug#61207; Package guix-patches. (Mon, 13 Feb 2023 04:32:03 GMT) Full text and rfc822 format available.

Reply sent to Nicolas Goaziou <mail <at> nicolasgoaziou.fr>:
You have taken responsibility. (Sat, 18 Feb 2023 11:47:02 GMT) Full text and rfc822 format available.

Notification sent to Skylar Hill <stellarskylark <at> posteo.net>:
bug acknowledged by developer. (Sat, 18 Feb 2023 11:47:02 GMT) Full text and rfc822 format available.

Message #37 received at 61207-done <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
To: Skylar Hill <stellarskylark <at> posteo.net>
Cc: dev <at> jpoiret.xyz, 61207-done <at> debbugs.gnu.org
Subject: Re: [bug#61207] [PATCH v2] gnu: Add opentaxsolver.
Date: Sat, 18 Feb 2023 12:46:31 +0100
Hello,

Skylar Hill <stellarskylark <at> posteo.net> writes:

> Subject: [PATCH v3] gnu: Add opentaxsolver

I added a proper commit message and applied your patch, with slight
fixes to indentation.

> +      (description
> +       "OpenTaxSolver is a program for calculating tax form entries for federal and
> +state personal income taxes. It automatically fills out and prints your forms
> +for mailing.")

I added two spaces between sentences as requested by Texinfo syntax.

Regards,
-- 
Nicolas Goaziou




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 19 Mar 2023 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 95 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.