ring-lang

LOW
maintainer SAVIG 1 votes scanned 2026-09-04 21:58:42.058385
View on AUR
Why flagged

Uploaded within the last 14 days with 2 or fewer community votes — little peer review so far.

Triggered rules

Low Few votes, recently uploaded zero_votes_recent

Uploaded within the last 14 days with 2 or fewer community votes — little peer review so far.

PKGBUILD

1# Maintainer: Savi G. <info@monsoonresearch.cc>
2pkgname=ring-lang
3pkgver=1.27
4pkgrel=44
5pkgdesc="Simple, lightweight, embeddable multi-paradigm dynamic language (full build: VM, console tools, RingQt on Qt6, Allegro, SDL2, network & database extensions)"
6arch=('x86_64' 'x86_64_v3' 'x86_64_v4') # v3/v4 entries match CachyOS optimized repos
7url="https://ring-lang.github.io/"
8license=('MIT')
9# Qt module list mirrors extensions/ringqt/ring_qt515.pro (+ svgwidgets):
10# sql core gui network multimedia multimediawidgets testlib printsupport
11# widgets serialport bluetooth opengl openglwidgets positioning webenginewidgets
12# texttospeech 3dcore 3dextras 3drender 3dlogic charts svg svgwidgets
13# + quick quickwidgets qml. core5compat supplies QRegExp/QStringRef/QTextCodec.
14# qt6-webengine is large (~hundreds of MB) but the .pro requires webenginewidgets.
15depends=(
16 'glibc' 'gcc-libs' 'curl' 'openssl'
17 'allegro' 'sdl2' 'freeglut'
18 'unixodbc' 'mariadb-libs' 'postgresql-libs'
19 'qt6-base' 'qt6-declarative' 'qt6-multimedia' 'qt6-svg' 'qt6-charts'
20 'qt6-connectivity' 'qt6-positioning' 'qt6-serialport' 'qt6-speech'
21 'qt6-webengine' 'qt6-3d' 'qt6-5compat'
22)
23provides=('ring')
24conflicts=('ring') # AUR 'ring' is an unrelated Rust ping utility
25source=("$pkgname-$pkgver.tar.gz::https://github.com/ring-lang/ring/archive/refs/tags/v$pkgver.tar.gz")
26sha256sums=('4991ee0ec8c4279f58fe779ac1cc9cb078c7f485db84ad0c2911fd720ad0a12f')
27# ring2exe embeds payloads in its bin/ executables; stripping corrupts them.
28# (lib/*.so are manually strip-debugged in package() — that's safe.)
29options=(!strip)
30
31# Known cosmetic limitations (documented for AUR users):
32# - GButtonGroup buttonClicked/Pressed/Released(int) connects print "No such
33# signal" at runtime: Qt6 removed the int overloads; the generated class
34# library connects by Qt5 string signatures. Those specific handlers are
35# inert; everything else functions.
36# - RingNotepad SaveAs dialog defaults its startup folder from the (read-only)
37# install tree; saving to $HOME works. Settings live in ~/.ringnotepad/.
38
39prepare() {
40 cd "ring-$pkgver"
41 local p f m fn n
42
43 # --- QtTextToSpeech module guard ------------------------------------------
44 if [[ ! -d /usr/include/qt6/QtTextToSpeech ]]; then
45 error "QtTextToSpeech development headers not found — the full RingQt"
46 error "build requires the Qt6 TextToSpeech module (package: qt6-speech)."
47 return 1
48 fi
49
50 # --- Upstream build scripts ---------------------------------------------
51 # They finish by sudo-symlinking into /usr — neutralize for makepkg
52 sed -i 's|sudo ./install.sh|true|' language/build/buildgcc.sh
53 sed -i 's|\./install\.sh|true|g' build/buildgcc.sh
54 # buildgcc.sh calls `clear` and `sleep 2`; noisy without a TTY
55 sed -i '/^clear$/d; /^sleep 2$/d' build/buildgcc.sh
56 # Stop buildgcc.sh from discarding per-stage output (> /dev/null 2>&1);
57 # the generic "Error: Failed to build X" otherwise hides the real cause.
58 sed -i -e 's|\./"$_gencode_script" > /dev/null 2>&1|./"$_gencode_script"|g' \
59 -e 's|\./"$_build_script" > /dev/null 2>&1|./"$_build_script"|g' \
60 build/buildgcc.sh
61
62 # --- RingQt vs Qt6 --------------------------------------------------------
63 # (a) Link against the in-tree VM. CRITICAL FORM: linking by direct path
64 # (`../../lib/libring.so`) with a SONAME-less libring records the LITERAL
65 # path into DT_NEEDED — the loader resolves it relative to CWD at
66 # runtime and dlopen fails with R38. The -L/-l: form records the bare
67 # NAME; the $ORIGIN rpath makes the .so find libring.so in its own
68 # directory — valid in BOTH the build tree (lib/) and the installed
69 # tree (/usr/lib/ring/lib).
70 for p in extensions/ringqt/ring_qt515{,_core,_light}.pro; do
71 sed -i 's|LIBS += */usr/lib/libring\.so|LIBS += -L../../lib -l:libring.so|' "$p"
72 if ! grep -q 'rpath.*ORIGIN' "$p"; then
73 if [[ -n $(tail -c 1 "$p") ]]; then printf '\n' >> "$p"; fi
74 printf 'QMAKE_LFLAGS += -Wl,-rpath,$$ORIGIN -Wl,-rpath,$$ORIGIN/../../lib\n' >> "$p"
75 fi
76 grep -q '\-l:libring\.so' "$p" || {
77 error "libring LIBS patch did not apply to $p"; return 1; }
78 grep -q 'rpath.*ORIGIN' "$p" || {
79 error "rpath patch did not apply to $p"; return 1; }
80 done
81
82 # (i) QOpenGLWidget moved QtWidgets -> QtOpenGLWidgets in Qt6; and
83 # QGraphicsSvgItem/QSvgWidget moved QtSvg -> QtSvgWidgets.
84 for p in extensions/ringqt/ring_qt515_light.pro extensions/ringqt/ring_qt515.pro; do
85 if ! grep -q 'openglwidgets' "$p"; then
86 if [[ -n $(tail -c 1 "$p") ]]; then printf '\n' >> "$p"; fi
87 printf 'QT += openglwidgets\n' >> "$p"
88 fi
89 grep -q 'openglwidgets' "$p" || {
90 error "openglwidgets module not added to $p"; return 1; }
91 done
92 if ! grep -q 'svgwidgets' extensions/ringqt/ring_qt515.pro; then
93 if [[ -n $(tail -c 1 extensions/ringqt/ring_qt515.pro) ]]; then printf '\n' >> extensions/ringqt/ring_qt515.pro; fi
94 printf 'QT += svgwidgets\n' >> extensions/ringqt/ring_qt515.pro
95 fi
96 grep -q 'svgwidgets' extensions/ringqt/ring_qt515.pro || {
97 error "svgwidgets module not added to ring_qt515.pro"; return 1; }
98
99 # (c) The generated sources relied on Qt5's <QtCore> umbrella header; Qt6
100 # only FORWARD-DECLARES QRegExp/QStringRef/QTextCodec. Register the
101 # Qt5Compat module AND add its include path / link flag explicitly —
102 # belt and braces: if the file lacks a trailing newline, a plain
103 # append CONCATENATES with the last line and qmake never parses the
104 # module request (the pkgrel=6 silent failure).
105 for p in extensions/ringqt/ring_qt515{,_core,_light}.pro; do
106 if ! grep -q '^QT += core5compat' "$p"; then
107 if [[ -n $(tail -c 1 "$p") ]]; then printf '\n' >> "$p"; fi
108 printf 'QT += core5compat\n' >> "$p"
109 printf 'INCLUDEPATH += $$[QT_INSTALL_HEADERS]/Qt5Compat\n' >> "$p"
110 printf 'LIBS += -lQt6Core5Compat\n' >> "$p"
111 printf 'DEFINES += QT_CORE5COMPAT_LIB\n' >> "$p"
112 fi
113 grep -q '^QT += core5compat' "$p" || {
114 error "core5compat patch did not apply to $p"; return 1; }
115 done
116
117 # --- Inert stub headers for Qt5 classes REMOVED in Qt6 -------------------
118 # (cpp/include is on every compile line via -Icpp/include; the real Qt
119 # headers are gone, so these are the only match. gencode never writes
120 # these filenames, so they survive regeneration.)
121
122 # (k) Bluetooth OBEX transfer classes:
123 cat > extensions/ringqt/cpp/include/QBluetoothTransferRequest <<'STUB'
124#ifndef RINGQT6_QBT_TRANSFERREQUEST_STUB
125#define RINGQT6_QBT_TRANSFERREQUEST_STUB
126/* Qt5 API, removed in Qt6 — inert stub (see PKGBUILD prepare()) */
127#include <QtBluetooth/QBluetoothAddress>
128#include <QVariant>
129
130class QBluetoothTransferRequest
131{
132public:
133 enum Header { ContentType, Name, Description, Length, Time, Target };
134 enum Attribute { TypeAttribute, NameAttribute, DescriptionAttribute,
135 LengthAttribute, TimeAttribute, TargetAttribute };
136
137 QBluetoothTransferRequest() {}
138 explicit QBluetoothTransferRequest(const QBluetoothAddress &address) : m_address(address) {}
139 QBluetoothTransferRequest(const QBluetoothTransferRequest &other) : m_address(other.m_address) {}
140 ~QBluetoothTransferRequest() {}
141
142 QBluetoothAddress address() const { return m_address; }
143 QVariant header(Header) const { return QVariant(); }
144 void setHeader(Header, const QVariant &) {}
145
146 QVariant attribute(Attribute) const { return QVariant(); }
147 QVariant attribute(Attribute attribute, QVariant &defaultValue) const { (void) attribute; return defaultValue; }
148 void setAttribute(Attribute, const QVariant &value) { (void) value; }
149
150 bool operator==(const QBluetoothTransferRequest &other) const { return m_address == other.m_address; }
151 bool operator!=(const QBluetoothTransferRequest &other) const { return !(*this == other); }
152
153private:
154 QBluetoothAddress m_address;
155};
156#endif
157STUB
158 cat > extensions/ringqt/cpp/include/QBluetoothTransferReply <<'STUB'
159#ifndef RINGQT6_QBT_TRANSFERREPLY_STUB
160#define RINGQT6_QBT_TRANSFERREPLY_STUB
161/* Qt5 API, removed in Qt6 — inert stub (see PKGBUILD prepare()) */
162#include <QObject>
163#include <QString>
164#include "QBluetoothTransferRequest"
165
166class QBluetoothTransferManager;
167
168class QBluetoothTransferReply : public QObject
169{
170public:
171 enum TransferError {
172 NoError = 0, UnknownError, HostError, RemoteHostClosedError,
173 ServiceError, UserCanceledError, UnsupportedType
174 };
175
176 explicit QBluetoothTransferReply(QObject *parent = nullptr) : QObject(parent) {}
177 ~QBluetoothTransferReply() {}
178
179 TransferError error() const { return NoError; }
180 QString errorString() const { return QString(); }
181 bool isFinished() const { return true; }
182 QBluetoothTransferManager *manager() const { return nullptr; }
183 QBluetoothTransferRequest request() const { return QBluetoothTransferRequest(); }
184
185 void abort() {}
186 void finished(QBluetoothTransferReply *reply) { (void) reply; }
187 void error(TransferError) {}
188};
189#endif
190STUB
191 cat > extensions/ringqt/cpp/include/QBluetoothTransferManager <<'STUB'
192#ifndef RINGQT6_QBT_TRANSFERMANAGER_STUB
193#define RINGQT6_QBT_TRANSFERMANAGER_STUB
194/* Qt5 API, removed in Qt6 — inert stub (see PKGBUILD prepare()) */
195#include <QObject>
196#include <QIODevice>
197#include <QString>
198#include "QBluetoothTransferRequest"
199
200class QBluetoothTransferReply;
201
202class QBluetoothTransferManager : public QObject
203{
204public:
205 explicit QBluetoothTransferManager(QObject *parent = nullptr) : QObject(parent) {}
206 ~QBluetoothTransferManager() {}
207
208 QBluetoothTransferReply *transfer(const QBluetoothTransferRequest &, QIODevice *) { return nullptr; }
209 QBluetoothTransferReply *transfer(const QBluetoothTransferRequest &, const QString &) { return nullptr; }
210 QBluetoothTransferReply *put(const QBluetoothTransferRequest &request, QIODevice *device) { (void) request; (void) device; return nullptr; }
211};
212#endif
213STUB
214
215 # (m) QtNetwork bearer API:
216 cat > extensions/ringqt/cpp/include/QNetworkConfiguration <<'STUB'
217#ifndef RINGQT6_QNETCONFIG_STUB
218#define RINGQT6_QNETCONFIG_STUB
219/* Qt5 bearer API, removed in Qt6 — inert stub (see PKGBUILD prepare()) */
220#include <QtCore/QFlags>
221#include <QtCore/QString>
222#include <QtCore/QList>
223
224class QNetworkConfiguration
225{
226public:
227 enum Type { Internet, Intranet, ServiceNetwork, UserChoice, Invalid };
228 enum StateFlag {
229 Undefined = 0x0000001,
230 Defined = 0x0000002,
231 Discovered = 0x0000004,
232 Active = 0x0000008
233 };
234 Q_DECLARE_FLAGS(StateFlags, StateFlag)
235 enum Purpose {
236 UnknownPurpose, PublicPurpose, PrivatePurpose, ServiceSpecificPurpose
237 };
238 enum BearerType {
239 BearerUnknown, BearerEthernet, BearerWLAN, Bearer2G, BearerCDMA2000,
240 BearerWCDMA, BearerHSPA, BearerBluetooth, BearerWiMAX, BearerLTE
241 };
242
243 QNetworkConfiguration() {}
244 QNetworkConfiguration(const QNetworkConfiguration &other) { (void) other; }
245 ~QNetworkConfiguration() {}
246
247 bool isValid() const { return false; }
248 QString name() const { return QString(); }
249 QString identifier() const { return QString(); }
250 Type type() const { return Invalid; }
251 Purpose purpose() const { return UnknownPurpose; }
252 StateFlags state() const { return Undefined; }
253 BearerType bearerType() const { return BearerUnknown; }
254 QString bearerTypeName() const { return QString(); }
255 bool isRoamingAvailable() const { return false; }
256 QList<QNetworkConfiguration> children() const { return QList<QNetworkConfiguration>(); }
257
258 bool operator==(const QNetworkConfiguration &) const { return true; }
259 bool operator!=(const QNetworkConfiguration &) const { return false; }
260};
261Q_DECLARE_OPERATORS_FOR_FLAGS(QNetworkConfiguration::StateFlags)
262#endif
263STUB
264 cat > extensions/ringqt/cpp/include/QNetworkConfigurationManager <<'STUB'
265#ifndef RINGQT6_QNETCONFIGMGR_STUB
266#define RINGQT6_QNETCONFIGMGR_STUB
267/* Qt5 bearer API, removed in Qt6 — inert stub (see PKGBUILD prepare()) */
268#include <QtCore/QObject>
269#include <QtCore/QString>
270#include <QtCore/QList>
271#include "QNetworkConfiguration"
272
273class QNetworkConfigurationManager : public QObject
274{
275public:
276 enum Capability {
277 CanStartAndStopInterfaces = 0x00000001,
278 DirectConnectionRouting = 0x00000002,
279 SystemSessionSupport = 0x00000004,
280 ApplicationLevelLicensing = 0x00000008,
281 NoCapability = 0
282 };
283 Q_DECLARE_FLAGS(Capabilities, Capability)
284
285 explicit QNetworkConfigurationManager(QObject *parent = nullptr) : QObject(parent) {}
286 ~QNetworkConfigurationManager() {}
287
288 QNetworkConfiguration defaultConfiguration() const { return QNetworkConfiguration(); }
289 QList<QNetworkConfiguration> allConfigurations(QNetworkConfiguration::StateFlags flags = QNetworkConfiguration::Discovered) const
290 { return flags ? QList<QNetworkConfiguration>() : QList<QNetworkConfiguration>(); }
291 QNetworkConfiguration configuration(const QString &identifier) const { (void) identifier; return QNetworkConfiguration(); }
292 QNetworkConfiguration configurationFromIdentifier(const QString &identifier) const { (void) identifier; return QNetworkConfiguration(); }
293 bool isOnline() const { return false; }
294 Capabilities capabilities() const { return Capabilities(NoCapability); }
295
296 void updateConfigurations() {}
297 void configurationAdded(const QNetworkConfiguration &) {}
298 void configurationChanged(const QNetworkConfiguration &) {}
299 void configurationRemoved(const QNetworkConfiguration &) {}
300 void onlineStateChanged(bool) {}
301 void updateCompleted() {}
302};
303#endif
304STUB
305 cat > extensions/ringqt/cpp/include/QNetworkSession <<'STUB'
306#ifndef RINGQT6_QNETSESSION_STUB
307#define RINGQT6_QNETSESSION_STUB
308/* Qt5 bearer API, removed in Qt6 — inert stub (see PKGBUILD prepare()) */
309#include <QtCore/QObject>
310#include <QtCore/QString>
311#include <QtCore/QVariant>
312#include "QNetworkConfiguration"
313
314class QNetworkSession : public QObject
315{
316public:
317 enum SessionError {
318 UnknownSessionError = 0, SessionAbortedError = 1, RoamingError = 2,
319 OperationNotSupportedError = 3, InvalidConfigurationError = 4
320 };
321 enum State {
322 Invalid = 0, NotAvailable = 1, Connecting = 2, Connected = 3,
323 Closing = 4, Disconnected = 5, Roaming = 6
324 };
325 enum UsagePolicy { NoPolicy = 0, NoBackgroundDataPolicy = 1 };
326
327 explicit QNetworkSession(const QNetworkConfiguration &config, QObject *parent = nullptr) : QObject(parent) { (void) config; }
328 ~QNetworkSession() {}
329
330 bool isOpen() const { return false; }
331 void open() {}
332 void close() {}
333 void stop() {}
334 QNetworkConfiguration configuration() const { return QNetworkConfiguration(); }
335 State state() const { return NotAvailable; }
336 SessionError error() const { return UnknownSessionError; }
337 QString errorString() const { return QString(); }
338 quint64 bytesWritten() const { return 0; }
339 quint64 bytesReceived() const { return 0; }
340 bool waitForOpened(int msecs = 3000) { (void) msecs; return false; }
341 QVariant sessionProperty(const QString &key) const { (void) key; return QVariant(); }
342 void setSessionProperty(const QString &key, const QVariant &value) { (void) key; (void) value; }
343 UsagePolicy usagePolicy() const { return NoPolicy; }
344 void setUsagePolicy(UsagePolicy policy) { (void) policy; }
345 void migrate() {}
346 void ignore() {}
347 void accept() {}
348 void reject() {}
349
350 void stateChanged(State) {}
351 void error(SessionError) {}
352 void opened() {}
353 void closed() {}
354 void preferredConfigurationChanged(const QNetworkConfiguration &, bool) {}
355 void newConfigurationActivated() {}
356};
357#endif
358STUB
359
360 # (n)/(o)/(p)/(r) Multimedia removals:
361 cat > extensions/ringqt/cpp/include/QAudioRecorder <<'STUB'
362#ifndef RINGQT6_QAUDIORECORDER_STUB
363#define RINGQT6_QAUDIORECORDER_STUB
364/* Qt5 API, removed in Qt6 — inert stub (see PKGBUILD prepare()) */
365#include <QtCore/QObject>
366#include <QtCore/QString>
367#include <QtCore/QStringList>
368#include <QtCore/QUrl>
369
370class QAudioRecorder : public QObject
371{
372public:
373 enum State { StoppedState = 0, RecordingState = 1, PausedState = 2 };
374 enum Status {
375 UnavailableStatus = 0, UnloadedStatus, LoadedStatus, BufferingStatus,
376 StartingStatus, RecordingStatus, PausedStatus, FinalizingStatus,
377 StoppedStatus
378 };
379 enum Error { NoError = 0, ResourceError, ContainerError, OutOfSpaceError };
380
381 explicit QAudioRecorder(QObject *parent = nullptr) : QObject(parent) {}
382 ~QAudioRecorder() {}
383
384 QString audioInput() const { return QString(); }
385 void setAudioInput(const QString &name) { (void) name; }
386 QStringList audioInputs() const { return QStringList(); }
387 QString defaultAudioInput() const { return QString(); }
388 QString audioInputDescription(const QString &name) const { (void) name; return QString(); }
389
390 void record() {}
391 void pause() {}
392 void stop() {}
393 void setOutputLocation(const QUrl &location) { (void) location; }
394 QUrl outputLocation() const { return QUrl(); }
395 QUrl actualLocation() const { return QUrl(); }
396 qint64 duration() const { return 0; }
397 State state() const { return StoppedState; }
398 Status status() const { return UnavailableStatus; }
399 Error error() const { return NoError; }
400 QString errorString() const { return QString(); }
401
402 void durationChanged(qint64 duration) { (void) duration; }
403 void stateChanged(State newState) { (void) newState; }
404 void statusChanged(Status status) { (void) status; }
405 void actualLocationChanged(const QUrl &location) { (void) location; }
406 void error(Error error) { (void) error; }
407};
408#endif
409STUB
410 cat > extensions/ringqt/cpp/include/QMediaObject <<'STUB'
411#ifndef RINGQT6_QMEDIAOBJECT_STUB
412#define RINGQT6_QMEDIAOBJECT_STUB
413/* Qt5 API, removed in Qt6 — inert stub (see PKGBUILD prepare()) */
414#include <QtCore/QObject>
415#include <QtCore/QString>
416#include <QtCore/QStringList>
417#include <QtCore/QVariant>
418
419class QMediaObject : public QObject
420{
421public:
422 explicit QMediaObject(QObject *parent = nullptr) : QObject(parent) {}
423 ~QMediaObject() {}
424
425 bool isAvailable() const { return false; }
426 int notifyInterval() const { return 0; }
427 void setNotifyInterval(int milliSeconds) { (void) milliSeconds; }
428
429 QVariant metaData(const QString &key) const { (void) key; return QVariant(); }
430 bool isMetaDataAvailable() const { return false; }
431 QStringList availableMetaData() const { return QStringList(); }
432};
433#endif
434STUB
435 cat > extensions/ringqt/cpp/include/QAudioProbe <<'STUB'
436#ifndef RINGQT6_QAUDIOPROBE_STUB
437#define RINGQT6_QAUDIOPROBE_STUB
438/* Qt5 API, removed in Qt6 — inert stub (see PKGBUILD prepare()) */
439#include <QtCore/QObject>
440
441class QMediaObject;
442class QMediaRecorder;
443class QAudioBuffer;
444
445class QAudioProbe : public QObject
446{
447public:
448 explicit QAudioProbe(QObject *parent = nullptr) : QObject(parent) {}
449 ~QAudioProbe() {}
450
451 bool setSource(QMediaObject *source) { (void) source; return false; }
452 bool setSource(QMediaRecorder *source) { (void) source; return false; }
453 bool isActive() const { return false; }
454
455 void audioBufferProbed(const QAudioBuffer &buffer) { (void) buffer; }
456 void flushed() {}
457};
458#endif
459STUB
460 cat > extensions/ringqt/cpp/include/QVideoProbe <<'STUB'
461#ifndef RINGQT6_QVIDEOPROBE_STUB
462#define RINGQT6_QVIDEOPROBE_STUB
463/* Qt5 API, removed in Qt6 — inert stub (see PKGBUILD prepare()) */
464#include <QtCore/QObject>
465
466class QMediaObject;
467class QMediaRecorder;
468class QVideoFrame;
469
470class QVideoProbe : public QObject
471{
472public:
473 explicit QVideoProbe(QObject *parent = nullptr) : QObject(parent) {}
474 ~QVideoProbe() {}
475
476 bool setSource(QMediaObject *source) { (void) source; return false; }
477 bool setSource(QMediaRecorder *source) { (void) source; return false; }
478 bool isActive() const { return false; }
479
480 void videoFrameProbed(const QVideoFrame &frame) { (void) frame; }
481 void flushed() {}
482};
483#endif
484STUB
485 cat > extensions/ringqt/cpp/include/QMediaResource <<'STUB'
486#ifndef RINGQT6_QMEDIARESOURCE_STUB
487#define RINGQT6_QMEDIARESOURCE_STUB
488/* Qt5 API, removed in Qt6 — inert stub (see PKGBUILD prepare()) */
489#include <QtCore/QUrl>
490#include <QtCore/QString>
491
492class QMediaResource
493{
494public:
495 QMediaResource() {}
496 explicit QMediaResource(const QUrl &url, const QString &mimeType = QString()) { (void) url; (void) mimeType; }
497 QMediaResource(const QMediaResource &other) { (void) other; }
498 ~QMediaResource() {}
499
500 QUrl url() const { return QUrl(); }
501 QString mimeType() const { return QString(); }
502 QString audioCodec() const { return QString(); }
503 QString videoCodec() const { return QString(); }
504 qint64 dataSize() const { return -1; }
505 int sampleRate() const { return -1; }
506 int channelCount() const { return -1; }
507
508 bool operator==(const QMediaResource &) const { return true; }
509 bool operator!=(const QMediaResource &) const { return false; }
510};
511#endif
512STUB
513 cat > extensions/ringqt/cpp/include/QMediaContent <<'STUB'
514#ifndef RINGQT6_QMEDIACONTENT_STUB
515#define RINGQT6_QMEDIACONTENT_STUB
516/* Qt5 API, removed in Qt6 — inert stub (see PKGBUILD prepare()) */
517#include <QtCore/QUrl>
518#include <QtCore/QList>
519#include "QMediaResource"
520
521class QMediaPlaylist;
522
523class QMediaContent
524{
525public:
526 QMediaContent() {}
527 explicit QMediaContent(const QUrl &url) { (void) url; }
528 explicit QMediaContent(const QMediaResource &resource) { (void) resource; }
529 QMediaContent(const QList<QMediaResource> &resources) { (void) resources; }
530 QMediaContent(const QMediaContent &other) { (void) other; }
531 ~QMediaContent() {}
532
533 QUrl url() const { return QUrl(); }
534 QUrl canonicalUrl() const { return QUrl(); }
535 QMediaResource canonicalResource() const { return QMediaResource(); }
536 QList<QMediaResource> resources() const { return QList<QMediaResource>(); }
537 QMediaPlaylist *playlist() const { return nullptr; }
538 bool isNull() const { return true; }
539
540 bool operator==(const QMediaContent &) const { return true; }
541 bool operator!=(const QMediaContent &) const { return false; }
542};
543#endif
544STUB
545 cat > extensions/ringqt/cpp/include/QMediaPlaylist <<'STUB'
546#ifndef RINGQT6_QMEDIAPLAYLIST_STUB
547#define RINGQT6_QMEDIAPLAYLIST_STUB
548/* Qt5 API, removed in Qt6 — inert stub (see PKGBUILD prepare()) */
549#include <QtCore/QObject>
550#include <QtCore/QUrl>
551#include <QtCore/QList>
552#include <QtCore/QIODevice>
553#include "QMediaContent"
554
555class QMediaPlaylist : public QObject
556{
557public:
558 enum PlaybackMode { CurrentItemOnce = 0, CurrentItemInLoop, Sequential, Loop, Random };
559 enum Error { NoError = 0, FormatError, FormatNotSupportedError, NetworkError, AccessDeniedError };
560
561 explicit QMediaPlaylist(QObject *parent = nullptr) : QObject(parent) {}
562 ~QMediaPlaylist() {}
563
564 PlaybackMode playbackMode() const { return Sequential; }
565 void setPlaybackMode(PlaybackMode mode) { (void) mode; }
566 int currentIndex() const { return -1; }
567 int nextIndex(int steps = 1) const { (void) steps; return -1; }
568 int previousIndex(int steps = 1) const { (void) steps; return -1; }
569 int mediaCount() const { return 0; }
570 QMediaContent media(int index) const { (void) index; return QMediaContent(); }
571 QMediaContent currentMedia() const { return QMediaContent(); }
572 bool addMedia(const QMediaContent &content) { (void) content; return false; }
573 bool addMedia(const QUrl &content) { (void) content; return false; }
574 bool addMedia(const QList<QMediaContent> &items) { (void) items; return false; }
575 bool insertMedia(int index, const QMediaContent &content) { (void) index; (void) content; return false; }
576 bool removeMedia(int pos) { (void) pos; return false; }
577 bool removeMedia(int start, int end) { (void) start; (void) end; return false; }
578 bool clear() { return false; }
579 bool load(const QUrl &location, const char *format = nullptr) { (void) location; (void) format; return false; }
580 bool load(QIODevice *device, const char *format = nullptr) { (void) device; (void) format; return false; }
581 bool read(const QUrl &location) { (void) location; return false; }
582 bool save(const QUrl &location) { (void) location; return false; }
583 bool save(const QUrl &location, const char *format) { (void) location; (void) format; return false; }
584 bool save(QIODevice *device, const char *format) { (void) device; (void) format; return false; }
585 void next() {}
586 void previous() {}
587 void shuffle() {}
588 void setCurrentIndex(int index) { (void) index; }
589 bool isEmpty() const { return true; }
590 bool isReadOnly() const { return true; }
591 Error error() const { return NoError; }
592 QString errorString() const { return QString(); }
593
594 void currentIndexChanged(int) {}
595 void playbackModeChanged(PlaybackMode) {}
596 void currentMediaChanged(const QMediaContent &) {}
597 void mediaInserted(int, int) {}
598 void mediaRemoved(int, int) {}
599 void mediaChanged(int, int) {}
600 void loaded() {}
601 void loadFailed() {}
602};
603#endif
604STUB
605 cat > extensions/ringqt/cpp/include/QAudioDeviceInfo <<'STUB'
606#ifndef RINGQT6_QAUDIODEVICEINFO_STUB
607#define RINGQT6_QAUDIODEVICEINFO_STUB
608/* Qt5 API, removed in Qt6 — inert stub (see PKGBUILD prepare()) */
609#include <QtCore/QString>
610#include <QtCore/QStringList>
611#include <QtCore/QList>
612#include <QtMultimedia/QAudioFormat>
613
614class QAudioDeviceInfo
615{
616public:
617 QAudioDeviceInfo() {}
618 QAudioDeviceInfo(const QAudioDeviceInfo &other) { (void) other; }
619 ~QAudioDeviceInfo() {}
620
621 bool isNull() const { return true; }
622 QString deviceName() const { return QString(); }
623 QString realm() const { return QString(); }
624 bool isFormatSupported(const QAudioFormat &format) const { (void) format; return false; }
625 QAudioFormat preferredFormat() const { return QAudioFormat(); }
626 QAudioFormat nearestFormat(const QAudioFormat &format) const { (void) format; return QAudioFormat(); }
627 QList<int> supportedSampleRates() const { return QList<int>(); }
628 QList<int> supportedChannelCounts() const { return QList<int>(); }
629 QList<int> supportedSampleSizes() const { return QList<int>(); }
630 QStringList supportedCodecs() const { return QStringList(); }
631 QList<int> supportedByteOrders() const { return QList<int>(); }
632 QList<int> supportedSampleTypes() const { return QList<int>(); }
633
634 static QAudioDeviceInfo defaultInputDevice() { return QAudioDeviceInfo(); }
635 static QAudioDeviceInfo defaultOutputDevice() { return QAudioDeviceInfo(); }
636 static QList<QAudioDeviceInfo> availableDevices(int mode) { (void) mode; return QList<QAudioDeviceInfo>(); }
637
638 bool operator==(const QAudioDeviceInfo &) const { return true; }
639 bool operator!=(const QAudioDeviceInfo &) const { return false; }
640};
641#endif
642STUB
643 cat > extensions/ringqt/cpp/include/QCameraViewfinder <<'STUB'
644#ifndef RINGQT6_QCAMERAVIEWFINDER_STUB
645#define RINGQT6_QCAMERAVIEWFINDER_STUB
646/* Qt5 API, removed in Qt6 — inert stub (see PKGBUILD prepare()) */
647#include <QtWidgets/QWidget>
648#include <QtCore/QSize>
649
650class QCamera;
651
652class QCameraViewfinder : public QWidget
653{
654public:
655 explicit QCameraViewfinder(QWidget *parent = nullptr) : QWidget(parent) {}
656 ~QCameraViewfinder() {}
657
658 void setCamera(QCamera *camera) { (void) camera; }
659 QCamera *camera() const { return nullptr; }
660 QSize sizeHint() const { return QSize(320, 240); }
661};
662#endif
663STUB
664 cat > extensions/ringqt/cpp/include/QVideoWidgetControl <<'STUB'
665#ifndef RINGQT6_QVIDEOWIDGETCONTROL_STUB
666#define RINGQT6_QVIDEOWIDGETCONTROL_STUB
667/* Qt5 API, removed in Qt6 — inert stub (see PKGBUILD prepare()) */
668#include <QtCore/QObject>
669#include <QtCore/QSize>
670
671class QVideoWidgetControl : public QObject
672{
673public:
674 explicit QVideoWidgetControl(QObject *parent = nullptr) : QObject(parent) {}
675 ~QVideoWidgetControl() {}
676
677 Qt::AspectRatioMode aspectRatioMode() const { return Qt::IgnoreAspectRatio; }
678 void setAspectRatioMode(Qt::AspectRatioMode mode) { (void) mode; }
679 int brightness() const { return 0; }
680 void setBrightness(int brightness) { (void) brightness; }
681 int contrast() const { return 0; }
682 void setContrast(int contrast) { (void) contrast; }
683 int hue() const { return 0; }
684 void setHue(int hue) { (void) hue; }
685 int saturation() const { return 0; }
686 void setSaturation(int saturation) { (void) saturation; }
687
688 void brightnessChanged(int brightness) { (void) brightness; }
689 void contrastChanged(int contrast) { (void) contrast; }
690 void hueChanged(int hue) { (void) hue; }
691 void saturationChanged(int saturation) { (void) saturation; }
692};
693#endif
694STUB
695 cat > extensions/ringqt/cpp/include/QCameraImageCapture <<'STUB'
696#ifndef RINGQT6_QCAMERAIMAGECAPTURE_STUB
697#define RINGQT6_QCAMERAIMAGECAPTURE_STUB
698/* Qt5 API, renamed QImageCapture in Qt6 — inert stub keeping the Qt5
699 name and surface (see PKGBUILD prepare()) */
700#include <QtCore/QObject>
701#include <QtCore/QString>
702#include <QtCore/QStringList>
703#include <QtCore/QList>
704#include <QtCore/QSize>
705#include <QtCore/QFlags>
706#include <QtGui/QImage>
707#include "QImageEncoderSettings"
708
709class QCameraImageCapture : public QObject
710{
711public:
712 enum Error { NoError = 0, CameraError, UnsupportedFormatError, OutOfSpaceError };
713 enum CaptureStatus { UninitializedStatus = 0, LoadedStatus, StartingStatus, ActiveStatus, CapturingStatus, IdleStatus };
714 enum CaptureDestination { CaptureToBuffer = 0x1, CaptureToFile = 0x2 };
715 Q_DECLARE_FLAGS(CaptureDestinations, CaptureDestination)
716 enum AvailabilityStatus { AvailabilityUnknown = 0, Busy, Available, ResourceMissing };
717
718 explicit QCameraImageCapture(QObject *parent = nullptr) : QObject(parent) {}
719 ~QCameraImageCapture() {}
720
721 bool isAvailable() const { return false; }
722 bool isReadyForCapture() const { return false; }
723 int capture(const QString &location = QString()) { (void) location; return -1; }
724 void cancelCapture() {}
725 Error error() const { return NoError; }
726 QString errorString() const { return QString(); }
727 CaptureStatus status() const { return UninitializedStatus; }
728
729 CaptureDestinations captureDestination() const { return CaptureDestinations(); }
730 void setCaptureDestination(CaptureDestinations destination) { (void) destination; }
731 bool isCaptureDestinationSupported(CaptureDestinations destination) const { (void) destination; return false; }
732
733 AvailabilityStatus availability() const { return AvailabilityUnknown; }
734 int bufferFormat() const { return 0; }
735 void setBufferFormat(int format) { (void) format; }
736 QImageEncoderSettings encodingSettings() const { return QImageEncoderSettings(); }
737 void setEncodingSettings(const QImageEncoderSettings &settings) { (void) settings; }
738 QStringList supportedImageCodecs() const { return QStringList(); }
739 QString imageCodecDescription(const QString &codecName) const { (void) codecName; return QString(); }
740 QList<QSize> supportedResolutions() const { return QList<QSize>(); }
741 QList<QSize> supportedResolutions(const QImageEncoderSettings &settings, bool *continuous = nullptr) const
742 { (void) settings; (void) continuous; return QList<QSize>(); }
743 QList<int> supportedBufferFormats() const { return QList<int>(); }
744
745 void imageCaptured(int id, const QImage &preview) { (void) id; (void) preview; }
746 void imageExposed(int id) { (void) id; }
747 void imageSaved(int id, const QString &fileName) { (void) id; (void) fileName; }
748 void readyForCaptureChanged(bool ready) { (void) ready; }
749};
750#endif
751STUB
752 cat > extensions/ringqt/cpp/include/QWebEngineCallback <<'STUB'
753#ifndef RINGQT6_QWEBENGINECALLBACK_STUB
754#define RINGQT6_QWEBENGINECALLBACK_STUB
755/* Qt6 on this system ships no CamelCase forwarding header for this name
756 (class, if present, is only under the lowercase qwebenginecallback.h).
757 Use the real class when reachable, else an inert template so the
758 generated type usage resolves. See PKGBUILD prepare(). */
759#if __has_include(<QtWebEngineCore/qwebenginecallback.h>)
760#include <QtWebEngineCore/qwebenginecallback.h>
761#else
762template <typename T>
763class QWebEngineCallback
764{
765public:
766 QWebEngineCallback() {}
767 template <typename Func> QWebEngineCallback(Func &&) {}
768 QWebEngineCallback(const QWebEngineCallback &) {}
769 ~QWebEngineCallback() {}
770 void operator()(const T &) const {}
771};
772#endif
773#endif
774STUB
775
776 # (s) Qt3DCore/QNodeCommand: absent from Qt 6.11's Qt3DCore.
777 mkdir -p extensions/ringqt/cpp/include/Qt3DCore
778 cat > extensions/ringqt/cpp/include/Qt3DCore/QNodeCommand <<'STUB'
779#ifndef RINGQT6_QT3DCORE_QNODECOMMAND_STUB
780#define RINGQT6_QT3DCORE_QNODECOMMAND_STUB
781/* Qt5 API, absent from Qt6 Qt3DCore — inert stub (see PKGBUILD prepare()) */
782#include <QtCore/QSharedPointer>
783
784namespace Qt3DCore {
785class QNodeCommand
786{
787public:
788 explicit QNodeCommand(int subjectId) { (void) subjectId; }
789 ~QNodeCommand() {}
790 int subjectId() const { return 0; }
791};
792typedef QSharedPointer<QNodeCommand> QNodeCommandPtr;
793}
794#endif
795STUB
796
797 cat > extensions/ringqt/cpp/include/QAudioEncoderSettings <<'STUB'
798#ifndef RINGQT6_QAUDIOENCODERSETTINGS_STUB
799#define RINGQT6_QAUDIOENCODERSETTINGS_STUB
800/* Qt5 API, removed in Qt6 — inert stub (see PKGBUILD prepare()) */
801#include <QtCore/QString>
802
803class QAudioEncoderSettings
804{
805public:
806 enum Quality { VeryLowQuality, LowQuality, NormalQuality, HighQuality, VeryHighQuality };
807 enum EncodingMode { ConstantQualityEncoding, ConstantBitRateEncoding };
808
809 QAudioEncoderSettings() {}
810 QAudioEncoderSettings(const QAudioEncoderSettings &other) { (void) other; }
811 ~QAudioEncoderSettings() {}
812
813 QString codec() const { return QString(); }
814 void setCodec(const QString &codec) { (void) codec; }
815 int bitRate() const { return -1; }
816 void setBitRate(int bitrate) { (void) bitrate; }
817 int channelCount() const { return -1; }
818 void setChannelCount(int channels) { (void) channels; }
819 int sampleRate() const { return -1; }
820 void setSampleRate(int rate) { (void) rate; }
821 Quality quality() const { return NormalQuality; }
822 void setQuality(Quality quality) { (void) quality; }
823 EncodingMode encodingMode() const { return ConstantQualityEncoding; }
824 void setEncodingMode(EncodingMode mode) { (void) mode; }
825
826 bool isNull() const { return true; }
827 bool operator==(const QAudioEncoderSettings &) const { return true; }
828 bool operator!=(const QAudioEncoderSettings &) const { return false; }
829};
830#endif
831STUB
832 cat > extensions/ringqt/cpp/include/QVideoEncoderSettings <<'STUB'
833#ifndef RINGQT6_QVIDEOENCODERSETTINGS_STUB
834#define RINGQT6_QVIDEOENCODERSETTINGS_STUB
835/* Qt5 API, removed in Qt6 — inert stub (see PKGBUILD prepare()) */
836#include <QtCore/QString>
837#include <QtCore/QSize>
838
839class QVideoEncoderSettings
840{
841public:
842 enum Quality { VeryLowQuality, LowQuality, NormalQuality, HighQuality, VeryHighQuality };
843 enum EncodingMode { ConstantQualityEncoding, ConstantBitRateEncoding };
844
845 QVideoEncoderSettings() {}
846 QVideoEncoderSettings(const QVideoEncoderSettings &other) { (void) other; }
847 ~QVideoEncoderSettings() {}
848
849 QString codec() const { return QString(); }
850 void setCodec(const QString &codec) { (void) codec; }
851 int bitRate() const { return -1; }
852 void setBitRate(int bitrate) { (void) bitrate; }
853 qreal frameRate() const { return 0.0; }
854 void setFrameRate(qreal rate) { (void) rate; }
855 QSize resolution() const { return QSize(); }
856 void setResolution(const QSize &resolution) { (void) resolution; }
857 Quality quality() const { return NormalQuality; }
858 void setQuality(Quality quality) { (void) quality; }
859 EncodingMode encodingMode() const { return ConstantQualityEncoding; }
860 void setEncodingMode(EncodingMode mode) { (void) mode; }
861
862 bool isNull() const { return true; }
863 bool operator==(const QVideoEncoderSettings &) const { return true; }
864 bool operator!=(const QVideoEncoderSettings &) const { return false; }
865};
866#endif
867STUB
868 cat > extensions/ringqt/cpp/include/QImageEncoderSettings <<'STUB'
869#ifndef RINGQT6_QIMAGEENCODERSETTINGS_STUB
870#define RINGQT6_QIMAGEENCODERSETTINGS_STUB
871/* Qt5 API, removed in Qt6 — inert stub (see PKGBUILD prepare()) */
872#include <QtCore/QString>
873#include <QtCore/QSize>
874
875class QImageEncoderSettings
876{
877public:
878 enum Quality { VeryLowQuality, LowQuality, NormalQuality, HighQuality, VeryHighQuality };
879 enum EncodingMode { ConstantQualityEncoding, ConstantBitRateEncoding };
880
881 QImageEncoderSettings() {}
882 QImageEncoderSettings(const QImageEncoderSettings &other) { (void) other; }
883 ~QImageEncoderSettings() {}
884
885 QString codec() const { return QString(); }
886 void setCodec(const QString &codec) { (void) codec; }
887 QSize resolution() const { return QSize(); }
888 void setResolution(const QSize &resolution) { (void) resolution; }
889 Quality quality() const { return NormalQuality; }
890 void setQuality(Quality quality) { (void) quality; }
891 EncodingMode encodingMode() const { return ConstantQualityEncoding; }
892 void setEncodingMode(EncodingMode mode) { (void) mode; }
893
894 bool isNull() const { return true; }
895 bool operator==(const QImageEncoderSettings &) const { return true; }
896 bool operator!=(const QImageEncoderSettings &) const { return false; }
897};
898#endif
899STUB
900
901 for f in QBluetoothTransferManager QBluetoothTransferRequest QBluetoothTransferReply \
902 QNetworkConfigurationManager QNetworkConfiguration QNetworkSession \
903 QAudioRecorder QMediaObject QAudioProbe QVideoProbe \
904 QMediaContent QMediaResource QMediaPlaylist \
905 QAudioDeviceInfo QCameraViewfinder QVideoWidgetControl QCameraImageCapture \
906 QAudioEncoderSettings QVideoEncoderSettings QImageEncoderSettings \
907 QWebEngineCallback; do
908 [[ -f "extensions/ringqt/cpp/include/$f" ]] || {
909 error "stub header $f was not created"; return 1; }
910 done
911 [[ -f "extensions/ringqt/cpp/include/Qt3DCore/QNodeCommand" ]] || {
912 error "stub header Qt3DCore/QNodeCommand was not created"; return 1; }
913
914 # --- Wrapper-level patch script ------------------------------------------
915 cat > extensions/ringqt/qt6_wrapper_patches.sh <<'WRAPPATCH'
916#!/bin/sh
917# Wrapper-level Qt6 patches for the ringqt tree. Idempotent.
918cd "$(dirname "$0")" || exit 1
919
920for m in QAction QKeyEvent QMouseEvent; do
921 grep -rl "#include <$m>" cpp | xargs -r \
922 sed -i "s|#include <$m>|#include <QtGui/$m>|"
923done
924
925for f in cpp/include/gshortcut.h; do
926 [ -f "$f" ] || continue
927 grep -q '#include <QWidget>' "$f" || \
928 sed -i 's|#include <QShortcut>|#include <QShortcut>\n#include <QWidget>|' "$f"
929done
930
931sed -i 's|QtCharts::||g' cpp/include/*.h cpp/src/*.cpp
932
933for f in cpp/include/gaudioinput.h cpp/include/gaudiooutput.h; do
934 [ -f "$f" ] || continue
935 grep -q '#include <QAudioFormat>' "$f" || \
936 sed -i '1i #include <QAudioFormat> /* Qt6: qaudioinput/qaudiooutput no longer define it */' "$f"
937done
938for f in cpp/src/gaudioinput.cpp cpp/src/gaudiooutput.cpp; do
939 [ -f "$f" ] || continue
940 sed -i -e 's|: QAudioInput(parent)|: QAudioInput(nullptr) /* Qt6: routing ctor, format arg dropped */|' \
941 -e 's|: QAudioOutput(parent)|: QAudioOutput(nullptr) /* Qt6: routing ctor, format arg dropped */|' "$f"
942done
943for f in cpp/include/gmediarecorder.h; do
944 [ -f "$f" ] || continue
945 grep -q '#include <QMediaObject>' "$f" || \
946 sed -i '1i #include <QMediaObject> /* Qt6 stub: class removed */' "$f"
947done
948
949# GAudioInput wrapper: Qt6's QAudioInput is a routing class with no media
950# methods. NOTE: start is deliberately NOT here (wrapped multi-line shape;
951# battery's whole-function awk is the only safe treatment). All entries
952# below are plain-statement methods only.
953for f in cpp/src/gaudioinput.cpp; do
954 [ -f "$f" ] || continue
955 for fn in stop suspend reset resume setBufferSize setNotifyInterval; do
956 sed -i "/GAudioInput::$fn/,/^}/ s|pObject->[^;]*;|(void)0; /* Qt6: routing class, no media API */|" "$f"
957 done
958 sed -i -e "/GAudioInput::state/,/^}/ s|QAudioInput::state()|0 /* Qt6: routing class */|" \
959 -e "/GAudioInput::bufferSize/,/^}/ s|QAudioInput::bufferSize()|0 /* Qt6: routing class */|" \
960 -e "/GAudioInput::bytesReady/,/^}/ s|QAudioInput::bytesReady()|0 /* Qt6: routing class */|" \
961 -e "/GAudioInput::elapsedUSecs/,/^}/ s|QAudioInput::elapsedUSecs()|0 /* Qt6: routing class */|" \
962 -e "/GAudioInput::processedUSecs/,/^}/ s|QAudioInput::processedUSecs()|0 /* Qt6: routing class */|" \
963 -e "/GAudioInput::periodSize/,/^}/ s|QAudioInput::periodSize()|0 /* Qt6: routing class */|" \
964 -e "/GAudioInput::notifyInterval/,/^}/ s|QAudioInput::notifyInterval()|0 /* Qt6: routing class */|" \
965 -e "/GAudioInput::error/,/^}/ s|QAudioInput::error()|0 /* Qt6: routing class */|" \
966 -e "/GAudioInput::format/,/^}/ s|QAudioInput::format()|QAudioFormat() /* Qt6: routing class */|" \
967 "$f"
968done
969exit 0
970WRAPPATCH
971 # sanity: the tarball wrappers must still carry the Qt5 patterns we fix
972 n="$(grep -rl 'QtCharts::' extensions/ringqt/cpp | wc -l)"
973 if (( n == 0 )); then
974 error "expected QtCharts:: qualifiers in the ringqt wrappers (upstream drift?)"
975 return 1
976 fi
977 sh extensions/ringqt/qt6_wrapper_patches.sh || {
978 error "wrapper patch script failed"; return 1; }
979 grep -rq '#include <QtGui/QAction>' extensions/ringqt/cpp || {
980 error "QAction include patch did not apply"; return 1; }
981 grep -q '#include <QWidget>' extensions/ringqt/cpp/include/gshortcut.h || {
982 error "gshortcut QWidget include patch did not apply"; return 1; }
983 if grep -rq 'QtCharts::' extensions/ringqt/cpp; then
984 error "QtCharts:: namespace strip incomplete"
985 return 1
986 fi
987 grep -q '#include <QAudioFormat>' extensions/ringqt/cpp/include/gaudioinput.h || {
988 error "gaudioinput QAudioFormat include patch did not apply"; return 1; }
989 grep -q 'QAudioInput(nullptr)' extensions/ringqt/cpp/src/gaudioinput.cpp || {
990 error "gaudioinput ctor patch did not apply"; return 1; }
991 grep -q '#include <QMediaObject>' extensions/ringqt/cpp/include/gmediarecorder.h || {
992 error "gmediarecorder QMediaObject include patch did not apply"; return 1; }
993
994 # --- Mega-TU patch battery ------------------------------------------------
995 cat > extensions/ringqt/qt6_battery.sh <<'BATTERY'
996#!/bin/sh
997# Qt6 compatibility battery for ONE generated mega-TU ($1, path relative to
998# extensions/ringqt). Idempotent. Created by the ring-lang PKGBUILD prepare().
999cd "$(dirname "$0")" || exit 1
1000f="$1"
1001[ -f "$f" ] || { echo "ERROR: battery target missing: $f" >&2; exit 1; }
1002
1003# delete_call_statement TOKEN — removes the full statement containing the
1004# TOKEN call, robust to multi-line lambda arguments: tracks paren depth
1005# from TOKEN's opening paren until it closes.
1006delete_call_statement() {
1007 tok="$1"
1008 awk -v tok="$tok" '
1009 index($0, tok) && !kill {
1010 start = index($0, tok) + length(tok) - 1
1011 depth = 0
1012 for (i = start; i <= length($0); i++) {
1013 c = substr($0, i, 1)
1014 if (c == "(") depth++
1015 if (c == ")") depth--
1016 }
1017 if (depth > 0) { kill = 1; next }
1018 next
1019 }
1020 kill {
1021 for (i = 1; i <= length($0); i++) {
1022 c = substr($0, i, 1)
1023 if (c == "(") depth++
1024 if (c == ")") depth--
1025 }
1026 if (depth <= 0) kill = 0
1027 next
1028 }
1029 { print }
1030 ' "$f" > "$f.tmp" && mv "$f.tmp" "$f"
1031}
1032
1033# Qt6 only FORWARD-DECLARES QRegExp/QStringRef/QTextCodec — force the
1034# Qt5Compat definitions in:
1035if ! grep -q '#include <QRegExp>' "$f" ; then
1036 { echo '#include <QRegExp> /* Qt6: moved to Qt5Compat */'
1037 echo '#include <QStringRef> /* Qt6: moved to Qt5Compat */'
1038 echo '#include <QTextCodec> /* Qt6: moved to Qt5Compat */'
1039 cat "$f"; } > "$f.tmp" && mv "$f.tmp" "$f"
1040fi
1041
1042# QLocale getters returned QChar in Qt5, QString in Qt6:
1043for m in decimalPoint exponential groupSeparator negativeSign percent positiveSign zeroDigit; do
1044 sed -i "s|\*pValue = pObject->$m();|*pValue = pObject->$m().at(0);|" "$f"
1045done
1046# QTextStream::codec()/setCodec() and QMutex::isRecursive() removed;
1047# QMutexLocker became a template:
1048sed -i -e 's|RING_API_RETCPOINTER(pObject->codec(),"QTextCodec")|RING_API_RETCPOINTER(nullptr,"QTextCodec") /* Qt6: removed */|' \
1049 -e 's|pObject->setCodec(.*|(void)0; /* Qt6: QTextStream::setCodec() removed */|' \
1050 -e 's|pObject->isRecursive()|0 /* Qt6: QMutex::isRecursive() removed */|' \
1051 -e 's|QMutexLocker \*|QMutexLocker<QMutex> *|g' \
1052 -e 's|new QMutexLocker(|new QMutexLocker<QMutex>(|g' \
1053 "$f"
1054
1055# QLocale lost its QStringRef overloads in Qt6 — pass QString instead:
1056for fn in quoteString_2 toDouble_2 toFloat_2 toInt_2 toLongLong_2 toShort_2 \
1057 toUInt_2 toULongLong_2 toUShort_2; do
1058 sed -i "/ring_QLocale_$fn/,/^}/ s|\* (QStringRef \*) RING_API_GETCPOINTER(\([0-9]*\),\"QStringRef\")|(* (QStringRef *) RING_API_GETCPOINTER(\1,\"QStringRef\")).toString()|" "$f"
1059done
1060
1061# split()/section() lost their QRegExp overloads:
1062sed -i -e 's|\*pValue = pObject->split(\* (QRegExp\b[^;]*;|RING_API_ERROR("Qt6: split(QRegExp) removed"); return; /* was split(QRegExp) */|' \
1063 -e 's|RING_API_RETSTRING(pObject->section(\* (QRegExp\b[^;]*;|RING_API_ERROR("Qt6: section(QRegExp) removed"); return; /* was section(QRegExp) */|' \
1064 "$f"
1065# XML stream getters now return QStringView instead of QStringRef:
1066for fn in \
1067 QXmlStreamReader_documentEncoding QXmlStreamReader_documentVersion \
1068 QXmlStreamReader_dtdName QXmlStreamReader_dtdPublicId QXmlStreamReader_dtdSystemId \
1069 QXmlStreamReader_name QXmlStreamReader_namespaceUri QXmlStreamReader_prefix \
1070 QXmlStreamReader_processingInstructionData QXmlStreamReader_processingInstructionTarget \
1071 QXmlStreamReader_qualifiedName QXmlStreamReader_text \
1072 QXmlStreamNotationDeclaration_name QXmlStreamNotationDeclaration_publicId \
1073 QXmlStreamNotationDeclaration_systemId \
1074 QXmlStreamNamespaceDeclaration_namespaceUri QXmlStreamNamespaceDeclaration_prefix \
1075 QXmlStreamEntityDeclaration_name QXmlStreamEntityDeclaration_notationName \
1076 QXmlStreamEntityDeclaration_publicId QXmlStreamEntityDeclaration_systemId \
1077 QXmlStreamEntityDeclaration_value \
1078 QXmlStreamAttributes_value QXmlStreamAttributes_value_2 QXmlStreamAttributes_value_3 \
1079 QXmlStreamAttributes_value_4 QXmlStreamAttributes_value_5 \
1080 QXmlStreamAttribute_name QXmlStreamAttribute_namespaceUri QXmlStreamAttribute_prefix \
1081 QXmlStreamAttribute_qualifiedName QXmlStreamAttribute_value \
1082 QRegularExpressionMatch_capturedRef QRegularExpressionMatch_capturedRef_2 ; do
1083 sed -i "/ring_$fn/,/^}/ {
1084 s|QStringRef *\*pValue|QStringView *pValue|
1085 s|pValue *= *new QStringRef|pValue = new QStringView|
1086 s|RETCPOINTER(pValue,\"QStringRef\")|RETCPOINTER(pValue,\"QStringView\")|
1087 }" "$f"
1088done
1089# Blanket fixes (patterns unique to the affected sites):
1090sed -i -e 's|pObject->capturedRef(\(.*\));|QStringView(pObject->captured(\1));|g' \
1091 -e 's|(QString::SplitBehavior ) *(int)|(Qt::SplitBehavior ) (int)|g' \
1092 -e 's|setProperty(RING_API_GETSTRING(2),RING_API_GETSTRING(3))|setProperty(RING_API_GETSTRING(2),QString(RING_API_GETSTRING(3)))|g' \
1093 -e 's|new QVariant(RING_API_GETSTRING(1))|new QVariant(QString(RING_API_GETSTRING(1)))|g' \
1094 -e 's|new QMutex((QMutex::RecursionMode) *(int) RING_API_GETNUMBER(1))|new QMutex() /* Qt6: non-recursive only */|' \
1095 -e 's|\*pValue = pObject->toRegExp();|RING_API_ERROR("Qt6: QVariant::toRegExp() removed"); return;|' \
1096 "$f"
1097
1098# Light-stage drift:
1099sed -i -e 's|pObject->setWeight( (int ) RING_API_GETNUMBER(2))|pObject->setWeight((QFont::Weight) (int) RING_API_GETNUMBER(2))|' \
1100 -e 's|pObject->toHtml(\* (QByteArray \*) RING_API_GETCPOINTER(2,"QByteArray"))|pObject->toHtml() /* Qt6: no encoding arg */|' \
1101 -e 's|RING_API_RETNUMBER(pObject->orientationUpdateMask());|RING_API_RETNUMBER(0); /* Qt6: removed */|' \
1102 -e 's|pObject->setOrientationUpdateMask( (Qt::ScreenOrientations ) (int) RING_API_GETNUMBER(2));|(void)0; /* Qt6: removed */|' \
1103 -e 's|\*pValue = pObject->nativeHandle();|*pValue = QVariant(); /* Qt6: removed */|' \
1104 -e 's|pObject->setNativeHandle(\* (QVariant \*) RING_API_GETCPOINTER(2,"QVariant"));|(void)0; /* Qt6: removed */|' \
1105 -e 's|RING_API_RETCPOINTER(pObject->openGLModuleHandle(),"void");|RING_API_RETCPOINTER(nullptr,"void"); /* Qt6: removed */|' \
1106 -e 's|RING_API_RETCPOINTER(pObject->versionFunctions(\* (QOpenGLVersionProfile \*) RING_API_GETCPOINTER(2,"QOpenGLVersionProfile")),"QAbstractOpenGLFunctions");|RING_API_ERROR("Qt6: versionFunctions() removed"); return;|' \
1107 -e 's|RING_API_RETCPOINTER(pObject->versionFunctions(),"TYPE");|RING_API_ERROR("Qt6: versionFunctions() removed"); return;|' \
1108 -e 's|QOpenGLContext::currentContext()->versionFunctions<QOpenGLFunctions_3_2_Core>()|nullptr /* Qt6: versionFunctions<T>() removed */|' \
1109 -e 's|pObject->glIndexub( (GLubyte ) RING_API_GETNUMBER(2));|(void)0; /* Qt6: removed */|' \
1110 -e 's|pObject->glIndexubv((GLubyte \*) RING_API_GETCPOINTER(2,"GLubyte"));|(void)0; /* Qt6: removed */|' \
1111 -e 's|pObject->animateClick( (int ) RING_API_GETNUMBER(2));|pObject->animateClick(); /* Qt6: no delay arg */|' \
1112 -e 's|pObject->visitedPages()|pObject->visitedIds()|' \
1113 -e 's|setSelectionArea(\* (QPainterPath \*) RING_API_GETCPOINTER(2,"QPainterPath"), (Qt::ItemSelectionMode|setSelectionArea(* (QPainterPath *) RING_API_GETCPOINTER(2,"QPainterPath"), Qt::ReplaceSelection, (Qt::ItemSelectionMode|' \
1114 "$f"
1115
1116# QPicture::load/save lost the format argument in Qt6:
1117sed -i "/ring_QPicture_load/,/^}/ s|RING_API_RETNUMBER(pObject->load(.*|RING_API_RETNUMBER(pObject->load(QString(RING_API_GETSTRING(2)))); /* Qt6: no format arg */|" "$f"
1118sed -i "/ring_QPicture_save/,/^}/ s|RING_API_RETNUMBER(pObject->save(.*|RING_API_RETNUMBER(pObject->save(QString(RING_API_GETSTRING(2)))); /* Qt6: no format arg */|" "$f"
1119
1120# Qt6 color getters take float*:
1121for fn in QColor_getCmykF QColor_getHslF QColor_getHsvF QColor_getRgbF; do
1122 sed -i "/ring_$fn/,/^}/ s|(qreal \*) RING_API_GETCPOINTER(|(float *) RING_API_GETCPOINTER(|g" "$f"
1123done
1124# QWheelEvent coordinate accessors replaced by position()/globalPosition():
1125for fn in QWheelEvent_globalPosF QWheelEvent_globalX QWheelEvent_globalY \
1126 QWheelEvent_posF QWheelEvent_x QWheelEvent_y; do
1127 sed -i "/ring_$fn/,/^}/ {
1128 s|pObject->globalPosF()|pObject->globalPosition()|
1129 s|pObject->globalX()|pObject->globalPosition().toPoint().x()|
1130 s|pObject->globalY()|pObject->globalPosition().toPoint().y()|
1131 s|pObject->posF()|pObject->position()|
1132 s|pObject->x()|pObject->position().toPoint().x()|
1133 s|pObject->y()|pObject->position().toPoint().y()|
1134 }" "$f"
1135done
1136# Qt6 returns these by value — box for RETCPOINTER:
1137sed -i "/ring_QCursor_bitmap/,/^}/ s|RING_API_RETCPOINTER(pObject->bitmap(),\"QBitmap\")|RING_API_RETCPOINTER(new QBitmap(pObject->bitmap()),\"QBitmap\")|" "$f"
1138sed -i "/ring_QCursor_mask/,/^}/ s|RING_API_RETCPOINTER(pObject->mask(),\"QBitmap\")|RING_API_RETCPOINTER(new QBitmap(pObject->mask()),\"QBitmap\")|" "$f"
1139sed -i "/ring_QLabel_picture/,/^}/ s|RING_API_RETCPOINTER(pObject->picture(),\"QPicture\")|RING_API_RETCPOINTER(new QPicture(pObject->picture()),\"QPicture\")|" "$f"
1140sed -i "/ring_QLabel_pixmap/,/^}/ s|RING_API_RETCPOINTER(pObject->pixmap(),\"QPixmap\")|RING_API_RETCPOINTER(new QPixmap(pObject->pixmap()),\"QPixmap\")|" "$f"
1141
1142# --- Full-TU body drift (pkgrel=24 digest) -----------------------------------
1143sed -i -e 's|QAudioFormat::SampleType|int|g' \
1144 -e 's|QAudioFormat::Endian|int|g' \
1145 -e 's|QVideoFrame::PixelFormat|int|g' \
1146 -e 's|QBluetoothDeviceInfo::DataCompleteness|int|g' \
1147 -e 's|Qt3DCore::QNode::PropertyTrackingMode|int|g' \
1148 -e 's|QCamera::LockTypes|int|g' \
1149 -e 's|QCamera::LockType\b|int|g' \
1150 -e 's|QCamera::CaptureModes|int|g' \
1151 -e 's|QWebEngineDownloadItem|QWebEngineDownloadRequest|g' \
1152 "$f"
1153# QCamera Qt5 lock/viewfinder/captureMode API removed in Qt6:
1154sed -i -e 's|pObject->setViewfinder([^;]*;|(void)0; /* Qt6: viewfinder API removed */|' \
1155 -e 's|pObject->searchAndLock([^;]*;|(void)0; /* Qt6: lock API removed */|' \
1156 -e 's|pObject->setCaptureMode([^;]*;|(void)0; /* Qt6: captureMode API removed */|' \
1157 -e 's|RING_API_RETNUMBER(pObject->lockStatus([^;]*;|RING_API_RETNUMBER(0); /* Qt6: lock API removed */|' \
1158 -e 's|RING_API_RETNUMBER(pObject->isCaptureModeSupported([^;]*;|RING_API_RETNUMBER(0); /* Qt6: captureMode API removed */|' \
1159 "$f"
1160# QCamera::unlock stays FUNCTION-SCOPED (QMutex::unlock() is valid Qt6):
1161sed -i "/ring_QCamera_unlock/,/^}/ s|pObject->unlock([^;]*;|(void)0; /* Qt6: lock API removed */|" "$f"
1162
1163# QAudioInput::start removed in Qt6 — whole-function inert stub via awk.
1164# The awk REGEX matches the bare function name PREFIX, so overloads
1165# (ring_QAudioInput_start_2 etc.) AND the wrapped-multi-line shape are all
1166# handled by function replacement. Idempotent via the marker text.
1167if ! grep -q 'QAudioInput::start() removed' "$f" ; then
1168 awk '
1169 /^RING_FUNC\(ring_QAudioInput_start/ {
1170 fname = $0
1171 sub(/^RING_FUNC\(/, "", fname); sub(/\)$/, "", fname)
1172 print "RING_FUNC(" fname ")"
1173 print "{"
1174 print "\tRING_API_ERROR(\"Qt6: QAudioInput::start() removed (use QAudioSource)\");"
1175 print "}"
1176 infn = 1; next
1177 }
1178 infn && /^}/ { infn = 0; next }
1179 infn { next }
1180 { print }
1181 ' "$f" > "$f.tmp" && mv "$f.tmp" "$f"
1182fi
1183
1184# QMediaRecorder::setOutputLocation returns void in Qt6 — whole-function stub:
1185if ! grep -q 'setOutputLocation() removed' "$f" ; then
1186 awk '
1187 /^RING_FUNC\(ring_QMediaRecorder_setOutputLocation/ {
1188 fname = $0
1189 sub(/^RING_FUNC\(/, "", fname); sub(/\)$/, "", fname)
1190 print "RING_FUNC(" fname ")"
1191 print "{"
1192 print "\tRING_API_ERROR(\"Qt6: setOutputLocation() removed\");"
1193 print "}"
1194 infn = 1; next
1195 }
1196 infn && /^}/ { infn = 0; next }
1197 infn { next }
1198 { print }
1199 ' "$f" > "$f.tmp" && mv "$f.tmp" "$f"
1200fi
1201
1202# --- QMediaPlayer/QCamera removed Qt5 methods (pkgrel=27 digest) --------------
1203for fn in QMediaPlayer_setMedia QMediaPlayer_setPlaylist \
1204 QMediaPlayer_setVolume QMediaPlayer_setMuted; do
1205 sed -i "/ring_$fn/,/^}/ s|pObject->[^;]*;|(void)0; /* Qt6: removed */|" "$f"
1206done
1207sed -i -e "/ring_QMediaPlayer_volume/,/^}/ s|pObject->volume()|0 /* Qt6: removed */|" \
1208 -e "/ring_QMediaPlayer_state/,/^}/ s|pObject->state()|0 /* Qt6: removed */|" \
1209 -e "/ring_QMediaPlayer_isMuted/,/^}/ s|pObject->isMuted()|0 /* Qt6: removed */|" \
1210 -e "/ring_QMediaPlayer_isAudioAvailable/,/^}/ s|pObject->isAudioAvailable()|0 /* Qt6: removed */|" \
1211 -e "/ring_QMediaPlayer_isVideoAvailable/,/^}/ s|pObject->isVideoAvailable()|0 /* Qt6: removed */|" \
1212 -e "/ring_QMediaPlayer_bufferStatus/,/^}/ s|pObject->bufferStatus()|0 /* Qt6: removed */|" \
1213 -e "/ring_QMediaPlayer_playlist/,/^}/ s|pObject->playlist()|nullptr /* Qt6: removed */|" \
1214 -e "/ring_QMediaPlayer_mediaStream/,/^}/ s|pObject->mediaStream()|nullptr /* Qt6: removed */|" \
1215 "$f"
1216sed -i -e 's|RING_API_RETCPOINTER(pObject->media(),"QMediaContent")|RING_API_RETCPOINTER(new QMediaContent(),"QMediaContent") /* Qt6: removed */|' \
1217 -e 's|RING_API_RETCPOINTER(pObject->currentMedia(),"QMediaContent")|RING_API_RETCPOINTER(new QMediaContent(),"QMediaContent") /* Qt6: removed */|' \
1218 -e 's|new QMediaContent(pObject->media())|new QMediaContent() /* Qt6: removed */|g' \
1219 -e 's|new QMediaContent(pObject->currentMedia())|new QMediaContent() /* Qt6: removed */|g' \
1220 -e 's|\*pValue = pObject->media();|*pValue = QMediaContent(); /* Qt6: removed */|' \
1221 -e 's|\*pValue = pObject->currentMedia();|*pValue = QMediaContent(); /* Qt6: removed */|' \
1222 "$f"
1223sed -i "/ring_QCamera_unload/,/^}/ s|pObject->unload() *;|(void)0; /* Qt6: removed */|" "$f"
1224sed -i "/ring_QCamera_supportedLocks/,/^}/ s|pObject->supportedLocks()|0 /* Qt6: removed */|" "$f"
1225
1226# --- pkgrel=32/33/34 digest ---------------------------------------------------
1227delete_call_statement "pObject->page()->print("
1228delete_call_statement "pObject->print("
1229delete_call_statement "pObject->findText("
1230
1231sed -i "/ring_QBluetoothSocket_state/,/^}/ s|RING_API_RETNUMBER(pObject->state())|RING_API_RETNUMBER((int) pObject->state())|" "$f"
1232sed -i "/ring_QBluetoothSocket_error/,/^}/ s|RING_API_RETNUMBER(pObject->error())|RING_API_RETNUMBER((int) pObject->error())|" "$f"
1233
1234sed -i "/ring_QPrintPreviewWidget_setOrientation/,/^}/ s|pObject->setOrientation([^;]*;|(void)0; /* Qt6: QPrinter::Orientation removed */|" "$f"
1235sed -i "/ring_QNetworkAccessManager_setNetworkAccessible/,/^}/ s|pObject->setNetworkAccessible([^;]*;|(void)0; /* Qt6: removed */|" "$f"
1236sed -i "/ring_QNetworkAccessManager_networkAccessible/,/^}/ s|pObject->networkAccessible()|0 /* Qt6: removed */|" "$f"
1237sed -i "/ring_QBluetoothDeviceDiscoveryAgent_setInquiryType/,/^}/ s|pObject->setInquiryType([^;]*;|(void)0; /* Qt6: removed */|" "$f"
1238sed -i "/ring_QBluetoothDeviceDiscoveryAgent_inquiryType/,/^}/ s|pObject->inquiryType()|0 /* Qt6: removed */|" "$f"
1239sed -i "/ring_QVideoWidget_setSaturation/,/^}/ s|pObject->setSaturation([^;]*;|(void)0; /* Qt6: removed */|" "$f"
1240
1241sed -i -e 's|QPrinter::Orientation|int|g' \
1242 -e 's|QNetworkAccessManager::NetworkAccessibility|int|g' \
1243 -e 's|QBluetoothDeviceDiscoveryAgent::InquiryType|int|g' \
1244 "$f"
1245
1246sed -i 's|pObject->setPageSizeMM([^;]*;|(void)0; /* Qt6: removed */|' "$f"
1247
1248sed -i -e 's|pObject->setPropertyTracking([^;]*;|(void)0; /* Qt6: removed */|' \
1249 -e 's|pObject->setDefaultPropertyTrackingMode([^;]*;|(void)0; /* Qt6: removed */|' \
1250 -e 's|pObject->sendReply([^;]*;|(void)0; /* Qt6: removed */|' \
1251 -e 's|pObject->clearPropertyTrackings([^;]*;|(void)0; /* Qt6: removed */|' \
1252 -e 's|pObject->clearPropertyTracking([^;]*;|(void)0; /* Qt6: removed */|' \
1253 -e 's|pObject->propertyTracking(RING_API_GETSTRING([0-9]*))|0 /* Qt6: removed */|' \
1254 -e 's|pObject->propertyTracking()|0 /* Qt6: removed */|' \
1255 -e 's|pObject->defaultPropertyTrackingMode()|0 /* Qt6: removed */|' \
1256 "$f"
1257
1258sed -i -e 's|\*pValue = pObject->serviceUuids([^;]*;|*pValue = QList<QBluetoothUuid>(); /* Qt6: changed */|' \
1259 -e 's|pObject->setServiceUuids([^;]*;|(void)0; /* Qt6: changed */|' \
1260 "$f"
1261
1262sed -i "/ring_QMediaRecorder_metaData/,/^}/ s|pObject->metaData(RING_API_GETSTRING([0-9]*))|QVariant() /* Qt6: QMediaMetaData API */|" "$f"
1263sed -i "/ring_QMediaRecorder_setMetaData/,/^}/ s|pObject->setMetaData([^;]*;|(void)0; /* Qt6: QMediaMetaData API */|" "$f"
1264
1265sed -i -e "/ring_QCamera_status/,/^}/ s|pObject->status()|0 /* Qt6: removed */|" \
1266 -e "/ring_QCamera_state/,/^}/ s|pObject->state()|0 /* Qt6: removed */|" \
1267 -e "/ring_QCamera_load/,/^}/ s|pObject->load([^;]*;|(void)0; /* Qt6: removed */|" \
1268 -e "/ring_QCamera_requestedLocks/,/^}/ s|pObject->requestedLocks()|0 /* Qt6: removed */|" \
1269 "$f"
1270
1271# --- pkgrel=36 digest ---------------------------------------------------------
1272for fn in QVideoWidget_setBrightness QVideoWidget_setContrast QVideoWidget_setHue; do
1273 sed -i "/ring_$fn/,/^}/ s|pObject->[^;]*;|(void)0; /* Qt6: removed */|" "$f"
1274done
1275sed -i -e "/ring_QVideoWidget_brightness/,/^}/ s|pObject->brightness()|0 /* Qt6: removed */|" \
1276 -e "/ring_QVideoWidget_contrast/,/^}/ s|pObject->contrast()|0 /* Qt6: removed */|" \
1277 -e "/ring_QVideoWidget_hue/,/^}/ s|pObject->hue()|0 /* Qt6: removed */|" \
1278 -e "/ring_QVideoWidget_saturation/,/^}/ s|pObject->saturation()|0 /* Qt6: removed */|" \
1279 "$f"
1280
1281sed -i "/ring_QWebEnginePage_setView/,/^}/ s|pObject->setView([^;]*;|(void)0; /* Qt6: removed */|" "$f"
1282sed -i -e "/ring_QWebEnginePage_view/,/^}/ s|pObject->view()|nullptr /* Qt6: removed */|" \
1283 -e "/ring_QWebEnginePage_createStandardContextMenu/,/^}/ s|pObject->createStandardContextMenu()|nullptr /* Qt6: removed */|" \
1284 "$f"
1285
1286sed -i -e "/ring_QCamera_exposure/,/^}/ s|pObject->exposure()|nullptr /* Qt6: removed */|" \
1287 -e "/ring_QCamera_focus/,/^}/ s|pObject->focus()|nullptr /* Qt6: removed */|" \
1288 -e "/ring_QCamera_imageProcessing/,/^}/ s|pObject->imageProcessing()|nullptr /* Qt6: removed */|" \
1289 -e "/ring_QCamera_captureMode/,/^}/ s|pObject->captureMode()|0 /* Qt6: removed */|" \
1290 "$f"
1291
1292for fn in QAudioFormat_setSampleType QAudioFormat_setSampleSize QAudioFormat_setByteOrder; do
1293 sed -i "/ring_$fn/,/^}/ s|pObject->[^;]*;|(void)0; /* Qt6: removed */|" "$f"
1294done
1295sed -i -e "/ring_QAudioFormat_sampleType/,/^}/ s|pObject->sampleType()|0 /* Qt6: removed */|" \
1296 -e "/ring_QAudioFormat_sampleSize/,/^}/ s|pObject->sampleSize()|0 /* Qt6: removed */|" \
1297 -e "/ring_QAudioFormat_byteOrder/,/^}/ s|pObject->byteOrder()|0 /* Qt6: removed */|" \
1298 -e "/ring_QAudioFormat_codec/,/^}/ s|pObject->codec()|QString() /* Qt6: removed */|" \
1299 "$f"
1300
1301sed -i "/ring_QSoundEffect_setCategory/,/^}/ s|pObject->setCategory([^;]*;|(void)0; /* Qt6: removed */|" "$f"
1302sed -i "/ring_QSoundEffect_category/,/^}/ s|pObject->category()|QString() /* Qt6: removed */|" "$f"
1303
1304sed -i "/ring_QNetworkAccessManager_setConfiguration/,/^}/ s|pObject->setConfiguration([^;]*;|(void)0; /* Qt6: bearer API removed */|" "$f"
1305sed -i "/ring_QNetworkAccessManager_configuration/,/^}/ s|pObject->configuration()|QNetworkConfiguration() /* Qt6: bearer API removed */|" "$f"
1306
1307sed -i "/ring_QBluetoothDeviceInfo_serviceUuidsCompleteness/,/^}/ s|pObject->serviceUuidsCompleteness()|0 /* Qt6: removed */|" "$f"
1308
1309# --- pkgrel=37/39 digest ------------------------------------------------------
1310# GMediaRecorder Qt5 methods removed/changed in Qt6 (19 methods):
1311for fn in QMediaRecorder_setVolume QMediaRecorder_setMuted \
1312 QMediaRecorder_setAudioSettings QMediaRecorder_setVideoSettings \
1313 QMediaRecorder_setEncodingSettings; do
1314 sed -i "/ring_$fn/,/^}/ s|pObject->[^;]*;|(void)0; /* Qt6: removed */|" "$f"
1315done
1316sed -i -e "/ring_QMediaRecorder_volume/,/^}/ s|pObject->volume()|0 /* Qt6: removed */|" \
1317 -e "/ring_QMediaRecorder_state/,/^}/ s|pObject->state()|0 /* Qt6: removed */|" \
1318 -e "/ring_QMediaRecorder_status/,/^}/ s|pObject->status()|0 /* Qt6: removed */|" \
1319 -e "/ring_QMediaRecorder_isMuted/,/^}/ s|pObject->isMuted()|0 /* Qt6: removed */|" \
1320 -e "/ring_QMediaRecorder_isMetaDataAvailable/,/^}/ s|pObject->isMetaDataAvailable()|0 /* Qt6: removed */|" \
1321 -e "/ring_QMediaRecorder_isMetaDataWritable/,/^}/ s|pObject->isMetaDataWritable()|0 /* Qt6: removed */|" \
1322 -e "/ring_QMediaRecorder_availability/,/^}/ s|pObject->availability()|0 /* Qt6: removed */|" \
1323 -e "/ring_QMediaRecorder_containerFormat/,/^}/ s|pObject->containerFormat()|QString() /* Qt6: removed */|" \
1324 -e "/ring_QMediaRecorder_supportedContainers/,/^}/ s|pObject->supportedContainers()|QStringList() /* Qt6: removed */|" \
1325 -e "/ring_QMediaRecorder_supportedAudioCodecs/,/^}/ s|pObject->supportedAudioCodecs()|QStringList() /* Qt6: removed */|" \
1326 -e "/ring_QMediaRecorder_supportedVideoCodecs/,/^}/ s|pObject->supportedVideoCodecs()|QStringList() /* Qt6: removed */|" \
1327 -e "/ring_QMediaRecorder_audioSettings/,/^}/ s|pObject->audioSettings()|QAudioEncoderSettings() /* Qt6: removed */|" \
1328 -e "/ring_QMediaRecorder_videoSettings/,/^}/ s|pObject->videoSettings()|QVideoEncoderSettings() /* Qt6: removed */|" \
1329 "$f"
1330sed -i "/ring_QMediaRecorder_containerDescription/,/^}/ s|pObject->containerDescription(RING_API_GETSTRING([0-9]*))|QString() /* Qt6: removed */|" "$f"
1331sed -i "/ring_QMediaRecorder_videoCodecDescription/,/^}/ s|pObject->videoCodecDescription(RING_API_GETSTRING([0-9]*))|QString() /* Qt6: removed */|" "$f"
1332
1333# GAudioInput Qt5 methods removed in Qt6 (routing class has no media API).
1334# start is handled ONLY by the whole-function awk stub above — no sed.
1335# All call shapes here are PROVABLY PLAIN one-line statements.
1336for fn in QAudioInput_stop QAudioInput_suspend QAudioInput_reset QAudioInput_resume \
1337 QAudioInput_setBufferSize QAudioInput_setNotifyInterval; do
1338 sed -i "/ring_$fn/,/^}/ s|pObject->[^;]*;|(void)0; /* Qt6: routing class, no media API */|" "$f"
1339done
1340sed -i -e "/ring_QAudioInput_state/,/^}/ s|pObject->state()|0 /* Qt6: routing class */|" \
1341 -e "/ring_QAudioInput_bufferSize/,/^}/ s|pObject->bufferSize()|0 /* Qt6: routing class */|" \
1342 -e "/ring_QAudioInput_bytesReady/,/^}/ s|pObject->bytesReady()|0 /* Qt6: routing class */|" \
1343 -e "/ring_QAudioInput_elapsedUSecs/,/^}/ s|pObject->elapsedUSecs()|0 /* Qt6: routing class */|" \
1344 -e "/ring_QAudioInput_processedUSecs/,/^}/ s|pObject->processedUSecs()|0 /* Qt6: routing class */|" \
1345 -e "/ring_QAudioInput_periodSize/,/^}/ s|pObject->periodSize()|0 /* Qt6: routing class */|" \
1346 -e "/ring_QAudioInput_notifyInterval/,/^}/ s|pObject->notifyInterval()|0 /* Qt6: routing class */|" \
1347 -e "/ring_QAudioInput_error/,/^}/ s|pObject->error()|0 /* Qt6: routing class */|" \
1348 "$f"
1349sed -i "/ring_QAudioInput_format/,/^}/ s|pObject->format()|QAudioFormat() /* Qt6: routing class */|" "$f"
1350
1351# GBluetoothLocalDevice::pairingConfirmation removed:
1352sed -i "/ring_QBluetoothLocalDevice_pairingConfirmation/,/^}/ s|pObject->pairingConfirmation([^;]*;|(void)0; /* Qt6: removed */|" "$f"
1353
1354# GNetworkAccessManager::activeConfiguration removed (bearer API):
1355sed -i "/ring_QNetworkAccessManager_activeConfiguration/,/^}/ s|pObject->activeConfiguration()|QNetworkConfiguration() /* Qt6: bearer API removed */|" "$f"
1356
1357# (QBluetoothTransferReply::abort and QBluetoothTransferManager::put are
1358# provided by the STUB HEADERS — no seds needed for those.)
1359exit 0
1360BATTERY
1361 local qtfiles=(cpp/src/ring_qt_core.cpp
1362 cpp/src/ring_qt_light.cpp
1363 cpp/src/ring_qt.cpp)
1364 for f in "${qtfiles[@]}"; do
1365 [[ -f "extensions/ringqt/$f" ]] || continue
1366 ( cd extensions/ringqt && sh qt6_battery.sh "$f" ) || {
1367 error "Qt6 battery failed on $f"; return 1; }
1368 done
1369 grep -q '#include <QRegExp>' extensions/ringqt/cpp/src/ring_qt_core.cpp || {
1370 error "Qt5Compat include injection failed (core)"; return 1; }
1371 n="$(grep -c 'QStringView \*pValue' extensions/ringqt/cpp/src/ring_qt_core.cpp || true)"
1372 if (( n < 32 )); then
1373 error "QStringView getter swap applied to only $n functions (expected 32+)"
1374 return 1
1375 fi
1376
1377 # Battery output sanity: macro lines must have balanced parens, EXCEPT
1378 # lambda openers.
1379 local bad
1380 for f in "${qtfiles[@]}"; do
1381 [[ -f "extensions/ringqt/$f" ]] || continue
1382 bad="$(awk '
1383 /RING_API_(RETNUMBER|RETSTRING|RETCPOINTER|ERROR|GETSTRING|GETNUMBER|GETCPOINTER)/ {
1384 if ($0 ~ /\[=\]\(/) next
1385 if (gsub(/\(/, "(") == gsub(/\)/, ")")) next
1386 if ($0 ~ /\{$/) next
1387 print FILENAME ":" FNR ": " $0
1388 }' "extensions/ringqt/$f")"
1389 if [[ -n "$bad" ]]; then
1390 error "battery produced unbalanced macro statements:"
1391 error "$bad"
1392 return 1
1393 fi
1394 done
1395
1396 # --- Full-stage gencode wrapper -------------------------------------------
1397 cat > extensions/ringqt/gencode_qt6.sh <<'GENCODE'
1398#!/bin/sh
1399cd "$(dirname "$0")" || exit 1
1400
1401./gencode.sh || exit 1
1402
1403if grep -q 'QAx' cpp/src/ring_qt.cpp ; then
1404 echo "ERROR: regenerated ring_qt.cpp still contains ActiveX (QAx) content" >&2
1405 exit 1
1406fi
1407
1408missing=$(grep -h -oE '#include <[A-Z][A-Za-z0-9]*(/[A-Za-z0-9]+)*>' cpp/src/ring_qt.cpp \
1409 | sed -e 's/^#include <//' -e 's/>$//' | sort -u | grep -v '^QAx' \
1410 | while read -r h; do
1411 found=""
1412 for d in /usr/include/qt6 /usr/include/qt6/*; do
1413 [ -f "$d/$h" ] && { found=1; break; }
1414 done
1415 [ -z "$found" ] && [ -f "cpp/include/$h" ] && found=1
1416 [ -z "$found" ] && echo "$h"
1417 done)
1418if [ -n "$missing" ]; then
1419 echo "ERROR: unresolved Qt headers in the regenerated ring_qt.cpp:$missing" >&2
1420 exit 1
1421fi
1422
1423# .pro insurance matching prepare()'s (a) fix:
1424grep -q '\-l:libring\.so' ring_qt515.pro || \
1425 sed -i 's|LIBS += */usr/lib/libring\.so|LIBS += -L../../lib -l:libring.so|' ring_qt515.pro
1426grep -q 'rpath.*ORIGIN' ring_qt515.pro || \
1427 printf 'QMAKE_LFLAGS += -Wl,-rpath,$$ORIGIN -Wl,-rpath,$$ORIGIN/../../lib\n' >> ring_qt515.pro
1428for mod in openglwidgets svgwidgets; do
1429 grep -q "QT += $mod" ring_qt515.pro || printf 'QT += %s\n' "$mod" >> ring_qt515.pro
1430done
1431if ! grep -q '^QT += core5compat' ring_qt515.pro; then
1432 [ -n "$(tail -c 1 ring_qt515.pro)" ] && printf '\n' >> ring_qt515.pro
1433 printf 'QT += core5compat\n' >> ring_qt515.pro
1434 printf 'INCLUDEPATH += $$[QT_INSTALL_HEADERS]/Qt5Compat\n' >> ring_qt515.pro
1435 printf 'LIBS += -lQt6Core5Compat\n' >> ring_qt515.pro
1436 printf 'DEFINES += QT_CORE5COMPAT_LIB\n' >> ring_qt515.pro
1437fi
1438
1439sh qt6_wrapper_patches.sh || exit 1
1440sh qt6_battery.sh cpp/src/ring_qt.cpp || exit 1
1441
1442bad=$(awk '/RING_API_(RETNUMBER|RETSTRING|RETCPOINTER|ERROR|GETSTRING|GETNUMBER|GETCPOINTER)/ {
1443 if ($0 ~ /\[=\]\(/) next
1444 if (gsub(/\(/,"(") == gsub(/\)/,")")) next
1445 if ($0 ~ /\{$/) next
1446 print FNR": "$0
1447 }' cpp/src/ring_qt.cpp)
1448if [ -n "$bad" ]; then
1449 echo "ERROR: battery produced unbalanced macro statements:" >&2
1450 echo "$bad" >&2
1451 exit 1
1452fi
1453
1454for h in QSvgWidget QWebEngineCallback QWebEngineDownloadRequest \
1455 QAudioEncoderSettings QVideoEncoderSettings QImageEncoderSettings; do
1456 grep -q "#include <$h>" cpp/src/ring_qt.cpp || \
1457 sed -i "1i #include <$h> /* PKGBUILD: used without include */" cpp/src/ring_qt.cpp
1458done
1459
1460echo "gencode_qt6.sh: ring_qt.cpp + wrappers regenerated (Linux flavor), Qt6 patches re-applied"
1461GENCODE
1462 chmod 755 extensions/ringqt/gencode_qt6.sh
1463 [[ -f extensions/ringqt/gencode_qt6.sh ]] || {
1464 error "gencode_qt6.sh was not created"; return 1; }
1465
1466 # (f) gencode stage control:
1467 sed -i '/extensions\/ringqt/s/"gencode[^"]*"/""/g' build/buildgcc.sh
1468 sed -i '/extensions\/ringqt/{/"buildgcc\.sh"/s|""|"gencode_qt6.sh"|}' build/buildgcc.sh
1469 if grep -Eq 'extensions/ringqt[[:space:]]+"gencode(_core|_light)?\.sh"' build/buildgcc.sh; then
1470 error "failed to neutralize the core/light ringqt gencode stages"
1471 return 1
1472 fi
1473 if ! grep -q 'extensions/ringqt.*"gencode_qt6\.sh"' build/buildgcc.sh; then
1474 error "full ringqt stage does not call gencode_qt6.sh"
1475 return 1
1476 fi
1477
1478 # (q) COMPLETENESS CHECK:
1479 local missing="" hit
1480 while read -r h; do
1481 hit=""
1482 for d in /usr/include/qt6 /usr/include/qt6/*; do
1483 [[ -f "$d/$h" ]] && { hit=1; break; }
1484 done
1485 [[ -z "$hit" && -f "extensions/ringqt/cpp/include/$h" ]] && hit=1
1486 [[ -z "$hit" ]] && missing+=" $h"
1487 done < <(grep -h -oP '#include <\K[A-Z][A-Za-z0-9]*(/[A-Za-z0-9]+)*(?=>)' \
1488 extensions/ringqt/cpp/src/ring_qt_core.cpp \
1489 extensions/ringqt/cpp/src/ring_qt_light.cpp \
1490 extensions/ringqt/cpp/src/ring_qt.cpp | grep -v '^QAx' | sort -u)
1491 if [[ -n "$missing" ]]; then
1492 error "unresolved Qt headers in the mega-TU include blocks (add stubs or a module):$missing"
1493 return 1
1494 fi
1495
1496 # --- RingMySQL vs Arch's MariaDB-only packaging ----------------------------
1497 # Arch ships no Oracle MySQL; mariadb-libs provides the client as
1498 # libmariadb: pkg-config name 'libmariadb' (no mysqlclient.pc exists) and
1499 # headers under /usr/include/mariadb (mysql.h is NOT at /usr/include).
1500 # libmariadb is API-compatible with libmysqlclient, so a token rename of
1501 # the build script's package name fixes compile AND link.
1502 local mysqlpatched=0
1503 for s in extensions/ringmysql/buildgcc.sh extensions/ringmysql/build.sh \
1504 extensions/ringmysql/src/buildgcc.sh; do
1505 [[ -f "$s" ]] || continue
1506 sed -i 's|mysqlclient|libmariadb|g' "$s"
1507 mysqlpatched=1
1508 done
1509 if (( mysqlpatched == 0 )); then
1510 error "could not find the RingMySQL build script to patch"
1511 error "run: ls extensions/ringmysql/ and adjust the loop above"
1512 return 1
1513 fi
1514 grep -rq 'libmariadb' extensions/ringmysql || {
1515 error "RingMySQL libmariadb patch did not apply"; return 1; }
1516
1517 # --- RingNotepad settings: written to the (read-only) install tree on close
1518 # and at startup — R35 in savesettingstofile() via ringnotepadxbutton().
1519 # Redirect to ~/.ringnotepad/ (same treatment as ringpm's ~/.ringpm).
1520 # The settings path is built in rnotesettings.ring; locate and rewrite
1521 # the file-path expression, whatever its exact spelling. Fail LOUD if
1522 # neither pattern matched — the message asks for the grep output so
1523 # the redirect can be matched exactly.
1524 local rs=tools/ringnotepad/src/rnotesettings.ring
1525 if [[ -f "$rs" ]]; then
1526 # Form 1: path derived from exefolder()
1527 sed -i 's|exefolder()+\("[^"]*"\)|sysget("HOME")+"/.ringnotepad/"+\1|g' "$rs"
1528 # Form 2: an absolute settings-path constant pointing at the install tree
1529 sed -i 's|\(/usr/lib/ring[^"]*settings[^"]*\)|sysget("HOME")+"/.ringnotepad/settings"|g' "$rs"
1530 fi
1531 if [[ -f "$rs" ]] && grep -q 'exefolder\|/usr/lib/ring' "$rs"; then
1532 error "rnotesettings.ring still references the install tree — the redirect"
1533 error "sed did not match. Run:"
1534 error " grep -n 'settings\|exefolder\|\.ring' tools/ringnotepad/src/rnotesettings.ring | head -20"
1535 error "and paste the output so the redirect can be matched exactly."
1536 return 1
1537 fi
1538
1539 # --- RingPM: redirect state from the read-only install tree to ~/.ringpm ---
1540 local rdir="$srcdir/ring-$pkgver/tools/ringpm"
1541 find "$rdir" -name '*.ring' -exec sed -i \
1542 -e 's|exefolder()+"\.\./tools/ringpm/|sysget("HOME")+"/.ringpm/|g' \
1543 -e 's|exefolder()+"allpackages\.ring"|sysget("HOME")+"/.ringpm/allpackages.ring"|g' \
1544 -e 's|exefolder()+"/\.\./"|sysget("HOME")+"/.ringpm/ring/"|g' \
1545 -e 's|write(exefolder()+cCompletePackageName+"\.ring"|write(sysget("HOME")+"/.ringpm/ring/"+cCompletePackageName+".ring"|g' \
1546 {} +
1547 n="$(grep -r 'sysget("HOME")' "$rdir" --include='*.ring' | grep -v '/packages/' | wc -l)"
1548 if (( n < 9 )); then
1549 error "ringpm redirect seds matched only $n sites (expected 10 in $pkgver)"
1550 error "upstream source wording changed — adjust the seds in prepare()"
1551 return 1
1552 fi
1553}
1554
1555build() {
1556 cd "ring-$pkgver"
1557 # Pin Qt6's qmake so the build never silently targets a Qt5 that happens
1558 # to be installed. The srcdir/bin entry also gives the ringqt gencode
1559 # stage the freshly built `ring` interpreter it needs.
1560 export PATH="/usr/lib/qt6/bin:$srcdir/ring-$pkgver/bin:$PATH"
1561
1562 # Scrub stale qmake artifacts (e.g. Qt5-compiled .o files from an earlier
1563 # attempt in this srcdir; make would reuse them and then fail to link Qt6).
1564 rm -f extensions/ringqt/*.o extensions/ringqt/*.so* \
1565 extensions/ringqt/moc_*.cpp extensions/ringqt/moc_predefs.h \
1566 extensions/ringqt/Makefile extensions/ringqt/.qmake.stash
1567
1568 cd build
1569 ./buildgcc.sh
1570}
1571
1572check() {
1573 cd "ring-$pkgver"
1574 printf 'see "Hello from Ring!" + NL\n' > hello_test.ring
1575 ./bin/ring hello_test.ring
1576
1577 # Build-tree runtime insurance for the extension dlopen test (the
1578 # $ORIGIN rpath in (a) should suffice; LD_LIBRARY_PATH is belt-and-braces).
1579 export LD_LIBRARY_PATH="$srcdir/ring-$pkgver/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
1580
1581 # RingQt smoke test (headless)
1582 if compgen -G "lib/*qt*.so" > /dev/null; then
1583 printf 'load "qtcore.ring"\n? "qt ok"\n' > qt_test.ring
1584 QT_QPA_PLATFORM=offscreen ./bin/ring qt_test.ring
1585 else
1586 warning "no Qt extension library found — skipping Qt smoke test"
1587 fi
1588
1589 # RingPM offline test: seed a throwaway HOME like the wrapper does
1590 local t="$srcdir/ringpm-check-home"
1591 rm -rf "$t"
1592 mkdir -p "$t/.ringpm/registry" "$t/.ringpm/packages" "$t/.ringpm/ring"
1593 cp bin/allpackages.ring "$t/.ringpm/allpackages.ring"
1594 cp tools/ringpm/registry/version.ring tools/ringpm/registry/registry.ring \
1595 "$t/.ringpm/registry/"
1596 HOME="$t" ./bin/ringpm search ringnotepad
1597}
1598
1599package() {
1600 cd "ring-$pkgver"
1601 local dst="$pkgdir/usr/lib/ring"
1602 install -d "$dst"
1603 local d
1604 for d in bin lib libraries extensions tools applications samples documents; do
1605 if [[ -d "$d" ]]; then
1606 cp -a "$d" "$dst/"
1607 else
1608 warning "upstream tree has no '$d' — skipping"
1609 fi
1610 done
1611 # Drop build intermediates that rode along (qa flagged the Makefile;
1612 # moc_*.cpp are compiled-in, .qmake.stash is generator state):
1613 find "$dst" -name '*.o' -delete
1614 find "$dst" -name 'Makefile' -delete
1615 find "$dst" -name 'Makefile.*' -delete
1616 find "$dst" -name '.qmake.stash' -delete
1617 find "$dst" -name 'moc_*.cpp' -delete
1618 # Strip debug info from the shared libraries (removes $srcdir references
1619 # flagged by qa; safe — only bin/ executables carry ring2exe payloads,
1620 # and those are untouched because options=(!strip)).
1621 find "$dst/lib" -maxdepth 1 -type f -name '*.so*' \
1622 -exec strip --strip-debug {} \; 2>/dev/null || true
1623 # Optional size trims (Windows-only payloads; safe to enable):
1624 # rm -rf "$dst/extensions/libdepwin"
1625 # find "$dst" -name '*.exe' -delete
1626
1627 install -d "$pkgdir/usr/bin"
1628 # QtWebEngine computes resources/locales from the binary location
1629 # (/usr/lib/ring/bin -> ../.. = /usr/lib) — missing qt6-webengine's actual
1630 # paths — and a FULLY missing resource bundle makes WebEngine qFatal at
1631 # init (SIGABRT; confirmed via gdb backtrace: QMessageLogger::fatal in
1632 # libQt6WebEngineCore). Therefore EVERY entry point exports the real
1633 # locations; pre-set user values are respected.
1634 local envblock='if [ -d /usr/share/qt6/resources ]; then export QTWEBENGINE_RESOURCES_PATH="${QTWEBENGINE_RESOURCES_PATH:-/usr/share/qt6/resources}"; fi
1635if [ -d /usr/share/qt6/translations/qtwebengine_locales ]; then export QTWEBENGINE_LOCALES_PATH="${QTWEBENGINE_LOCALES_PATH:-/usr/share/qt6/translations/qtwebengine_locales}"; fi'
1636
1637 # ring itself: real wrapper (not a symlink) so ANY script using Qt/WebEngine
1638 # (rnote.ring and friends) inherits the correct paths.
1639 if [[ -e "$dst/bin/ring" ]]; then
1640 printf '#!/bin/sh\n%s\nexec /usr/lib/ring/bin/ring "$@"\n' "$envblock" \
1641 > "$pkgdir/usr/bin/ring"
1642 chmod 755 "$pkgdir/usr/bin/ring"
1643 fi
1644 for f in ring2exe ringrepl ringfmt folder2qrc; do
1645 if [[ -e "$dst/bin/$f" ]]; then
1646 printf '#!/bin/sh\n%s\nexec /usr/lib/ring/bin/%s "$@"\n' "$envblock" "$f" \
1647 > "$pkgdir/usr/bin/$f"
1648 chmod 755 "$pkgdir/usr/bin/$f"
1649 fi
1650 done
1651 # GUI entry points: env vars PLUS the writable state dir for the
1652 # redirected RingNotepad settings (see prepare()).
1653 for f in ringnotepad formdesigner; do
1654 if [[ -e "$dst/bin/$f" ]]; then
1655 printf '#!/bin/sh\n%s\nmkdir -p "$HOME/.ringnotepad" 2>/dev/null\nexec /usr/lib/ring/bin/%s "$@"\n' \
1656 "$envblock" "$f" > "$pkgdir/usr/bin/$f"
1657 chmod 755 "$pkgdir/usr/bin/$f"
1658 fi
1659 done
1660
1661 local so
1662 for so in "$dst/lib/"*.so; do
1663 [[ -e "$so" ]] || continue
1664 ln -s "/usr/lib/ring/lib/$(basename "$so")" "$pkgdir/usr/lib/$(basename "$so")"
1665 done
1666
1667 install -Dm644 bin/allpackages.ring \
1668 "$pkgdir/usr/share/ring-lang/allpackages.ring"
1669 install -Dm644 tools/ringpm/registry/version.ring \
1670 "$pkgdir/usr/share/ring-lang/registry/version.ring"
1671 install -Dm644 tools/ringpm/registry/registry.ring \
1672 "$pkgdir/usr/share/ring-lang/registry/registry.ring"
1673
1674 cat > "$pkgdir/usr/bin/ringpm" <<'EOF'
1675#!/bin/sh
1676if [ -n "$HOME" ]; then
1677 mkdir -p "$HOME/.ringpm/registry" "$HOME/.ringpm/packages" "$HOME/.ringpm/ring" 2>/dev/null
1678 [ -s "$HOME/.ringpm/allpackages.ring" ] ||
1679 cp /usr/share/ring-lang/allpackages.ring "$HOME/.ringpm/allpackages.ring" 2>/dev/null
1680 [ -s "$HOME/.ringpm/registry/version.ring" ] ||
1681 cp /usr/share/ring-lang/registry/version.ring "$HOME/.ringpm/registry/version.ring" 2>/dev/null
1682 [ -s "$HOME/.ringpm/registry/registry.ring" ] ||
1683 cp /usr/share/ring-lang/registry/registry.ring "$HOME/.ringpm/registry/registry.ring" 2>/dev/null
1684fi
1685# QtWebEngine resources/locales for any GUI app launched via ringpm
1686# (binary lives at /usr/lib/ring/bin; ../.. misses /usr/share/qt6):
1687if [ -d /usr/share/qt6/resources ]; then
1688 export QTWEBENGINE_RESOURCES_PATH="${QTWEBENGINE_RESOURCES_PATH:-/usr/share/qt6/resources}"
1689fi
1690if [ -d /usr/share/qt6/translations/qtwebengine_locales ]; then
1691 export QTWEBENGINE_LOCALES_PATH="${QTWEBENGINE_LOCALES_PATH:-/usr/share/qt6/translations/qtwebengine_locales}"
1692fi
1693exec /usr/lib/ring/bin/ringpm "$@"
1694EOF
1695 chmod 755 "$pkgdir/usr/bin/ringpm"
1696
1697 install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
1698}
1699

Scan history

Scanned at (UTC)SeverityRules
2026-09-04 21:58:42 Low 1

Report a package

Reports go to the AURWatch maintainer (one person) and are read by hand. No login required.

0 / 4000
Your suggestion