emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: phodina via "General discussions about Org-mode." <emacs-orgmode@gnu.org>
To: "51043@debbugs.gnu.org" <51043@debbugs.gnu.org>
Cc: Tobias Geerinckx-Rice <me@tobias.gr>
Subject: bug#51043: Fix build of rkdeveloptool
Date: Mon, 21 Feb 2022 12:43:09 +0000	[thread overview]
Message-ID: <UbNDhFyAp_6UmSgTIicxl617-LOqZ-hj1TQSPO8a4XbarG2T8MqZwrEguOHeQ-YanQ30pDM_zxd90BpOzMgg8anTh-P-VqSwpRX2DG1HEUM=@protonmail.com> (raw)
In-Reply-To: <XeraZiDxiWFLBwhjjMyyRnlkdqQk9as-9yGJPUEv9M5OK7w8tlrKEm8ha6_Xcp7t1tJVQ7zhKefOUs93DhWkeJe6AMcFRMTenb95sK1cjMw=@protonmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 189 bytes --]

Hi,

Here's fix of the rkdeveloptool package which fails to build due to GCC complaining about the truncation error.

See https://github.com/rockchip-linux/rkdeveloptool/pull/62.

----
Petr

[-- Attachment #1.2: Type: text/html, Size: 748 bytes --]

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-rkdeveloptool-Fix-build.patch --]
[-- Type: text/x-patch; name=0001-gnu-rkdeveloptool-Fix-build.patch, Size: 4161 bytes --]

From 50e6bbcf7f648a7793ecf6b1ddd9a4148fc776b8 Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Mon, 21 Feb 2022 13:25:16 +0100
Subject: [PATCH 1/2] gnu: rkdeveloptool: Fix build.

* gnu/packages/hardware.scm (rkdeveloptool): Update to newer commit 46bb4c.
  [source]: Apply patch to fix GCC format truncation error.
  [arguments]: Add phase after install to install udev rules.
* gnu/local.mk: Add patch.
* gnu/packages/patches/rkdeveloptool-fix-format-truncation.patch: New file.

diff --git a/gnu/local.mk b/gnu/local.mk
index dcee1611b2..3e84188937 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1754,6 +1754,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/remake-impure-dirs.patch			\
   %D%/packages/patches/restic-0.9.6-fix-tests-for-go1.15.patch	\
   %D%/packages/patches/retroarch-LIBRETRO_DIRECTORY.patch	\
+  %D%/packages/patches/rkdeveloptool-fix-format-truncation.patch \
   %D%/packages/patches/rnp-add-version.cmake.patch		\
   %D%/packages/patches/rnp-disable-ruby-rnp-tests.patch		\
   %D%/packages/patches/rnp-unbundle-googletest.patch		\
