From 256d33ba46d12c16deb55eca6b989be69138ce45 Mon Sep 17 00:00:00 2001 From: Keto Date: Fri, 27 Sep 2024 22:25:00 -0400 Subject: [PATCH 1/2] archivemount: Migrate to `by-name` --- .../ar/archivemount/package.nix} | 14 ++++++++++++-- pkgs/top-level/all-packages.nix | 2 -- 2 files changed, 12 insertions(+), 4 deletions(-) rename pkgs/{tools/filesystems/archivemount/default.nix => by-name/ar/archivemount/package.nix} (82%) diff --git a/pkgs/tools/filesystems/archivemount/default.nix b/pkgs/by-name/ar/archivemount/package.nix similarity index 82% rename from pkgs/tools/filesystems/archivemount/default.nix rename to pkgs/by-name/ar/archivemount/package.nix index 48e78fe7d108..026dddc46c24 100644 --- a/pkgs/tools/filesystems/archivemount/default.nix +++ b/pkgs/by-name/ar/archivemount/package.nix @@ -1,4 +1,11 @@ -{ lib, stdenv, fetchurl, pkg-config, fuse, libarchive }: +{ + lib, + stdenv, + fetchurl, + pkg-config, + fuse, + libarchive, +}: stdenv.mkDerivation rec { pname = "archivemount"; @@ -10,7 +17,10 @@ stdenv.mkDerivation rec { }; nativeBuildInputs = [ pkg-config ]; - buildInputs = [ fuse libarchive ]; + buildInputs = [ + fuse + libarchive + ]; meta = { description = "Gateway between FUSE and libarchive: allows mounting of cpio, .tar.gz, .tar.bz2 archives"; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 05c5985bd5c9..0d2eacc496a5 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -3062,8 +3062,6 @@ with pkgs; archivebox = callPackage ../applications/misc/archivebox { }; - archivemount = callPackage ../tools/filesystems/archivemount { }; - archivy = callPackage ../applications/misc/archivy { }; arandr = callPackage ../tools/X11/arandr { }; From 2d19e4a770ae7843085eae36c2dc06933d2dc03d Mon Sep 17 00:00:00 2001 From: Keto Date: Fri, 27 Sep 2024 22:37:00 -0400 Subject: [PATCH 2/2] archivemount: 0.9.1 -> 1 --- pkgs/by-name/ar/archivemount/package.nix | 44 +++++++++++++++++++----- 1 file changed, 36 insertions(+), 8 deletions(-) diff --git a/pkgs/by-name/ar/archivemount/package.nix b/pkgs/by-name/ar/archivemount/package.nix index 026dddc46c24..0a86748873ad 100644 --- a/pkgs/by-name/ar/archivemount/package.nix +++ b/pkgs/by-name/ar/archivemount/package.nix @@ -1,19 +1,22 @@ { lib, stdenv, - fetchurl, + fetchFromSourcehut, + fetchpatch, pkg-config, fuse, libarchive, }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "archivemount"; - version = "0.9.1"; + version = "1"; - src = fetchurl { - url = "https://www.cybernoia.de/software/archivemount/archivemount-${version}.tar.gz"; - sha256 = "1cy5b6qril9c3ry6fv7ir87s8iyy5vxxmbyx90dm86fbra0vjaf5"; + src = fetchFromSourcehut { + owner = "~nabijaczleweli"; + repo = "archivemount-ng"; + rev = finalAttrs.version; + hash = "sha256-xuLtbqC9iS86BKz4jG8of4id+GTlBXoohONrkmIzOpY="; }; nativeBuildInputs = [ pkg-config ]; @@ -22,10 +25,35 @@ stdenv.mkDerivation rec { libarchive ]; + makeFlags = [ + "PREFIX=${placeholder "out"}" + "VERSION=${finalAttrs.version}" + ]; + + dontConfigure = true; + + # Fix missing standard struct stat on Darwin + # Already on upstream, but no new release made + patches = [ + (fetchpatch { + name = "fix-missing-standard-struct-stat-on-darwin.patch"; + url = "https://git.sr.ht/~nabijaczleweli/archivemount-ng/commit/53dd70f05fdb6ababe7c1ca70f0f62bcf4930b5a.patch"; + hash = "sha256-UqoALAJoNXihop6Mem4mu+W8REOV92Zyv7pPW20Ugz8="; + }) + ]; + + # Fix cross-compilation + postPatch = '' + substituteInPlace Makefile --replace-fail pkg-config "$PKG_CONFIG" + ''; + meta = { description = "Gateway between FUSE and libarchive: allows mounting of cpio, .tar.gz, .tar.bz2 archives"; mainProgram = "archivemount"; - license = lib.licenses.gpl2Only; + license = [ + lib.licenses.lgpl2Plus + lib.licenses.bsd0 + ]; platforms = lib.platforms.unix; }; -} +})