Merge ~unity7maintainers/ubuntu/+source/nux:ubuntu/devel into ubuntu/+source/nux:ubuntu/devel

Proposed by Tomasz Jeruzalski
Status: Needs review
Proposed branch: ~unity7maintainers/ubuntu/+source/nux:ubuntu/devel
Merge into: ubuntu/+source/nux:ubuntu/devel
Diff against target: 181 lines (+139/-2)
4 files modified
debian/changelog (+6/-0)
debian/control (+2/-2)
debian/patches/migrate-to-libpcre2.patch (+130/-0)
debian/patches/series (+1/-0)
Reviewer Review Type Date Requested Status
Skia (community) Needs Fixing
Ubuntu Sponsors Pending
Review via email: mp+499456@code.launchpad.net

This proposal supersedes a proposal from 2025-11-12.

Commit message

imported pcre2 migration from the gentoo team

Description of the change

Changes from this branch migrate nux package from libpcre3 to libpcre2. Source code patch originated from Gentoo team.

This merge proposal supersedes https://code.launchpad.net/~unity7maintainers/ubuntu/+source/nux/+git/nux/+merge/495677

To post a comment you must log in.
Revision history for this message
Rahammetoela Toekiman (fuseteam) wrote : Posted in a previous version of this proposal

it currently fails to build, but i am having trouble figuring out why: https://launchpadlibrarian.net/830926741/buildlog.txt.gz

Revision history for this message
Athos Ribeiro (athos) wrote : Posted in a previous version of this proposal

Thanks, Rahammetoela. Can you point us to the gentoo change from where this is being pulled from?

Also, this should be a patch under debian/patches. This should help you getting started: https://documentation.ubuntu.com/project/contributors/patching/work-with-debian-patches/

Revision history for this message
Rahammetoela Toekiman (fuseteam) wrote : Posted in a previous version of this proposal

> Thanks, Rahammetoela. Can you point us to the gentoo change from where this is
> being pulled from?

I actually got it as a patch file from them via telegram

> Also, this should be a patch under debian/patches. This should help you
> getting started:
> https://documentation.ubuntu.com/project/contributors/patching/work-with-
> debian-patches/

is there particular reason why it should be under debian/patches?

Revision history for this message
Skia (skia) wrote : Posted in a previous version of this proposal

debian/patches is the only place where the Debian build system will look for patches to apply before building, that's why your patch needs to go there. The link provided by @athos explains many things about how to work with patches.
I'm unsubscribing ~ubuntu-sponsors, feel free to resubscribed once you have performed the necessary changes and it's ready for review again.

review: Needs Fixing
Revision history for this message
Tomasz Jeruzalski (tomekdev) wrote : Posted in a previous version of this proposal

I think that the repository is messed up and pristine-tar branch has been altered or something other went wrong. I couldn't run git-build-recipe from any branch I tested.

When I forked the project into my account, manually committed changes to pristine-tar branch using pristine-tar commit NEWEST_TARBALL.orig.tar.gz and pushing to my account and then I was able to run the build.

I might be wrong because I'm new to this but this all I know so far.

Revision history for this message
Tomasz Jeruzalski (tomekdev) wrote : Posted in a previous version of this proposal

After performing changes I mentioned above and providing changes from this merge request as a patch debian/ directory I was able to successfully build all nux packages with patch from this merge request.

Here is my repository: https://code.launchpad.net/~tomekdev/ubuntu/+source/nux/+git/nux

The branch is applied/ubuntu/devel.

Revision history for this message
Rahammetoela Toekiman (fuseteam) wrote (last edit ): Posted in a previous version of this proposal

thanks for looking into that @tomekdev feel free to make a new merge proposal against https://code.launchpad.net/~git-ubuntu-import/ubuntu/+source/nux/+git/nux/+ref/ubuntu/devel to supersede this one you can tag ~ubuntu-sponsors as reviewer or work on the same branch from unity7maintainers now that you are a member

Revision history for this message
Skia (skia) wrote :

Left a couple of inline-comments. That generally looks wayyy better :-)

review: Needs Fixing
Revision history for this message
Tomasz Jeruzalski (tomekdev) wrote :

I have updated the patch and changelog following your comments. The only thing I'm not sure is the "Origin" tag, because original author sent the patch over telegram. I wasn't sure how to fill this tag so I put there a link to his github repository with his work over Unity.

