GNU bug report logs - #55349
[PATCH]: Add libobjc2.

Previous Next

Package: guix-patches;

Reported by: Zhu Zihao <all_but_last <at> 163.com>

Date: Tue, 10 May 2022 12:18:01 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

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

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

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


Report forwarded to guix-patches <at> gnu.org:
bug#55349; Package guix-patches. (Tue, 10 May 2022 12:18:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Zhu Zihao <all_but_last <at> 163.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Tue, 10 May 2022 12:18:02 GMT) Full text and rfc822 format available.

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

From: Zhu Zihao <all_but_last <at> 163.com>
To: guix-patches <at> gnu.org
Subject: [PATCH]: Add libobjc2.
Date: Tue, 10 May 2022 20:15:25 +0800
[Message part 1 (text/plain, inline)]

[signature.asc (application/pgp-signature, inline)]
[0001-gnu-Use-license-prefix-for-gnu-packages-gnustep.scm.patch (text/x-patch, inline)]
From 8ecb351adf9220651d7901d88c1acc120b2572f2 Mon Sep 17 00:00:00 2001
From: Zhu Zihao <all_but_last <at> 163.com>
Date: Tue, 10 May 2022 19:57:17 +0800
Subject: [PATCH 1/3] gnu: Use license: prefix for gnu/packages/gnustep.scm.

* gnu/packages/gnustep.scm (gnustep-make)[license]: Use "license:" prefix.
(windowmaker): Ditto.
(wmbattery): Ditto.
(wmnd): Ditto.
(wmcpuload): Ditto.
(wmclock): Ditto.
(wmfire): Ditto.
---
 gnu/packages/gnustep.scm | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/gnu/packages/gnustep.scm b/gnu/packages/gnustep.scm
index eef3863949..a6c7c800a8 100644
--- a/gnu/packages/gnustep.scm
+++ b/gnu/packages/gnustep.scm
@@ -3,6 +3,7 @@
 ;;; Copyright © 2016, 2017 Kei Kebreau <kkebreau <at> posteo.net>
 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me <at> tobias.gr>
 ;;; Copyright © 2018 Ricardo Wurmus <rekado <at> elephly.net>
+;;; Copyright © 2022 Zhu Zihao <all_but_last <at> 163.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -23,7 +24,7 @@ (define-module (gnu packages gnustep)
   #:use-module (guix download)
   #:use-module (guix packages)
   #:use-module (guix build-system gnu)
-  #:use-module (guix licenses)
+  #:use-module ((guix licenses) #:prefix license:)
   #:use-module (gnu packages)
   #:use-module (gnu packages base)
   #:use-module (gnu packages xorg)
@@ -62,7 +63,7 @@ (define-public gnustep-make
 project without having to deal with the complex issues associated with
 configuration, building, installation, and packaging.  It also allows the user
 to easily create cross-compiled binaries.")
-    (license gpl3+)))
+    (license license:gpl3+)))
 
 (define-public windowmaker
   (package
@@ -153,7 +154,7 @@ (define-public windowmaker
 interface.  It is fast, feature rich, easy to configure, and easy to use.")
 
     ;; Artwork is distributed under the WTFPL.
-    (license gpl2+)))
+    (license license:gpl2+)))
 
 (define-public wmbattery
   (package
@@ -180,7 +181,7 @@ (define-public wmbattery
 This includes if it is plugged in, if the battery is charging, how many minutes
 of battery life remain, battery life remaining (with both a percentage and a
 graph), and battery status (high - green, low - yellow, or critical - red).")
-    (license gpl2)))
+    (license license:gpl2)))
 
 (define-public wmnd
   (package
@@ -204,7 +205,7 @@ (define-public wmnd
     (description
      "WMND is a dockapp for monitoring network interfaces under WindowMaker and
 other compatible window managers.")
-    (license gpl2+)))
+    (license license:gpl2+)))
 
 (define-public wmcpuload
   (package
@@ -231,7 +232,7 @@ (define-public wmcpuload
 on and off by clicking the mouse button over the application.  If the CPU usage
 hits a certain threshold, an alarm-mode will alert you by turning back-light
 on.")
-    (license gpl2+)))
+    (license license:gpl2+)))
 
 (define-public wmclock
   (package
@@ -257,7 +258,7 @@ (define-public wmclock
      "wmclock is an applet for Window Maker which displays the date and time in
 a dockable tile.  It features multiple language support, 24h or 12h time
 display, and can run a user-specified program on mouse click.")
-    (license gpl2+)))
+    (license license:gpl2+)))
 
 (define-public wmfire
   (package
@@ -286,4 +287,4 @@ (define-public wmfire
 entering the dock a burning spot replaces the cursor, and after two seconds
 symbols to represent the current monitor are \"burnt\" onscreen.  The flame
 colour can also be changed.")
-    (license gpl2+)))
+    (license license:gpl2+)))
-- 
2.36.0

