From dfdbcc428f365071f0ca3888f6ec8c25c3792885 Mon Sep 17 00:00:00 2001 From: Jacob Moody Date: Fri, 14 Jul 2023 17:30:57 -0500 Subject: [PATCH] 9pfs: 2015-09-18 -> 0.3 (#241801) * _9pfs: 2015-09-18 -> 0.3 * _9pfs: add updateScript --- pkgs/tools/filesystems/9pfs/default.nix | 36 +++++--------- .../filesystems/9pfs/fix-darwin-build.patch | 47 ------------------- 2 files changed, 11 insertions(+), 72 deletions(-) delete mode 100644 pkgs/tools/filesystems/9pfs/fix-darwin-build.patch diff --git a/pkgs/tools/filesystems/9pfs/default.nix b/pkgs/tools/filesystems/9pfs/default.nix index 5ca592aa4565..abb8f695ebcc 100644 --- a/pkgs/tools/filesystems/9pfs/default.nix +++ b/pkgs/tools/filesystems/9pfs/default.nix @@ -1,39 +1,25 @@ -{ lib, stdenv, fetchFromGitHub, fuse }: +{ lib, stdenv, fetchFromGitHub, pkg-config, fuse, gitUpdater }: -stdenv.mkDerivation { +stdenv.mkDerivation rec { pname = "9pfs"; - version = "unstable-2015-09-18"; + version = "0.3"; src = fetchFromGitHub { - owner = "mischief"; + owner = "ftrvxmtrx"; repo = "9pfs"; - rev = "7f4ca4cd750d650c1215b92ac3cc2a28041960e4"; - sha256 = "007s2idsn6bspmfxv1qabj39ggkgvn6gwdbhczwn04lb4c6gh3xc"; + rev = version; + sha256 = "sha256-ywWG/H2ilt36mjlDSgIzYpardCFXpmbLiml6wy47XuA="; }; - # Upstream development has stopped and is no longer accepting patches - # https://github.com/mischief/9pfs/pull/3 - patches = [ ./fix-darwin-build.patch ]; - - preConfigure = - '' - substituteInPlace Makefile --replace '-g bin' "" - installFlagsArray+=(BIN=$out/bin MAN=$out/share/man/man1) - mkdir -p $out/bin $out/share/man/man1 - ''; - + makeFlags = [ "BIN=$(out)/bin" "MAN=$(out)/share/man/man1" ]; + nativeBuildInputs = [ pkg-config ]; buildInputs = [ fuse ]; - - # Workaround build failure on -fno-common toolchains like upstream - # gcc-10. Otherwise build fails as: - # ld: lib/auth_rpc.o:/build/source/lib/../9pfs.h:35: multiple definition of - # `logfile'; 9pfs.o:/build/source/9pfs.h:35: first defined here - env.NIX_CFLAGS_COMPILE = "-fcommon"; - enableParallelBuilding = true; + passthru.updateScript = gitUpdater { }; + meta = { - homepage = "https://github.com/mischief/9pfs"; + homepage = "https://github.com/ftrvxmtrx/9pfs"; description = "FUSE-based client of the 9P network filesystem protocol"; maintainers = [ lib.maintainers.eelco ]; platforms = lib.platforms.unix; diff --git a/pkgs/tools/filesystems/9pfs/fix-darwin-build.patch b/pkgs/tools/filesystems/9pfs/fix-darwin-build.patch deleted file mode 100644 index a565248f19d5..000000000000 --- a/pkgs/tools/filesystems/9pfs/fix-darwin-build.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 6b7863b51c97f8ecd9a93fc4347f8938f9b5c05f Mon Sep 17 00:00:00 2001 -From: midchildan -Date: Tue, 30 Mar 2021 22:21:51 +0900 -Subject: [PATCH] build: fix build for macOS - ---- - 9pfs.c | 4 ++-- - libc.h | 4 ++++ - 2 files changed, 6 insertions(+), 2 deletions(-) - -diff --git a/9pfs.c b/9pfs.c -index 2c481bd..f5c487c 100644 ---- a/9pfs.c -+++ b/9pfs.c -@@ -30,7 +30,7 @@ - enum - { - CACHECTLSIZE = 8, /* sizeof("cleared\n") - 1 */ -- MSIZE = 8192 -+ MSIZE_9P = 8192 - }; - - void dir2stat(struct stat*, Dir*); -@@ -505,7 +505,7 @@ main(int argc, char *argv[]) - freeaddrinfo(ainfo); - - init9p(); -- msize = _9pversion(MSIZE); -+ msize = _9pversion(MSIZE_9P); - if(doauth){ - authfid = _9pauth(AUTHFID, user, NULL); - ai = auth_proxy(authfid, auth_getkey, "proto=p9any role=client"); -diff --git a/libc.h b/libc.h -index 099adba..aac03c5 100644 ---- a/libc.h -+++ b/libc.h -@@ -61,6 +61,10 @@ typedef unsigned char uchar; - typedef unsigned long long uvlong; - typedef long long vlong; - -+#ifndef __GLIBC__ -+typedef unsigned long ulong; -+#endif -+ - typedef - struct Qid - {