Revision history for this message
Skia (skia) wrote :

Oh, I see. Then in that case you at least need to fill the Author field with the information of the original author.
Also, in terms of `git-ubuntu` workflow: your latest commit isn't quite right, because it contains two very different things (changelog and patch update). It would be best to squash each of those changes into their original commits, so that the history becomes relevant.

I've tried to fix all those locally and do the upload, but unfortunately the build is currently failing on resolute-proposed due to https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1122650, which would be fixed in Ubuntu by 2130151.
Please subscribe to the Ubuntu bug and ping here again once it's seeing progress, and then I'll upload.

Revision history for this message
Rahammetoela Toekiman (fuseteam) wrote :

I have now subscribed the unity7maintainers to bug 2130151 thanks for the heads up Skia

Revision history for this message
Tomasz Jeruzalski (tomekdev) wrote :

THank you @skia for your review. I have updated the branch as you suggested and I hope it is good now. I am sorry if I did not do everything correctly but I am new to contributing here.

Revision history for this message
Athos Ribeiro (athos) wrote :

This looks much better now. Thanks!

I added a couple nitpicks inline, but those are just nitpicks!

Revision history for this message
Tomasz Jeruzalski (tomekdev) wrote :

Thank you very much for your review. I left answers to your comments and I hope we will be able to figure out how to handle this situation.

Unmerged commits

faaf734... by Tomasz Jeruzalski

debian/control: Replace dependency libpcre3-dev with libpcre2-dev

3616219... by Tomasz Jeruzalski

debian/changelog: Update changelog.

e572e60... by Tomasz Jeruzalski

