From 713e4b7f747916295188439b9f846f40a06dbb0b Mon Sep 17 00:00:00 2001
From: Alexander Golubev <fatzer2@gmail.com>
Date: Sat, 16 Aug 2025 23:22:57 +0300
Subject: app-mobilephone/gsmlib: new 1.11_pre250816

Update gsmlib sources. It's a new patched version developed specifically
for this this overlay based on merge of last 0.11 prerelease snapshot by
original author and later maintenance in Github repository by Vianney
Bouchaud[1]. The version also contains some original patches which
improve build process, fix automated test, compiller warnings and some
bugs. Though the codebase is absolutely untested against real hardware.

Sources for the version are available in the dedicated GitHub
repository[2] as well as on the TGW mirror[3].

[1]: https://github.com/vbouchaud/gsmlib
[2]: https://github.com/Fat-Zer/gsmlib
[3]: https://mirror.git.trinitydesktop.org/gitea/Fat-Zer/gsmlib

Closes: https://mirror.git.trinitydesktop.org/gitea/TDE/tde-packaging-gentoo/issues/15
Signed-off-by: Alexander Golubev <fatzer2@gmail.com>
---
 app-mobilephone/gsmlib/Manifest                    |  2 +-
 .../gsmlib/files/gsmlib-1.11-gcc41.patch           | 52 -----------------
 .../gsmlib/files/gsmlib-1.11-gcc43.patch           | 67 ----------------------
 .../files/gsmlib-1.11-include-gcc34-fix.patch      | 52 -----------------
 .../gsmlib/gsmlib-1.11_pre041028.ebuild            | 40 -------------
 .../gsmlib/gsmlib-1.11_pre250816.ebuild            | 34 +++++++++++
 app-mobilephone/gsmlib/metadata.xml                |  9 ++-
 7 files changed, 42 insertions(+), 214 deletions(-)
 delete mode 100644 app-mobilephone/gsmlib/files/gsmlib-1.11-gcc41.patch
 delete mode 100644 app-mobilephone/gsmlib/files/gsmlib-1.11-gcc43.patch
 delete mode 100644 app-mobilephone/gsmlib/files/gsmlib-1.11-include-gcc34-fix.patch
 delete mode 100644 app-mobilephone/gsmlib/gsmlib-1.11_pre041028.ebuild
 create mode 100644 app-mobilephone/gsmlib/gsmlib-1.11_pre250816.ebuild

