all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#35147] [PATCH 1/2] gnu: Add apsl2.0.
@ 2019-04-04 16:48 Pierre Neidhardt
  2019-04-04 16:49 ` [bug#35147] [PATCH 2/2] gnu: Add hfsprogs Pierre Neidhardt
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Pierre Neidhardt @ 2019-04-04 16:48 UTC (permalink / raw)
  To: 35147

* guix/licenses.scm (apsl2.0): New variable.
---
 guix/licenses.scm | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/guix/licenses.scm b/guix/licenses.scm
index 676e71acdb..623ec69898 100644
--- a/guix/licenses.scm
+++ b/guix/licenses.scm
@@ -34,6 +34,7 @@
   #:use-module (srfi srfi-9)
   #:export (license? license-name license-uri license-comment
             agpl1 agpl3 agpl3+
+            apsl2.0
             asl1.1 asl2.0
             boost1.0
             bsd-2 bsd-3 bsd-4
@@ -129,6 +130,11 @@
            "https://gnu.org/licenses/agpl.html"
            "https://gnu.org/licenses/why-affero-gpl.html"))
 
+(define apsl2.0
+  (license "APSL 2.0"
+           "https://opensource.apple.com/apsl/"
+           "Apple Public Source License 2.0"))
+
 (define asl1.1
   (license "ASL 1.1"
            "http://directory.fsf.org/wiki/License:Apache1.1"
-- 
2.21.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [bug#35147] [PATCH 2/2] gnu: Add hfsprogs.
  2019-04-04 16:48 [bug#35147] [PATCH 1/2] gnu: Add apsl2.0 Pierre Neidhardt
@ 2019-04-04 16:49 ` Pierre Neidhardt
  2022-06-23  9:23   ` bug#35147: [PATCH 1/2] gnu: Add apsl2.0 zimoun
       [not found] ` <handler.35147.B.155439651118672.ack@debbugs.gnu.org>
  2022-06-23  9:22 ` zimoun
  2 siblings, 1 reply; 7+ messages in thread
From: Pierre Neidhardt @ 2019-04-04 16:49 UTC (permalink / raw)
  To: 35147

* gnu/packages/linux.scm (hfsprogs): New variable.
---
 gnu/packages/linux.scm                        |  54 +++++++
 .../patches/hfsplus-tools-no-blocks.patch     | 147 ++++++++++++++++++
 2 files changed, 201 insertions(+)
 create mode 100644 gnu/packages/patches/hfsplus-tools-no-blocks.patch

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 06bf8095be..dcc9e946a2 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -80,8 +80,10 @@
   #:use-module (gnu packages gnuzilla)
   #:use-module (gnu packages gperf)
   #:use-module (gnu packages gtk)
+  #:use-module (gnu packages libbsd)
   #:use-module (gnu packages libunwind)
   #:use-module (gnu packages libusb)
+  #:use-module (gnu packages llvm)
   #:use-module (gnu packages man)
   #:use-module (gnu packages maths)
   #:use-module (gnu packages multiprecision)
@@ -5329,3 +5331,55 @@ have to construct the archives directly, without using the archiver.")
     (description "inputattach dispatches input events from several device
 types and interfaces and translates so that the X server can use them.")
     (license license:gpl2+)))
+
+(define-public hfsprogs
+  (package
+    (name "hfsprogs")
+    (version "540.1")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+                    ;; The tarball from
+                    ;; https://opensource.apple.com/tarballs/diskdev_cmds/
+                    ;; does not contain any Makefile.
+                    "http://cavan.codon.org.uk/~mjg59/diskdev_cmds/diskdev_cmds-"
+                    version ".linux3.tar.gz"))
+              (sha256
+               (base32
+                "15sl9z1dafykj3b249z6a82p74ljqpgkvh97l0vbz8zrjwx206xh"))
+              ;; The patch cleans up the Makefile so we don't need clang, among others.
+              (patches (search-patches "hfsplus-tools-no-blocks.patch"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f                      ; No tests.
+       #:phases
+       (modify-phases %standard-phases
+         (delete 'configure)
+         (replace 'build
+           (lambda _
+             ;; FIXME: Weirdly enough, PWD points to the parent directory when
+             ;; expanded in the CFLAGS, which leads the build to fail with
+             ;; "missing.h" not found.
+             (invoke "make" "CC=gcc"
+                     (string-append "PWD=" (getcwd)))))
+         (replace 'install
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (bin (string-append out "/bin/"))
+                    (doc (string-append out "/share/man/man8")))
+               (mkdir-p bin)
+               (copy-file "newfs_hfs.tproj/newfs_hfs" (string-append bin "/mkfs.hfsplus"))
+               (copy-file "fsck_hfs.tproj/fsck_hfs" (string-append bin "/fsck.hfsplus"))
+               (mkdir-p doc)
+               (copy-file "newfs_hfs.tproj/newfs_hfs.8" (string-append doc "/mkfs.hfsplus.8"))
+               (copy-file "fsck_hfs.tproj/fsck_hfs.8" (string-append doc "/fsck.hfsplus.8"))))))))
+    (inputs
+     `(("openssl" ,openssl)))
+    (native-inputs
+     `(("libbsd" ,libbsd)
+       ("util-linux" ,util-linux)))
+    (home-page "https://opensource.apple.com/")
+    (synopsis "HFS/HFS+ file system tools")
+    (description "This package provides user space tools to create and check
+Apple HFS/HFS+ filesystems.")
+    (license license:apsl2.0)))
diff --git a/gnu/packages/patches/hfsplus-tools-no-blocks.patch b/gnu/packages/patches/hfsplus-tools-no-blocks.patch
new file mode 100644
index 0000000000..2017055744
--- /dev/null
+++ b/gnu/packages/patches/hfsplus-tools-no-blocks.patch
@@ -0,0 +1,147 @@
+diff -up diskdev_cmds-540.1.linux3/fsck_hfs.tproj/dfalib/SControl.c.jx diskdev_cmds-540.1.linux3/fsck_hfs.tproj/dfalib/SControl.c
+--- diskdev_cmds-540.1.linux3/fsck_hfs.tproj/dfalib/SControl.c.jx	2012-02-02 17:16:56.000000000 -0500
++++ diskdev_cmds-540.1.linux3/fsck_hfs.tproj/dfalib/SControl.c	2014-06-18 13:01:42.716781467 -0400
+@@ -200,6 +200,22 @@ isMinorError(int msg, int *counts)
+ 	}
+ }
+ 
++static int *msgCounts = NULL;
++static jmp_buf envBuf;
++
++static fsck_block_status_t
++fsckAfterCallback(fsck_ctx_t c, int msgNum, va_list args)
++{
++	if (abs(msgNum) > E_FirstError && abs(msgNum) < E_LastError) {
++		if (isMinorError(abs(msgNum), msgCounts) == 1)
++			return fsckBlockContinue;
++		longjmp(envBuf, 1);
++		return fsckBlockAbort;
++	} else {
++		return fsckBlockContinue;
++	}
++}
++
+ /*------------------------------------------------------------------------------
+ 
+ External
+@@ -207,7 +223,6 @@ External
+ 
+ ------------------------------------------------------------------------------*/
+ 
+-static jmp_buf				envBuf;
+ int
+ CheckHFS( const char *rdevnode, int fsReadRef, int fsWriteRef, int checkLevel, 
+ 	  int repairLevel, fsck_ctx_t fsckContext, int lostAndFoundMode, 
+@@ -222,7 +237,6 @@ CheckHFS( const char *rdevnode, int fsRe
+ 	int					isJournaled = 0;
+ 	Boolean 			autoRepair;
+ 	Boolean				exitEarly = 0;
+-	__block int *msgCounts = NULL;
+ 	Boolean				majorErrors = 0;
+ 
+ 	if (checkLevel == kMajorCheck) {
+@@ -292,16 +306,7 @@ CheckHFS( const char *rdevnode, int fsRe
+ 			 * the message in question corresponds to a major or a minor error.  If it's
+ 			 * major, we longjmp just above, which causes us to exit out early.
+ 			 */
+-			fsckSetBlock(fsckContext, fsckPhaseAfterMessage, (fsckBlock_t) ^(fsck_ctx_t c, int msgNum, va_list args) {
+-				if (abs(msgNum) > E_FirstError && abs(msgNum) < E_LastError) {
+-					if (isMinorError(abs(msgNum), msgCounts) == 1)
+-						return fsckBlockContinue;
+-					longjmp(envBuf, 1);
+-					return fsckBlockAbort;
+-				} else {
+-					return fsckBlockContinue;
+-				}
+-			});
++			fsckSetBlock(fsckContext, fsckPhaseAfterMessage, fsckAfterCallback);
+ 		}
+ 	}
+ DoAgain:
+diff -up diskdev_cmds-540.1.linux3/fsck_hfs.tproj/fsck_messages.c.jx diskdev_cmds-540.1.linux3/fsck_hfs.tproj/fsck_messages.c
+--- diskdev_cmds-540.1.linux3/fsck_hfs.tproj/fsck_messages.c.jx	2012-02-02 17:42:58.000000000 -0500
++++ diskdev_cmds-540.1.linux3/fsck_hfs.tproj/fsck_messages.c	2014-06-18 12:57:01.110952333 -0400
+@@ -29,7 +29,6 @@
+ #include <stdarg.h>
+ #include <string.h>
+ #include <assert.h>
+-#include <Block.h>
+ 
+ #include "fsck_messages.h"
+ #include "fsck_keys.h"
+@@ -287,20 +286,10 @@ fsckSetBlock(fsck_ctx_t c, fsck_block_ph
+ 	if (c != NULL) {
+ 		switch (phase) {
+ 		case fsckPhaseBeforeMessage:
+-			if (ctx->preMessage) {
+-				Block_release(ctx->preMessage);
+-				ctx->preMessage = NULL;
+-			}
+-			if (bp)
+-				ctx->preMessage = (fsckBlock_t)Block_copy(bp);
++			ctx->preMessage = bp;
+ 			break;
+ 		case fsckPhaseAfterMessage:
+-			if (ctx->postMessage) {
+-				Block_release(ctx->postMessage);
+-				ctx->postMessage = NULL;
+-			}
+-			if (bp)
+-				ctx->postMessage = (fsckBlock_t)Block_copy(bp);
++			ctx->postMessage = bp;
+ 			break;
+ 		case fsckPhaseNone:
+ 			/* Just here for compiler warnings */
+@@ -591,12 +580,6 @@ fsckDestroy(fsck_ctx_t c)
+ 	if (ctx->flags & cfFromFD) {
+ 		fclose(ctx->fp);
+ 	}
+-	if (ctx->preMessage) {
+-		Block_release(ctx->preMessage);
+-	}
+-	if (ctx->postMessage) {
+-		Block_release(ctx->postMessage);
+-	}
+ 
+ 	free(ctx);
+ 	return;
+diff -up diskdev_cmds-540.1.linux3/fsck_hfs.tproj/fsck_messages.h.jx diskdev_cmds-540.1.linux3/fsck_hfs.tproj/fsck_messages.h
+--- diskdev_cmds-540.1.linux3/fsck_hfs.tproj/fsck_messages.h.jx	2012-02-02 17:54:40.000000000 -0500
++++ diskdev_cmds-540.1.linux3/fsck_hfs.tproj/fsck_messages.h	2014-06-18 12:31:48.602094998 -0400
+@@ -139,7 +139,7 @@ typedef enum fsck_block_phase_type fsck_
+  * the third is a va_list of the arguments for the message.
+  */
+ 
+-typedef fsck_block_status_t (^fsckBlock_t)(fsck_ctx_t, int, va_list);
++typedef fsck_block_status_t (*fsckBlock_t)(fsck_ctx_t, int, va_list);
+ 
+ extern fsckBlock_t fsckGetBlock(fsck_ctx_t, fsck_block_phase_t);
+ extern void fsckSetBlock(fsck_ctx_t, fsck_block_phase_t, fsckBlock_t);
+diff -up diskdev_cmds-540.1.linux3/fsck_hfs.tproj/Makefile.lnx.jx diskdev_cmds-540.1.linux3/fsck_hfs.tproj/Makefile.lnx
+--- diskdev_cmds-540.1.linux3/fsck_hfs.tproj/Makefile.lnx.jx	2012-02-03 11:25:21.000000000 -0500
++++ diskdev_cmds-540.1.linux3/fsck_hfs.tproj/Makefile.lnx	2014-06-18 12:52:03.146015370 -0400
+@@ -4,7 +4,7 @@ OFILES = $(CFILES:.c=.o)
+ all: fsck_hfs
+ 
+ fsck_hfs: $(OFILES) dfalib/libdfa.a
+-	  $(CC) $(CFLAGS) $(LDFLAGS) $(OFILES) dfalib/libdfa.a -o fsck_hfs -lBlocksRunTime -lpthread
++	  $(CC) $(CFLAGS) $(LDFLAGS) $(OFILES) dfalib/libdfa.a -o fsck_hfs -lpthread
+ 
+ dfalib/libdfa.a: FORCE
+ 	$(MAKE) -C dfalib -f Makefile.lnx libdfa.a
+diff -up diskdev_cmds-540.1.linux3/Makefile.jx diskdev_cmds-540.1.linux3/Makefile
+--- diskdev_cmds-540.1.linux3/Makefile.jx	2012-02-16 15:00:18.000000000 -0500
++++ diskdev_cmds-540.1.linux3/Makefile	2014-06-18 12:42:59.015463500 -0400
+@@ -1,9 +1,8 @@
+ VERSION=540.1.linux3
+ 
+-CC := clang
+-CFLAGS := -g3 -Wall -fblocks -I$(PWD)/BlocksRunTime -I$(PWD)/include -DDEBUG_BUILD=0 -D_FILE_OFFSET_BITS=64 -D LINUX=1 -D BSD=1 -D VERSION=\"$(VERSION)\"
+-LDFLAGS := -Wl,--build-id -L$(PWD)/BlocksRunTime
+-SUBDIRS := BlocksRunTime newfs_hfs.tproj fsck_hfs.tproj
++CFLAGS += -I$(PWD)/include -DDEBUG_BUILD=0 -D_FILE_OFFSET_BITS=64 -D LINUX=1 -D BSD=1 -D VERSION=\"$(VERSION)\"
++LDFLAGS := -Wl,--build-id
++SUBDIRS := newfs_hfs.tproj fsck_hfs.tproj
+ 
+ all clean:
+ 	for d in $(SUBDIRS); do $(MAKE) -C $$d -f Makefile.lnx $@; done
-- 
2.21.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [bug#35147] Acknowledgement ([PATCH 1/2] gnu: Add apsl2.0.)
       [not found] ` <handler.35147.B.155439651118672.ack@debbugs.gnu.org>
@ 2019-04-04 16:57   ` Pierre Neidhardt
  2022-04-07 12:48     ` [bug#35147] [PATCH 1/2] gnu: Add apsl2.0 zimoun
  0 siblings, 1 reply; 7+ messages in thread
From: Pierre Neidhardt @ 2019-04-04 16:57 UTC (permalink / raw)
  To: 35147

[-- Attachment #1: Type: text/plain, Size: 549 bytes --]

I've got a weird issue with the Makefile:

--8<---------------cut here---------------start------------->8---
CFLAGS += -I$(PWD)/include -DDEBUG_BUILD=0 -D_FILE_OFFSET_BITS=64 -D LINUX=1 -D BSD=1 -D VERSION=\"$(VERSION)\"
--8<---------------cut here---------------end--------------->8---

PWD is expanded to the parent directory of the current directory (what
the hell?!?), I had to force it to the current directory for it to
work.  Any clue what's going on?

It seems to work beside that.

-- 
Pierre Neidhardt
https://ambrevar.xyz/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [bug#35147] [PATCH 1/2] gnu: Add apsl2.0.
  2019-04-04 16:57   ` [bug#35147] Acknowledgement ([PATCH 1/2] gnu: Add apsl2.0.) Pierre Neidhardt
@ 2022-04-07 12:48     ` zimoun
  2022-05-19 21:24       ` zimoun
  0 siblings, 1 reply; 7+ messages in thread
From: zimoun @ 2022-04-07 12:48 UTC (permalink / raw)
  To: Pierre Neidhardt; +Cc: 35147

Hi,

This old submission [1] is not merged yet.

1: <http://issues.guix.gnu.org/issue/35147>


On Thu, 04 Apr 2019 at 18:57, Pierre Neidhardt <mail@ambrevar.xyz> wrote:

> I've got a weird issue with the Makefile:
>
> CFLAGS += -I$(PWD)/include -DDEBUG_BUILD=0 -D_FILE_OFFSET_BITS=64 -D LINUX=1 -D BSD=1 -D VERSION=\"$(VERSION)\"
>
> PWD is expanded to the parent directory of the current directory (what
> the hell?!?), I had to force it to the current directory for it to
> work.  Any clue what's going on?

Is it the blocker?


> It seems to work beside

I miss how it can work beside that.


What is the next step?  Especially about the addition of the Apple
license to the guix/licenses.scm file.

Do we drop this submission?  If not, what is missing for merging it?


Cheers,
simon




^ permalink raw reply	[flat|nested] 7+ messages in thread

* [bug#35147] [PATCH 1/2] gnu: Add apsl2.0.
  2022-04-07 12:48     ` [bug#35147] [PATCH 1/2] gnu: Add apsl2.0 zimoun
@ 2022-05-19 21:24       ` zimoun
  0 siblings, 0 replies; 7+ messages in thread
From: zimoun @ 2022-05-19 21:24 UTC (permalink / raw)
  To: Pierre Neidhardt; +Cc: 35147

Hi,

On Thu, 07 Apr 2022 at 14:48, zimoun <zimon.toutoune@gmail.com> wrote:
> On Thu, 04 Apr 2019 at 18:57, Pierre Neidhardt <mail@ambrevar.xyz> wrote:

> This old submission [1] is not merged yet.
>
> 1: <http://issues.guix.gnu.org/issue/35147>
>

> Do we drop this submission?  If not, what is missing for merging it?

I am proposing to drop this submission if no objection.


Cheers,
simon




^ permalink raw reply	[flat|nested] 7+ messages in thread

* [bug#35147] [PATCH 1/2] gnu: Add apsl2.0.
  2019-04-04 16:48 [bug#35147] [PATCH 1/2] gnu: Add apsl2.0 Pierre Neidhardt
  2019-04-04 16:49 ` [bug#35147] [PATCH 2/2] gnu: Add hfsprogs Pierre Neidhardt
       [not found] ` <handler.35147.B.155439651118672.ack@debbugs.gnu.org>
@ 2022-06-23  9:22 ` zimoun
  2 siblings, 0 replies; 7+ messages in thread
From: zimoun @ 2022-06-23  9:22 UTC (permalink / raw)
  To: Pierre Neidhardt; +Cc: 35147

Hi,

On Thu, 04 Apr 2019 at 18:48, Pierre Neidhardt <mail@ambrevar.xyz> wrote:
> * guix/licenses.scm (apsl2.0): New variable.

Similar patch applied with 9c4aaa630d97f9f29ca1b732fb265bd583e83e02.


Cheers,
simon




^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#35147: [PATCH 1/2] gnu: Add apsl2.0.
  2019-04-04 16:49 ` [bug#35147] [PATCH 2/2] gnu: Add hfsprogs Pierre Neidhardt
@ 2022-06-23  9:23   ` zimoun
  0 siblings, 0 replies; 7+ messages in thread
From: zimoun @ 2022-06-23  9:23 UTC (permalink / raw)
  To: Pierre Neidhardt; +Cc: 35147-done

Hi,

On Thu, 04 Apr 2019 at 18:49, Pierre Neidhardt <mail@ambrevar.xyz> wrote:
> * gnu/packages/linux.scm (hfsprogs): New variable.
> ---

I am closing so no news.


Cheers,
simon




^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-06-23 10:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-04 16:48 [bug#35147] [PATCH 1/2] gnu: Add apsl2.0 Pierre Neidhardt
2019-04-04 16:49 ` [bug#35147] [PATCH 2/2] gnu: Add hfsprogs Pierre Neidhardt
2022-06-23  9:23   ` bug#35147: [PATCH 1/2] gnu: Add apsl2.0 zimoun
     [not found] ` <handler.35147.B.155439651118672.ack@debbugs.gnu.org>
2019-04-04 16:57   ` [bug#35147] Acknowledgement ([PATCH 1/2] gnu: Add apsl2.0.) Pierre Neidhardt
2022-04-07 12:48     ` [bug#35147] [PATCH 1/2] gnu: Add apsl2.0 zimoun
2022-05-19 21:24       ` zimoun
2022-06-23  9:22 ` zimoun

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.