debian/patches: Add patch for migrating nux from libpcre3 to libpcre2

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index 0e1b9d7..7e53d46 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,9 @@
6+nux (4.0.8+18.10.20180623-0ubuntu12) resolute; urgency=medium
7+
8+ * debian/patches: Add patch for migrating from libpcre3 to libpcre2 (LP: #2103918)
9+
10+ -- Tomasz Jeruzalski <tomekdev17@gmail.com> Wed, 28 Jan 2026 19:03:12 +0000
11+
12 nux (4.0.8+18.10.20180623-0ubuntu11) questing; urgency=medium
13
14 * d/control: use the non deprecated libgdk-pixbuf-2.0-dev (lp: #2118581)
15diff --git a/debian/control b/debian/control
16index 3e9bf14..28ef202 100644
17--- a/debian/control
18+++ b/debian/control
19@@ -27,7 +27,7 @@ Build-Depends: debhelper (>= 9),
20 libsigc++-2.0-dev,
21 libpango1.0-dev,
22 libx11-dev,
23- libpcre3-dev,
24+ libpcre2-dev,
25 libpci-dev,
26 libxinerama-dev,
27 libgeis-dev (>= 2.2.10),
28@@ -85,7 +85,7 @@ Depends: libnux-4.0-0 (= ${binary:Version}),
29 libgles2-mesa-dev [armel armhf],
30 libgeis-dev (>= 2.2.10),
31 libsigc++-2.0-dev,
32- libpcre3-dev,
33+ libpcre2-dev,
34 libx11-dev,
35 libxext-dev,
36 libxinerama-dev,
37diff --git a/debian/patches/migrate-to-libpcre2.patch b/debian/patches/migrate-to-libpcre2.patch
38new file mode 100644
39index 0000000..2e15d28
40--- /dev/null
41+++ b/debian/patches/migrate-to-libpcre2.patch
42@@ -0,0 +1,130 @@
43+Description: Migrate nux to libpcre2
44+ Migrate to libpcre2 because libpcre3 is unmaintained.
45+Author: Tomasz Jeruzalski<tomekdev17@gmail.com> and c4pp4 from Gentoo team
46+Forwarded: no
47+Last-Update: 2026-01-28
48+Origin: https://github.com/c4pp4/gentoo-unity7
49+---
50+--- a/Nux/Validator.cpp
51++++ b/Nux/Validator.cpp
52+@@ -27,12 +27,19 @@
53+ {
54+
55+ Validator::Validator()
56++#if !defined(NUX_OS_WINDOWS)
57++ : _regexp(nullptr)
58++#endif
59+ {
60+ }
61+
62+ Validator::~Validator()
63+ {
64+
65++#if !defined(NUX_OS_WINDOWS)
66++ if (_regexp)
67++ pcre2_code_free(_regexp);
68++#endif
69+ }
70+
71+ bool Validator::InitRegExp()
72+@@ -41,18 +48,23 @@
73+ regex_ = _regexp_str.c_str();
74+ return true;
75+ #else
76+- const char *error;
77+- int erroffset;
78+- _regexp = pcre_compile(
79+- _regexp_str.c_str(), /* the pattern */
80+- PCRE_MULTILINE,
81+- &error, /* for error message */
82+- &erroffset, /* for error offset */
83+- 0); /* use default character tables */
84++ int errorcode;
85++ PCRE2_SIZE erroroffset;
86++ _regexp = pcre2_compile(
87++ reinterpret_cast<PCRE2_SPTR>(_regexp_str.c_str()), /* pattern */
88++ PCRE2_ZERO_TERMINATED, /* pattern length */
89++ PCRE2_MULTILINE, /* option bits */
90++ &errorcode, /* error code */
91++ &erroroffset, /* error offset */
92++ nullptr); /* compile context */
93+
94+ if (!_regexp)
95+ {
96+- nuxDebugMsg("[IntegerValidator::IntegerValidator] Invalid regular expression: %s", _regexp_str.c_str());
97++ PCRE2_UCHAR buffer[256];
98++ pcre2_get_error_message(errorcode, buffer, sizeof(buffer));
99++ nuxDebugMsg("[Validator::InitRegExp] Invalid regular expression '%s' "
100++ "at offset %d: %s",
101++ _regexp_str.c_str(), (int)erroroffset, buffer);
102+ return false;
103+ }
104+ return true;
105+@@ -72,20 +84,24 @@
106+ }
107+ return Validator::Acceptable;
108+ #else
109+- if (_regexp == 0)
110++ if (!_regexp || !str)
111+ return Validator::Invalid;
112+
113+- int out_vector [10];
114+- unsigned int offset = 0;
115+- int len = (int) strlen(str);
116+-
117+- // See the "PCRE DISCUSSION OF STACK USAGE" and why it maybe necessary to limit the stack usage.
118+- pcre_extra extra;
119+- extra.flags = PCRE_EXTRA_MATCH_LIMIT_RECURSION;
120+- extra.match_limit_recursion = 2000;
121++ pcre2_match_data *match_data =
122++ pcre2_match_data_create_from_pattern(_regexp, nullptr);
123++
124++ int rc = pcre2_match(
125++ _regexp, /* compiled pattern */
126++ reinterpret_cast<PCRE2_SPTR>(str), /* subject string */
127++ strlen(str), /* length of subject */
128++ 0, /* start offset */
129++ 0, /* match options */
130++ match_data, /* match data block */
131++ nullptr); /* match context */
132++
133++ pcre2_match_data_free(match_data);
134+
135+- int rc = pcre_exec(_regexp, &extra, str, len, offset, 0, out_vector, 10);
136+- if (rc <= -1)
137++ if (rc < 0)
138+ {
139+ return Validator::Invalid;
140+ }
141+--- a/Nux/Validator.h
142++++ b/Nux/Validator.h
143+@@ -26,7 +26,8 @@
144+ #if defined(NUX_OS_WINDOWS)
145+ #include <regex>
146+ #else
147+- #include <pcre.h>
148++ #define PCRE2_CODE_UNIT_WIDTH 8
149++ #include <pcre2.h>
150+ #endif
151+
152+ namespace nux
153+@@ -57,7 +58,7 @@
154+ #if defined(NUX_OS_WINDOWS)
155+ std::regex regex_;
156+ #else
157+- pcre *_regexp;
158++ pcre2_code *_regexp;
159+ #endif
160+ };
161+ }
162+--- a/configure.ac
163++++ b/configure.ac
164+@@ -196,7 +196,7 @@
165+ sigc++-2.0
166+ pango
167+ pangocairo
168+- libpcre
169++ libpcre2-8
170+ )
171+ AC_SUBST(NUX_CFLAGS)
172+ AC_SUBST(NUX_LIBS)
173diff --git a/debian/patches/series b/debian/patches/series
174index 8f1d184..4b67934 100644
175--- a/debian/patches/series
176+++ b/debian/patches/series
177@@ -1,3 +1,4 @@
178+migrate-to-libpcre2.patch
179 no-Werror.patch
180 add-shared_ptr-include.patch
181 drop-std.patch

Subscribers

People subscribed via source and target branches