diff --git a/app-mobilephone/gsmlib/Manifest b/app-mobilephone/gsmlib/Manifest
index 2bf3be28..b086f11f 100644
--- a/app-mobilephone/gsmlib/Manifest
+++ b/app-mobilephone/gsmlib/Manifest
@@ -1 +1 @@
-DIST gsmlib-pre1.11-041028.tar.gz 499052 BLAKE2B fba909db8b696da55fb974a129556a22dbc85e4f22120dc3c3f13dbeeb6bde4eb101f4b2569fadd4971d0367a6b1913cf0ae48a6c4ce01f7607c060e78fa8bd8 SHA512 9009fce488b7ed7aeb0a0581f0586a3898911ea042b92369e0242dc8b0292ca82f913058cfd958a7af121be57cf925598dc26822817ccf81027917abe6b6096a
+DIST gsmlib-pre1.11-250816.tar.gz 673683 BLAKE2B dc703fc240ea13601b4ed12a7d026dbd1dda1b0f15581a9c6cc5bd0561d1565be98c96660ff25b98f010bc148c8bf28e32507186af5118bf4e9575684f174058 SHA512 4dff23f90cb7674361977149291e75671eee87ac042a54146edd8fdfb9470c1261c2cd4772a790cb1d5f0e54161790ec9f268ce99148284643858e2a15a326ff
diff --git a/app-mobilephone/gsmlib/files/gsmlib-1.11-gcc41.patch b/app-mobilephone/gsmlib/files/gsmlib-1.11-gcc41.patch
deleted file mode 100644
index a7414e36..00000000
--- a/app-mobilephone/gsmlib/files/gsmlib-1.11-gcc41.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-diff -ur gsmlib-1.11-orig/gsmlib/gsm_map_key.h gsmlib-1.11/gsmlib/gsm_map_key.h
---- gsmlib-1.11-orig/gsmlib/gsm_map_key.h	2006-02-25 19:20:52.000000000 -0500
-+++ gsmlib-1.11/gsmlib/gsm_map_key.h	2006-02-25 19:23:01.000000000 -0500
-@@ -78,7 +78,7 @@
-   // MapKey members
-   
-   template <class SortedStore>
--    bool gsmlib::operator<(const MapKey<SortedStore> &x,
-+    bool operator<(const MapKey<SortedStore> &x,
-                            const MapKey<SortedStore> &y)
-     {
-       assert(&x._myStore == &y._myStore);
-@@ -103,7 +103,7 @@
-     }
- 
-   template <class SortedStore>
--    bool gsmlib::operator==(const MapKey<SortedStore> &x,
-+    bool operator==(const MapKey<SortedStore> &x,
-                             const MapKey<SortedStore> &y)
-     {
-       assert(&x._myStore == &y._myStore);
-diff -ur gsmlib-1.11-orig/gsmlib/gsm_me_ta.h gsmlib-1.11/gsmlib/gsm_me_ta.h
---- gsmlib-1.11-orig/gsmlib/gsm_me_ta.h	2006-02-25 19:20:52.000000000 -0500
-+++ gsmlib-1.11/gsmlib/gsm_me_ta.h	2006-02-25 19:21:48.000000000 -0500
-@@ -294,8 +294,8 @@
-     // 3 disable phone receive RF circuits only
-     // 4 disable phone both transmit and receive RF circuits
-     // 5...127 implementation-defined
--    int MeTa::getFunctionalityLevel() throw(GsmException);
--    void MeTa::setFunctionalityLevel(int level) throw(GsmException);
-+    int getFunctionalityLevel() throw(GsmException);
-+    void setFunctionalityLevel(int level) throw(GsmException);
- 
-     // return battery charge status (+CBC):
-     // 0 ME is powered by the battery
-@@ -389,13 +389,13 @@
-     void setCallWaitingLockStatus(FacilityClass cl,
-                                   bool lock)throw(GsmException);
- 
--    void MeTa::setCLIRPresentation(bool enable) throw(GsmException);
-+    void setCLIRPresentation(bool enable) throw(GsmException);
-     //(+CLIR)
-     
-     // 0:according to the subscription of the CLIR service
-     // 1:CLIR invocation
-     // 2:CLIR suppression
--    int MeTa::getCLIRPresentation() throw(GsmException);
-+    int getCLIRPresentation() throw(GsmException);
- 
-     friend class Phonebook;
-     friend class SMSStore;
-
diff --git a/app-mobilephone/gsmlib/files/gsmlib-1.11-gcc43.patch b/app-mobilephone/gsmlib/files/gsmlib-1.11-gcc43.patch
deleted file mode 100644
index ddd78c6d..00000000
--- a/app-mobilephone/gsmlib/files/gsmlib-1.11-gcc43.patch
+++ /dev/null
@@ -1,67 +0,0 @@
-diff -Naurp gsmlib-1.11-orig/gsmlib/gsm_me_ta.cc gsmlib-1.11/gsmlib/gsm_me_ta.cc
---- gsmlib-1.11-orig/gsmlib/gsm_me_ta.cc	2003-08-26 02:01:36.000000000 -0600
-+++ gsmlib-1.11/gsmlib/gsm_me_ta.cc	2008-02-24 15:09:58.000000000 -0600
-@@ -19,6 +19,8 @@
- #include <gsmlib/gsm_parser.h>
- #include <gsmlib/gsm_sysdep.h>
- 
-+#include <cstdlib>
-+
- using namespace std;
- using namespace gsmlib;
- 
-diff -Naurp gsmlib-1.11-orig/gsmlib/gsm_sms_codec.cc gsmlib-1.11/gsmlib/gsm_sms_codec.cc
---- gsmlib-1.11-orig/gsmlib/gsm_sms_codec.cc	2004-10-27 17:06:06.000000000 -0600
-+++ gsmlib-1.11/gsmlib/gsm_sms_codec.cc	2008-02-24 15:10:44.000000000 -0600
-@@ -23,6 +23,7 @@
- #ifdef HAVE_STRING_H
- #include <string.h>
- #endif
-+#include <climits>
- #include <string>
- using namespace std;
- using namespace gsmlib;
-diff -Naurp gsmlib-1.11-orig/gsmlib/gsm_util.cc gsmlib-1.11/gsmlib/gsm_util.cc
---- gsmlib-1.11-orig/gsmlib/gsm_util.cc	2004-10-27 17:05:53.000000000 -0600
-+++ gsmlib-1.11/gsmlib/gsm_util.cc	2008-02-24 15:09:36.000000000 -0600
-@@ -35,6 +35,7 @@
- #define __USE_GNU
- #define _GNU_SOURCE
- #endif
-+#include <cstdlib>
- #include <stdio.h>
- #include <sys/stat.h>
- 
-diff -Naurp gsmlib-1.11-orig/gsmlib/gsm_unix_serial.cc gsmlib-1.11/gsmlib/gsm_unix_serial.cc
---- gsmlib-1.11-orig/gsmlib/gsm_unix_serial.cc	2004-10-27 16:57:35.000000000 -0600
-+++ gsmlib-1.11/gsmlib/gsm_unix_serial.cc	2008-02-24 15:19:03.000000000 -0600
-@@ -28,6 +28,7 @@
- #include <pthread.h>
- #include <cassert>
- #include <assert.h>
-+#include <cstring>
- 
- using namespace std;
- using namespace gsmlib;
-diff -Naurp gsmlib-1.11-orig/gsmlib/gsm_sorted_phonebook.cc gsmlib-1.11/gsmlib/gsm_sorted_phonebook.cc
---- gsmlib-1.11-orig/gsmlib/gsm_sorted_phonebook.cc	2002-05-14 13:38:12.000000000 -0600
-+++ gsmlib-1.11/gsmlib/gsm_sorted_phonebook.cc	2008-02-24 15:22:52.000000000 -0600
-@@ -20,6 +20,7 @@
- #include <iostream>
- #include <fstream>
- #include <limits.h>
-+#include <cstring>
- 
- const int MAX_LINE_SIZE = 1000;
- 
-diff -Naurp gsmlib-1.11-orig/apps/gsmsmsd.cc gsmlib-1.11/apps/gsmsmsd.cc
---- gsmlib-1.11-orig/apps/gsmsmsd.cc	2003-08-26 00:47:47.000000000 -0600
-+++ gsmlib-1.11/apps/gsmsmsd.cc	2008-02-24 15:25:54.000000000 -0600
-@@ -40,6 +40,7 @@
- #include <iostream>
- #include <gsmlib/gsm_me_ta.h>
- #include <gsmlib/gsm_event.h>
-+#include <cstring>
- 
- using namespace std;
- using namespace gsmlib;
diff --git a/app-mobilephone/gsmlib/files/gsmlib-1.11-include-gcc34-fix.patch b/app-mobilephone/gsmlib/files/gsmlib-1.11-include-gcc34-fix.patch
deleted file mode 100644
index dda54512..00000000
--- a/app-mobilephone/gsmlib/files/gsmlib-1.11-include-gcc34-fix.patch
+++ /dev/null
@@ -1,52 +0,0 @@
---- gsmlib-1.11/gsmlib/gsm_map_key.h	2002-05-14 23:38:12.000000000 +0400
-+++ gsmlib-1.11-fixed/gsmlib/gsm_map_key.h	2004-08-02 00:56:40.997784696 +0400
-@@ -25,6 +25,16 @@
- 
-   // wrapper for map key, can access Sortedtore to get sortOrder()
- 
-+  // compare two keys
-+  template <class SortedStore> class MapKey;
-+  
-+  template <class SortedStore>
-+    bool operator<(const MapKey<SortedStore> &x,
-+                          const MapKey<SortedStore> &y);
-+  template <class SortedStore>
-+    bool operator==(const MapKey<SortedStore> &x,
-+                           const MapKey<SortedStore> &y);
-+
-   template <class SortedStore> class MapKey
-   {
-     SortedStore &_myStore;   // my store
-@@ -47,20 +57,16 @@
- 
-     friend
-     bool operator< 
--#ifndef WIN32
--	<>
--#endif
-+	<SortedStore>
- 	                 (const MapKey<SortedStore> &x,
-                       const MapKey<SortedStore> &y);
-     friend
-     bool operator==
--#ifndef WIN32
--	<>
--#endif
-+	<SortedStore>
- 	                  (const MapKey<SortedStore> &x,
-                        const MapKey<SortedStore> &y);
-   };
--
-+/*
-   // compare two keys
-   template <class SortedStore>
-     extern bool operator<(const MapKey<SortedStore> &x,
-@@ -68,7 +74,7 @@
-   template <class SortedStore>
-     extern bool operator==(const MapKey<SortedStore> &x,
-                            const MapKey<SortedStore> &y);
--  
-+  */
-   // MapKey members
-   
-   template <class SortedStore>
diff --git a/app-mobilephone/gsmlib/gsmlib-1.11_pre041028.ebuild b/app-mobilephone/gsmlib/gsmlib-1.11_pre041028.ebuild
deleted file mode 100644
index 08661f41..00000000
--- a/app-mobilephone/gsmlib/gsmlib-1.11_pre041028.ebuild
+++ /dev/null
@@ -1,40 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Copyright 2020 The Trinity Desktop Project
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="7"
-
-inherit flag-o-matic
-
-DESCRIPTION="Library and applications to access GSM mobile phones"
-HOMEPAGE="http://www.pxh.de/fs/gsmlib/"
-SRC_URI="http://www.pxh.de/fs/gsmlib/snapshots/${PN}-pre${PV%_pre*}-${PV#*_pre}.tar.gz"
-
-LICENSE="LGPL-2"
-SLOT="0"
-KEYWORDS="amd64 ~arm64 ~ia64 ppc ppc64 sparc x86"
-
-# Don't use Gentoo mirrors
-RESTRICT+=" mirror test"
-
-S="${WORKDIR}/${PN}-${PV%_pre*}"
-
-PATCHES=(
-	"${FILESDIR}/${P%_pre*}-include-gcc34-fix.patch"
-	"${FILESDIR}/${P%_pre*}-gcc41.patch"
-	"${FILESDIR}/${P%_pre*}-gcc43.patch"
-)
-
-src_configure() {
-	append-cxxflags "-std=c++11"
-	econf
-}
-
-src_unpack() {
-	unpack ${A}
-}
-
-src_install () {
-	emake DESTDIR="${D}" install || die "make install failed"
-	dodoc README
-}
diff --git a/app-mobilephone/gsmlib/gsmlib-1.11_pre250816.ebuild b/app-mobilephone/gsmlib/gsmlib-1.11_pre250816.ebuild
new file mode 100644
index 00000000..7551f18b
--- /dev/null
+++ b/app-mobilephone/gsmlib/gsmlib-1.11_pre250816.ebuild
@@ -0,0 +1,34 @@
+# Copyright 1999-2020 Gentoo Authors
+# Copyright 2020-2025 The Trinity Desktop Project
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="8"
+
+inherit autotools
+
+MY_PV="pre${PV%_pre*}-${PV#*_pre}"
+
+DESCRIPTION="Library and applications to access GSM mobile phones"
+HOMEPAGE="https://web.archive.org/web/20080714224238/http://www.pxh.de/fs/gsmlib/"
+SRC_URI="https://github.com/Fat-Zer/${PN}/archive/refs/tags/${MY_PV}.tar.gz -> ${PN}-${MY_PV}.tar.gz"
+
+S="${WORKDIR}/${PN}-${MY_PV}"
+
+LICENSE="LGPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~ppc ~ppc64 ~sparc ~x86"
+
+# Don't use Gentoo mirrors
+RESTRICT="mirror"
+
+src_prepare() {
+	default
+
+	eautoreconf
+}
+
+src_install() {
+	default
+
+	rm "${ED}/usr/$(get_libdir)/"*.la || die
+}
diff --git a/app-mobilephone/gsmlib/metadata.xml b/app-mobilephone/gsmlib/metadata.xml
index 957f1602..1d830e25 100644
--- a/app-mobilephone/gsmlib/metadata.xml
+++ b/app-mobilephone/gsmlib/metadata.xml
@@ -1,6 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
 <pkgmetadata>
-<!-- maintainer-needed -->
-<longdescription>Library and applications to access GSM mobile phones.</longdescription>
+  <maintainer type="project">
+    <email>team-gentoo@trinitydesktop.org</email>
+    <name>Trinity Gentoo ebuilds project</name>
+  </maintainer>
+  <upstream>
+    <remote-id type="github">Fat-Zer/gsmlib</remote-id>
+  </upstream>
 </pkgmetadata>
-- 
cgit v1.2.3