diff --git a/gnu/packages/hardware.scm b/gnu/packages/hardware.scm
index a3ce90f75e..e4aceab54b 100644
--- a/gnu/packages/hardware.scm
+++ b/gnu/packages/hardware.scm
@@ -770,29 +770,40 @@ (define-public wavemon
     (license license:gpl3+)))
 
 (define-public rkdeveloptool
-  (let ((commit "6e92ebcf8b1812da02663494a68972f956e490d3")
-        (revision "0"))
+  (let ((commit "46bb4c073624226c3f05b37b9ecc50bbcf543f5a")
+        (revision "1"))
     (package
       (name "rkdeveloptool")
-      (version (git-version "1.3" revision commit))
+      (version (git-version "1.32" revision commit))
       (source
        (origin
          (method git-fetch)
          (uri (git-reference
                (url "https://github.com/rockchip-linux/rkdeveloptool")
                (commit commit)))
+         ;; https://github.com/rockchip-linux/rkdeveloptool/pull/62
+         (patches (search-patches "rkdeveloptool-fix-format-truncation.patch"))
          (file-name (git-file-name name version))
          (sha256
-          (base32 "0zwrkqfxd671iy69v3q0844gfdpm1yk51i9qh2rqc969bd8glxga"))))
+          (base32 "0kb2ylsrqqrdf4np66yxmk96kdc5g8nvjx13gifpm5rshv5770bq"))))
       (build-system gnu-build-system)
+	  (arguments
+	  `(#:phases
+	   (modify-phases %standard-phases
+	    (add-after 'install 'install-udev-rules
+		 (lambda* (#:key outputs #:allow-other-keys)
+		  (let ((udev (string-append (assoc-ref outputs "out")
+		  "/lib/udev/rules.d")))
+		  (mkdir-p udev)
+		  (install-file "99-rk-rockusb.rules" udev)))))))
       (native-inputs
        (list autoconf automake pkg-config))
       (inputs
        (list libusb))
       (home-page "https://github.com/rockchip-linux/rkdeveloptool")
-      (synopsis "Read from and write to RockChicp devices over USB")
+      (synopsis "Read/write to rockchip devices over USB")
       (description
-       "Rkdeveloptool can read from and write to RockChip devices over USB, such
+       "Rkdeveloptool can read from and write to rockchip devices over USB, such
 as the Pinebook Pro.")
       (license license:gpl2+))))
 
diff --git a/gnu/packages/patches/rkdeveloptool-fix-format-truncation.patch b/gnu/packages/patches/rkdeveloptool-fix-format-truncation.patch
new file mode 100644
index 0000000000..fd9a193e76
--- /dev/null
+++ b/gnu/packages/patches/rkdeveloptool-fix-format-truncation.patch
@@ -0,0 +1,22 @@
+From bc9e5f03d71b3dd4360721f4df3524c1dcba9bc8 Mon Sep 17 00:00:00 2001
+From: Petr Hodina <phodina@protonmail.com>
+Date: Mon, 21 Feb 2022 13:00:53 +0100
+Subject: [PATCH] Fix format truncation for GCC >7.1.
+
+
+diff --git a/main.cpp b/main.cpp
+index 72bd94b..800db0b 100644
+--- a/main.cpp
++++ b/main.cpp
+@@ -1490,7 +1490,7 @@ static bool saveEntry(FILE* outFile, char* path, rk_entry_type type,
+ static inline uint32_t convertChipType(const char* chip) {
+ 	char buffer[5];
+ 	memset(buffer, 0, sizeof(buffer));
+-	snprintf(buffer, sizeof(buffer), "%s", chip);
++	memcpy(buffer, chip, 4);
+ 	return buffer[0] << 24 | buffer[1] << 16 | buffer[2] << 8 | buffer[3];
+ }
+ 
+-- 
+2.34.0
+
-- 
2.34.0


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0002-gnu-Add-rkdeveloptool-pine64.patch --]
[-- Type: text/x-patch; name=0002-gnu-Add-rkdeveloptool-pine64.patch, Size: 2051 bytes --]

From 1ed30235dbaae9f95c34826051eb88f9d6def032 Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Mon, 21 Feb 2022 13:33:41 +0100
Subject: [PATCH 2/2] gnu: Add rkdeveloptool-pine64.

* gnu/packages/hardware.scm (rkdeveloptool-pine64): New variable.

diff --git a/gnu/packages/hardware.scm b/gnu/packages/hardware.scm
index e4aceab54b..ceb63081b2 100644
--- a/gnu/packages/hardware.scm
+++ b/gnu/packages/hardware.scm
@@ -807,6 +807,41 @@ (define-public rkdeveloptool
 as the Pinebook Pro.")
       (license license:gpl2+))))
 
+(define-public rkdeveloptool-pine64
+  (package
+    (name "rkdeveloptool-pine64")
+    (version "1.1.0")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url
+                     "https://gitlab.com/pine64-org/quartz-bsp/rkdeveloptool")
+                    (commit version)))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "0nh9592mllygycnxbw91vg58wwais7w3w62rl9gcvc4m3i909b1z"))))
+    (build-system meson-build-system)
+    (arguments
+     `(#:tests? #f ;no test suite
+       #:phases
+       (modify-phases %standard-phases
+         ;; attempts to place the file into the udev pkg read-only path
+         (add-after 'unpack 'fix-udev-path
+           (lambda* _
+             (substitute* "meson.build"
+               (("udev_rules_dir,") (string-append "'" %output
+                                                   "/lib/udev/rules.d',"))))))))
+    (native-inputs (list pkg-config))
+    (inputs (list eudev libusb))
+    (synopsis "Read from and write to RockChicp devices over USB")
+    (description
+     "Rkdeveloptool is a fastboot-like CLI tool to read from and
+write to RockChip devices over USB.  Supports PineNote and Quartz64 as well
+as other Pine64 RK devices.")
+    (home-page "https://gitlab.com/pine64-org/quartz-bsp/rkdeveloptool")
+    (license license:gpl2+)))
+
 (define-public libqb
   (package
     (name "libqb")
-- 
2.34.0


           reply	other threads:[~2022-02-21 14:41 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <XeraZiDxiWFLBwhjjMyyRnlkdqQk9as-9yGJPUEv9M5OK7w8tlrKEm8ha6_Xcp7t1tJVQ7zhKefOUs93DhWkeJe6AMcFRMTenb95sK1cjMw=@protonmail.com>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='UbNDhFyAp_6UmSgTIicxl617-LOqZ-hj1TQSPO8a4XbarG2T8MqZwrEguOHeQ-YanQ30pDM_zxd90BpOzMgg8anTh-P-VqSwpRX2DG1HEUM=@protonmail.com' \
    --to=emacs-orgmode@gnu.org \
    --cc=51043@debbugs.gnu.org \
    --cc=me@tobias.gr \
    --cc=phodina@protonmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).