[0002-gnu-Add-libobjc2.patch (text/x-patch, inline)]
From b73e30fa1a9d07c3d7f0f3ca0574b09c55622f85 Mon Sep 17 00:00:00 2001
From: Zhu Zihao <all_but_last <at> 163.com>
Date: Sun, 27 Mar 2022 01:11:15 +0800
Subject: [PATCH 2/3] gnu: Add libobjc2.

* gnu/packages/patches/libobjc2-unbundle-robin-map.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add corresponding file entry.
* gnu/packages/gnustep.scm (libobjc2): New variable.
---
 gnu/local.mk                                  |  1 +
 gnu/packages/gnustep.scm                      | 50 +++++++++++++++++++
 .../patches/libobjc2-unbundle-robin-map.patch | 47 +++++++++++++++++
 3 files changed, 98 insertions(+)
 create mode 100644 gnu/packages/patches/libobjc2-unbundle-robin-map.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 3b7db46b26..066aad89e1 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1333,6 +1333,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/kdbusaddons-kinit-file-name.patch	\
   %D%/packages/patches/libffi-3.3-powerpc-fixes.patch		\
   %D%/packages/patches/libffi-float128-powerpc64le.patch	\
+  %D%/packages/patches/libobjc2-unbundle-robin-map.patch	\
   %D%/packages/patches/librime-fix-build-with-gcc10.patch	\
   %D%/packages/patches/libvirt-add-install-prefix.patch	\
   %D%/packages/patches/libziparchive-add-includes.patch		\
diff --git a/gnu/packages/gnustep.scm b/gnu/packages/gnustep.scm
index a6c7c800a8..dd0b645395 100644
--- a/gnu/packages/gnustep.scm
+++ b/gnu/packages/gnustep.scm
@@ -22,15 +22,21 @@
 
 (define-module (gnu packages gnustep)
   #:use-module (guix download)
+  #:use-module (guix git-download)
+  #:use-module (guix gexp)
   #:use-module (guix packages)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system cmake)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (gnu packages)
   #:use-module (gnu packages base)
+  #:use-module (gnu packages datastructures)
   #:use-module (gnu packages xorg)
   #:use-module (gnu packages libffcall)
+  #:use-module (gnu packages gcc)
   #:use-module (gnu packages gnome)
   #:use-module (gnu packages gtk)
+  #:use-module (gnu packages llvm)
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages glib)
@@ -65,6 +71,50 @@ (define-public gnustep-make
 to easily create cross-compiled binaries.")
     (license license:gpl3+)))
 
