Bug 238567 - audio/gsequencer missing license and log in about box
Summary: audio/gsequencer missing license and log in about box
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Yuri Victorovich
URL:
Keywords:
: 238566 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-06-14 18:23 UTC by Joël Krähemann
Modified: 2019-06-15 17:27 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (yuri)


Attachments
GSequencer about dialog (152.92 KB, image/png)
2019-06-14 18:23 UTC, Joël Krähemann
no flags Details
Preprocessor patch for license and logo in Makefile.am (452 bytes, patch)
2019-06-15 01:46 UTC, Joël Krähemann
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joël Krähemann 2019-06-14 18:23:13 UTC
Created attachment 205063 [details]
GSequencer about dialog

Hi yuri,

Please provide logo and license to Advanced Gtk+ Sequencer at build time, by substitute CPPFLAGS environment variable before `./configure`. Add the C macros to configure script by setting it in CPPFLAGS.

For an example look at AM_CPPFLAGS in Makefile.am.

Optionally you can provide environment variables to the binary.

`AGS_LICENSE_FILENAME=/usr/local/share/licenses/gsequencer-2.1.76/GPLv3 AGS_LOGO_FILENAME=/usr/local/share/gsequencer/images/ags.png gsequencer`

by,
Joël
Comment 1 Yuri Victorovich freebsd_committer freebsd_triage 2019-06-14 18:30:51 UTC
(In reply to Joël Krähemann from comment #0)

Hi Joël,

Thanks for reporting this.

I will update the port with the changes you requested.

Yuri
Comment 2 Yuri Victorovich freebsd_committer freebsd_triage 2019-06-14 23:54:15 UTC
(In reply to Joël Krähemann from comment #0)

> For an example look at AM_CPPFLAGS in Makefile.am.

I don't see anything related to logo or license in AM_CPPFLAGS lines in Makefile.am.

Could you please provide an example what build-time environment variables should be provided to configure assuming the paths for logo and license are known?

-------

I also noticed that there are memory leaks in ags/gsequencer_main.c. For example, in
>    str = malloc(PATH_MAX * sizeof(gchar));
>    sprintf(str,
>            "AGS_LICENSE_FILENAME=%s/GPL-3",
>            data_dir);
>    putenv(str);

str needs to be freed every time it is malloc-ed.


Also, technically this code should be:
>    str = malloc((strlen("AGS_LICENSE_FILENAME=") + PATH_MAX + strlen("/GPL-3") + 1) * sizeof(gchar));
>    sprintf(str,
>            "AGS_LICENSE_FILENAME=%s/GPL-3",
>            data_dir);
>    putenv(str);

The original code would crash if strlen(data_dir)==PATH_MAX.


Yuri
Comment 3 Joël Krähemann 2019-06-15 01:15:31 UTC
Hi Ineiev,

Sorry the C macro has got the very same name as the environment variable. So in your Makefile.am do:

AM_CPPFLAGS += -DAGS_LICENSE_FILENAME=\"/usr/local/share/licenses/gsequencer-2.1.76/GPLv3\" -DAGS_LOGO_FILENAME=\"/usr/local/share/gsequencer/images/ags.png\"

See in ags_menu_action_about_callback() here:

https://github.com/gsequencer/gsequencer/blob/2.1.x/ags/X/ags_menu_action_callbacks.c#L1267


The memory-leak is not within executable code. Sorry, I don't use it anymore.
Comment 4 Joël Krähemann 2019-06-15 01:22:08 UTC
Sorry I mean Yuri :/
Comment 5 Joël Krähemann 2019-06-15 01:23:59 UTC
Hi Yuri,

Here more about preprocessor options:

https://gcc.gnu.org/onlinedocs/gcc/Preprocessor-Options.html
Comment 6 Joël Krähemann 2019-06-15 01:46:32 UTC
Created attachment 205067 [details]
Preprocessor patch for license and logo in Makefile.am
Comment 7 Joël Krähemann 2019-06-15 01:47:07 UTC
Hi Yuri,

Just provided a patch :)

cheers,
Joël
Comment 8 Yuri Victorovich freebsd_committer freebsd_triage 2019-06-15 02:41:41 UTC
(In reply to Joël Krähemann from comment #7)

Ideally, the location of /usr/local/share/gsequencer/images/ags.png is known to the executable. It is in ${DATADIR}, other files are alongside it: ${DATADIR}/icons/jumper.png, etc.

Only the license file should be supplied as a define.
Comment 9 Yuri Victorovich freebsd_committer freebsd_triage 2019-06-15 02:56:34 UTC
*** Bug 238566 has been marked as a duplicate of this bug. ***
Comment 10 Yuri Victorovich freebsd_committer freebsd_triage 2019-06-15 03:01:33 UTC
Committed a similar patch.

Thank you for reporting the problem.
Comment 11 commit-hook freebsd_committer freebsd_triage 2019-06-15 03:01:57 UTC
A commit references this bug:

Author: yuri
Date: Sat Jun 15 03:01:10 UTC 2019
New revision: 504223
URL: https://svnweb.freebsd.org/changeset/ports/504223

Log:
  audio/gsequencer: Add defines for the app to find license and logo screen png; Strip the binary

  PR:		238567
  Reported by:	Jo?l Kr?hemann <jkraehemann@gmail.com> (upstream)

Changes:
  head/audio/gsequencer/Makefile
Comment 12 Joël Krähemann 2019-06-15 09:59:22 UTC
Hi Yuri,

The license location is wrong. It should be:

-DAGS_LICENSE_FILENAME=\"/usr/local/share/licenses/gsequencer-2.1.76_1/GPLv3\"
Comment 13 commit-hook freebsd_committer freebsd_triage 2019-06-15 17:27:45 UTC
A commit references this bug:

Author: yuri
Date: Sat Jun 15 17:27:37 UTC 2019
New revision: 504249
URL: https://svnweb.freebsd.org/changeset/ports/504249

Log:
  audio/gsequencer: Fix the license file name supplied to the build

  PR:		238567
  Reported by:	Jo?l Kr?hemann <jkraehemann@gmail.com>

Changes:
  head/audio/gsequencer/Makefile