+(define-public libobjc2
+  (package
+    (name "libobjc2")
+    (version "2.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/gnustep/libobjc2")
+         (commit (string-append "v" version))))
+       (sha256
+        (base32
+         "1zjryzvy06gjf36gz6zrkg9icwz6wsf80mp94x6bq1109vkl40b5"))
+       (patches
+        (search-patches "libobjc2-unbundle-robin-map.patch"))))
+    (build-system cmake-build-system)
+    (arguments
+     (list
+      ;; XXX: Cannot use GCC to compile ObjC code due to
+      ;; https://issues.guix.gnu.org/29644.
+      #:configure-flags #~(list "-DCMAKE_C_COMPILER=clang"
+                                "-DCMAKE_CXX_COMPILER=clang++")))
+    (inputs
+     (list clang
+           gcc-objc                          ;For Objective-C headers
+           robin-map))
+    (home-page "http://www.gnustep.org/")
+    (synopsis "Objective-C runtime library for Clang")
+    (description "Libobjc2 is an Objective-C runtime library designed as a
+drop-in replacment for GCC runtime. It supports following features beyond
+GCC runtime.
+
+@itemize
+@item Modern Objective-C runtime APIs.
+@item Blocks (Closures).
+@item Synthesised property accessors.
+@item Efficient support for @code{@@synchronized()}.
+@item Type-dependent dispatch.
+@item Associated reference API.
+@item Automatic Reference Counting.
+@end itemize")
+    (license license:expat)))
+
 (define-public windowmaker
   (package
     (name "windowmaker")
diff --git a/gnu/packages/patches/libobjc2-unbundle-robin-map.patch b/gnu/packages/patches/libobjc2-unbundle-robin-map.patch
new file mode 100644
index 0000000000..b828a64221
--- /dev/null
+++ b/gnu/packages/patches/libobjc2-unbundle-robin-map.patch
@@ -0,0 +1,47 @@
+From 2c5b0d5d6eba3bda4e83f489da546060fa8f3a2b Mon Sep 17 00:00:00 2001
+From: Zhu Zihao <all_but_last <at> 163.com>
+Date: Sat, 26 Mar 2022 16:54:43 +0800
+Subject: [PATCH] Unbundle robin-map.
+
+This patch makes libobjc2 use robin-map header from system instead of cloning
+from submodule.
+---
+ CMakeLists.txt | 8 --------
+ arc.mm         | 2 +-
+ 2 files changed, 1 insertion(+), 9 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index e2746e9..cf731f1 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -86,14 +86,6 @@ else ()
+ 	list(APPEND libobjc_C_SRCS eh_personality.c)
+ endif (WIN32)
+ 
+-if (NOT EXISTS "${CMAKE_SOURCE_DIR}/third_party/robin-map/include/tsl/robin_map.h")
+-	message(FATAL_ERROR "Git submodules not present, please run:\n\n"
+-						" $ git submodule init && git submodule update\n\n"
+-						"If you did not checkout via git, you will need to"
+-						"fetch the submodule's contents from"
+-						"https://github.com/Tessil/robin-map/")
+-endif ()
+-
+ # For release builds, we disable spamming the terminal with warnings about
+ # selector type mismatches
+ if (CMAKE_BUILD_TYPE STREQUAL Release)
+diff --git a/arc.mm b/arc.mm
+index c96681f..cc93e7f 100644
+--- a/arc.mm
++++ b/arc.mm
+@@ -3,7 +3,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <assert.h>
+-#include "third_party/robin-map/include/tsl/robin_map.h"
++#include <tsl/robin_map.h>
+ #import "lock.h"
+ #import "objc/runtime.h"
+ #import "objc/blocks_runtime.h"
+-- 
+2.34.0
+
-- 
2.36.0

[0003-gnu-clang-Add-OBJC_INCLUDE_PATH-to-native-search-pat.patch (text/x-patch, inline)]
From a0974ff954165732c90be02f20ac6e8701f4fb43 Mon Sep 17 00:00:00 2001
From: Zhu Zihao <all_but_last <at> 163.com>
Date: Tue, 10 May 2022 19:27:25 +0800
Subject: [PATCH 3/3] gnu: clang: Add OBJC_INCLUDE_PATH to native-search-paths.

Clang is also a compiler for Objective-C.

* gnu/packages/llvm.scm (clang-for-llvm): Add OBJC_INCLUDE_PATH to native-search-paths.
---
 gnu/packages/llvm.scm | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm
index 0fc2a8e380..619c3280fc 100644
--- a/gnu/packages/llvm.scm
+++ b/gnu/packages/llvm.scm
@@ -388,6 +388,9 @@ (define* (clang-from-llvm llvm clang-runtime
            (search-path-specification
             (variable "CPLUS_INCLUDE_PATH")
             (files '("include/c++" "include")))
+           (search-path-specification
+            (variable "OBJC_INCLUDE_PATH")
+            (files '("include")))
            (search-path-specification
             (variable "LIBRARY_PATH")
             (files '("lib" "lib64")))))
-- 
2.36.0

[Message part 6 (text/plain, inline)]
-- 
Retrieve my PGP public key:

  gpg --recv-keys D47A9C8B2AE3905B563D9135BE42B352A9F6821F

Zihao

Information forwarded to guix-patches <at> gnu.org:
bug#55349; Package guix-patches. (Tue, 10 May 2022 12:36:01 GMT) Full text and rfc822 format available.

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

From: Zhu Zihao <all_but_last <at> 163.com>
To: 55349 <at> debbugs.gnu.org
Subject: Re: bug#55349: Acknowledgement ([PATCH]: Add libobjc2.)
Date: Tue, 10 May 2022 20:34:50 +0800
[Message part 1 (text/plain, inline)]
Remove unneeded input gcc-objc.

[signature.asc (application/pgp-signature, inline)]
[0001-gnu-Use-license-prefix-for-gnu-packages-gnustep.scm.patch (text/x-patch, inline)]
From 8ecb351adf9220651d7901d88c1acc120b2572f2 Mon Sep 17 00:00:00 2001
From: Zhu Zihao <all_but_last <at> 163.com>
Date: Tue, 10 May 2022 19:57:17 +0800
Subject: [PATCH 1/3] gnu: Use license: prefix for gnu/packages/gnustep.scm.

* gnu/packages/gnustep.scm (gnustep-make)[license]: Use "license:" prefix.
(windowmaker): Ditto.
(wmbattery): Ditto.
(wmnd): Ditto.
(wmcpuload): Ditto.
(wmclock): Ditto.
(wmfire): Ditto.
---
 gnu/packages/gnustep.scm | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/gnu/packages/gnustep.scm b/gnu/packages/gnustep.scm
index eef3863949..a6c7c800a8 100644
--- a/gnu/packages/gnustep.scm
+++ b/gnu/packages/gnustep.scm
@@ -3,6 +3,7 @@
 ;;; Copyright © 2016, 2017 Kei Kebreau <kkebreau <at> posteo.net>
 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me <at> tobias.gr>
 ;;; Copyright © 2018 Ricardo Wurmus <rekado <at> elephly.net>
+;;; Copyright © 2022 Zhu Zihao <all_but_last <at> 163.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -23,7 +24,7 @@ (define-module (gnu packages gnustep)
   #:use-module (guix download)
   #:use-module (guix packages)
   #:use-module (guix build-system gnu)
-  #:use-module (guix licenses)
+  #:use-module ((guix licenses) #:prefix license:)
   #:use-module (gnu packages)
   #:use-module (gnu packages base)
   #:use-module (gnu packages xorg)
@@ -62,7 +63,7 @@ (define-public gnustep-make
 project without having to deal with the complex issues associated with
 configuration, building, installation, and packaging.  It also allows the user
 to easily create cross-compiled binaries.")
-    (license gpl3+)))
+    (license license:gpl3+)))
 
 (define-public windowmaker
   (package
@@ -153,7 +154,7 @@ (define-public windowmaker
 interface.  It is fast, feature rich, easy to configure, and easy to use.")
 
     ;; Artwork is distributed under the WTFPL.
-    (license gpl2+)))
+    (license license:gpl2+)))
 
 (define-public wmbattery
   (package
@@ -180,7 +181,7 @@ (define-public wmbattery
 This includes if it is plugged in, if the battery is charging, how many minutes
 of battery life remain, battery life remaining (with both a percentage and a
 graph), and battery status (high - green, low - yellow, or critical - red).")
-    (license gpl2)))
+    (license license:gpl2)))
 
 (define-public wmnd
   (package
@@ -204,7 +205,7 @@ (define-public wmnd
     (description
      "WMND is a dockapp for monitoring network interfaces under WindowMaker and
 other compatible window managers.")
-    (license gpl2+)))
+    (license license:gpl2+)))
 
 (define-public wmcpuload
   (package
@@ -231,7 +232,7 @@ (define-public wmcpuload
 on and off by clicking the mouse button over the application.  If the CPU usage
 hits a certain threshold, an alarm-mode will alert you by turning back-light
 on.")
-    (license gpl2+)))
+    (license license:gpl2+)))
 
 (define-public wmclock
   (package
@@ -257,7 +258,7 @@ (define-public wmclock
      "wmclock is an applet for Window Maker which displays the date and time in
 a dockable tile.  It features multiple language support, 24h or 12h time
 display, and can run a user-specified program on mouse click.")
-    (license gpl2+)))
+    (license license:gpl2+)))
 
 (define-public wmfire
   (package
@@ -286,4 +287,4 @@ (define-public wmfire
 entering the dock a burning spot replaces the cursor, and after two seconds
 symbols to represent the current monitor are \"burnt\" onscreen.  The flame
 colour can also be changed.")
-    (license gpl2+)))
+    (license license:gpl2+)))
-- 
2.36.0

[0002-gnu-clang-Add-OBJC_INCLUDE_PATH-to-native-search-pat.patch (text/x-patch, inline)]
From f8e8dccc92813ded4e3464593427c6cae095e490 Mon Sep 17 00:00:00 2001
From: Zhu Zihao <all_but_last <at> 163.com>
Date: Tue, 10 May 2022 19:27:25 +0800
Subject: [PATCH 2/3] gnu: clang: Add OBJC_INCLUDE_PATH to native-search-paths.

Clang is also a compiler for Objective-C.

* gnu/packages/llvm.scm (clang-for-llvm): Add OBJC_INCLUDE_PATH to native-search-paths.
---
 gnu/packages/llvm.scm | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm
index 0fc2a8e380..619c3280fc 100644
--- a/gnu/packages/llvm.scm
+++ b/gnu/packages/llvm.scm
@@ -388,6 +388,9 @@ (define* (clang-from-llvm llvm clang-runtime
            (search-path-specification
             (variable "CPLUS_INCLUDE_PATH")
             (files '("include/c++" "include")))
+           (search-path-specification
+            (variable "OBJC_INCLUDE_PATH")
+            (files '("include")))
            (search-path-specification
             (variable "LIBRARY_PATH")
             (files '("lib" "lib64")))))
-- 
2.36.0

[0003-gnu-Add-libobjc2.patch (text/x-patch, inline)]
From 6c828759cc66da8a1c7ecfed77abe7cd41aee055 Mon Sep 17 00:00:00 2001
From: Zhu Zihao <all_but_last <at> 163.com>
Date: Sun, 27 Mar 2022 01:11:15 +0800
Subject: [PATCH 3/3] gnu: Add libobjc2.

* gnu/packages/patches/libobjc2-unbundle-robin-map.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add corresponding file entry.
* gnu/packages/gnustep.scm (libobjc2): New variable.
---
 gnu/local.mk                                  |  1 +
 gnu/packages/gnustep.scm                      | 48 +++++++++++++++++++
 .../patches/libobjc2-unbundle-robin-map.patch | 47 ++++++++++++++++++
 3 files changed, 96 insertions(+)
 create mode 100644 gnu/packages/patches/libobjc2-unbundle-robin-map.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 3b7db46b26..066aad89e1 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1333,6 +1333,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/kdbusaddons-kinit-file-name.patch	\
   %D%/packages/patches/libffi-3.3-powerpc-fixes.patch		\
   %D%/packages/patches/libffi-float128-powerpc64le.patch	\
+  %D%/packages/patches/libobjc2-unbundle-robin-map.patch	\
   %D%/packages/patches/librime-fix-build-with-gcc10.patch	\
   %D%/packages/patches/libvirt-add-install-prefix.patch	\
   %D%/packages/patches/libziparchive-add-includes.patch		\
diff --git a/gnu/packages/gnustep.scm b/gnu/packages/gnustep.scm
index a6c7c800a8..0fde3c0ebe 100644
--- a/gnu/packages/gnustep.scm
+++ b/gnu/packages/gnustep.scm
@@ -22,15 +22,21 @@
 
 (define-module (gnu packages gnustep)
   #:use-module (guix download)
+  #:use-module (guix git-download)
+  #:use-module (guix gexp)
   #:use-module (guix packages)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system cmake)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (gnu packages)
   #:use-module (gnu packages base)
+  #:use-module (gnu packages datastructures)
   #:use-module (gnu packages xorg)
   #:use-module (gnu packages libffcall)
+  #:use-module (gnu packages gcc)
   #:use-module (gnu packages gnome)
   #:use-module (gnu packages gtk)
+  #:use-module (gnu packages llvm)
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages glib)
@@ -65,6 +71,48 @@ (define-public gnustep-make
 to easily create cross-compiled binaries.")
     (license license:gpl3+)))
 
+(define-public libobjc2
+  (package
+    (name "libobjc2")
+    (version "2.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/gnustep/libobjc2")
+         (commit (string-append "v" version))))
+       (sha256
+        (base32
+         "1zjryzvy06gjf36gz6zrkg9icwz6wsf80mp94x6bq1109vkl40b5"))
+       (patches
+        (search-patches "libobjc2-unbundle-robin-map.patch"))))
+    (build-system cmake-build-system)
+    (arguments
+     (list
+      ;; XXX: Cannot use GCC to compile ObjC code due to
+      ;; https://issues.guix.gnu.org/29644.
+      #:configure-flags #~(list "-DCMAKE_C_COMPILER=clang"
+                                "-DCMAKE_CXX_COMPILER=clang++")))
+    (inputs
+     (list clang robin-map))
+    (home-page "http://www.gnustep.org/")
+    (synopsis "Objective-C runtime library for Clang")
+    (description "Libobjc2 is an Objective-C runtime library designed as a
+drop-in replacment for GCC runtime. It supports following features beyond
+GCC runtime.
+
+@itemize
+@item Modern Objective-C runtime APIs.
+@item Blocks (Closures).
+@item Synthesised property accessors.
+@item Efficient support for @code{@@synchronized()}.
+@item Type-dependent dispatch.
+@item Associated reference API.
+@item Automatic Reference Counting.
+@end itemize")
+    (license license:expat)))
+
 (define-public windowmaker
   (package
     (name "windowmaker")
diff --git a/gnu/packages/patches/libobjc2-unbundle-robin-map.patch b/gnu/packages/patches/libobjc2-unbundle-robin-map.patch
new file mode 100644
index 0000000000..b828a64221
--- /dev/null
+++ b/gnu/packages/patches/libobjc2-unbundle-robin-map.patch
@@ -0,0 +1,47 @@
+From 2c5b0d5d6eba3bda4e83f489da546060fa8f3a2b Mon Sep 17 00:00:00 2001
+From: Zhu Zihao <all_but_last <at> 163.com>
+Date: Sat, 26 Mar 2022 16:54:43 +0800
+Subject: [PATCH] Unbundle robin-map.
+
+This patch makes libobjc2 use robin-map header from system instead of cloning
+from submodule.
+---
+ CMakeLists.txt | 8 --------
+ arc.mm         | 2 +-
+ 2 files changed, 1 insertion(+), 9 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index e2746e9..cf731f1 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -86,14 +86,6 @@ else ()
+ 	list(APPEND libobjc_C_SRCS eh_personality.c)
+ endif (WIN32)
+ 
+-if (NOT EXISTS "${CMAKE_SOURCE_DIR}/third_party/robin-map/include/tsl/robin_map.h")
+-	message(FATAL_ERROR "Git submodules not present, please run:\n\n"
+-						" $ git submodule init && git submodule update\n\n"
+-						"If you did not checkout via git, you will need to"
+-						"fetch the submodule's contents from"
+-						"https://github.com/Tessil/robin-map/")
+-endif ()
+-
+ # For release builds, we disable spamming the terminal with warnings about
+ # selector type mismatches
+ if (CMAKE_BUILD_TYPE STREQUAL Release)
+diff --git a/arc.mm b/arc.mm
+index c96681f..cc93e7f 100644
+--- a/arc.mm
++++ b/arc.mm
+@@ -3,7 +3,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <assert.h>
+-#include "third_party/robin-map/include/tsl/robin_map.h"
++#include <tsl/robin_map.h>
+ #import "lock.h"
+ #import "objc/runtime.h"
+ #import "objc/blocks_runtime.h"
+-- 
+2.34.0
+
-- 
2.36.0

[Message part 6 (text/plain, inline)]
-- 
Retrieve my PGP public key:

  gpg --recv-keys D47A9C8B2AE3905B563D9135BE42B352A9F6821F

Zihao

Information forwarded to guix-patches <at> gnu.org:
bug#55349; Package guix-patches. (Thu, 19 May 2022 15:56:01 GMT) Full text and rfc822 format available.

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

From: Zhu Zihao <all_but_last <at> 163.com>
To: 55349 <at> debbugs.gnu.org
Subject: Re: bug#55349: Acknowledgement ([PATCH]: Add libobjc2.)
Date: Thu, 19 May 2022 23:55:07 +0800
[Message part 1 (text/plain, inline)]
ping.

-- 
Retrieve my PGP public key:

  gpg --recv-keys D47A9C8B2AE3905B563D9135BE42B352A9F6821F

Zihao
[signature.asc (application/pgp-signature, inline)]

Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Fri, 20 May 2022 18:28:01 GMT) Full text and rfc822 format available.

Notification sent to Zhu Zihao <all_but_last <at> 163.com>:
bug acknowledged by developer. (Fri, 20 May 2022 18:28:01 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: Zhu Zihao <all_but_last <at> 163.com>
Cc: 55349-done <at> debbugs.gnu.org
Subject: Re: bug#55349: [PATCH]: Add libobjc2.
Date: Fri, 20 May 2022 20:27:18 +0200
[Message part 1 (text/plain, inline)]
Hi,

Zhu Zihao <all_but_last <at> 163.com> skribis:

>>From 8ecb351adf9220651d7901d88c1acc120b2572f2 Mon Sep 17 00:00:00 2001
> From: Zhu Zihao <all_but_last <at> 163.com>
> Date: Tue, 10 May 2022 19:57:17 +0800
> Subject: [PATCH 1/3] gnu: Use license: prefix for gnu/packages/gnustep.scm.
>
> * gnu/packages/gnustep.scm (gnustep-make)[license]: Use "license:" prefix.
> (windowmaker): Ditto.
> (wmbattery): Ditto.
> (wmnd): Ditto.
> (wmcpuload): Ditto.
> (wmclock): Ditto.
> (wmfire): Ditto.

[...]

>>From f8e8dccc92813ded4e3464593427c6cae095e490 Mon Sep 17 00:00:00 2001
> From: Zhu Zihao <all_but_last <at> 163.com>
> Date: Tue, 10 May 2022 19:27:25 +0800
> Subject: [PATCH 2/3] gnu: clang: Add OBJC_INCLUDE_PATH to native-search-paths.
>
> Clang is also a compiler for Objective-C.
>
> * gnu/packages/llvm.scm (clang-for-llvm): Add OBJC_INCLUDE_PATH to native-search-paths.

[...]

>>From 6c828759cc66da8a1c7ecfed77abe7cd41aee055 Mon Sep 17 00:00:00 2001
> From: Zhu Zihao <all_but_last <at> 163.com>
> Date: Sun, 27 Mar 2022 01:11:15 +0800
> Subject: [PATCH 3/3] gnu: Add libobjc2.
>
> * gnu/packages/patches/libobjc2-unbundle-robin-map.patch: New file.
> * gnu/local.mk (dist_patch_DATA): Add corresponding file entry.
> * gnu/packages/gnustep.scm (libobjc2): New variable.

Applied, with the cosmetic changes below to placate ‘guix lint’.

Thanks,
Ludo’.

[Message part 2 (text/x-patch, inline)]
diff --git a/gnu/packages/gnustep.scm b/gnu/packages/gnustep.scm
index 0fde3c0ebe..0314983559 100644
--- a/gnu/packages/gnustep.scm
+++ b/gnu/packages/gnustep.scm
@@ -75,18 +75,17 @@ (define-public libobjc2
   (package
     (name "libobjc2")
     (version "2.1")
-    (source
-     (origin
-       (method git-fetch)
-       (uri
-        (git-reference
-         (url "https://github.com/gnustep/libobjc2")
-         (commit (string-append "v" version))))
-       (sha256
-        (base32
-         "1zjryzvy06gjf36gz6zrkg9icwz6wsf80mp94x6bq1109vkl40b5"))
-       (patches
-        (search-patches "libobjc2-unbundle-robin-map.patch"))))
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/gnustep/libobjc2")
+                    (commit (string-append "v" version))))
+              (sha256
+               (base32
+                "1zjryzvy06gjf36gz6zrkg9icwz6wsf80mp94x6bq1109vkl40b5"))
+              (file-name (git-file-name name version))
+              (patches
+               (search-patches "libobjc2-unbundle-robin-map.patch"))))
     (build-system cmake-build-system)
     (arguments
      (list
@@ -99,7 +98,7 @@ (define-public libobjc2
     (home-page "http://www.gnustep.org/")
     (synopsis "Objective-C runtime library for Clang")
     (description "Libobjc2 is an Objective-C runtime library designed as a
-drop-in replacment for GCC runtime. It supports following features beyond
+drop-in replacment for GCC runtime.  It supports following features beyond
 GCC runtime.
 
 @itemize

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 18 Jun 2022 11:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 312 days ago.

Previous Next


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